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 (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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • he kept his promise! i think it's a good idea to unban his old account. he shares files with the community and could help both new and veteran l2off users! good job, Guytis!
    • the only thing you know how to do is to change drawings inside a lineage2 client and you decide to talk about the IQ of others? hahahaha
    • Web: https://cheatcenter.net/ Counter Strike 2 Nixware Hack With the Nixware cheat, you have powerful software in your hands for exciting battles in Counter-Strike 2! The perfect set of features for Rage and Semi-Rage games will provide you with confidence on the battlefield. Use antiaim to avoid being hit. Customize the world for yourself by adjusting the colors and the sky. Shoot through the walls and use other unique opportunities to defeat your rivals and become the leader of the team! Product Description LEGITBOT FOV Hitboxes Head Neck Chest Stomach Pelvis Smooth Shot delay Kill delay Lock target Lock mouse Draw FOV Disable when Smoke Flash Jump RAGEBOT Aimbot FOV changer Hitscan Head Neck Chest Stomach Pelvis HeadBody point scale Minimal damage Hitchance Force shoot PSilent Antiaim Autoscope Autostop (between shots) Bunnyhop Auto strafer with smooth adjustment Accurate walk ESP Box Glow Skeleton Footsteps Name Weapon name Health Health bar Ammo Chams Ragdoll chams Offscreen ESP Box Minimal and maximum radius customization Minimal and maximum size customization WORLD Bomb esp Timer Damage Name Weapons Icon Name Glow Grenades Color Trajectory Timer Grenade proximity warning SKINS Gloves Seed Paint kit Wear Knifes Seed Paint kit Wear Weapons Seed Paint kit Wear MISC View Model Editor View Model Chams Hand chams Glove chams Sleeve chams Weapon chams Auto Accept Show player money Spectator list World modulation (world, clouds, sky, sun) Spread circle TaserKnife range Hit markerHit effect Aspect ratio Third person REMOVALS Flash Smoke Visual recoil Scope borders Zoom Sniper crosshair check Team intro First person legs Model occlusion Shadows Fog Decals Particles Water effect Lightning  
    • Web: https://cheatcenter.net/ Counter Strike 2 Xone Hack Looking for a legit cheat for Counter-Strike 2? Xone is your perfect choice! Our product provides unsurpassed features that allow you to play legit and at the same time have an advantage over other players. Discover a new level of gaming efficiency with Xone! Product Description AIM Draw fov Draw target Only enemy Only visible Status Smooth Fov Hitbox Compensation Standalone Target switch Trigger Use aimbot Sticky mode Recoil compensation Delay Custom setting for all VISUAL Enable Box Skeleton Head Loot Health Weapon Name Defuser Bomb Visible check MISK Radar Only enemy Color Enemy/Team Scale Size Keybind Spectator list Bomb info  
  • Topics

×
×
  • Create New...