22 lines
566 B
Transact-SQL
22 lines
566 B
Transact-SQL
CREATE PROCEDURE [dbo].[up_update_character_fatigue]
|
|
@character_id [uniqueidentifier]
|
|
,@fatigue int
|
|
,@cash tinyint
|
|
as begin
|
|
set nocount on
|
|
declare @curfatigue int;
|
|
set @curfatigue = 0
|
|
|
|
if( @cash = 0 )
|
|
begin
|
|
SELECT TOP 1 @curfatigue = [Fatigue] FROM CharacterTable WITH(NOLOCK) WHERE character_id = @character_id
|
|
if( @curfatigue > @fatigue + 100 )
|
|
begin
|
|
set @fatigue = @curfatigue
|
|
end
|
|
end
|
|
|
|
update CharacterTable
|
|
set Fatigue = @fatigue
|
|
where character_id = @character_id
|
|
end
|