ScriptName SuH_NPCsconsentScript extends ActiveMagicEffect

GlobalVariable Property SuH_PCShpabsorb auto
GlobalVariable Property SuH_PCSmpabsorb auto
GlobalVariable Property SuH_PCSspabsorb auto

MagicEffect property SuH_sp_speciallovereffect auto
MagicEffect property SuH_sp_caringlovereffect auto
MagicEffect property SuH_sp_magicallovereffect auto
MagicEffect property SuH_sp_lastinglovereffect auto

Spell property SuH_NPCsvictim auto

actor eActor

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

Event OnUpdate()
	
	if Game.GetPlayer().HasMagicEffect(SuH_sp_speciallovereffect)
		float fhealth = eActor.GetBaseActorValue("health")
		float chealth = eActor.GetActorValue("health")
		float hheal = math.Floor((fhealth - chealth)*0.1)
		eActor.RestoreActorValue("health",hheal)
		float fmagicka = eActor.GetBaseActorValue("magicka")
		float cmagicka = eActor.GetActorValue("magicka")
		float mheal = math.Floor((fmagicka - cmagicka)*0.1)
		eActor.RestoreActorValue("magicka",mheal)
		float fstamina = eActor.GetBaseActorValue("stamina")
		float cstamina = eActor.GetActorValue("stamina")
		float sheal = math.Floor((fstamina - cstamina)*0.1)
		eActor.RestoreActorValue("stamina",sheal)
	endIf
	if Game.GetPlayer().HasMagicEffect(SuH_sp_caringlovereffect)
		float fhealth = eActor.GetBaseActorValue("health")
		fhealth += 1
		eActor.SetActorValue("health",fhealth)
	endIf
	if Game.GetPlayer().HasMagicEffect(SuH_sp_magicallovereffect)
		float fmagicka = eActor.GetBaseActorValue("magicka")
		fmagicka += 1
		eActor.SetActorValue("magicka",fmagicka)
	endIf
	if Game.GetPlayer().HasMagicEffect(SuH_sp_lastinglovereffect)
		float fstamina = eActor.GetBaseActorValue("stamina")
		fstamina += 1
		eActor.SetActorValue("stamina",fstamina)
	endIf
	
	
	RegisterForSingleUpdate(5.0)
endEvent