;'Restore' skill scripts

SkillLevel = 0
SkillFlag = GetUserSkill(#USERID, 40)
If SkillFlag > 3
	SkillFlag = SkillFlag - 4
	SkillLevel = SkillLevel + 1
EndIf
If SkillFlag > 1
	SkillFlag = SkillFlag - 2
	SkillLevel = SkillLevel + 1
EndIf
If SkillFlag > 0
	SkillFlag = SkillFlag - 1
	SkillLevel = SkillLevel + 1
EndIf

HealthPerWisdom = 0
BaseHealth = 0
BloodCost = 0

If SkillLevel = 3
	HealthPerWisdom = 2.5
	BaseHealth = 10
	BloodCost = 15
ElseIf SkillLevel = 2
	HealthPerWisdom = 1.5
	BaseHealth = 5
	BloodCost = 12
ElseIf SkillLevel = 1
	HealthPerWisdom = 1
	BaseHealth = 2
	BloodCost = 10
Else
	GoTo END
EndIf

CurrentHealth = GetUserHP(#USERID)
CurrentBlood = GetUserMana(#USERID)

If CurrentHealth > GetUserMaxHP(#USERID)-1
	SendCombatMessage(#USERID,"You are at full health already. ")
	GoTo END
EndIf
If CurrentBlood < BloodCost
	SendCombatMessage(#USERID,"You need more blood to use Restore. ")
	GoTo END
EndIf

CurrentHealth = CurrentHealth + BaseHealth + Floor(HealthPerWisdom * GetUserTotalWisdom(#USERID))
If CurrentHealth > GetUserMaxHP(#USERID)
	CurrentHealth = GetUserMaxHP(#USERID)
EndIf

CurrentBlood = CurrentBlood - BloodCost

SetUserHP(#USERID, CurrentHealth)
SetUserMana(#USERID, CurrentBlood)

SendCombatMessage(#USERID,"Your flesh knits back together. ")

Label END

Continue = 1