- Joined
- Feb 27, 2013
- Messages
- 1,430
- Reaction score
- 201
Hello guys, I want to get my Honor Point Ranks by Killing Jobbers. any idea?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
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
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
Oh I see what your doing now, so the job kills are all working correctly but the kill values aren't adding in the Graduates column?
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
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
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)
/* 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
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
So, what i have to do? I got it worked but it server need to be restarted to see real kills points. any idea?ye but problem is you will not see on real time (on game )your point you have to restart gs to see point....
/* 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
So, what i have to do? I got it worked but it server need to be restarted to see real kills points. any idea?
This won't help, His thread won't work on anyway. because all his lines are wrong.look hereYou must be registered to see links
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 minuteyou 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..