搜索
 找回密码
 加入

G想我的EVT中的一断

duepbbmal336 2012-8-4 15:14:29 4306
ctgwglzc
2012-5-29 20:24:48
1、建立 NEW_CHAR_ITEM存储
  1. CREATE PROCEDURE [dbo].[NEW_CHAR_ITEM]
  2. @account varchar(21)
  3. AS
  4. begin

  5. declare @class smallint

  6. select @class = cast(substring(cast(class as varchar(3)),2,2) as smallint(2)) from userdata where struserid=@account

  7. if @class=1 or @class=5 or @class=6
  8. set @class = 1

  9. if @class=2 or @class=7 or @class=8
  10. set @class = 2

  11. if @class=3 or @class=9 or @class=10
  12. set @class = 3

  13. if @class=4 or @class=11 or @class=12
  14. set @class = 4

  15. update userdata set  stritem = (select stritem from BIRTH_ITEM where class=@class) where struserid=@account

  16. end
  17. GO
复制代码
ctgwglzc
2012-5-29 20:25:33
点击查看详情
2、导入数据表
点击进入下载-BIRTH_ITEM.7z
3、CREATE_NEW_CHAR存储中
  1. IF @@ERROR <> 0
  2.         BEGIN         
  3.                 ROLLBACK TRAN
  4.                 SET @nRet =  4
  5.                 RETURN
  6.         END
复制代码
上一行,加入
  1.    exec NEW_CHAR_ITEM @CharID
复制代码
雪皓松松
2012-5-29 22:24:39
{:1_209:}CT放出来了,楼主你就把这EVT分享了吧.好吗。
feifeixia
2012-5-29 22:37:38
这个 真的号复杂。。
duepbbmal336
2012-5-30 19:31:41
楼主
本帖最后由 duepbbmal336 于 2012-5-30 19:58 编辑
雪皓松松 发表于 2012-5-29 22:24
CT放出来了,楼主你就把这EVT分享了吧.好吗。



CREATE PROCEDURE 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 >= 1        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 =  1
                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
        BEGIN
        ROLLBACK TRAN
        SET @nRet=4
        RETURN
        END
        --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
        exec NEW_CHAR_ITEM @CharID

COMMIT TRAN
SET @nRet =  0
GO

按这样也没有出生装备无语了啊
ctgwglzc
2012-5-31 20:51
exec NEW_CHAR_ITEM @CharID应该放在IF @@ERROR <> 0之前 
jianweis
2012-5-30 20:36:46
回复一下
music852
2012-6-20 04:13:41
非常感謝一個爆炸
JYMETIN
2012-6-24 21:49:35
看看?
evaydd
2012-7-30 18:56:34
好东西,收下了!!!
Rayman
2012-8-4 15:14:29
本帖最后由 Rayman 于 2012-8-4 15:16 编辑

看过此贴,有感,是而发一段好多人都想要的存储。


  1. CREATE PROCEDURE CREATE_NEW_CHAR

  2. @nRet                smallint OUTPUT,
  3. @AccountID         char(21),
  4. @index                 tinyint,
  5. @CharID        char(21),
  6. @Race         tinyint,
  7. @Class                 smallint,
  8. @Hair                 tinyint,
  9. @Face                 tinyint,
  10. @Str                 tinyint,
  11. @Sta                 tinyint,
  12. @Dex                 tinyint,
  13. @Intel                 tinyint,
  14. @Cha                 tinyint

  15. AS

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

  18.         SELECT @Nation = bNation, @Row = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
  19.        
  20.         --只准建三个人
  21.         IF @Row >=3        SET @nRet =  1
  22.        
  23.         IF @Nation = 1 AND @Race > 10        SET @nRet = 2
  24.         ELSE IF @Nation = 2 AND @Race < 10        SET @nRet = 2
  25.         ELSE IF @Nation <>1 AND @Nation <> 2        SET @nRet = 2

  26.         IF @nRet > 0
  27.                 RETURN
  28.        
  29.         SELECT @Row = COUNT(*) FROM USERDATA WHERE strUserId = @CharID
  30.         IF @Row > 0
  31.         BEGIN
  32.                 SET @nRet =  3
  33.                 RETURN
  34.         END

  35.         --SET @Zone = @Nation
  36.         SET @Zone=21
  37.         SELECT @PosX = InitX, @PosZ = InitZ  FROM ZONE_INFO WHERE ZoneNo = @Zone
  38.        

  39. BEGIN TRAN       
  40.         IF @index = 0--中间的
  41.                 UPDATE ACCOUNT_CHAR SET strCharID1 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
  42.         ELSE IF @index = 1--左边的
  43.                 UPDATE ACCOUNT_CHAR SET strCharID2 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
  44.         ELSE IF @index = 2 --右边的
  45.                 UPDATE ACCOUNT_CHAR SET strCharID3 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
  46.         --ELSE IF @index = 3 --sohu未开放的
  47.         --        UPDATE ACCOUNT_CHAR SET strCharID4 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
  48.         --ELSE IF @index = 4 --sohu未开放的
  49.                 --UPDATE ACCOUNT_CHAR SET strCharID5 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
  50.        
  51.         --如果是中间的,则给80级,否则给1级
  52.         IF @index=0
  53.                 INSERT INTO USERDATA (strUserId,strAccountID, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ ,loyalty,exp,level,gold,points,strsKill)  VALUES  (@CharID,@AccountID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ,100,1000000000,80,500000,277,0x8E000000000000000000)
  54.         ELSE
  55.                 INSERT INTO USERDATA (strUserId,strAccountID, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ ,loyalty,exp,gold)  VALUES  (@CharID,@AccountID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ,100,1000000000,500000)
  56.         ------------------------------------------------------------------------------------------------------------------------------------------
  57.         --开始发放新手装备
  58.         IF @index=0 --如果是80级的号,给80的装备,否则让其自己打
  59.         BEGIN
  60.                 DECLARE @strItem char(400)
  61.                 IF @Class=101 or @Class=201 or @Class=106 or @Class=206
  62.                         BEGIN
  63.                                 select @strItem=strItem from userdata where struserid='warrior'
  64.                                 update userdata set strItem=@strItem where struserid=@CharID
  65.                         END
  66.                 IF @Class=102 or @Class=202 or @Class=108 or @Class=208
  67.                         BEGIN
  68.                                 select @strItem=strItem from userdata where struserid='roger'
  69.                                 update userdata set strItem=@strItem where struserid=@CharID
  70.                         END
  71.                 IF @Class=103 or @Class=203 or @Class=110 or @Class=210
  72.                         BEGIN
  73.                                 select @strItem=strItem from userdata where struserid='mace'
  74.                                 update userdata set strItem=@strItem where struserid=@CharID
  75.                         END
  76.                 IF @Class=104 or @Class=204 or @Class=112 or @Class=212
  77.                         BEGIN
  78.                                 select @strItem=strItem from userdata where struserid='premist'
  79.                                 update userdata set strItem=@strItem where struserid=@CharID
  80.                         END
  81.         END
  82.         ------------------------------------------------------------------------------------------------------------------------------------------
  83.        
  84.         IF @@ERROR <> 0
  85.         BEGIN         
  86.                 ROLLBACK TRAN
  87.                 SET @nRet =  4
  88.                 RETURN
  89.         END
  90.        
  91. COMMIT TRAN
  92. SET @nRet =  0
  93. GO
复制代码
存储说明:
这个存储是允许建三个人物,中间的为80级(技能和能力点给到位了),两边的就默认1级,上线后复制初始人物装备。装备来源为四个初始号,分别是warriror,roger,mace,premist。

此存储比CT发的要精简,无需再新建一个存储为实现所需功能。操作也灵活,只需更改四个初始号上的装备即可。

后记:
其实懂存储的人一看就知道是小儿科了,只有想不到,没有做不到,深入技术才是根本,怎么抄都没用的。网上下的再好的端也是个废品,因为好的东西是高手不断完善来才得来的,真正好的东西,很难在网上下载的到。也由此B4一下那些成天害人的垃圾,比如以前的什么招牌、788等。我想说的是:有本事的人一般不会倒处招摇。
高级模式
游客