;'Regenerate' - Skill script

Loops = 20

HealthPerTick = Ceiling(GetUserWisdom(#USERID)/2.5)
If HealthPerTick < 3
	HealthPerTick = 3
EndIf

If GetUserMana(#USERID) < GetUserMaxMana(#USERID)
	SendMessageToUser(#USERID,"To regenerate your flesh requires the usage of a full amount of blood.",#MSG_CRITICAL)
	GoTo END
EndIf

SetUserMana(#USERID,GetUserMana(#USERID)-GetUserMaxMana(#USERID))
SendMessageToUser(#USERID,"Your flesh begins to nit itself back together.",#MSG_EMOTE)

i = 0
While i < Loops
	i=i+1
	Timer(229, 3000*i, #USERID, HealthPerTick,"0")
Wend

Timer(229, 3000*Loops, #USERID, 0, "Your flesh ceases to regenerate!")


Label END

Continue = 1