ScriptName DfSV_NPCsvictimScript extends ActiveMagicEffect

GlobalVariable Property DfSV_PCSheartXP auto
GlobalVariable Property DfSV_PCSheartForce auto
GlobalVariable Property DfSV_PCSheartForceMax auto
GlobalVariable Property DfSV_PCShpabsorb auto
GlobalVariable Property DfSV_PCSmpabsorb auto
GlobalVariable Property DfSV_PCSspabsorb auto
GlobalVariable Property DfSV_PCSabsorbmulti auto

actor eActor

Event OnEffectStart(Actor akTarget, Actor akCaster)
	eActor = akTarget
	
	RegisterForSingleUpdate(5.0)
endEvent

Event OnUpdate()
	float playerhpa = DfSV_PCShpabsorb.GetValue()
	float playermpa = DfSV_PCSmpabsorb.GetValue()
	float playerspa = DfSV_PCSspabsorb.GetValue()
	float absorbMulti = DfSV_PCSabsorbmulti.GetValue()
	float eActorH = eActor.GetBaseActorValue("health")
	float eActorS = eActor.GetBaseActorValue("stamina")
	float eActorM = eActor.GetBaseActorValue("magicka")
	eActorH -= (playerhpa * absorbMulti)
	eActorM -= (playermpa * absorbMulti)
	eActorS -= (playerspa * absorbMulti)
	eActor.SetActorValue("health", eActorH)
	eActor.SetActorValue("stamina", eActorS)
	eActor.SetActorValue("magicka", eActorM)
	RegisterForSingleUpdate(5.0)
endEvent