function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A006' // Well it is your ability raw ID here (you can find it with Ctrl+D in the object editor)
endfunction
function FilterFunc takes nothing returns boolean
local unit filter = GetFilterUnit()
return (GetUnitTypeId(filter) != 'e000' ) and (GetUnitState(filter, UNIT_STATE_LIFE) > 0)
endfunction
function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit tempu
local group tempg = CreateGroup()
local group g = CreateGroup()
local real LINE_ACCURACY = 20 //kinda a constant to improve readability
local integer imax = DistanceBetweenPoints(GetUnitLoc(caster),GetSpellTargetPoint())/LINE_ACCURACY
local integer i = 0
local filterfunc MyFilter = Filter(function FilterFunc)
loop
set i = i + 1
exitwhen i > imax
call GroupEnumUnitsInRangeOfLoc(tempg,PolarProjectionBJ(GetUnitLoc(caster),i*20+150,GetUnitFacing(caster))
,150,MyFilter)
call GroupAddGroup(tempg,g)
endloop
loop
set tempu = FirstOfGroup(g)
exitwhen tempu == null
call UnitDamageTargetBJ(caster,tempu,999, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL) // huge damage bro
call GroupRemoveUnit(g,tempu)
set tempu = null
endloop
call DestroyGroup(tempg)
call DestroyGroup(g)
call DestroyFilter(MyFilter)
set caster = null
endfunction
private function InitTrig_MYTRIGGER takes nothing returns nothing
set gg_trg_MYTRIGGER = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_MYTRIGGER, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MYTRIGGER, Condition( function Conditions) )
call TriggerAddAction( gg_trg_MYTRIGGER, function Actions )
endfunction