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!

Get Honor Point by Killing Jobbers.

Joined
Feb 27, 2013
Messages
1,430
Reaction score
201
No packets were logged, or even external program to record this.. though, I have edited some of Honor's SPs

Code:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_TRAINING_CAMP_UPDATEHONORRANK]    Script Date: 5/30/2015 9:55:11 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[_TRAINING_CAMP_UPDATEHONORRANK]
AS

Declare @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID int
Declare @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID int
declare @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] int
declare @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] int
declare @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] int
SET @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] =0
SET @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] =0
update _TrainingCampHonorRank set Rank =null,CampID =null
/* --------------------Trader------------------*/
DECLARE RankCursor CURSOR FAST_FORWARD FOR
    SELECT TOP 30 CharID FROM _CharTrijob WITH (NOLOCK)
    WHERE JobType =1 and Level >=5
    ORDER BY Exp DESC, Level desc
    OPEN RankCursor
    FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    select @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID from _TrainingCampMember where CharID  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
                IF (@@ROWCOUNT > 0)
             BEGIN
     set @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] +1
    set @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] +1
    IF  @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 1 and 5)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 1
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 6 and 10)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 2
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 11 and 20)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 3
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 21 and 30)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 4
        END
         update _TrainingCamp set Rank= @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] where ID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID
         update _TrainingCampHonorRank set Rank  @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I],CampID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID where Ranking = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]
        
         END
     FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    END
    CLOSE RankCursor
    DEALLOCATE RankCursor


SET @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] =0
set @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID =0
set @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID =0
/* --------------------Thief------------------*/
DECLARE RankCursor CURSOR FAST_FORWARD FOR
    SELECT TOP 30 CharID FROM _CharTrijob WITH (NOLOCK)
    WHERE JobType =2 and Level >=5
    ORDER BY Exp DESC, Level desc
    OPEN RankCursor
    FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    
        select @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID from _TrainingCampMember where CharID  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
        IF (@@ROWCOUNT > 0)
             BEGIN
             
    set @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] +1
    set @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] +1
    IF  @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 1 and 5)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 1
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 6 and 10)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 2
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 11 and 20)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 3
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 21 and 30)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 4
        END
       update _TrainingCamp set Rank= @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] where ID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID
       update _TrainingCampHonorRank set Rank  @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I],CampID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID where Ranking = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]
       
        END
     FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    END
    CLOSE RankCursor
    DEALLOCATE RankCursor

SET @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] =0
set @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID =0
set @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID =0
/* --------------------Hunter------------------*/
DECLARE RankCursor CURSOR FAST_FORWARD FOR
    SELECT TOP 30 CharID FROM _CharTrijob WITH (NOLOCK)
    WHERE JobType =3 and Level >=5
    ORDER BY Exp DESC, Level desc
    OPEN RankCursor
    FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    
        select @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID from _TrainingCampMember where CharID  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
        IF (@@ROWCOUNT > 0)
             BEGIN
             
    set @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] +1
    set @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] = @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] +1
    IF  @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 1 and 5)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 1
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 6 and 10)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 2
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 11 and 20)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 3
        END
        ELSE IF @[I][B][URL="https://forum.ragezone.com/members/1333459381.html"]Index[/URL][/B][/I] between 21 and 30)
        BEGIN
            SET @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] = 4
        END
       update _TrainingCamp set Rank= @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I] where ID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID
       update _TrainingCampHonorRank set Rank  @[I][B][URL="https://forum.ragezone.com/members/833731.html"]Rank[/URL][/B][/I],CampID  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID where Ranking = @[I][B][URL="https://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]
     
        END
     FETCH NEXT FROM RankCursor INTO @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
    END
    CLOSE RankCursor
    DEALLOCATE RankCursor
    

    RETURN 1

Code:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_TrainingCamp_FnAddMember]    Script Date: 5/30/2015 9:58:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER  PROCEDURE [dbo].[_TrainingCamp_FnAddMember]
    @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID    INT,
    @MemberID    INT,
    @[I][B][URL="https://forum.ragezone.com/members/185162.html"]honor[/URL][/B][/I]Point    INT
AS
    SET NOCOUNT ON

    IF EXISTS (SELECT CharID FROM _TrainingCampMember WHERE CharID = @MemberID)
    BEGIN
        RETURN -1001
    END

    DECLARE @MemberName    VARCHAR(64)
    DECLARE @MemberMaxLvl        TINYINT
    DECLARE @MemberCurLvl        TINYINT
    DECLARE @Jobtype TINYINT
    Declare @[I][B][URL="https://forum.ragezone.com/members/560981.html"]String[/URL][/B][/I] NVARCHAR(50)
  
    select @Jobtype = JobType from _CharTrijob where CharID=@MemberID
    if(@Jobtype =1)
    begin
    set @[I][B][URL="https://forum.ragezone.com/members/560981.html"]String[/URL][/B][/I] ='*(Trader)'
    end
    else if (@Jobtype =2)
    begin
       set @[I][B][URL="https://forum.ragezone.com/members/560981.html"]String[/URL][/B][/I] ='*(Thief)'
    end
    else if(@Jobtype =3)
    begin
       set @[I][B][URL="https://forum.ragezone.com/members/560981.html"]String[/URL][/B][/I] ='*(Hunter)'
    end
    SELECT @MemberName = CharName16 @[I][B][URL="https://forum.ragezone.com/members/560981.html"]String[/URL][/B][/I], @MemberMaxLvl = MaxLevel, @MemberCurLvl = CurLevel FROM _Char WITH (NOLOCK) WHERE CharID = @MemberID
    IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
    BEGIN
        RETURN -1
    END

    IF EXISTS (SELECT CharID FROM _TrainingCampMember WITH (NOLOCK) WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND CharID = @MemberID)
    BEGIN
        RETURN -2
    END

    DECLARE @[I][B][URL="https://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID INT
    SELECT @[I][B][URL="https://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID = RefObjID FROM _Char WITH (NOLOCK) WHERE CharID = @MemberID
    IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
    BEGIN
        RETURN -3
    END

/*    commented by novice. ¾Æ·¡·Î ¿Å±ä´Ù!! 2007. 07. 16.
    ----------------------------------------------------------------------------------------------------------
    -- by novice
    DECLARE @ApprenticeCount    INT
    DECLARE @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount    INT

    -- Àý´ë nolockÀ¸·Î ÇÏÁö ¸»ÀÚ!!
    SELECT @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount = COUNT(*) FROM _TrainingCampMember WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND MemberClass = 1
    IF ( @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount >= 2 )
    BEGIN
        RETURN -11
    END

    -- Àý´ë nolockÀ¸·Î ÇÏÁö ¸»ÀÚ!!
    SELECT @ApprenticeCount = COUNT(*) FROM _TrainingCampMember WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND MemberClass = 2
    IF ( @ApprenticeCount >= 5 )
    BEGIN
        RETURN -12
    END
    ----------------------------------------------------------------------------------------------------------
*/

    DECLARE @MemberClass TINYINT
    SET @MemberClass = 0
   

    ----------------------------------------------------------------------------------------------------------
    -- by novice 2007. 07. 16.
    -- °¡ÀÔ½ÃÅ°´Â »ç¶÷ÀÇ ·¹º§¿¡ µû¶ó¼­ Ŭ·¡½º¸¦ °áÁ¤Çϴµ¥..
    -- ±×³É ¹«ÀÛÁ¤ °¢ Ŭ·¡½º¿¡ ´ëÇØ ÀοøÀ» °Ë»çÇÏ¸é ´ç±Ù ¹®Á¦°¡ ÀÖ´Ù
    -- °¡ÀÔÇÏ´Â »ç¶÷ÀÇ Å¬·¡½º¿¡ ¸Â´Â Àοø °Ë»ç¸¦ ½ÃµµÇØ¾ß ÇÑ´Ù!!
    -- ±Ùµ¥.. ³»°¡ Àü¿¡´Â ¿Ö Àú·¸°Ô Çß¾úÀ»±î.......... ¤Ð_¤Ð
    ----------------------------------------------------------------------------------------------------------
    IF @MemberClass = 0
    BEGIN
        DECLARE @[I][B][URL="https://forum.ragezone.com/members/451528.html"]mentor[/URL][/B][/I]Count    INT
    
        -- Àý´ë nolockÀ¸·Î ÇÏÁö ¸»ÀÚ!!
        SELECT @[I][B][URL="https://forum.ragezone.com/members/451528.html"]mentor[/URL][/B][/I]Count = COUNT(*) FROM _TrainingCampMember WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND MemberClass = 0
        IF ( @[I][B][URL="https://forum.ragezone.com/members/451528.html"]mentor[/URL][/B][/I]Count >= 1 )
        BEGIN
            RETURN -14            -- ADD DBÀÛ¾÷ ½ÇÆжó´Â ·Î±×·Î ¾´´Ù..
        END
    END
    ELSE IF @MemberClass = 1
    BEGIN
        DECLARE @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount    INT
    
        -- Àý´ë nolockÀ¸·Î ÇÏÁö ¸»ÀÚ!!
        SELECT @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount = COUNT(*) FROM _TrainingCampMember WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND MemberClass = 1
        IF ( @[I][B][URL="https://forum.ragezone.com/members/616144.html"]sub[/URL][/B][/I]MentorCount >= 2 )
        BEGIN
            RETURN -11
        END
    END
    ELSE IF @MemberClass = 2
    BEGIN
        DECLARE @ApprenticeCount    INT
    
        -- Àý´ë nolockÀ¸·Î ÇÏÁö ¸»ÀÚ!!
        SELECT @ApprenticeCount = COUNT(*) FROM _TrainingCampMember WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID AND MemberClass = 2
        IF ( @ApprenticeCount >= 5 )
        BEGIN
            RETURN -12
        END
    END
    ----------------------------------------------------------------------------------------------------------


    INSERT _TrainingCampMember VALUES
     @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID, @MemberID, @[I][B][URL="https://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID, @MemberName, GETDATE(), @MemberClass, @MemberMaxLvl, @MemberCurLvl, @MemberMaxLvl, @[I][B][URL="https://forum.ragezone.com/members/185162.html"]honor[/URL][/B][/I]Point)
    IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
    BEGIN
        RETURN -5
    END

    IF ( 0 < (SELECT COUNT(*) FROM _TrainingCampBuffStatus
            WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID and RecipientCharID = @MemberID) )
    BEGIN
        RETURN -2006
    END

    IF @MemberClass = 0 OR @MemberClass = 2
    BEGIN
        -- °æÇèÄ¡ ´©Àû ¹öÇÁ¿¡ ´ëÇÑ ³»¿ë
        INSERT _TrainingCampBuffStatus 
            VALUES  @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID, @MemberID, 0, 0, default, 0, 0)
        IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
        BEGIN
            RETURN -2005
        END
    END

    -- °æÇèÄ¡ Àû¸³ ¹öÇÁ¿¡ ´ëÇÑ ³»¿ë
    IF @MemberClass = 0
    BEGIN
        INSERT _TrainingCampBuffStatus
            SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID, @MemberID, cnt + 1, 0, '2000-01-01', 0, 3
            FROM _RefDummySlot with( nolock )  
            WHERE cnt < 5
        IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
        BEGIN
            RETURN -2005
        END
    END
    ELSE IF @MemberClass = 2
    BEGIN
        INSERT _TrainingCampBuffStatus
            SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID, @MemberID, 1, 0, '2000-01-01', 0, 3
        IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
        BEGIN
            RETURN -2005
        END
    END

    SET NOCOUNT OFF

    RETURN 1

Meanwhile, I have managed to get it work when a thief jobber kill a trader or even a hunter and vice... but he must be level (5) in a job when he killing his enemies... but still have bug in Honor Rank page in Storage NPCs...

An image for explain:

RenePunik - Get Honor Point by Killing Jobbers. - RaGEZONE Forums

It doesn't record the number of Kills in the Graduates Column.
 
Upvote 1
Experienced Elementalist
Joined
Aug 22, 2013
Messages
208
Reaction score
125
Hello,

Oh, is the idea to update honor rank not by academy system but from job kills? and the "Graduates" should be the kill point?

Perhaps you could do that by calling [dbo].[_TRAINING_CAMP_MEMBER_GRADUATE] from _AddLogChar every time the job kill happens (EventID = 20), it's the simplest way but you have to adjust some values and not sure how this will effect the server performance.

OR

You could do that using another table (or another field in existing table) that count kills with the help of _AddLogChar procedure (EventID = 20). And put the kill values as graduates when updating the honor rank, or directly after kill sequence.

For example:

In store procedure [SRO_VT_LOG].[dbo].[_AddLogChar], add these:
Code:
IF (@EventID = 20) -- PVP (died)
BEGIN
    IF   @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Trader, Neutral, no freebattle team%'    -- Trader
        OR  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Hunter, Neutral, no freebattle team%'    -- Hunter
        OR  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Robber, Neutral, no freebattle team%'    -- Thief
    )
    BEGIN
        /* Uncomment this if you want PVP to be recorder only in certain region */
        /*
        DECLARE @LatestRegion INT = (SELECT LatestRegion FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
        IF (@LatestRegion IN (32241, 32242, 31985, 31986))
        BEGIN
            RETURN -1
        END
        */
        -- Get killer name
        DECLARE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name VARCHAR(512) =  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c
        DECLARE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID INT = 0
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name = REPLACE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, LEFT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, CHARINDEX('(',  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name)), '')
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name = REPLACE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, RIGHT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, CHARINDEX(')', REVERSE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name))), '')
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID = CharID FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharName16 =  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name
        -- Get job type
        DECLARE @JobString VARCHAR(10) = LTRIM(RTRIM(SUBSTRING  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c, 5, 7)))
        DECLARE @JobType INT = CASE
            WHEN @JobString LIKE 'Trader' THEN 1
            WHEN @JobString LIKE 'Robber' THEN 2
            WHEN @JobString LIKE 'Hunter' THEN 3
            ELSE 0 END
        -- Delete original log
        DELETE FROM _LogEventChar WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND EventID = 20
            AND (strDesc LIKE '%Trader, Neutral, no freebattle team%'
            OR strDesc LIKE '%Hunter, Neutral, no freebattle team%'
            OR strDesc LIKE '%Robber, Neutral, no freebattle team%'
        )
        -- Get additional info for notice message
        DECLARE  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]Name VARCHAR(64) = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
        DECLARE @JobDesc VARCHAR(32) = CASE WHEN @JobType BETWEEN 1 AND 3 THEN 'Job Conflict' ELSE 'Free PVP' END
        DECLARE @strDesc VARCHAR(512)
        DECLARE @isSent TINYINT = 0
        IF (@JobString LIKE 'Trader' OR @JobString LIKE 'Robber' OR @JobString LIKE 'Hunter')
        BEGIN
            -- If it's a Job Kill, then write character nicknames
            DECLARE  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID)
            DECLARE  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
            SET @strDesc = '[' +  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]NickName + '] has just killed [' +  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]NickName + '] in [' + @JobDesc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
        END
        -- Update the log
        INSERT INTO _LogEventNotice VALUES (@isSent,  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID,  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID, @JobType, GETDATE(), @strPos, @strDesc)
        -- Flag notice if it's not sent more than 5 minutes
        UPDATE _LogEventNotice SET isSent = 1 WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND JobType BETWEEN 1 AND 3 AND EventTime < DATEADD(MINUTE, -5, GETDATE())
        /*
         * Count kills (JOB KILLS)
         */
        DECLARE  @[I][B][URL="https://forum.ragezone.com/members/39035.html"]kill[/URL][/B][/I]Count INT = (SELECT COUNT(*) FROM _LogEventNotice WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND JobType BETWEEN 1 AND 3)
    END
    RETURN -1
END

And the table:
Code:
USE [SRO_VT_LOG]
GO
/****** Object:  Table [dbo].[_LogEventNotice]    Script Date: 05/28/2015 01:31:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_LogEventNotice](
    [isSent] [int] NOT NULL,
    [CharID] [int] NOT NULL,
    [KilledCharID] [int] NOT NULL,
    [JobType] [int] NOT NULL,
    [EventTime] [datetime] NULL,
    [EventLocation] [varchar](128) NULL,
    [strDesc] [varchar](512) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[_LogEventNotice] ADD  DEFAULT ((0)) FOR [isSent]
GO
ALTER TABLE [dbo].[_LogEventNotice] ADD  DEFAULT ((0)) FOR [CharID]
GO
ALTER TABLE [dbo].[_LogEventNotice] ADD  DEFAULT ((0)) FOR [KilledCharID]
GO
ALTER TABLE [dbo].[_LogEventNotice] ADD  DEFAULT ((0)) FOR [JobType]
GO
You can count the kill using:
Code:
DECLARE  @[I][B][URL="https://forum.ragezone.com/members/39035.html"]kill[/URL][/B][/I]Count INT = (SELECT COUNT(*) FROM _LogEventNotice WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND JobType BETWEEN 1 AND 3)
And you can also use the _LogEventNotice table for another purpose :), modify as you need.
 
Upvote 0
kaju
Joined
Nov 8, 2011
Messages
833
Reaction score
96
ye but problem is you will not see on real time (on game )your point you have to restart gs to see point....
 
Upvote 0
Experienced Elementalist
Joined
Aug 22, 2013
Messages
208
Reaction score
125
you did pretty nice mods fulfilling your needs though, no need to change anything if they already works.

The _AddLogChar thingy is completely different thing, I just tried to add an example for you to record kill activities, which you can use for the honor thingy you wanna make, or other stuff.

For example you can update the kill count to automatically to your honor table everytime a char got killed, like:

Code:
/* Check if Camp exist */
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID INT
SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID FROM [SRO_VT_SHARD].[dbo].[_TrainingCampMember] WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID AND MemberClass = 0
IF  (@[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID <> 0)
BEGIN
    -- Set graduate
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCamp] SET GraduateCount = GraduateCount + 1 WHERE CampID = [USER=2000014779]Cam[/USER]pID
    -- Add honor point
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCampMember] SET HonorPoint = HonorPoint + (your formula here) WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID
END

the formula should be some value you want, say, how much honor value a person will get when they kill in job mode. And that sequence should be called by _AddLogChar, inside the Event 20 sequence :)

something like that... ish..
 
Last edited:
Upvote 0
Joined
Feb 27, 2013
Messages
1,430
Reaction score
201
After some edits, I got it executed with no errors was occurred, but you have made a little mistake... there's no column called CharID on _TrainingCamp table.


This is my edited _AddLogChar : ONLY YOUR PART

Code:
IF (@EventID = 20) -- PVP (died)
BEGIN
        IF  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Trader, Neutral, no freebattle team%'    -- Trader
        OR  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Hunter, Neutral, no freebattle team%'    -- Hunter
        OR  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c LIKE '%Robber, Neutral, no freebattle team%'    -- Thief
    
    BEGIN
        /* Uncomment this if you want PVP to be recorder only in certain region */
        /*
        DECLARE @LatestRegion INT = (SELECT LatestRegion FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
        IF (@LatestRegion IN (32241, 32242, 31985, 31986))
        BEGIN
            RETURN -1
        END
        */
        -- Get killer name
        DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name VARCHAR(512) =  @[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c
        DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID INT = 0
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name = REPLACE   (@[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, LEFT   (@[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, CHARINDEX('(',  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name)), '')
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name = REPLACE   (@[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, RIGHT   (@[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name, CHARINDEX(')', REVERSE   @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name))), '')
        SELECT  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID = CharID FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharName16 =  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]Name
        -- Get job type
        DECLARE @JobString VARCHAR(10) = LTRIM(RTRIM(SUBSTRING   (@[I][B][URL="https://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c, 5, 7)))
        DECLARE @JobType INT = CASE
            WHEN @JobString LIKE 'Trader' THEN 1
            WHEN @JobString LIKE 'Robber' THEN 2
            WHEN @JobString LIKE 'Hunter' THEN 3
            ELSE 0 END
        -- Delete original log
        DELETE FROM _LogEventChar WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND EventID = 20
            AND (strDesc LIKE '%Trader, Neutral, no freebattle team%'
            OR strDesc LIKE '%Hunter, Neutral, no freebattle team%'
            OR strDesc LIKE '%Robber, Neutral, no freebattle team%'
        )
        -- Get additional info for notice message
        DECLARE @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]Name2 VARCHAR(64) = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
        DECLARE @JobDesc VARCHAR(32) = CASE WHEN @JobType BETWEEN 1 AND 3 THEN 'Job Conflict' ELSE 'Free PVP' END
        DECLARE @strDesc VARCHAR(512)
        DECLARE @isSent TINYINT = 0
        IF (@JobString LIKE 'Trader' OR @JobString LIKE 'Robber' OR @JobString LIKE 'Hunter')
        BEGIN
            -- If it's a Job Kill, then write character nicknames
            DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID)
            DECLARE @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID)
            SET @strDesc = '[' +  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]NickName + '] has just killed [' +  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]NickName + '] in [' + @JobDesc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
        END
        -- Update the log
        INSERT INTO _LogEventNotice VALUES (@isSent,  @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID,  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID, @JobType, GETDATE(), @strPos, @strDesc)
        -- Flag notice if it's not sent more than 5 minutes
        UPDATE _LogEventNotice SET isSent = 1 WHERE CharID =  @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND JobType BETWEEN 1 AND 3 AND EventTime < DATEADD(MINUTE, -5, GETDATE())
        /*
         * Count kills (JOB KILLS)
         */
        DECLARE  @[I][B][URL="https://forum.ragezone.com/members/39035.html"]kill[/URL][/B][/I]Count INT = (SELECT COUNT(*) FROM _LogEventNotice WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID AND JobType BETWEEN 1 AND 3)
    END
    RETURN -1

       /* Check if Camp exist */
      DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID INT
      SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID FROM SRO_VT_SHARD.[dbo].[_TrainingCampMember] WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID AND MemberClass = 0
      IF   @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID <> 0)
      BEGIN
      -- Set graduate
       My Edited Line > [COLOR=#ff0000]UPDATE SRO_VT_SHARD.[dbo].[_TrainingCamp] SET GraduateCount = GraduateCount + 1 WHERE ID = @[/COLOR][I][B][URL="https://forum.ragezone.com/members/2000172901.html"][COLOR=#ff0000]Killer[/COLOR][/URL][/B][/I][COLOR=#ff0000]ID[/COLOR]
       Your one > [COLOR=#ff0000]UPDATE SRO_VT_SHARD.[dbo].[_TrainingCamp] SET GraduateCount = GraduateCount + 1 WHERE CharID = @[/COLOR][I][B][URL="https://forum.ragezone.com/members/2000172901.html"][COLOR=#ff0000]KillerChar[/COLOR][/URL][/B][/I][COLOR=#ff0000]ID[/COLOR]
      -- Add honor point
      UPDATE SRO_VT_SHARD.[dbo].[_TrainingCampMember] SET HonorPoint = HonorPoint + 39 WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000172901.html"]Killer[/URL][/B][/I]ID
      END
END
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Aug 22, 2013
Messages
208
Reaction score
125
Yeah my bad sorry, it should be this:

Code:
/* Check if Camp exist */
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID INT
SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID FROM [SRO_VT_SHARD].[dbo].[_TrainingCampMember] WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID AND MemberClass = 0
IF  (@[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID <> 0)
BEGIN
    -- Set graduate
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCamp] SET GraduateCount = GraduateCount + 1 [COLOR=#ff0000]WHERE ID = [B][I]@[/I][/B]CampID[/COLOR]
    -- Add honor point
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCampMember] SET HonorPoint = HonorPoint + (your formula here) WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID
END

"WHERE ID = @CampID", my mistake on that one :)
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Aug 15, 2014
Messages
145
Reaction score
5
but i show you it work for me :D



you did pretty nice mods fulfilling your needs though, no need to change anything if they already works.

The _AddLogChar thingy is completely different thing, I just tried to add an example for you to record kill activities, which you can use for the honor thingy you wanna make, or other stuff.

For example you can update the kill count to automatically to your honor table everytime a char got killed, like:

Code:
/* Check if Camp exist */
DECLARE @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID INT
SELECT @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID = CampID FROM [SRO_VT_SHARD].[dbo].[_TrainingCampMember] WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID AND MemberClass = 0
IF  (@[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID <> 0)
BEGIN
    -- Set graduate
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCamp] SET GraduateCount = GraduateCount + 1 WHERE CampID = @[I][B][URL="https://forum.ragezone.com/members/2000014779.html"]Cam[/URL][/B][/I]pID
    -- Add honor point
    UPDATE [SRO_VT_SHARD].[dbo].[_TrainingCampMember] SET HonorPoint = HonorPoint + (your formula here) WHERE CharID = @[I][B][URL="https://forum.ragezone.com/members/2000154399.html"]KillerC[/URL][/B][/I]harID
END

the formula should be some value you want, say, how much honor value a person will get when they kill in job mode. And that sequence should be called by _AddLogChar, inside the Event 20 sequence :)

something like that... ish..
but he mean want to update honor every time in game not in tab in tab so easy but in game it need add update honor in SMC like every 1 minute
 
Upvote 0
Back
Top