Parzival
.
Prosedür çalısıyor db ye kımın kestıgı gecıyor fakat oyunda notıce gecmıyor Sebebi nedir
Prosedür bu
IF (@EventID = 20) -- PVP
BEGIN
IF @ c LIKE '%Trader, Neutral, no freebattle team%' -- Trader
OR @ c LIKE '%Hunter, Neutral, no freebattle team%' -- Hunter
OR @ c LIKE '%Robber, Neutral, no freebattle team%' -- Thief
OR @ c like '%no job, Neutral, %no job, Neutral%' -- Free PVP
)
BEGIN
-- Get killer name
DECLARE @ VARCHAR(512) = @ c
DECLARE @ D INT = 0
SELECT @ = REPLACE @ , LEFT @ , CHARINDEX('(', @ )), '')
SELECT @ = REPLACE @ , RIGHT @ , CHARINDEX(')', REVERSE @ ))), '')
SELECT @ D = CharID FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharName16 = @
-- Get job type
DECLARE @ String VARCHAR(10) = LTRIM(RTRIM(SUBSTRING @ c, 5, 7)))
DECLARE @ Type INT = CASE
WHEN @ String LIKE 'Trader' THEN 1
WHEN @ String LIKE 'Robber' THEN 2
WHEN @ String LIKE 'Hunter' THEN 3
ELSE 0 END
-- Delete original log
DELETE FROM _LogEventChar WHERE CharID = @ 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%'
OR @ c like '%no job, Neutral, %no job, Neutral%')
-- Get additional info for notice message
DECLARE @ Name VARCHAR(64) = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ ID)
DECLARE @ Desc VARCHAR(32) = CASE WHEN @ Type BETWEEN 1 AND 3 THEN 'Job Conflict' ELSE 'Free PVP' END
DECLARE @strDesc VARCHAR(512)
IF @ String LIKE 'Trader' OR @ String LIKE 'Robber' OR @ String LIKE 'Hunter')
BEGIN
-- If it's a Job Kill, then write character nicknames
DECLARE @ NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ D)
DECLARE @ kName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ ID)
SET @strDesc = '[' + @ NickName + '] has just killed [' + @ kName + '] in [' + @ Desc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
END
ELSE BEGIN
-- If it's normal PVP Kill, write real character names
SET @strDesc = '[' + @ + '] has just killed [' + @ Name + '] in [' + @ Desc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
END
-- Update the log
INSERT INTO _LogEventPVP VALUES (0, @ D, @ ID, @ Type, GETDATE(), @strPos, @strDesc)
-- Flag notice if it's not sent more than 5 minutes
UPDATE _LogEventPVP SET isSent = 1 WHERE CharID = @ ID AND EventTime < DATEADD(MINUTE, -5, GETDATE())
END
END
Prosedür bu
IF (@EventID = 20) -- PVP
BEGIN
IF @ c LIKE '%Trader, Neutral, no freebattle team%' -- Trader
OR @ c LIKE '%Hunter, Neutral, no freebattle team%' -- Hunter
OR @ c LIKE '%Robber, Neutral, no freebattle team%' -- Thief
OR @ c like '%no job, Neutral, %no job, Neutral%' -- Free PVP
)
BEGIN
-- Get killer name
DECLARE @ VARCHAR(512) = @ c
DECLARE @ D INT = 0
SELECT @ = REPLACE @ , LEFT @ , CHARINDEX('(', @ )), '')
SELECT @ = REPLACE @ , RIGHT @ , CHARINDEX(')', REVERSE @ ))), '')
SELECT @ D = CharID FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharName16 = @
-- Get job type
DECLARE @ String VARCHAR(10) = LTRIM(RTRIM(SUBSTRING @ c, 5, 7)))
DECLARE @ Type INT = CASE
WHEN @ String LIKE 'Trader' THEN 1
WHEN @ String LIKE 'Robber' THEN 2
WHEN @ String LIKE 'Hunter' THEN 3
ELSE 0 END
-- Delete original log
DELETE FROM _LogEventChar WHERE CharID = @ 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%'
OR @ c like '%no job, Neutral, %no job, Neutral%')
-- Get additional info for notice message
DECLARE @ Name VARCHAR(64) = (SELECT CharName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ ID)
DECLARE @ Desc VARCHAR(32) = CASE WHEN @ Type BETWEEN 1 AND 3 THEN 'Job Conflict' ELSE 'Free PVP' END
DECLARE @strDesc VARCHAR(512)
IF @ String LIKE 'Trader' OR @ String LIKE 'Robber' OR @ String LIKE 'Hunter')
BEGIN
-- If it's a Job Kill, then write character nicknames
DECLARE @ NickName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ D)
DECLARE @ kName VARCHAR(64) = (SELECT NickName16 FROM [SRO_VT_SHARD].[dbo].[_Char] WHERE CharID = @ ID)
SET @strDesc = '[' + @ NickName + '] has just killed [' + @ kName + '] in [' + @ Desc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
END
ELSE BEGIN
-- If it's normal PVP Kill, write real character names
SET @strDesc = '[' + @ + '] has just killed [' + @ Name + '] in [' + @ Desc + '] mode on [' + CONVERT(NVARCHAR(30), GETDATE(), 0) + ']'
END
-- Update the log
INSERT INTO _LogEventPVP VALUES (0, @ D, @ ID, @ Type, GETDATE(), @strPos, @strDesc)
-- Flag notice if it's not sent more than 5 minutes
UPDATE _LogEventPVP SET isSent = 1 WHERE CharID = @ ID AND EventTime < DATEADD(MINUTE, -5, GETDATE())
END
END