;'Restore All' skill script

Effect = 1
BloodCost = 10
HealFraction = 1
MinimumHeal = 50

UserBlood = GetUserMana(#USERID)
UserHP = GetUserHP(#USERID)
UserMaxHP = GetUserMaxHP(#USERID)

HealthGain = Floor(UserMaxHP/HealPercentage)

If UserBlood < BloodCost
	SendCombatMessage(#USERID,"Not enough blood ")
	GoTo END
EndIf

If UserHP > UserMaxHP-1
	SendCombatMessage(#USERID,"You have full health already! ")
	GoTo END
EndIf

UserBlood = UserBlood - BloodCost
SetUserMana(#USERID,BloodCost)

UserHP = UserHP + HealthGain
If UserHP > UserMaxHP
	UserHP = UserMaxHP
EndIf

SetUserHP(#USERID,UserHP)

CreateEffect(Effect,500,0,#DIR_RIGHT,#MAPID,#XPOS,#YPOS,0,#USERID,0)

Label END

Continue = 1