function Trig_Create_Base_Actions takes nothing returns nothing
local integer i = 0
local player p
local race r
loop
set p = Player(i)
if GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
set r = GetPlayerRace(p)
if r == RACE_HUMAN then
call CreateUnit(p, 'htow', GetStartLocationX(i), GetStartLocationY(i), 0)
elseif r == RACE_ORC then
call CreateUnit(p, 'ogre', GetStartLocationX(i), GetStartLocationY(i), 0)
elseif r == RACE_UNDEAD then
call CreateUnit(p, 'unpl', GetStartLocationX(i), GetStartLocationY(i), 0)
elseif r == RACE_NIGHTELF then
call CreateUnit(p, 'etol', GetStartLocationX(i), GetStartLocationY(i), 0)
endif
endif
set i = i + 1
exitwhen i > 11
endloop
endfunction
function InitTrig_CreateBase takes nothing returns nothing
set gg_trg_CreateBase = CreateTrigger( )
call TriggerAddAction( gg_trg_CreateBase, function Trig_Create_Base_Actions )
endfunction