library GiveUnitsZ initializer Init
// Boolexprs leak, so I created this function to avoid the leak
private function True takes nothing returns boolean
return true
endfunction
private function Act2 takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbility(u,'Arav')
call UnitRemoveAbility(u,'Arav')
set u = null
endfunction
private function Give takes nothing returns nothing
local unit u = GetEnumUnit()
call UnitAddAbility(u,'Arav')
call UnitRemoveAbility(u,'Arav')
set u = null
endfunction
private function Act takes nothing returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRange(g,0.00,0.00,9999999.00, function True)
call ForGroup(g, function Give)
call DestroyGroup(g)
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterEnterRegion(t,bj_mapInitialPlayableArea,function True)
call TriggerAddAction(t, function Act2)
call TimerStart(CreateTimer(),0.00,false,function Act)
set t = null
endfunction
endlibrary