flyswallow 发表于 2008-8-14 13:47:13

希望对通过调整70级"经验值"来限制70级的GM有帮助...

CREATE TRIGGER ON .
FOR UPDATE
AS
Begin
        if update()
        begin
                declare @oldExp int
                declare @newExp int
                declare @strUserId char(21)

                select @strUserId = strUserId, @oldExp = from deleted
                select @newExp = from inserted

                if( @newExp < 0 )
                begin
                        declare @exp70 int
                        select @exp70 = exp from LEVEL_UP where =70
                        update userData
                        set exp = cast((@oldExp - @exp70*0.05) as int)
                        where strUserId = @strUserId
                end
        end
End


作用:当70级死后.人物经验成为负值.人物上线后.会直接血为0.不能发出任何操作..通过执行上面的代码.可以解决这个问题...希望对大家有所帮助.分享才会发展..
页: [1]
查看完整版本: 希望对通过调整70级"经验值"来限制70级的GM有帮助...