function GetPlayerUnitGroup takes player p,integer ucode returns group
set aglobalgroup=CreateGroup()
set bj_groupEnumTypeId=ucode
call GroupEnumUnitsOfPlayer(aglobalgroup,p,filterGetUnitsOfPlayerAndTypeId)
return aglobalgroup
endfunction
function SpawnUnits takes integer uc1,integer uc2 returns nothing //spawn normal
local integer p=0
local group g=null
local unit loopunit=null
local unit newunit=null
local player teamcomputer=null
local integer loc_integer04=0
local integer loc_integer05=0
loop
exitwhen p>5
set g=GetPlayerUnitGroup(Player(p),uc1)
if p<3 then
set teamcomputer=Player(10)
else
set teamcomputer=Player(11)
endif
loop
set loopunit=FirstOfGroup(g)
exitwhen loopunit==null
set newunit=CreateUnit(teamcomputer,uc2,GetUnitX(loopunit),GetUnitY(loopunit),0)
call UnitApplyTimedLife(newunit,'BTLF',120)
call GroupRemoveUnit(g,loopunit)
endloop
call DestroyGroup(g)
set p=p+1
endloop
set g=null
set loopunit=null
set newunit=null
set teamcomputer=null
endfunction