;'Grave Spectre' NPC buff timer

UserID = #PARAM1
Ticks = #PARAM3

If GetUserFlag(UserID,34) = 0
	GoTo END
EndIf

If Ticks = 0
	SetUserStrengthBonus(UserID,GetUserStrengthBonus(UserID)-5)
	SetUserEnduranceBonus(UserID,GetUserEnduranceBonus(UserID)-5)
	SetUserWisdomBonus(UserID,GetUserWisdomBonus(UserID)-5)
	SetUserAgilityBonus(UserID,GetUserAgilityBonus(UserID)-5)
	
	SetUserFlag(UserID,34,0)
	
	SendCombatMessage(UserID,"The Grave Spectre's buff has worn off. ")
Else
	If GetUserHP(UserID) < GetUserMaxHP(UserID)-1
		SetUserHP(UserID,GetUserHP(UserID)+2) 
	EndIf
	If GetUserMana(UserID) < GetUserMaxMana(UserID)
		SetUserMana(UserID,GetUserMana(UserID)+1) 
	EndIf
	
	Timer(665,1500,UserID,0,Ticks-1)
EndIf

Label END

Continue = 1