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

MagicEffect property SuH_sp_healthydelightseffect auto
MagicEffect property SuH_sp_shiningdelightseffect auto
MagicEffect property SuH_sp_sugarydelightseffect auto
;end/

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if akTarget == Game.GetPlayer()
		;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 = Game.GetPlayer().GetBaseActorValue("health")
		float playerStamina = Game.GetPlayer().GetBaseActorValue("stamina")
		float playerMagicka = Game.GetPlayer().GetBaseActorValue("magicka")
		float heartXPgain = SuH_PCSheartXPgain.GetValue()
		int charLevel = Game.GetPlayer().GetLevel()
		float statCap = 101+(10*charLevel)
		;end/
		;ent/ Absorb Effect
		playerHeartXP += Math.Floor(2*heartXPgain*0.01)
		if(playerHealth < statCap)
			playerHealth += Math.Floor((playerhpa*1)*1.5)
		else
			playerHealth += Math.Floor(playerhpa*1)
		endIf
		if(playerStamina < statCap)
			playerStamina += Math.Floor((playerspa*1)*1.5)
		else
			playerStamina += Math.Floor(playerspa*1)
		endIf
		if(playerMagicka < statCap)
			playerMagicka += Math.Floor((playermpa*1)*1.5)
		else
			playerMagicka += Math.Floor(playermpa*1)
		endIf
		SuH_PCSheartXP.SetValue(playerHeartXP)
		Game.GetPlayer().SetActorValue("health", playerHealth)
		Game.GetPlayer().SetActorValue("stamina", playerStamina)
		Game.GetPlayer().SetActorValue("magicka", playerMagicka)
		;end/
		;ent/ Passive Effects
		if Game.GetPlayer().HasMagicEffect(SuH_sp_healthydelightseffect)
			float chealth = Game.GetPlayer().GetActorValue("health")
			float heal = Math.Floor((playerHealth - chealth)*0.25)
			Game.Getplayer().RestoreActorValue("health",heal)
		endIf
		if Game.GetPlayer().HasMagicEffect(SuH_sp_shiningdelightseffect)
			float cmagicka = Game.GetPlayer().GetActorValue("magicka")
			float heal = Math.Floor((playerHealth - cmagicka)*0.25)
			Game.Getplayer().RestoreActorValue("magicka",heal)
		endIf
		if Game.GetPlayer().HasMagicEffect(SuH_sp_sugarydelightseffect)
			float cstamina = Game.GetPlayer().GetActorValue("stamina")
			float heal = Math.Floor((playerHealth - cstamina)*0.25)
			Game.Getplayer().RestoreActorValue("stamina",heal)
		endIf
		;end/
		
	endIf
endEvent