scope NAME initializer init
globals
private group targets
private boolexpr targetActions
endglobals
private function FilterFunc takes nothing returns boolean
local unit u = GetFilterUnit()
local boolean ok = GetWidgetLife(u) > .405 and IsUnitEnemy(u,GetOwningPlayer(GetTriggerUnit()))
if ok then
//do stuff to the targets
endif
return false
endfunction
private function Actions takes nothing returns nothing
//set up local variables like x,y,radius and stuff
call GroupEnumUnitsInRange(targets,x,y,radius,targetActions)
//More Stuff
endfunction
private function init takes nothing returns nothing
local trigger Trig = CreateTrigger()
//set up events/conditions
call TriggerAddAction(Trig, function Actions)
set targetActions = Filter(function FilterFunc)
set targets = CreateGroup()
endfunction
endscope