Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

AutoSkill Learn by leveling up

Newbie Spellweaver
Joined
Aug 25, 2013
Messages
28
Reaction score
0
Hi, all is in the title, I tried to write some SQL code on level procedure, but it appair to be a little bit heavy, here's my code if someone can help :
Code:
DECLARE @SkList table(SkId int)
DECLARE @clss int
DECLARE [USER=16085]lev[/USER]l int
DECLARE @TotalSk int
DECLARE @sklrn int
DECLARE @i int

/* GET CHAR INFOS */
SELECT @clss = nClass FROM tCharacterShape WHERE nCharNo = @nCharNo
SELECT [USER=16085]lev[/USER]l = nLevel FROM tCharacter WHERE nCharNo = @nCharNo


/* SKILL LIST */
IF [USER=16085]lev[/USER]l = '10'
BEGIN
    IF @clss = '4' OR @clss = '5'
    BEGIN
        insert @SkList(SkId) values(1)
        insert @SkList(SkId) values(20)
        insert @SkList(SkId) values(80)
        insert @SkList(SkId) values(21)
    END
END
IF [USER=16085]lev[/USER]l = '20'
BEGIN
    IF @clss = '5'
    BEGIN
        insert @SkList(SkId) values(2)
        insert @SkList(SkId) values(21)
        insert @SkList(SkId) values(40)
        insert @SkList(SkId) values(60)
        insert @SkList(SkId) values(81)
        insert @SkList(SkId) values(140)
        insert @SkList(SkId) values(160)
        insert @SkList(SkId) values(180)
        insert @SkList(SkId) values(260)
        insert @SkList(SkId) values(505)
    END
    IF @clss = '4'
    BEGIN
        insert @SkList(SkId) values(120)
        insert @SkList(SkId) values(100)
        insert @SkList(SkId) values(21)
        insert @SkList(SkId) values(40)
        insert @SkList(SkId) values(60)
        insert @SkList(SkId) values(81)
        insert @SkList(SkId) values(140)
        insert @SkList(SkId) values(180)
        insert @SkList(SkId) values(260)
        insert @SkList(SkId) values(505)
    END
END


SELECT @TotalSk = count(SkId) FROM @SkList
SET @i = 0


/* LEARN SKILLS */
WHILE @i < @TotalSk + 1
BEGIN
    WITH tab AS (SELECT (ROW_NUMBER() OVER (ORDER BY myTable.SomeField)) as row,* FROM @SkList)
    SELECT @sklrn = SkId FROM tab WHERE row = @i
    EXEC [dbo].[p_Skill_Set] @nCharNo, @sklrn, '0', '0', '0', '0', '0', '0', '0', '0', 0
    SET @i = @i + 1
END

Thank you :)
 
Experienced Elementalist
Joined
Jul 6, 2014
Messages
222
Reaction score
14
You must relog if you do it by SQL. If you want to do the thing Verix seems to be doing, you will need Kobalt's Filter.

Verstuurd vanaf mijn SM-G900F met Tapatalk
 
Newbie Spellweaver
Joined
Aug 25, 2013
Messages
28
Reaction score
0
Thank you for your answer, I found the Kobalt's filter but I don't know how shoul I use it (client or server side) plus when I open it nothing happens (window still black with the highlight cursor I can't type any thing), is it working with HK client?
 
Experienced Elementalist
Joined
Jul 6, 2014
Messages
222
Reaction score
14
The one on here is outdated and pretty buggy. You're better off buying the updated one from him.

Verstuurd vanaf mijn SM-G900F met Tapatalk
 
Newbie Spellweaver
Joined
Aug 25, 2013
Messages
28
Reaction score
0
Thank you very much for help, i'll try to update myself (cuz we have the source code)
 
Back
Top