友情提示:奇迹私服无保障,喜爱奇迹请支持官方奇迹MU!

游戏资料库

你当前的位置:奇迹私发网 > 技术资料 > 内容

技术资料

圣导师用PL网站系统转生后,统率不为零解决方案


圣导师用PL网站系统转生后,统率不为零解决方案如下:
打开MuOnline---储存过程---- WEB2_CHECKZSX,修改成如下:


CREATE PROCEDURE WEB2_CHECKZSX
    @XSMONEY INT,
    @ACC VARCHAR(10),      --1
    @NAME NVARCHAR(10),    --2
    @MANA REAL,            --3
    @LIFE REAL,            --4
    @STRENGTH SMALLINT,    --5
    @DEXTERITY SMALLINT,    --6
    @VITALITY SMALLINT,    --7
    @ENERGY SMALLINT,      --8
    @XSZSCOUNT INT,      --9
    @PTZSCS INT,          --10
    @HJZSCS INT,          --11
    @BJZSCS INT,        --12
    @BCDS INT,          --13
    @XZZS VARCHAR(5),    --14
    @XSZSCLEVEL SMALLINT,--15
    @ZSCLEVEL SMALLINT,  --16
    @MAPNUMBER SMALLINT, --17
    @MAPPOSX SMALLINT,  --18
    @MAPPOSY SMALLINT,  --19
    @ZSSJJG SMALLINT,    --20
    @ZSSJJG1 SMALLINT,  --21
    @ZSSJJG2 SMALLINT,  --22
    @XSJF INT,          --23
    @EXPERIENCE INT,    --24
    @ZSLEVELUPPOINT INT, --25
    @PKLEVEL INT,        --26
    @CLZB CHAR(5),      --27
    @JCZB VARCHAR(5),    --28
    @ZDJ INT,
    @ZSFS CHAR(1),
    @MONEY INT,
    @FHJF INT,
    @FHJF1 INT,
    @FHJF2 INT,
    @ZSCS INT,        --中级转生次数
    @TGS00 CHAR(1),
    @TGS01 INT,
    @TGS02 INT,
    @TGS03 INT,
    @TGS04 INT,      --高级转生次数
    @TGS05 INT,
    @TGS06 NVARCHAR(5),
    @TGS07 INT,
    @TGS08 NVARCHAR(5),
    @TGS09 INT,
    @TGS10 NVARCHAR(5),
    @TGS11 INT,
    @TGS12 INT,
    @TGS13 INT,
    @TGS14 INT,
    @TGS15 INT,
    @JLZS INT,
    @ZSJL INT,
    @ZSJL1 INT,
    @ZSJL2 INT,
    @ZSJS INT,
    @GS2LJ CHAR(5),
    @TGSZ01 INT,
    @TGSZ02 INT,
    @TGSZ03 INT,
    @TGSG01 INT,
    @TGSG02 INT,
    @TGSG03 INT
AS
SET NOCOUNT ON
DECLARE @ZCOUNT INT
DECLARE @ZZSCOUNT INT
DECLARE @USERCLEVEL SMALLINT
DECLARE @ACCQX CHAR(1)
DECLARE @XZSCOUNT INT
DECLARE @XCZSSJ VARCHAR(50)
DECLARE @PPKTIME INT
DECLARE @PKCOUNT INT
DECLARE @CZCS SMALLINT  --转世次数
DECLARE @JDJ SMALLINT
DECLARE @MJSJ DATETIME
DECLARE @ZSSJ DATETIME
DECLARE @JF1 INT
DECLARE @YJF INT
DECLARE @MDATE DATETIME
DECLARE @YZSTIME DATETIME
DECLARE @YNAME VARCHAR(10)
DECLARE @ITEMS VARBINARY(1200)    --前12件物品
DECLARE @RITEMS VARBINARY(1200)
DECLARE @GJZSCS INT
DECLARE @YMONEY INT
DECLARE @GDDS INT
DECLARE @CGXS INT
DECLARE @ZSDSSC INT
DECLARE @YZZSCOUNT INT
DECLARE @CLASS TINYINT
SET @XZSCOUNT=0
SET @ZCOUNT=0
/*判断在线*/
SET @ZCOUNT=DBO.JC_USER_ONLINE(@ACC)
IF @ZCOUNT >= 1
    BEGIN
        SELECT '用户在线上请先下线。'
        SET NOCOUNT OFF
        RETURN
    END
SET @ZCOUNT=0
SET @ZCOUNT=DBO.JC_USER_ONLINEJS(@ACC,@NAME)
IF @ZCOUNT >= 1
    BEGIN
        SELECT '角色'+ @NAME + '是最后一个退出游戏的无法转生。请先换其它角色登陆游戏后安全退出再来转生。谢谢!'
        SET NOCOUNT OFF
        RETURN
    END
SELECT @CLASS=CLASS,@YMONEY=MONEY,@YNAME=NAME,@ITEMS=INVENTORY,@MDATE=MDATE,@USERCLEVEL=CLEVEL,@PPKTIME=PKTIME,@PKCOUNT=PKLEVEL FROM CHARACTER WHERE NAME = @NAME AND ACCOUNTID=@ACC
IF @YNAME IS NULL OR @YNAME = ''
    BEGIN
        SELECT '角色名不存在请从试。'
        SET NOCOUNT OFF
        RETURN
    END
--------------------------检查是否装备物品----------------------
DECLARE @I INT
IF (@ITEMS IS NULL OR LEN(@ITEMS) < 120)
    SET @ITEMS = CAST(REPLICATE(CHAR(0XFF),760) AS VARBINARY(760))

IF(@JCZB = 'YTRUE' AND @CLZB = '3')
    BEGIN
        SET @I=0
        WHILE @I<12
        BEGIN
            IF SUBSTRING(@ITEMS,@I*10+1,1)<>0XFF
                BREAK
            SET @I=@I+1
        END
        IF @I<12    --错误退出
        BEGIN
            SELECT '转生时身上不得装备任何物品 !'
            RETURN
        END
    END
IF(@CLZB = '2')
    SET @ITEMS=SUBSTRING(@ITEMS,1,120) + CAST(REPLICATE(CHAR(0XFF),640) AS VARBINARY(640))
IF(@CLZB = '3')
    SET @ITEMS=CAST(REPLICATE(CHAR(0XFF),760) AS VARBINARY(760))
-----------------------------------------------------------------
SELECT @YJF=JF,@ACCQX=QX FROM MEMB_INFO WHERE MEMB___ID=@ACC
IF @ACCQX='A'
    BEGIN
        SET @XZSCOUNT=@HJZSCS
        SET @ZSSJJG=@ZSSJJG2
    END
IF @ACCQX='B'
    BEGIN
        SET @XZSCOUNT=@PTZSCS
    END
IF @ACCQX='C'
    BEGIN
        SET @XZSCOUNT=@BJZSCS
        SET @ZSSJJG=@ZSSJJG1
    END
SELECT @ZSDSSC=LEVELUPPOINT,@GDDS=GDDS,@YZZSCOUNT=ZSCS,@CZCS=CZCS,@ZSSJ=ZSTIME,@XCZSSJ=CONVERT(VARCHAR,DATEADD(MINUTE,@ZSSJJG,ZSTIME),111) + ' ' + CONVERT(VARCHAR,DATEADD(MINUTE,@ZSSJJG,ZSTIME),8)  FROM WEB_ZS WHERE NAME=@NAME
IF(@YZZSCOUNT IS NULL)
BEGIN
    SET @YZZSCOUNT = 0

END
SET @ZZSCOUNT=@YZZSCOUNT
IF(@ZSDSSC IS NULL)
    SET @ZSDSSC= 0
/*-----------------------判断修正转生数据-----------------------------*/
IF(@ZSSJ IS NULL)
    BEGIN
        SET @ZSSJ=GETDATE()
    END
IF(@MDATE >= @ZSSJ)
    BEGIN
        IF(@XZZS = 'STRUE')
            BEGIN
                SELECT '你的转生数据有误请联系管理员进行修正后再转生'
                SET NOCOUNT OFF
                RETURN
            END
        IF(@XZZS = 'YTRUE')
            BEGIN
                SET @ZCOUNT=0                                           
                SELECT @ZCOUNT=COUNT(*) FROM WEB_ZS WHERE NAME=@NAME
                IF @ZCOUNT > 0
                    BEGIN
                        UPDATE WEB_ZS SET ZSTIME=GETDATE(),BSCS=0,CZCS=0,ZSCLEVEL=1,ZSCS=0,CJZSCS=0,ZJZSCS=0,GJZSCS=0,LEVELUPPOINT=0 WHERE NAME=@NAME
                    END
                ELSE
                    BEGIN
                        INSERT INTO WEB_ZS(ACC,NAME,ZSTIME,ZSCLEVEL,ZSCS,CJZSCS,GJZSCS,ZJZSCS,LEVELUPPOINT,BSCS,CZCS) VALUES(@ACC,@NAME,GETDATE(),1,0,0,0,0,0,0,0)
                    END
                SELECT @ZZSCOUNT=ZSCS,@CZCS=CZCS,@ZSSJ=ZSTIME FROM WEB_ZS WHERE NAME=@NAME
                SET @ZSSJJG=0
            END
    END

/*-----------------------结束-----------------------------*/
IF(@ZZSCOUNT <= 0)
    BEGIN
        SET @ZSSJJG=0
    END
IF(DATEADD(MINUTE,@ZSSJJG,@ZSSJ) > GETDATE())
    BEGIN
        SELECT '你现在还不能转生,你的下次转生时间为' + @XCZSSJ
        SET NOCOUNT OFF
        RETURN
    END
IF(@CZCS IS NULL OR @CZCS <= 0)
    BEGIN
        SET @CZCS=0
    END
IF @ZZSCOUNT >= @XZSCOUNT
    BEGIN
        SELECT '对不起你不能再转生了!!您已经转生了'+ CONVERT(VARCHAR,@ZZSCOUNT) +'!请马上去升级会员哦!'
        SET NOCOUNT OFF
        RETURN
    END
/*------------等级增加------------------*/   
IF(@ZZSCOUNT <= @TGS11)
    SET @TGS12=@TGS12 + @ZZSCOUNT * @TGS13
ELSE
BEGIN
    IF(@ZZSCOUNT <= (@TGS11 + @TGS04))
    SET @TGS12=@TGS12 + (@ZZSCOUNT-@TGS11) * @TGS13
    ELSE
    SET @TGS12 = @TGS12 + (@ZZSCOUNT - @TGS11 - @TGS04) * @TGS13
END


/*------------判断是否是新手转生------------------*/
IF (@ZZSCOUNT < @XSZSCOUNT AND @CZCS=0)
    BEGIN
        SET @MONEY= @XSMONEY                                    
        SET @TGS12=@XSZSCLEVEL
    END
SET @ZZSCOUNT = @ZZSCOUNT + 1
/*----------------转生机率------------------*/
IF(@ZZSCOUNT >= @JLZS AND @JLZS != 0)
BEGIN
    IF @ACCQX='A'
        SET @ZSJL=@ZSJL2
    IF @ACCQX='C'
        SET @ZSJL=@ZSJL1
    IF(@ZSJL < 8)
        SET @ZSJL=8
    IF(@ZSJL > 99)
        SET @ZSJL=99
    SELECT @CGXS=CONVERT(INT,SUBSTRING(CONVERT(VARCHAR,RAND()),3,2))
    IF(@CGXS > @ZSJL)
    BEGIN
        SET @ZZSCOUNT=@ZZSCOUNT - @ZSJS-1
    END   
END
/*---------------判断是否够等级-----------------*/
IF(@ZDJ < 350)
    SET @ZDJ = 350
IF(@TGS12 >= @ZDJ)
    SET @TGS12=@ZDJ
IF (@USERCLEVEL < @TGS12)
    BEGIN
        SELECT '兄弟啊!你的等级还不够再去练练吧!!转生需要'+ CONVERT(VARCHAR,@TGS12) +'级哦!'
        SET NOCOUNT OFF
        RETURN
    END
/*-----------------判断是有霹雳币--------------*/
IF @ZZSCOUNT < @XSZSCOUNT
    SET @ZCOUNT=1
ELSE
    BEGIN
    SET @GJZSCS=@TGS11 + @TGS04
    IF(@ZZSCOUNT > @TGS11 AND @ZZSCOUNT <= @GJZSCS)
            BEGIN
                SET @TGS14=@TGS14 + (@ZZSCOUNT-@TGS11) * @TGS15
            END
       
        IF(@ZZSCOUNT > @GJZSCS)
            BEGIN
                SET @TGS14=@TGS14 + (@ZZSCOUNT-@GJZSCS) * @TGS15   
            END
        IF(@ZZSCOUNT < @TGS11)
            SET @TGS14=@TGS14 + @ZZSCOUNT * @TGS15   
        IF (@YJF < @TGS14)
            BEGIN
                SELECT '你的霹雳币币不足!转生需要'+ CONVERT(VARCHAR,@TGS14) +'点霹雳币!'
                SET NOCOUNT OFF
                RETURN
            END
END
--------------------------------红名是否允许转生------------------
IF(@PKLEVEL = 0)
    BEGIN
        IF(@PKCOUNT > 3)           
            BEGIN
                SELECT '系统提示:目前不允许红名和魔头转生!'
                SET NOCOUNT OFF
                RETURN
            END
        IF(@PKCOUNT <= 3 AND @PPKTIME > 0)           
            BEGIN
                SELECT '系统提示:你的杀人通缉时间还没过,网通奇迹私服,不能转生。\N如果你不是红名而又出现这种情况,请用“清洗红名”功能进行免费洗名。'
                SET NOCOUNT OFF
                RETURN
            END
        SET @ZCOUNT=0
    END
/*---------------------判断身上是否有中够的钱转生----------------------------*/
IF (@YMONEY < @MONEY)
    BEGIN
        SELECT '你的帐号余额不足!转生需要'+ CONVERT(VARCHAR,@MONEY) +'MONEY!'
        SET NOCOUNT OFF
        RETURN
    END
/*-------------------------------选择转生公式--------------------------------*/

IF(@GDDS IS NULL)
    SET @GDDS = 0
DECLARE @ERC INT
SET @ERC = 1
BEGIN TRAN
IF (@TGS00 = '1')
    BEGIN
        IF (@ZZSCOUNT < @XSZSCOUNT AND @CZCS=0)
            BEGIN
                SET @ZZSCOUNT = @XSZSCOUNT
            END
        SET @GJZSCS=@TGS11 + @TGS04
       
        IF(@ZZSCOUNT > @GJZSCS)
            BEGIN
                SET @ZSLEVELUPPOINT=@TGSG01 + @TGS11 * @TGS02 + @TGSZ02 * @TGS04 + (@ZZSCOUNT - @GJZSCS) * @TGSG02 + @CZCS * @TGSG03 + @BCDS + @GDDS
            END
        IF(@ZZSCOUNT > @TGS11 AND @ZZSCOUNT <= @GJZSCS)
            BEGIN
                SET @ZSLEVELUPPOINT=@TGSZ01 + @TGS11 * @TGS02  + (@ZZSCOUNT - @TGS11) * @TGSZ02 + @CZCS * @TGSZ03 + @BCDS + @GDDS
            END
        IF(@ZZSCOUNT <= @TGS11)
            BEGIN
                SET @ZSLEVELUPPOINT=@TGS01 + @ZZSCOUNT * @TGS02 + @CZCS * @TGS03 + @BCDS + @GDDS   
            END   
        IF(@CLASS = 48)
            BEGIN
            IF(@TGS06 = 1)
                SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS05 / 100
            ELSE
                SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS05
            END   
        IF (@ACCQX = 'C')
            BEGIN
                IF(@TGS08 = 1)
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS07 / 100
                ELSE
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS07       
            END
        IF (@ACCQX = 'A')
            BEGIN
                IF(@TGS10 = 1)
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS09 / 100
                ELSE
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS09       
            END   
        UPDATE CHARACTER SET MONEY=MONEY - @MONEY,INVENTORY=@ITEMS,STRENGTH=@STRENGTH,CLEVEL=@ZSCLEVEL,LEVELUPPOINT=@ZSLEVELUPPOINT,DEXTERITY=@DEXTERITY,VITALITY=@VITALITY,ENERGY=@ENERGY,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,PKLEVEL=3,PKTIME=0,PKCOUNT=0,EXPERIENCE=@EXPERIENCE,  leadership=0    WHERE ACCOUNTID=@ACC AND NAME=@NAME AND CLEVEL >= @TGS12
        SET @ERC=@@ROWCOUNT
    END
IF (@TGS00 = '2')
    BEGIN
        IF(@ZZSCOUNT > @YZZSCOUNT)
            BEGIN
            SET @USERCLEVEL = @USERCLEVEL + @ZSDSSC
            SET @GJZSCS=@TGS11 + @TGS04
            IF(@ZZSCOUNT > @TGS11 AND @ZZSCOUNT <= @GJZSCS)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL + @TGSZ02 + @BCDS
                END
            IF(@ZZSCOUNT > @GJZSCS)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL + @TGSG02 + @BCDS
                END
            IF(@ZZSCOUNT <= @TGS11)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL + @TGS02 + @BCDS
                END   
            IF(@CLASS = 48)
                BEGIN
                IF(@TGS06 = 1)
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS05 / 100
                ELSE
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS05
                END   
            IF (@ACCQX = 'C')
            BEGIN
                IF(@TGS08 = 1)
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS07 / 100
                ELSE
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS07       
            END
        IF (@ACCQX = 'A')
            BEGIN
                IF(@TGS10 = 1)
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS09 / 100
                ELSE
                    SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS09       
            END   
            UPDATE CHARACTER SET INVENTORY=@ITEMS,MONEY=MONEY-@MONEY,STRENGTH=@STRENGTH,CLEVEL=@ZSCLEVEL,LEVELUPPOINT=@ZSLEVELUPPOINT,DEXTERITY=@DEXTERITY,VITALITY=@VITALITY,ENERGY=@ENERGY,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,PKLEVEL=3,PKTIME=0,PKCOUNT=0,EXPERIENCE=@EXPERIENCE ,  leadership=0  WHERE NAME=@NAME AND CLEVEL >= @TGS12
            SET @ERC=@@ROWCOUNT
        END
    END
IF (@TGS00 = '3')
    BEGIN
        IF(@ZZSCOUNT > @YZZSCOUNT)
            BEGIN
                SET @ZSLEVELUPPOINT=0
                SELECT @ZSLEVELUPPOINT=LEVELUPPOINT FROM WEB_ZS  WHERE NAME=@NAME
                IF(@ZZSCOUNT <= 1)
                    BEGIN
                        SET @ZSLEVELUPPOINT=@USERCLEVEL + @CZCS * @TGS03
                    END
                IF(@ZZSCOUNT > 1 AND @ZZSCOUNT <= 10)
                    BEGIN
                        SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT  + @USERCLEVEL
                    END
                IF(@ZZSCOUNT > 10 AND @ZZSCOUNT <= 12)
                    BEGIN
                        SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT  + @USERCLEVEL/2
                        IF(@ZZSCOUNT = 13)
                            BEGIN
                                SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT + @CZCS * @TGS03               
                            END
                    END
                IF(@ZZSCOUNT > 12 AND @ZZSCOUNT <= 15)
                    BEGIN
                        SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT  + @USERCLEVEL/4
                        IF(@ZZSCOUNT = 13)
                            BEGIN
                                SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT + @CZCS * @TGS03               
                            END
                    END
                IF(@ZZSCOUNT > 15)
                    BEGIN
                        SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT  + @USERCLEVEL/8
                        IF(@ZZSCOUNT = 16)
                            BEGIN
                                SET @ZSLEVELUPPOINT=@ZSLEVELUPPOINT + @CZCS * @TGS03               
                            END
                       
                    END

                IF(@CLASS = 48)
                    BEGIN
                    IF(@TGS06 = 1)
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS05 / 100
                    ELSE
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS05
                    END   
                IF (@ACCQX = 'C')
                    BEGIN
                        IF(@TGS08 = 1)
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS07 / 100
                        ELSE
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS07       
                    END
                IF (@ACCQX = 'A')
                    BEGIN
                        IF(@TGS10 = 1)
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS09 / 100
                        ELSE
                            SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS09       
                    END   
                UPDATE CHARACTER SET  INVENTORY=@ITEMS,MONEY=MONEY-@MONEY,STRENGTH=@STRENGTH,CLEVEL=@ZSCLEVEL,LEVELUPPOINT=@ZSLEVELUPPOINT,DEXTERITY=@DEXTERITY,VITALITY=@VITALITY,ENERGY=@ENERGY,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,EXPERIENCE=@EXPERIENCE,  leadership=0    WHERE NAME=@NAME AND CLEVEL >= @TGS12
                SET @ERC=@@ROWCOUNT
            END
    END
IF (@TGS00 = '4')
    BEGIN
            IF (@ZZSCOUNT < @XSZSCOUNT AND @CZCS=0)
                BEGIN
                    SET @ZZSCOUNT = @XSZSCOUNT
                END
            SET @JDJ=@USERCLEVEL - @TGS12
                    IF(@JDJ < 0)
                        BEGIN
                            SET @JDJ = 0
                        END
            SET @GJZSCS=@TGS11 + @TGS04
            IF(@ZZSCOUNT > @TGS11 AND @ZZSCOUNT <= @GJZSCS)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL/10 + @JDJ * 2 + @ZZSCOUNT * @TGSZ02 + @CZCS * @TGSZ03 + @BCDS + @GDDS
                END
           
            IF(@ZZSCOUNT > @GJZSCS)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL/10 + @JDJ * 2 + @ZZSCOUNT * @TGSG02 + @CZCS * @TGSG03 + @BCDS + @GDDS
                END
            IF(@ZZSCOUNT <= @TGS11)
                BEGIN
                    SET @ZSLEVELUPPOINT=@USERCLEVEL/10 + @JDJ * 2 + @ZZSCOUNT * @TGS02 + @CZCS * @TGS03 + @BCDS + @GDDS
                END   
           
            
             IF(@CLASS = 48)
                BEGIN
                IF(@TGS06 = 1)
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS05 / 100
                ELSE
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS05
                END   
            IF (@ACCQX = 'C')
                BEGIN
                    IF(@TGS08 = 1)
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS07 / 100
                    ELSE
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS07       
                END
            IF (@ACCQX = 'A')
                BEGIN
                    IF(@TGS10 = 1)
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @ZSLEVELUPPOINT * @TGS09 / 100
                    ELSE
                        SET @ZSLEVELUPPOINT= @ZSLEVELUPPOINT + @TGS09       
                END   
            UPDATE CHARACTER SET INVENTORY=@ITEMS,MONEY=MONEY-@MONEY,STRENGTH=@STRENGTH,CLEVEL=@ZSCLEVEL,LEVELUPPOINT=@ZSLEVELUPPOINT,DEXTERITY=@DEXTERITY,VITALITY=@VITALITY,ENERGY=@ENERGY,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,PKLEVEL=3,PKTIME=0,PKCOUNT=0,EXPERIENCE=@EXPERIENCE ,  leadership=0  WHERE NAME=@NAME AND CLEVEL >= @TGS12
            SET @ERC=@@ROWCOUNT

    END
IF (@TGS00 = '5')
    BEGIN
        UPDATE CHARACTER SET INVENTORY=@ITEMS,MONEY=MONEY-@MONEY,CLEVEL=@ZSCLEVEL,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,PKLEVEL=@PKLEVEL,EXPERIENCE=@EXPERIENCE ,  leadership=0  WHERE NAME=@NAME AND CLEVEL >= @TGS12                                                   
        SET @ERC=@@ROWCOUNT
    END
---------------------------------------------------------------
IF (@ZZSCOUNT <= @XSZSCOUNT AND @CZCS=0)
    BEGIN
        SET @TGS14=0
        SET @FHJF=@XSJF
        UPDATE MEMB_INFO SET JF=JF + @XSJF WHERE MEMB___ID=@ACC
        SET @ERC=@ERC & @@ROWCOUNT   
    END
ELSE
    BEGIN
        SET @JF1=0
        SET @JF1=@TGS14
        IF @ACCQX='A'
            BEGIN
               
                SET @TGS14=@JF1 -  @JF1 * @FHJF2 / 100
                SET @FHJF= @JF1 * @FHJF2/100           
            END
        IF @ACCQX='C'
            BEGIN
                SET @TGS14=@JF1 -  @JF1 * @FHJF1 / 100
                SET @FHJF= @JF1 * @FHJF1/100           
            END
        IF @ACCQX='B'
            BEGIN
                SET @TGS14=@JF1 -  @JF1 * @FHJF / 100
                SET @FHJF= @JF1 * @FHJF/100
            END
        UPDATE MEMB_INFO SET JF=JF - @TGS14 WHERE MEMB___ID=@ACC   
        SET @ERC=@ERC & @@ROWCOUNT                                                                
    END
/*----------------转生机率------------------*/
IF(@ZZSCOUNT <= @YZZSCOUNT)
BEGIN                                                    
    IF EXISTS(SELECT NAME FROM WEB_ZS WHERE NAME=@NAME)
        UPDATE WEB_ZS SET ZSTIME=GETDATE(),ZSCLEVEL=@USERCLEVEL,ZSCS=@ZZSCOUNT WHERE NAME=@NAME   
    UPDATE CHARACTER SET CLEVEL=@ZSCLEVEL,MAGICLIST=NULL,MANA=@MANA,MAXMANA=@MANA,LIFE=@LIFE,MAXLIFE=@LIFE,MAPNUMBER=@MAPNUMBER,MAPPOSX=@MAPPOSX,MAPPOSY=@MAPPOSY,PKLEVEL=@PKLEVEL,EXPERIENCE=@EXPERIENCE  WHERE NAME=@NAME   
    SET @ZZSCOUNT = @ZZSCOUNT
    SELECT '不好意思哦!您转生失败了现在是'+ CONVERT(VARCHAR,@ZZSCOUNT) + '转,你的转生下降了' + CONVERT(VARCHAR,@ZSJS) + '转,您被扣除'+ CONVERT(VARCHAR,@MONEY) +'MU币.\N 转生需要'+ CONVERT(VARCHAR,@TGS14 + @FHJF) +'点霹雳币,实践扣除' + CONVERT(VARCHAR,@TGS14) + '点,返还' + CONVERT(VARCHAR,@FHJF) + '点'
    COMMIT TRAN
    SET NOCOUNT OFF
    RETURN
END
---------------------------------------------------------
IF(@ZSLEVELUPPOINT IS NULL)
    BEGIN
        SET @ZSLEVELUPPOINT=0
    END
IF EXISTS(SELECT NAME FROM WEB_ZS WHERE NAME=@NAME)
    BEGIN
    IF @ZSFS = '1'
        BEGIN
            UPDATE WEB_ZS SET ZSTIME=GETDATE(),ZSCLEVEL=@USERCLEVEL,ZSCS=@ZZSCOUNT,CJZSCS=CJZSCS+1,LEVELUPPOINT=@ZSLEVELUPPOINT WHERE NAME=@NAME
            SET @ERC=@ERC & @@ROWCOUNT
        END
    IF @ZSFS = '2'
        BEGIN
            UPDATE WEB_ZS SET ZSTIME=GETDATE(),ZSCLEVEL=@USERCLEVEL,ZSCS=@ZZSCOUNT,ZJZSCS=ZJZSCS+1,LEVELUPPOINT=@ZSLEVELUPPOINT WHERE NAME=@NAME
            SET @ERC=@ERC & @@ROWCOUNT
        END
    IF @ZSFS = '3'
        BEGIN
            UPDATE WEB_ZS SET ZSTIME=GETDATE(),ZSCLEVEL=@USERCLEVEL,ZSCS=@ZZSCOUNT,GJZSCS=GJZSCS+1,LEVELUPPOINT=@ZSLEVELUPPOINT WHERE NAME=@NAME
            SET @ERC=@ERC & @@ROWCOUNT
        END
    END
ELSE
    BEGIN
        IF @ZSFS = '1'
            BEGIN
                INSERT INTO WEB_ZS(ACC,NAME,ZSTIME,ZSCLEVEL,ZSCS,CJZSCS,LEVELUPPOINT) VALUES(@ACC,@NAME,GETDATE(),@USERCLEVEL,@ZZSCOUNT,@ZZSCOUNT,@ZSLEVELUPPOINT)
                SET @ERC=@ERC & @@ROWCOUNT
            END
        IF @ZSFS = '2'
            BEGIN
                INSERT INTO WEB_ZS(ACC,NAME,ZSTIME,ZSCLEVEL,ZSCS,ZJZSCS,LEVELUPPOINT) VALUES(@ACC,@NAME,GETDATE(),@USERCLEVEL,@ZZSCOUNT,@ZZSCOUNT,@ZSLEVELUPPOINT)
                SET @ERC=@ERC & @@ROWCOUNT
            END
        IF @ZSFS = '3'
            BEGIN
                INSERT INTO WEB_ZS(ACC,NAME,ZSTIME,ZSCLEVEL,ZSCS,GJZSCS,LEVELUPPOINT) VALUES(@ACC,@NAME,GETDATE(),@USERCLEVEL,@ZZSCOUNT,@ZZSCOUNT,@ZSLEVELUPPOINT)
                SET @ERC=@ERC & @@ROWCOUNT
            END
    END
IF @ERC >= 1
    BEGIN
        SET @ZZSCOUNT = @ZZSCOUNT
        SELECT '恭喜您!您目前转生为'+ CONVERT(VARCHAR,@ZZSCOUNT) + '转了,您被扣除'+ CONVERT(VARCHAR,@MONEY) +'MU币.\N 转生需要'+ CONVERT(VARCHAR,@TGS14 + @FHJF) +'点霹雳币,实践扣除' + CONVERT(VARCHAR,@TGS14) + '点,返还' + CONVERT(VARCHAR,@FHJF) + '点'
        COMMIT TRAN
        SET NOCOUNT OFF
        RETURN
    END
ELSE
    BEGIN
        SELECT '系统不能记录你的转身信息!'
        ROLLBACK
        SET NOCOUNT OFF
        RETURN
    END
COMMIT TRAN
SET NOCOUNT OFF
GO

本文标签:

如需转载,请注明本文链接:http://www.598mu.com/jishu/201304033769.html



上一篇:生命之光OD修改地址

下一篇:实现任意地图禁止允许PK的修改方法