ScriptName SuH_SuccubusDelight extends ActiveMagicEffect

;ent/ Globals
GlobalVariable Property SuH_PCSheartXP auto
GlobalVariable Property SuH_PCSheartXPgain auto
GlobalVariable Property SuH_PCSspermhvalue auto
GlobalVariable Property SuH_PCSspermmvalue auto
GlobalVariable Property SuH_PCSspermsvalue auto
GlobalVariable Property SuH_PCSseductionpoints auto

MagicEffect property SuH_sp_healthydelightseffect auto
MagicEffect property SuH_sp_shiningdelightseffect auto
MagicEffect property SuH_sp_sugarydelightseffect auto
MagicEffect property SuH_sp_healthydelights2effect auto
MagicEffect property SuH_sp_shiningdelights2effect auto
MagicEffect property SuH_sp_sugarydelights2effect auto
MagicEffect property SuH_sp_seductivedelightseffect auto
MagicEffect property SuH_NPCsuccubuseffect auto

Actor Property playerRef Auto
;end/

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if akTarget == playerRef
		;ent/ Variables
		float playerhpa = SuH_PCSspermhvalue.GetValue()
		float playermpa = SuH_PCSspermmvalue.GetValue()
		float playerspa = SuH_PCSspermsvalue.GetValue()
		float playerHeartXP = SuH_PCSheartXP.GetValue()
		float playerHeartXPgain = SuH_PCSheartXPgain.GetValue()
		float playerHealth = playerRef.GetBaseActorValue("health")
		float playerStamina = playerRef.GetBaseActorValue("stamina")
		float playerMagicka = playerRef.GetBaseActorValue("magicka")
		float heartXPgain = SuH_PCSheartXPgain.GetValue()
		int charLevel = playerRef.GetLevel()
		float statCap = 101+(10*charLevel)
		;end/
		;ent/ Absorb Effect
		int hxpUP = Math.Floor(10*heartXPgain*0.01)
		playerHeartXP += hxpUP
		playerHealth += Math.Floor(playerhpa*1)
		playerStamina += Math.Floor(playerspa*1)
		playerMagicka += Math.Floor(playermpa*1)
		debug.Notification("+"+hxpUP+" HeartXP")
		SuH_PCSheartXP.SetValue(playerHeartXP)
		playerRef.SetActorValue("health", playerHealth)
		playerRef.SetActorValue("stamina", playerStamina)
		playerRef.SetActorValue("magicka", playerMagicka)
		;end/
		;ent/ Passive Effects
		if playerRef.HasMagicEffect(SuH_sp_healthydelights2effect)
			float chealth = playerRef.GetActorValue("health")
			float heal = Math.Floor((playerHealth - chealth)*0.3)
			playerRef.RestoreActorValue("health",heal)
		elseIf playerRef.HasMagicEffect(SuH_sp_healthydelightseffect)
			float chealth = playerRef.GetActorValue("health")
			float heal = Math.Floor((playerHealth - chealth)*0.25)
			playerRef.RestoreActorValue("health",heal)
		endIf
		if playerRef.HasMagicEffect(SuH_sp_shiningdelights2effect)
			float cmagicka = playerRef.GetActorValue("magicka")
			float heal = Math.Floor((playerMagicka - cmagicka)*0.3)
			playerRef.RestoreActorValue("magicka",heal)
		elseIf playerRef.HasMagicEffect(SuH_sp_shiningdelightseffect)
			float cmagicka = playerRef.GetActorValue("magicka")
			float heal = Math.Floor((playerMagicka - cmagicka)*0.25)
			playerRef.RestoreActorValue("magicka",heal)
		endIf
		if playerRef.HasMagicEffect(SuH_sp_sugarydelights2effect)
			float cstamina = playerRef.GetActorValue("stamina")
			float heal = Math.Floor((playerStamina - cstamina)*0.3)
			playerRef.RestoreActorValue("stamina",heal)
		elseIf playerRef.HasMagicEffect(SuH_sp_sugarydelightseffect)
			float cstamina = playerRef.GetActorValue("stamina")
			float heal = Math.Floor((playerStamina - cstamina)*0.25)
			playerRef.RestoreActorValue("stamina",heal)
		endIf
		if playerRef.HasMagicEffect(SuH_sp_seductivedelightseffect)
			int Spoints = Math.Floor(SuH_PCSseductionpoints.GetValue())
			Spoints += 5
			SuH_PCSseductionpoints.SetValue(Spoints)
		endIf
		;end/
	elseIf akTarget.HasMagicEffect(SuH_NPCsuccubuseffect)
		float cH = akTarget.GetBaseActorValue("health")
		float cS = akTarget.GetBaseActorValue("stamina")
		float cM = akTarget.GetBaseActorValue("magicka")
		int cL = akTarget.GetLevel()
		int cA = Math.Floor(1+(cL*0.1))
		;end/
		cH += Math.Floor(cA)
		cM += Math.Floor(cA)
		cS += Math.Floor(cA)
		akTarget.SetActorValue("health", cH)
		akTarget.SetActorValue("stamina", cS)
		akTarget.SetActorValue("magicka", cM)
	endIf
endEvent