function SpellMove takes nothing returns nothing
local trigger trg = GetTriggeringTrigger()
local unit u = GetHandleUnit(trg,"u")
local unit t = GetHandleUnit(trg,"t")
local unit e = GetHandleUnit(trg,"e")
local unit f = null
local location l = GetUnitLoc(e)
local location m = GetUnitLoc(t)
local location n = PolarProjectionBJ(l,---(Missile Speed * 0.02)---,AngleBetweenPoints(l,m))
local group k = GetUnitsInRangeOfLocAll(---(Missile Speed * 0.02)---, l)
call SetUnitPositionLocFacingBJ(e,n,AngleBetweenPoints(l,m))
if IsUnitInGroup(t, k) then
----(Insert Spell Effect here)-----
call RemoveLocation(l)
call RemoveLocation(m)
call RemoveLocation(n)
call GroupClear(k)
call DestroyGroup(k)
call DisableTrigger(trg)
call FlushHandleLocals(trg)
call DestroyTrigger(trg)
set u = null
set t = null
set e = null
set k = null
set l = null
set m = null
set n = null
set f = null
set trg = null
endif
call RemoveLocation(l)
call RemoveLocation(m)
call RemoveLocation(n)
call GroupClear(k)
call DestroyGroup(k)
set u = null
set t = null
set l = null
set m = null
set n = null
set k = null
set e = null
set f = null
set trg = null
endfunction
function Trig_SpellName_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit t = GetSpellTargetUnit()
local location l = GetUnitLoc(u)
local unit e = CreateUnit(GetOwningPlayer(u),---(Dummy Caster)---,GetLocationX(l),GetLocationY(l),0.00)
local trigger trg = CreateTrigger()
call SetHandleHandle(trg,"u",u)
call SetHandleHandle(trg,"t",t)
call SetHandleHandle(trg,"e",e)
call TriggerRegisterTimerEventPeriodic(trg,0.02)
call TriggerAddAction(trg,function SpellMove)
call RemoveLocation(l)
set u = null
set t = null
set l = null
set e = null
set trg = null
endfunction