搜索
 找回密码
 加入

1310 AU无法建立人物存储(修复)

chencjh 2009-6-25 20:43:08 1388
USE [kn_online]
GO
/****** Object:  StoredProcedure [dbo].[smg_CREATE_NEW_CHAR]    Script Date: 06/22/2009 20:47:49 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO

/****** Object:  Stored Procedure dbo.CREATE_NEW_CHAR    Script Date: 6/6/2006 6:03:33 PM ******/


/****** ??: ?? ???? dbo.CREATE_NEW_CHAR    ???? ??: 2002-11-14 ?? 11:18:03 ******/


-- scripted by samma
-- 2002.01.17
-- 2003.02.06 sungyong
-- 2009.06.22 ShellX

create PROCEDURE [dbo].[smg_CREATE_NEW_CHAR]

@nRet                smallint OUTPUT,
@AccountID         char(21),
@index                 tinyint,
@CharID        char(21),
@Race                 tinyint,
@Class         smallint,
@Hair                 tinyint,
@Face                 tinyint,
@Str                 tinyint,
@Sta                 tinyint,
@Dex                 tinyint,
@Intel                 tinyint,
@Cha                 tinyint

AS

DECLARE @Row tinyint, @Nation tinyint, @Zone tinyint, @PosX int, @PosZ int
        SET @Row = 0        SET @Nation = 0  SET @Zone = 0  SET @PosX = 0 SET @PosZ = 0

        SELECT @Nation = bNation, @Row = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
       
        IF @Row >= 5        SET @nRet =  1
       
        IF @Nation = 1 AND @Race > 10        SET @nRet = 2
        ELSE IF @Nation = 2 AND @Race < 10        SET @nRet = 2
        ELSE IF @Nation <>1 AND @Nation <> 2        SET @nRet = 2

        IF @nRet > 0
                RETURN
       
        SELECT @Row = COUNT(*) FROM USERDATA WHERE strUserId = @CharID
        IF @Row > 0
        BEGIN
                SET @nRet =  3
                RETURN
        END

        --SET @Zone = @Nation
        SET @Zone=21
        SELECT @PosX = InitX, @PosZ = InitZ  FROM ZONE_INFO WHERE ZoneNo = @Zone
       

BEGIN TRAN       
        IF @index = 0
                UPDATE ACCOUNT_CHAR SET strCharID1 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
        ELSE IF @index = 1
                UPDATE ACCOUNT_CHAR SET strCharID2 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
        ELSE IF @index = 2
                UPDATE ACCOUNT_CHAR SET strCharID3 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
        ELSE IF @index = 3
                UPDATE ACCOUNT_CHAR SET strCharID4 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
        ELSE IF @index = 4
                UPDATE ACCOUNT_CHAR SET strCharID5 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
       

        INSERT INTO USERDATA (strUserId, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ )
        VALUES         (@CharID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ )
       
       
        IF @@ERROR <> 0
        BEGIN         
                ROLLBACK TRAN
                SET @nRet =  4
                RETURN
        END
       
COMMIT TRAN
SET @nRet =  0

4 回复

feifeixia
2009-6-25 18:58:14
点击查看详情
可以建人物的呀!
feifeixia
2009-6-25 19:47:15
只是在招手
only
2009-6-25 20:26:36
无法选择角色
1111
2009-6-25 20:43:08
大家能不能详细点..    什么只是在招手

是不是 选人物那进不去..   或者进了 中断?

我搞一个老外库原来好象 出现过的
高级模式
游客