function DoneWhatMakesThemWork takes nothing returns nothing //Do Damage
local unit u1 = GetEnumUnit()
call KillUnit(ToPass) //During the next timer cycle this missile will be destroyed, we can't destroy it here because we don't have the struct number, and its not attached to the unit
call UnitDamageTarget(ToPass,u1,DAMAGE_PER_MISSILE,false,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_COLD,WEAPON_TYPE_WHOKNOWS)//This isn't AOE damage, but the missile will still effect every unit in its col. radius.
endfunction
function MakeDoCollisions takes nothing returns nothing
local unit u = GetEnumUnit() //Slightly faster then calling the function 3 times
local group g = CreateGroup()
set ToPass = u //Yes I'm using a global to pass around my local...
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),PRJEXTSIZE,Filter(function TriG))
call ForGroup(g,function DoneWhatMakesThemWork)
call DestroyGroup(g)
set u = null //Clean up Clean up Clean up Clean up!
endfunction
function Trig_PeriodicRun_Actions takes nothing returns nothing
//This part allows the trigger to self disable if no spells are running
set bj_groupCountUnits = 0
call ForGroup(AllEffected,function CountUnitsInGroupEnum)
if bj_groupCountUnits == 0 then
call DisableTrigger(gg_trg_PeriodicRun)
endif
// set bj_groupCountUnits = 0
// call ForGroup(PAllrojex,function CountUnitsInGroupEnum)
// call BJDebugMsg("Col = " + I2S(bj_groupCountUnits))
call ForGroup(PAllrojex, function MakeDoCollisions) //Make collisions work! I'm not sure if this is an efficient method, but I like it
call ForGroup(AllEffected , function MakeSpellDoStuff) //Now all this crazy stuff
endfunction