[Release] Stored Procedures.

Results 1 to 18 of 18
  1. #1
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    [Release] Stored Procedures.

    I'm gonna release some stored procedures from the new KalOnline database.

    So yeah, if you don't know how to use them, don't bother asking me.

    Skill Redistribute:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[SkillRedistribute]    Script Date: 07/06/2008 16:40:41 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    
    ALTER PROCEDURE [dbo].[SkillRedistribute]
        @Name varchar(15)
    AS    
        DECLARE @PID int
        DECLARE @Class tinyint
        DECLARE @Level tinyint
        DECLARE @Specialty tinyint
    
    
        declare Player_Cursor cursor for
        select [PID], [Class], [Level], [Specialty] from Player where [Name] = @Name 
        open Player_Cursor
    
        fetch next from Player_Cursor into @PID, @Class, @Level, @Specialty
        if (@@FETCH_STATUS = 0)
        begin
            delete from Skill where [PID] = @PID
    
            insert into Skill values ( @PID, 0, 1) -- 전력질주
            insert into Skill values ( @PID, 1, 1) -- 참수
    
            if( @Class = 0)
            begin
                if ( @Level >= 15)
                    insert into Skill values ( @PID, 14, 1) -- 보호하기
                if ( @Level >= 18)
                    insert into Skill values ( @PID, 4, 1) -- 우롱하기
                if ( @Level >= 25)
                    insert into Skill values ( @PID, 15, 1) -- 방패치기
                if ( @Specialty = 3)
                    insert into Skill values ( @PID, 6, 1) -- 막아내기
    
                if( @Specialty = 11) --장군
                begin
                    if( @Level < 56) -- 방어의기운
                        insert into Skill values ( @PID, 18, 1)
                    else if( @Level < 62)
                        insert into Skill values ( @PID, 18, 2)
                    else if( @Level < 70)
                        insert into Skill values ( @PID, 18, 3)
                    else
                        insert into Skill values ( @PID, 18, 4)
    
                    if( @Level >= 66) --보호하기
                        update Skill set [Level] = 3 where PID = @PID and [Index] = 14
                    else if( @Level >= 53)
                        update Skill set [Level] = 2 where PID = @PID and [Index] = 14
                end
            end
            else if( @Class = 1)
            begin
                insert into Skill values ( @PID, 4, 1) -- 낙뢰술
                if ( @Level >= 25)
                    insert into Skill values ( @PID, 5, 1) -- 원거리보호
                if ( @Specialty = 3)
                begin
                    insert into Skill values ( @PID, 17, 1) -- 인염술
                    if( @Level >= 35)
                        insert into Skill values ( @PID, 18, 1) -- 인해술
                    if( @Level >= 40)
                        insert into Skill values ( @PID, 19, 1) -- 인노술
                    if( @Level >= 45)
                        insert into Skill values ( @PID, 20, 1) -- 인거술
                    if( @Level >= 50)
                        insert into Skill values ( @PID, 21, 1) -- 인화술
                end
            end
            else if( @Class = 2)
            begin
                if ( @Level >= 25)
                    insert into Skill values ( @PID, 15, 1) -- 침묵의화살    
                if ( @Specialty = 3 and @Level >= 30)            
                    insert into Skill values ( @PID, 7, (@Level - 30) / 5 + 1 ) -- 뛰어난기회포착
            end
    
            -- 1차전직 기술 습득
            if ( @Specialty >= 3)
                insert into Skill values ( @PID, 11, 2) -- 휴식2레벨
            else
                insert into Skill values ( @PID, 11, 1) -- 휴식1레벨
    
            -- 2차전직 기술 습득
            if ( @Specialty >= 7)
                insert into Skill values ( @PID, 30, (@Level - 45) / 5) -- 생명력강화
        END    
        close Player_Cursor
        deallocate Player_Cursor
    
        update Player set SUPoint  = [Level] - 1 + (select  count(*)  from  Quest where  Quest.PID = @PID
         and Quest.[Quest] in ( 7, 11, 12, 13, 14, 16, 19, 21, 22, 23, 24, 33)
         and Quest.[Clear] = 1) where [PID] = @PID
    Move Items:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[MoveItem]    Script Date: 07/06/2008 16:52:25 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    
    -- 인자 
    
    -- @ PID who receive items PID
    -- @ IID moving items IID
    ALTER PROCEDURE [dbo].[MoveItem]
        @PID INT,
        @IID INT
    AS
        IF ( EXISTS (SELECT * FROM Item WHERE IID = @IID) )
        BEGIN
            UPDATE Item SET PID = @PID, Info = Info&0xFFFFFFEF WHERE IID = @IID
            INSERT INTO Log VALUES ( GETDATE(), 15, 53, @PID, 0, @IID, 0, 0, 0, 0)
        END
        ELSE    -- @PID
        BEGIN
            PRINT 'This item does not exist'
        END
    Name Change:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[NameChange]    Script Date: 07/06/2008 16:56:22 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    
    ALTER PROCEDURE [dbo].[NameChange]
        @NameOld varchar(16),
        @NameNew varchar(16)
    AS        
        DECLARE @PID int
        SELECT @PID = [PID] FROM Player WHERE [Name] = @NameOld
        if (select count(*) from Player where [Name] = @NameOld) > 0
        begin
             if ( select count(*) from Player where [Name] = @NameNew) = 0
            begin        
                update Player set [Name] = @NameNew where [Name] = @NameOld
                update MLM set [Name] = @NameNew where [Name] = @NameOld
                update Friend set [FName] = @NameNew where [FName] = @NameOld
                update Mail set [SName] = @NameNew where [SName] = @NameOld
                update Mail set [RName] = @NameNew where [RName] = @NameOld
                if @@ERROR = 0 
                begin  
                    --INSERT INTO NameChanged VALUES ( GETDATE(), @PID, @NameOld, @NameNew)
                    PRINT 'Sucessfully Changed. '
                end
                else
                    PRINT 'Failed. '                  
            end
            else
                PRINT 'The new name already exists. '            
        end
        else
            PRINT 'Name does not exist. '
    Delete Player:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[DeletePlayer]    Script Date: 07/06/2008 17:06:33 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    
    
    ALTER procedure [dbo].[DeletePlayer]
        @PID int
    as
        DELETE FROM Player WHERE [PID] = @PID
        DELETE FROM Item WHERE [PID] = @PID AND ( [Info] & 16) = 0 -- 16 : ITEM_STORAGE
        DELETE FROM Quest WHERE [PID] = @PID
        DELETE FROM Skill WHERE [PID] = @PID
    Change Co-Ordinates:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[ChangeCoordinate]    Script Date: 07/06/2008 17:13:46 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[ChangeCoordinate]
        @PID int
    AS
        SELECT * FROM Player WHERE PID = @PID
        UPDATE Player SET X=256495, Y=258908, Z=16297 WHERE PID = @PID
        SELECT * FROM Player WHERE PID = @PID
    Unbound Items:

    Code:
    USE [kal_db]
    GO
    /****** Object:  StoredProcedure [dbo].[Own2Free]    Script Date: 07/06/2008 17:15:43 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    ALTER PROCEDURE [dbo].[Own2Free]
        @IID int
    AS
        UPDATE Item SET Info = Info&0xFFFFFF7F WHERE IID = @IID


  2. #2
    boo General is offline
    MemberRank
    Sep 2006 Join Date
    at homeLocation
    2,269Posts

    Re: [Release] Stored Procedures.

    nice, where'd u get

  3. #3
    Gamma Nuklear is offline
    MemberRank
    May 2006 Join Date
    EarthLocation
    3,586Posts

    Re: [Release] Stored Procedures.

    He got it with his 1337 hax0r skillz.

  4. #4
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    Re: [Release] Stored Procedures.

    Database ;)

    I have something i need someone to test.

    There's a table SetGem, which everyone is wondering what it's for. I need some one to do

    /get 498 then add SetGem = 2

    /get 502 then add SetGem = 1

    Tell me what the item is and what it does to affect it, in game.

    Cheers.

  5. #5
    Alpha Member Shortor is offline
    MemberRank
    Jun 2007 Join Date
    1,627Posts

    Re: [Release] Stored Procedures.

    Hello Jake.

  6. #6
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    Re: [Release] Stored Procedures.

    Another one /get 621 - put Info = 6291457

    Should be G55 knight chest, want to know what the Info does to it ;)

  7. #7
    Account Upgraded | Title Enabled! gorlian is offline
    MemberRank
    Mar 2007 Join Date
    Dunno.......Location
    535Posts

    Re: [Release] Stored Procedures.

    /get 498 then add SetGem = 2

    NULL (Polishing stone), no visible changes. Did some clean tests (without SetGem 2 and with the normal polishing stone.

  8. #8
    boo General is offline
    MemberRank
    Sep 2006 Join Date
    at homeLocation
    2,269Posts

    Re: [Release] Stored Procedures.

    bof? on armor

  9. #9
    Account Upgraded | Title Enabled! gorlian is offline
    MemberRank
    Mar 2007 Join Date
    Dunno.......Location
    535Posts

    Re: [Release] Stored Procedures.

    /get 502 then add SetGem = 1

    NULL (Stone of Chance) Couldn't test it (don't have skill reset in my server yet, gonna work on it now )

  10. #10
    Account Upgraded | Title Enabled! gorlian is offline
    MemberRank
    Mar 2007 Join Date
    Dunno.......Location
    535Posts

    Re: [Release] Stored Procedures.

    /get 621 - put Info = 6291457

    Indeed g55 knight chest, Info 6291457 equips the item

    Btw, I haven't changed anything to the DB files (used clean auth and db, only changed the item table to the working one)

  11. #11
    Member xXIsTaRiXx is offline
    MemberRank
    Jun 2008 Join Date
    GermanyLocation
    78Posts

    Re: [Release] Stored Procedures.

    what work 4 you? bof or what i rly dont understand .......


    EDIT: lol understand forget my question, it work 4 me now

  12. #12
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    Re: [Release] Stored Procedures.

    I'll give you some more Info numbers to try in an hour or so, i have quite a lot of them.

  13. #13
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    Re: [Release] Stored Procedures.

    /get 844 - Info = 8388608
    /get 631 - Info = 6291457
    /get 794 - Info = 5505025
    /get 794 - Info = 5373953
    /get 769 - Info = 5251080
    /get 789 - Info = 4194433
    /get 337 - Info = 4194352
    /get 337 - Info = 4194345
    /get 85 - Info = 4194320
    /get 460 - Info = 4194313
    /get 898 - Info = 4194312
    /get 623 - Info = 4194305
    /get 206 - Info = 4194304
    /get 257 - Info = 2097161
    /get 621 - Info = 2097153
    /get 621 - Info = 2097152
    /get 791 - Info = 1310736
    /get 582 - Info = 1310728
    /get 792 - Info = 1310721
    /get 636 - Info = 144
    /get 511 - Info = 128
    /get 259 - Info = 80
    /get 621 - Info = 65
    /get 672 - Info = 64

  14. #14
    Account Upgraded | Title Enabled! Keppi is offline
    MemberRank
    Sep 2006 Join Date
    GermanyLocation
    884Posts

    Re: [Release] Stored Procedures.

    Quote Originally Posted by Jake View Post
    /get 844 - Info = 8388608
    /get 631 - Info = 6291457
    /get 794 - Info = 5505025
    /get 794 - Info = 5373953
    /get 769 - Info = 5251080
    /get 789 - Info = 4194433
    /get 337 - Info = 4194352
    /get 337 - Info = 4194345
    /get 85 - Info = 4194320
    /get 460 - Info = 4194313
    /get 898 - Info = 4194312
    /get 623 - Info = 4194305
    /get 206 - Info = 4194304
    /get 257 - Info = 2097161
    /get 621 - Info = 2097153
    /get 621 - Info = 2097152
    /get 791 - Info = 1310736
    /get 582 - Info = 1310728
    /get 792 - Info = 1310721
    /get 636 - Info = 144
    /get 511 - Info = 128
    /get 259 - Info = 80
    /get 621 - Info = 65
    /get 672 - Info = 64


    /get 844 - Info = 8388608 = Nothing Happens
    /get 794 - Info = 5505025 = The item has the tag Mixing : in blue and after equipping it I get engine.exe
    /get 794 - Info = 5373953 = ^ same
    /get 621 - Info = 65 = Polished
    /get 621 - Info = 2097153 = Nothing Happens
    /get 621 - Info = 2097152 = Nothing Happens
    /get 460 - Info = 4194313 = Equips it

  15. #15
    Enthusiast NGXLego is offline
    MemberRank
    Sep 2007 Join Date
    42Posts

    Re: [Release] Stored Procedures.

    i only get the error that the length is too long or somethin like that xD

  16. #16
    Account Upgraded | Title Enabled! gorlian is offline
    MemberRank
    Mar 2007 Join Date
    Dunno.......Location
    535Posts

    Re: [Release] Stored Procedures.

    /get 844 - Info = 8388608 g55 knight boots - nothing
    /get 631 - Info = 6291457 g55 mage chest - equips
    /get 794 - Info = 5505025 g62 Imp 1h - equips, mixing:, stone of demon blood effect
    /get 794 - Info = 5373953 g62 Imp 1h - equips, mixing:, stone of ice effect
    /get 769 - Info = 5251080 g40 Imp SaeHyung big - equips, (bound)
    /get 789 - Info = 4194433 g56 Imp general's stick - equips, (bound)
    /get 337 - Info = 4194352 Ancient tiger - Disappears from inventory
    /get 337 - Info = 4194345 Ancient tiger - equips
    /get 85 - Info = 4194320 g32 mage chest - Disapears
    /get 460 - Info = 4194313 g53 Diamond Giant sword - Nothing
    /get 898 - Info = 4194312 Stone of Ice - Nothing
    /get 623 - Info = 4194305 g55 knight gloves - Equips
    /get 206 - Info = 4194304 Belt - Nothing
    /get 257 - Info = 2097161 g46 archer helmet - equips
    /get 621 - Info = 2097153 g55 knight chest - Equips
    /get 621 - Info = 2097152 g55 knight chest - Nothing
    /get 791 - Info = 1310736 g59 Imp treasure Giant sword of doggebi - Disappears
    /get 582 - Info = 1310728 g48 savage tribe stick - Mixing:Stone of demon blood (+effect + stats)
    /get 792 - Info = 1310721 g59 imp treasure bow of doggebi - Mixing:Stone of demon blood (+effect + stats)
    /get 636 - Info = 144 Lucky key (7 days) - Disappears
    /get 511 - Info = 128 Moving scroll - (bound)
    /get 259 - Info = 80 g46 archer boots - disappears
    /get 621 - Info = 65 g55 knight chest - equips, polished (30 remaining)
    /get 672 - Info = 64 g65 treasure stick of darkness - polished

  17. #17
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    Re: [Release] Stored Procedures.

    USE [kal_db]
    GO
    /****** Object: StoredProcedure [dbo].[Own2Free] Script Date: 07/06/2008 17:15:43 ******/
    SET ANSI_NULLS OFF
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    ALTER PROCEDURE [dbo].[Own2Free]
    @IID int
    AS
    UPDATE Item SET Info = Info&0xFFFFFF7F WHERE IID = @IID
    lol

  18. #18
    Account Upgraded | Title Enabled! Jake is offline
    MemberRank
    Nov 2006 Join Date
    /home/jakeLocation
    1,016Posts

    Re: [Release] Stored Procedures.

    Quote Originally Posted by gorlian View Post
    /get 844 - Info = 8388608 g55 knight boots - nothing
    /get 631 - Info = 6291457 g55 mage chest - equips
    /get 794 - Info = 5505025 g62 Imp 1h - equips, mixing:, stone of demon blood effect
    /get 794 - Info = 5373953 g62 Imp 1h - equips, mixing:, stone of ice effect
    /get 769 - Info = 5251080 g40 Imp SaeHyung big - equips, (bound)
    /get 789 - Info = 4194433 g56 Imp general's stick - equips, (bound)
    /get 337 - Info = 4194352 Ancient tiger - Disappears from inventory
    /get 337 - Info = 4194345 Ancient tiger - equips
    /get 85 - Info = 4194320 g32 mage chest - Disapears
    /get 460 - Info = 4194313 g53 Diamond Giant sword - Nothing
    /get 898 - Info = 4194312 Stone of Ice - Nothing
    /get 623 - Info = 4194305 g55 knight gloves - Equips
    /get 206 - Info = 4194304 Belt - Nothing
    /get 257 - Info = 2097161 g46 archer helmet - equips
    /get 621 - Info = 2097153 g55 knight chest - Equips
    /get 621 - Info = 2097152 g55 knight chest - Nothing
    /get 791 - Info = 1310736 g59 Imp treasure Giant sword of doggebi - Disappears
    /get 582 - Info = 1310728 g48 savage tribe stick - Mixing:Stone of demon blood (+effect + stats)
    /get 792 - Info = 1310721 g59 imp treasure bow of doggebi - Mixing:Stone of demon blood (+effect + stats)
    /get 636 - Info = 144 Lucky key (7 days) - Disappears
    /get 511 - Info = 128 Moving scroll - (bound)
    /get 259 - Info = 80 g46 archer boots - disappears
    /get 621 - Info = 65 g55 knight chest - equips, polished (30 remaining)
    /get 672 - Info = 64 g65 treasure stick of darkness - polished
    Ahh, cheers.

    There's quite a lot of things i have. Just wondering what they do, least i know how they bound silver kalkash now.

    I'm probably sure we need the knew engine.exe to see what the correct effects are.

    Anyway, Ace-SG1, don't reply if you don't have anything clever to say.



Advertisement