Hello guys..
I want some of you to check this script and tell me if it works..or if there is any thing has to be modified or so...
It's a log procedure..that should Excute a query when a char lvls up.
I want some of you to check this script and tell me if it works..or if there is any thing has to be modified or so...
It's a log procedure..that should Excute a query when a char lvls up.
PHP Code:
USE [Log_DB]
GO
/****** Object: StoredProcedure [dbo].[_AddLogChar] Script Date: 02/09/2014 22:43:28 ******/
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
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 = 22 -- Character level up
BEGIN
DECLARE @CharNameEQ VARCHAR(64) = (SELECT CharName16 from [SRO_VT_SHARD_INIT].[dbo].[_Char] WHERE CharID = @CharID)
BEGIN
EXEC [SRO_VT_SHARD_INIT].[dbo].[W/E] @CharNameEQ, 7
END
END