Scriptname SuH_spellES_intimatetouch_base extends activemagiceffect  

GlobalVariable Property SuH_PCSstacksex auto

actor property PlayerRef auto

Event OnEffectStart(actor akTarget, actor akCaster)
	if akCaster == PlayerRef
		int sex = SuH_PCSstacksex.GetValue() as int
		if sex != 0
			if sex > 15
				sex -= 15
				SuH_PCSstacksex.SetValue(sex)
				sex = 15
			else
				SuH_PCSstacksex.SetValue(0)
			endIf
			float x = sex*0.05
			float h = akTarget.GetActorValue("health")
			float m = akTarget.GetActorValue("magicka")
			float s = akTarget.GetActorValue("stamina")
			int xh = Math.Floor(h*x)
			int xm = Math.Floor(m*x)
			int xs = Math.Floor(s*x)
			akTarget.DamageActorValue("health", xh)
			akTarget.DamageActorValue("magicka", xm)
			akTarget.DamageActorValue("stamina", xs)
		else
			debug.Notification("Intimate Touch Failed : Not enough Sex Stacks")
		endIf
	endIf
endEvent