Scriptname SuH_sexES_NPCattacker extends activemagiceffect  

SuH_Fun property _f auto
SuH_Status property _s auto

Actor char
int devious

Event OnInit()
	_f = Game.GetFormFromFile(0x814, "Succubus Heart.esp") as SuH_Fun
	_s = Game.GetFormFromFile(0x16E496, "Succubus Heart.esp") as SuH_Status
endEvent

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if akTarget == _s.PlayerRef
		debug.trace("SuH ERROR : NPCattacker set on PC - NULL Effect", 2) ;Error report to log
	else
		char = akTarget
		RegisterForSingleUpdate(5.0)
	endIf
	devious = _s.SuH_rank_deviouspartner
endEvent

Event OnUpdate()
	_f.STATcalc(char, aPreset="PCsubmit", stat="All")
	if devious > 0
		char.RemoveItem(_s.Gold001, devious, true, _s.PlayerRef)
	endIf
	RegisterForSingleUpdate(5.0)
endEvent