
Originally Posted by
Kevx96
USE [w00_Character]
GO
/****** Object: StoredProcedure [dbo].[p_Char_Logout] Script Date: 02.10.2016 21:42:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 개체: 저장 프로시저 dbo.p_Char_Logout 스크립트 날짜: 2007-03-13 오후 6:25:10 ******/
ALTER PROCEDURE [dbo].[p_Char_Logout]
/*
Character logout
2004.6 By CJC
Input:
nCharNo = To be logout
nPlayMin = Play minute at this time
output:
0 = error
1 = work ok
*/
@nCharNo int,
@nPlayMin int,
@nRet int OUTPUT
AS
SET NOCOUNT ON
UPDATE tCharacter
SET nPlayMin = nPlayMin + @nPlayMin
WHERE nCharNo = @nCharNo
SET @nRet = @@ROWCOUNT
Delete from dbo.LoggedInChars where nCharNo = @nCharNo
BEGIN
DECLARE @nLevel INT
DECLARE @nClass INT
SELECT @nLevel = nLevel FROM tCharacter WHERE nCharNo = @nCharNo
-- Only if level == 2
IF @nLevel = 2
BEGIN
&alllearnskill
CLOSE db_cursor
DEALLOCATE db_cursor
END
END
-- end