Scriptname SuH_spellES_spiritmend_base extends activemagiceffect  

actor property PlayerRef auto

Event OnEffectStart(actor akTarget, actor akCaster)
	int mm = akCaster.GetBaseActorValue("magicka") as int
	if mm >= 16
		mm -= 15
		int mh = akCaster.GetBaseActorValue("health") as int
		int ch = akCaster.GetActorValue("health") as int
		int x = Math.Floor((mh-ch)*0.5)
		akCaster.RestoreActorValue("health", x)
		akCaster.SetActorValue("magicka", mm)
	elseif akCaster == PlayerRef
		debug.Notification("Spirit Mend Failed : Not enough Magicka")
	endIf
endEvent