Scriptname SuH_dynaES_player extends activemagiceffect  

SuH_Fun property _Fun auto
actor property playerRef auto
GlobalVariable property SuH_SETcombatseduction auto
GlobalVariable property SuH_SETpc2npchealth auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	
EndEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	Actor attChar = akAggressor as Actor ; Set Attacker as usable actor reference
	if attChar != playerRef
	if SuH_SETcombatseduction.GetValue()
		float charHealthPercent = (playerRef.GetActorValue("health") / playerRef.GetBaseActorValue("health"))
		if charHealthPercent <= SuH_SETpc2npchealth.GetValue()
			actor[] animActor = new actor[2] ; Create Array of actors
			animActor[0] = attChar ; Set attChar As Aggressor
			animActor[1] = playerRef ; Set char As Victim
			_Fun.ANIMcalc("0", animActor, TRUE) ; Send aggressive act to SuH_Fun
		endIf
	endIf
	endIF
endEvent

Event OnDying(Actor akKiller)
	
endEvent