搜索
 找回密码
 加入

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

talkweb 2009-12-31 17:45:49 1371
哪位强人有修改角色名字的存储.
哪位强人有修改角色名字的存储.
发一下啦...

4 回复

ctgwglzc
2009-11-18 21:46:52
点击查看详情
  1. REATE  PROCEDURE CHANGE_NEW_ID
  2.         @ServerNo                tinyint,
  3.         @AccountID                 char(21),
  4.         @BeforeID                char(21),
  5.         @ChangeID                char(21),
  6.         @nRet                        smallint OUTPUT
  7. AS
  8. 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
  9. 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
  10. 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)
  11. declare @CharID1 char(21), @CharID2 char(21), @CharID3 char(21)
  12.        
  13. BEGIN TRAN
  14.         SELECT @CharID1 = strCharID1, @CharID2 = strCharID2, @CharID3 = strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
  15.         IF @CharID1 = @BeforeID
  16.         BEGIN
  17.                 UPDATE ACCOUNT_CHAR SET strCharID1 = @ChangeID WHERE strAccountID = @AccountID
  18.         END
  19.         ELSE IF @CharID2 = @BeforeID
  20.         BEGIN
  21.                 UPDATE ACCOUNT_CHAR SET strCharID2 = @ChangeID WHERE strAccountID = @AccountID
  22.         END
  23.         ELSE IF @CharID3 = @BeforeID
  24.         BEGIN
  25.                 UPDATE ACCOUNT_CHAR SET strCharID3 = @ChangeID WHERE strAccountID = @AccountID
  26.         END
  27.         IF @@ERROR <> 0
  28.         BEGIN
  29.                 ROLLBACK TRAN
  30.                 SET @nRet = 1
  31.                 RETURN
  32.         END
  33.         SELECT @Nation = Nation, @Race = Race, @Class = Class, @HairColor = HairColor, @Rank = Rank, @Title = Title, @Level = [Level], @Exp = [Exp], @Loyalty = Loyalty, @Face = Face, @City = City, @Knights = Knights,
  34.                      @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 = [Zone],
  35.                      @Bind = Bind, @PX = PX, @PZ = PZ, @PY = PY, @dwTime = dwTime, @strSkill = strSkill, @strItem = strItem, @strSerial = strSerial, @sQuest = sQuestCount, @strQuest = strQuest
  36.         FROM        USERDATA  WHERE strUserId = @BeforeID
  37.         INSERT INTO USERDATA (strUserID, Nation, Race, Class, HairColor, Rank, Title, [Level], [Exp], Loyalty, Face, City, Knights,
  38.                                     Fame, Hp, Mp, Sp, Strong, Sta, Dex, Intel, Cha, Authority, Points, Gold, Zone, Bind, PX, PZ, PY, dwTime, strSkill, strItem,strSerial, sQuestCount, strQuest )
  39.         VALUES         (@ChangeID, @Nation, @Race, @Class, @HairColor, @Rank, @Title, @Level, @Exp, @Loyalty, @Face, @City, @Knights,
  40.                         @Fame, @Hp, @Mp, @Sp, @Str, @Sta, @Dex, @Intel, @Cha, @Authority, @Points, @Gold, @Zone, @Bind, @PX, @PZ, @PY, @dwTime, @strSkill, @strItem, @strSerial, @sQuest, @strQuest )
  41.         IF @@ERROR <> 0
  42.         BEGIN
  43.                 ROLLBACK TRAN
  44.                 SET @nRet = 2
  45.                 RETURN
  46.         END
  47.         UPDATE USERDATA SET City = 255 WHERE strUserID = @BeforeID        -- ?? ???? ?? ??? ???.
  48.         SET XACT_ABORT ON
  49.         INSERT INTO [Account_Log].[dbo].[CHANGE_ID_LOG] (nServerNo, strAccountID, strBeforeID, strChangedID) VALUES (@ServerNo, @AccountID, @BeforeID, @ChangeID)
  50.         IF @@ERROR <> 0
  51.         BEGIN
  52.                 ROLLBACK TRAN
  53.                 SET @nRet = 3
  54.                 RETURN
  55.         END
  56. COMMIT TRAN
  57. SET @nRet = 0

  58. GO
复制代码
leonjaykai
2009-11-21 12:11:44
請問這個那個版本可以用???
ctgwglzc
2009-11-23 00:39:29
請問這個那個版本可以用???
leonjaykai 发表于 2009-11-21 12:11

1311,2.0
leonjaykai
2009-12-31 17:45:49
再請問ct 這是要貼在資料庫的那個文件之下 ??  qq
高级模式
游客