Scriptname SuH_ss_consumehealthScript extends activemagiceffect  

actor property playerRef auto

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