Scriptname nDragonTempestStaticScript extends activemagiceffect  
import utility

Explosion Property xBeam Auto  
SPELL Property ThisSpell Auto 
float Property fDelay Auto  

actor me
actor he

Event OnEffectStart(Actor akTarget, Actor akCaster)
	me = akCaster
	he = akTarget
	he.placeatme(xBeam)
	RegisterForSingleUpdate(3.0 + RandomFloat(-fDelay, fDelay))
Endevent

Event onUpdate()
If me.IsDead()
	he.dispelspell(ThisSpell)
Else
	he.placeatme(xBeam)
	RegisterForSingleUpdate(2.0 + RandomFloat(-fDelay, fDelay))
Endif
Endevent

Event OnEffectFinish(Actor akTarget, Actor akCaster)

Endevent