红月私服不同角色每天开放不同技能点设置

CREATE PROCEDURE RMS_INCREASEBONUSQUESTCOUNT
@GameID varchar(14)
AS

set nocount on

declare @IncreaseBonusError int, @InsertLogError int, @STotalBonus int,@face int,@days int,@add int
set @IncreaseBonusError = 1
set @InsertLogError = 1
set @STotalBonus = 0

begin transaction
set @days=DATEDIFF(day, '2009-07-07 15:41:02', getdate())
select @STotalBonus=STotalBonus,@face=face from tblGameID1 where GameID = @GameID
if @face=0 set @add=90
if @face=1 set @add=85
if @face=2 set @add=95
if @face=3 set @add=95
if @face=4 set @add=90
if @face=5 set @add=100
if @face=6 set @add=95
if @face=7 set @add=75
if @face=8 set @add=70

if @STotalBonus<2210+@add*@days
begin
update tblGameID1 set SBonus = SBonus + 1, STotalBonus = STotalBonus + 1 where GameID = @GameID
set @IncreaseBonusError = @@ERROR
end

select @STotalBonus = STotalBonus from tblGameID1 where GameID = @GameID

insert tblBonus2Log1 (GameID, STotalBonus, Kind) values (@GameID, @STotalBonus, 1)
set @InsertLogError = @@ERROR

if @IncreaseBonusError = 0 AND @InsertLogError = 0
begin
commit transaction
end
else
begin
rollback transaction
end
GO


开机和加点时间 set @days=DATEDIFF(day, '2009-07-07 15:41:02', getdate())
开区满点     if @STotalBonus<2210+@add*@days