Function MeleeStartingUnits

Line
8965
Location
blizzard.j
Constant?
no
Type
function
Arguments
nothing
Returns
nothing
8965
function MeleeStartingUnits takes nothing returns nothing
8966
    local integer  index
8967
    local player   indexPlayer
8968
    local location indexStartLoc
8969
    local race     indexRace
8970
8971
    call Preloader( "scripts\\SharedMelee.pld" )
8972
8973
    set index = 0
8974
    loop
8975
        set indexPlayer = Player(index)
8976
        if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then
8977
            set indexStartLoc = GetStartLocationLoc(GetPlayerStartLocation(indexPlayer))
8978
            set indexRace = GetPlayerRace(indexPlayer)
8979
8980
            // Create initial race-specific starting units
8981
            if (indexRace == RACE_HUMAN) then
8982
                call MeleeStartingUnitsHuman(indexPlayer, indexStartLoc, true, true, true)
8983
            elseif (indexRace == RACE_ORC) then
8984
                call MeleeStartingUnitsOrc(indexPlayer, indexStartLoc, true, true, true)
8985
            elseif (indexRace == RACE_UNDEAD) then
8986
                call MeleeStartingUnitsUndead(indexPlayer, indexStartLoc, true, true, true)
8987
            elseif (indexRace == RACE_NIGHTELF) then
8988
                call MeleeStartingUnitsNightElf(indexPlayer, indexStartLoc, true, true, true)
8989
            else
8990
                call MeleeStartingUnitsUnknownRace(indexPlayer, indexStartLoc, true, true, true)
8991
            endif
8992
        endif
8993
8994
        set index = index + 1
8995
        exitwhen index == bj_MAX_PLAYERS
8996
    endloop
8997
    
8998
endfunction