Jump to content
  • 0

Subclass Cumulative + Skilles Accumulated


Question

Posted
I have to make a server with subclass accumulative (principal + 3 subs)

of any class and race.

and that skilles se accumulate between of a subclass and another.

 

I do it with this SP:

 



set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[lin_SetAquireSkill]
(
@char_id INT,
@subjob_id INT,
@skill_id INT,
@skill_level TINYINT
)
AS
DECLARE @subjob_acu INT

SET NOCOUNT ON

set @subjob_acu = 0

WHILE (@subjob_acu < 3)

BEGIN

SET @subjob_acu = @subjob_acu + 1
IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id <= @subjob_acu

ELSE
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level);
IF NOT EXISTS(SELECT skill_id FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND skill_lev = @skill_level AND subjob_id = 0)
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, 0, @skill_id, @skill_level);

END



 

But only accumulate when "switch subclass".

When you subclass, the skilles of previous class  is cleared and starts loading the skilles of the new class, I need you to stay all skilles of all subclass.

is it possible?

15 answers to this question

Recommended Posts

  • 0
Posted

1. 4 jobs exist - not 3.

 

2. You already set subjob_acu to 1 before even making the loop effectively skipping all skills learned for the main\base class.

 

3.

 

 IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
   UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu
 ELSE
   INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level)

 set @subjob_fer = (@subjob_acu + 1)

 

 

Done.

  • 0
Posted
When a subclass ago erased all skilles and start to load the new class skilles.

I need not to delete, that are accumulated.

In the database yes accumulate.

But the player can see all skilles only when restarting the server.

Or when you "switch subclass".

It's like the player needs to do a refresh to the database so you can see all skilles. -

  • 0
Posted

lin_GetAquireSkill:

ALTER PROCEDURE [dbo].[lin_GetAquireSkill]
(
	@char_id	INT,
	@subjob_id	INT
)
AS
SET NOCOUNT ON

SELECT skill_id, skill_lev, is_lock FROM user_skill WHERE char_id = @char_id AND ISNULL(subjob_id, 0) = @subjob_id ORDER BY 1, 2

Edit it to:

ALTER PROCEDURE [dbo].[lin_GetAquireSkill]
(
	@char_id	INT,
	@subjob_id	INT
)
AS
SET NOCOUNT ON

SELECT skill_id, skill_lev, is_lock FROM user_skill WHERE char_id = @char_id ORDER BY 1, 2

Haven't tested but might work ;)

  • 0
Posted (edited)
Thank you very much for answering!

With this function you can do, I only need to add the turn of the subjob0_class, as I do?

 



function setCharacterData2($char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId)
{

global $cached_errors, $admin_name;
global $cached_ip, $cached_port;
$buf=pack("cVVVVVVV", 0x10, $char_id, $genderId, $raceId, $classId, $faceId, $hairShapeId, $hairColorId).tounicode_UA($admin_name);
$cachedsocket=@fsockopen($cached_ip, $cached_port, $errno, $errstr, 1) or die($notconnected);
fwrite($cachedsocket,pack("s",(strlen($buf)+2)).$buf);
$len=unpack("v",fread($cachedsocket,2));
$rid=unpack("c",fread($cachedsocket,1));
for($i=0;$i<(($len[1]-4)/4);$i++){
$read=unpack("i",fread($cachedsocket,4));
$rs.=$read[1];
}
fclose($cachedsocket);
return $rs;

}

Edited by WaLas
  • 0
Posted

well i guess,do you wanna to save main class skills in your subclass?when you changed over 3 subclass,you will get 4 class skills?right?

 

yes, I want them to go accumulating skilles

  • 0
Posted

then you want incremental change -

 

so main = main

 

1st = main + 1st

 

2nd = main + 1st + 2nd

 

3rd = main + 1st + 2nd

 

correct?

  • 0
Posted (edited)

then you want incremental change -

 

so main = main

 

1st = main + 1st

 

2nd = main + 1st + 2nd

 

3rd = main + 1st + 2nd

 

correct?

 

haha....

 

@WaLas

will you make it via extend l2server?why not via ai.obj? DNS system?

anyway,via extend l2server is the best way,but its not so easy.

Edited by sandeagle
  • 0
Posted

then you want incremental change -

 

so main = main

 

1st = main + 1st

 

2nd = main + 1st + 2nd

 

3rd = main + 1st + 2nd

 

correct?

 

Yes, i need this. with extender or php.-

 

 

haha....

 

@WaLas

will you make it via extend l2server?why not via ai.obj? DNS system?

anyway,via extend l2server is the best way,but its not so easy.

 

The DN system fails when you switch to another race. -

  • 0
Posted

You can script it with tSQL - in GetAquireSkill.

 

 

Might possibly need a cacheD hook to refresh char on subjobchange\create for cached internal memory block.

 

(I can't remember if  that's needed but i believe i did it just with SQL alone).

  • 0
Posted

hey guys i got this at the moment

 

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[lin_SetAquireSkill]
(
@char_id INT,
@subjob_id INT,
@skill_id INT,
@skill_level TINYINT
)
AS
DECLARE @subjob_acu INT

SET NOCOUNT ON

set @subjob_acu = 0

WHILE (@subjob_acu < 3)

BEGIN

SET @subjob_acu = @subjob_acu + 1
IF EXISTS(SELECT skill_lev FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id = @subjob_acu)
UPDATE user_skill SET skill_lev = @skill_level WHERE char_id = @char_id AND skill_id = @skill_id AND subjob_id <= @subjob_acu

ELSE
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, @subjob_acu, @skill_id, @skill_level);
IF NOT EXISTS(SELECT skill_id FROM user_skill WHERE char_id = @char_id AND skill_id = @skill_id AND skill_lev = @skill_level AND subjob_id = 0)
INSERT INTO user_skill (char_id, subjob_id, skill_id, skill_lev) VALUES (@char_id, 0, @skill_id, @skill_level);

END

 

 

 

i would like to do the same thing but with out changing the skin of the character

as now i can change subclass with out changing the skin but skills desapierd with subclass :(

  • 0
Posted

not very good on codding etc is there any thing that I need to change? like above ?

 

trying to save some $$ :( otherways devs will be doing it my Skype is sirblackx1 if anyone can guide me will be grate thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 10-17-2025 - OUR TOPIC IS RELEVANT! CONTACT US BY THE CONTACTS BELOW
    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock