Scriptname nDragonSolarSphereTargetScript extends activemagiceffect  

Activator Property fxemptyactivator Auto  
SPELL Property xAoE Auto  
SPELL Property ThisSpell Auto 

objectreference obj
actor me
actor he
float fX
float fY
float fZ
float fP

Event OnEffectStart(Actor akTarget, Actor akCaster)
	me = akCaster
	he = akTarget
	obj = he.placeatme(fxemptyactivator)
	RegisterForUpdate(2.0)
Endevent

Event onUpdate()
If !(me.IsDead())
	fX = he.GetPositionX()
	fY = he.GetPositionY()
	fZ = he.GetPositionZ()
	obj.setposition(fX, fY, fZ)
	xAoE.remotecast(obj, me)
Else
	he.dispelspell(ThisSpell)
Endif
Endevent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
obj.disable(true)
utility.wait(0.5)
obj.delete()
Endevent