;'BS - Blood Drench' - Timed skill script

TargetID = #PARAM1
Duration = #PARAM2

Blood = GetUserMana(TargetID) 
MaxBlood = GetUserMaxMana(TargetID)
If Blood < MaxBlood
	Blood = Blood + 1
	SetUserMana(TargetID, Blood)
	;SendCombatMessage(TargetID,"Your blood flows fiercly! ")
EndIf

;Keeps the skill from stacking
If GetUserFlag(TargetID,37) > 1
	If GetUserName(TargetID)="Comrade"
		;SendMessageTouser(TargetID,"Buff overwrite",#MSG_EMOTE)
	EndIf
	;SendMessageToUser(TargetID, "Sorry, a bug was encountered, will fix in a few - Comrade",#MSG_CRITICAL))
	SetUserFlag(TargetID,37, GetUserFlag(TargetID, 37) - 1) 
	GoTo END
ElseIf GetUserFlag(TargetID,37) = 0
	If GetUserName(TargetID)="Comrade"
		;SendMessageTouser(TargetID,"Buff killed",#MSG_EMOTE)
	EndIf
	GoTo END
EndIf

If Duration > 0
	Timer(578, 3000, TargetID, Duration-1, 0)
Else
	SetUserFlag(TargetID, 37, 0)
	SendMessageToUser(TargetID, "Your blood returns to it's normal flow...",#MSG_CRITICAL))
EndIf

If GetUserName(TargetID)="Comrade"
	;SendMessageTouser(TargetID,Duration,#MSG_EMOTE)
EndIf

Label END

Continue = 1