The spell however can work like this: As the above but only play magic effect animations/particles when active is 0.
Can anyone help me out with this?
Here's the current script:
ScriptName AkaviriEffect extends ActiveMagicEffectFunction StartChain()RegisterForUpdate(1)endFunctionSpell property spellToCast autoint property active autoEvent OnEffectStart(Actor akTarget, Actor akCaster)If akTarget.IsDead()akCaster.InterruptCast()debug.Notification("Invalid target.")ReturnENDIFIf active == 0debug.Notification("Ghostblade started.")spellToCast.Cast(akCaster, None)active = 5ENDIFIf active < 5akCaster.InterruptCast()debug.Notification("Renewed. " + active + " seconds remain.")active = active + 1ENDIFEndEVENTEvent OnEffectFinish(Actor akTarget, Actor akCaster)debug.Notification("Ghostblade ended.")active = 0EndEVENTEvent OnUpdate()If active > 0active = active - 1RegisterForUpdate(1)debug.Notification(active + "seconds remain.")ENDIFIf active == 0RegisterForUpdate(1)ENDIFEndEVENT