Scriptname SuH_ss_consumemagickaScript extends activemagiceffect  

actor property playerRef auto

Event OnEffectStart(actor cT, actor cC)
	int cHB = cC.GetBaseActorValue("magicka") as int
	int tHB = cC.GetBaseActorValue("magicka") as int
	int tH = cT.GetActorValue("magicka") as int
	
	if cHB > 5
		int tHeal = Math.Floor((tHB - tHB) *0.5)
		
		cHB -= 5
		cC.SetActorValue("magicka",cHB)
		cT.RestoreActorValue("magicka",tHeal)
	elseIf cC == playerRef
		debug.Notification("Consume Magicka : Not Enough Magicka!")
	endIf
endEvent