Scriptname KAHevnoraakHysteriaSCRIPT extends activemagiceffect  

SPELL Property Hysteria  Auto  

GlobalVariable Property KA_HevnorakHysteriaTimer  Auto  

GlobalVariable Property GameDaysPassed  Auto  

Float Property PercentHealth = 100.0 Auto  

; ready to heal you
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked )
; ;	debug.trace(self + " Enter Bleedout");	
	If KA_HevnorakHysteriaTimer.GetValue() < GameDaysPassed.GetValue()
		; cast heal spell
		PercentHealth = GetTargetActor().GetAVPercentage("Health")
		If PercentHealth < 0.20
			Hysteria.Cast(GetTargetActor())
			KA_HevnorakHysteriaTimer.SetValue(GameDaysPassed.GetValue() + 1.0)
; ;			debug.trace(self + " Hysteria "+ KA_HevnorakHysteriaTimer.GetValue() + " " + GameDaysPassed.GetValue())
		EndIf
	Else
; ;		debug.trace(self + " Timer not reset " + KA_HevnorakHysteriaTimer.GetValue() + " " + GameDaysPassed.GetValue())
	EndIf
endEvent