talkweb 发表于 2009-11-18 16:08:35

哪位强人有修改角色名字的存储.

哪位强人有修改角色名字的存储.
哪位强人有修改角色名字的存储.
发一下啦...

ctgwglzc 发表于 2009-11-18 21:46:52

REATEPROCEDURE CHANGE_NEW_ID
        @ServerNo                tinyint,
        @AccountID                 char(21),
        @BeforeID                char(21),
        @ChangeID                char(21),
        @nRet                        smallint OUTPUT
AS
declare        @Nation        tinyint, @Race tinyint, @Class smallint, @HairColor tinyint, @Rank tinyint, @Title tinyint, @Level tinyint, @Exp int,@Loyalty int, @Face tinyint, @City tinyint, @Knights smallint
declare@Fame tinyint, @Hp smallint, @Mp smallint, @Sp smallint, @Str tinyint, @Sta tinyint, @Dex tinyint, @Intel tinyint,        @Cha tinyint, @Authority smallint, @Points tinyint, @Gold         int, @Zone tinyint
declare         @Bind smallint, @PX int, @PZ int, @PY int, @dwTime int, @QuestTotal smallint, @strSkill varchar(20),@strItem varchar(400), @strSerial varchar(400), @sQuest smallint, @strQuest varchar(400)
declare @CharID1 char(21), @CharID2 char(21), @CharID3 char(21)
       
BEGIN TRAN
        SELECT @CharID1 = strCharID1, @CharID2 = strCharID2, @CharID3 = strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
        IF @CharID1 = @BeforeID
        BEGIN
                UPDATE ACCOUNT_CHAR SET strCharID1 = @ChangeID WHERE strAccountID = @AccountID
        END
        ELSE IF @CharID2 = @BeforeID
        BEGIN
                UPDATE ACCOUNT_CHAR SET strCharID2 = @ChangeID WHERE strAccountID = @AccountID
        END
        ELSE IF @CharID3 = @BeforeID
        BEGIN
                UPDATE ACCOUNT_CHAR SET strCharID3 = @ChangeID WHERE strAccountID = @AccountID
        END
        IF @@ERROR <> 0
        BEGIN
                ROLLBACK TRAN
                SET @nRet = 1
                RETURN
        END
        SELECT @Nation = Nation, @Race = Race, @Class = Class, @HairColor = HairColor, @Rank = Rank, @Title = Title, @Level = , @Exp = , @Loyalty = Loyalty, @Face = Face, @City = City, @Knights = Knights,
                   @Fame =Fame, @Hp = Hp, @Mp = Mp, @Sp = Sp, @Str = Strong, @Sta = Sta, @Dex = Dex, @Intel = Intel, @Cha = Cha, @Authority = Authority, @Points = Points, @Gold = Gold, @Zone = ,
                   @Bind = Bind, @PX = PX, @PZ = PZ, @PY = PY, @dwTime = dwTime, @strSkill = strSkill, @strItem = strItem, @strSerial = strSerial, @sQuest = sQuestCount, @strQuest = strQuest
        FROM        USERDATAWHERE strUserId = @BeforeID
        INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairColor, Rank, Title, , , Loyalty, Face, City, Knights,
                                    Fame, Hp, Mp, Sp, Strong, Sta, Dex, Intel, Cha, Authority, Points, Gold, Zone, Bind, PX, PZ, PY, dwTime, strSkill, strItem,strSerial, sQuestCount, strQuest )
        VALUES       (@ChangeID, @Nation, @Race, @Class, @HairColor, @Rank, @Title, @Level, @Exp, @Loyalty, @Face, @City, @Knights,
                      @Fame, @Hp, @Mp, @Sp, @Str, @Sta, @Dex, @Intel, @Cha, @Authority, @Points, @Gold, @Zone, @Bind, @PX, @PZ, @PY, @dwTime, @strSkill, @strItem, @strSerial, @sQuest, @strQuest )
        IF @@ERROR <> 0
        BEGIN
                ROLLBACK TRAN
                SET @nRet = 2
                RETURN
        END
        UPDATE USERDATA SET City = 255 WHERE strUserID = @BeforeID        -- ?? ???? ?? ??? ???.
        SET XACT_ABORT ON
        INSERT INTO .. (nServerNo, strAccountID, strBeforeID, strChangedID) VALUES (@ServerNo, @AccountID, @BeforeID, @ChangeID)
        IF @@ERROR <> 0
        BEGIN
                ROLLBACK TRAN
                SET @nRet = 3
                RETURN
        END
COMMIT TRAN
SET @nRet = 0

GO

leonjaykai 发表于 2009-11-21 12:11:44

請問這個那個版本可以用???

ctgwglzc 发表于 2009-11-23 00:39:29

請問這個那個版本可以用???
leonjaykai 发表于 2009-11-21 12:11 http://www.kofans.cn/bbs/static/image/common/back.gif
1311,2.0

leonjaykai 发表于 2009-12-31 17:45:49

再請問ct 這是要貼在資料庫的那個文件之下 ??qq
页: [1]
查看完整版本: 哪位强人有修改角色名字的存储.