Scriptname aaaTKCPullScript extends activemagiceffect  

Activator Property FXEmptyActivator Auto
ObjectReference StartBox


Event OnEffectStart (Actor akTarget, Actor akCaster)
	StartBox = akCaster.placeAtMe(FXEmptyActivator)

	float Angle= akCaster.GetAngleZ()
	float LocX = 100 * math.sin(Angle)
	float LocY = 100 * math.cos(Angle)

	StartBox.moveto(akCaster,LocX,LocY, 0)	

	if StartBox.GetDistance(akTarget) <=250
		akTarget.TranslateToRef(StartBox,500)
	else
		akTarget.TranslateToRef(StartBox,900)
	endif
	StartBox.Delete()
	self.dispel()
EndEvent