//===========================================================================
// Trigger: orc
//===========================================================================
function orc takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
local boolean useRandomHero = IsMapFlagSet(MAP_RANDOM_HERO)
local real unitSpacing = 64.00
local unit nearestMine
local location nearMineLoc
local location heroLoc
local real peonX
local real peonY
local unit townHall = null
set nearestMine = MeleeFindNearestMine(startLoc, bj_MELEE_MINE_SEARCH_RADIUS)
if (nearestMine != null) then
// Spawn Town Hall at the start location.
set townHall = CreateUnitAtLoc(whichPlayer, 'MAIN_HALL', startLoc, bj_UNIT_FACING)
// Spawn Peasants near the mine.
set nearMineLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 320, 0)
set peonX = GetLocationX(nearMineLoc)
set peonY = GetLocationY(nearMineLoc)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 0.00 * unitSpacing, peonY + 1.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 1.00 * unitSpacing, peonY + 0.15 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX - 1.00 * unitSpacing, peonY + 0.15 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 0.60 * unitSpacing, peonY - 1.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX - 0.60 * unitSpacing, peonY - 1.00 * unitSpacing, bj_UNIT_FACING)
// Set random hero spawn point to be off to the side of the start location.
set heroLoc = MeleeGetProjectedLoc(GetUnitLoc(nearestMine), startLoc, 384, 45)
else
// Spawn Town Hall at the start location.
set townHall = CreateUnitAtLoc(whichPlayer, 'htow', startLoc, bj_UNIT_FACING)
// Spawn Peasants directly south of the town hall.
set peonX = GetLocationX(startLoc)
set peonY = GetLocationY(startLoc) - 224.00
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX + 0.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX - 1.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
call CreateUnit(whichPlayer, 'PEON_UNIT', peonX - 2.00 * unitSpacing, peonY + 0.00 * unitSpacing, bj_UNIT_FACING)
// Set random hero spawn point to be just south of the start location.
set heroLoc = Location(peonX, peonY - 2.00 * unitSpacing)
endif
// This gives the starting town hall the ability to use call to arms.
//if (townHall != null) then
// call UnitAddAbilityBJ('Amic', townHall)
// call UnitMakeAbilityPermanentBJ(true, 'Amic', townHall)
//endif
if (doHeroes) then
// If the "Random Hero" option is set, start the player with a random hero.
// Otherwise, give them a "free hero" token.
if useRandomHero then
call MeleeRandomHeroLoc(whichPlayer, 'Hamg', 'Hmkg', 'Hpal', 'Hblm', heroLoc)
else
call SetPlayerState(whichPlayer, PLAYER_STATE_RESOURCE_HERO_TOKENS, bj_MELEE_STARTING_HERO_TOKENS)
endif
endif
if (doCamera) then
// Center the camera on the initial Peasants.
call SetCameraPositionForPlayer(whichPlayer, peonX, peonY)
call SetCameraQuickPositionForPlayer(whichPlayer, peonX, peonY)
endif
endfunction
//===========================================================================
function InitTrig_orc takes nothing returns nothing
set gg_trg_orc = CreateTrigger( )
call TriggerAddAction( gg_trg_orc, function Trig_orc_Actions )
endfunction
//===========================================================================
function InitCustomTriggers takes nothing returns nothing
call InitTrig_Inicializace___arv__tky( )
call InitTrig_Vysoky_elfovia( )
call InitTrig_Ludia( )
call InitTrig_Vys_Elfovia( )
call InitTrig_Vys_Elf_2( )
call InitTrig_Vys_Elf_2_Kop__rovat( )
call InitTrig_Choose( )
call InitTrig_Race( )
call InitTrig_orc( )
endfunction
//===========================================================================
function RunInitializationTriggers takes nothing returns nothing
call ConditionalTriggerExecute( gg_trg_Inicializace___arv__tky )
endfunction
//***************************************************************************
//*
//* Players
//*
//***************************************************************************
function InitCustomPlayerSlots takes nothing returns nothing
// Player 0
call SetPlayerStartLocation( Player(0), 0 )
call SetPlayerColor( Player(0), ConvertPlayerColor(0) )
call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN )
call SetPlayerRaceSelectable( Player(0), true )
call SetPlayerController( Player(0), MAP_CONTROL_USER )
// Player 1
call SetPlayerStartLocation( Player(1), 1 )
call SetPlayerColor( Player(1), ConvertPlayerColor(1) )
call SetPlayerRacePreference( Player(1), RACE_PREF_ORC )
call SetPlayerRaceSelectable( Player(1), true )
call SetPlayerController( Player(1), MAP_CONTROL_USER )
// Player 2
call SetPlayerStartLocation( Player(2), 2 )
call SetPlayerColor( Player(2), ConvertPlayerColor(2) )
call SetPlayerRacePreference( Player(2), RACE_PREF_UNDEAD )
call SetPlayerRaceSelectable( Player(2), true )
call SetPlayerController( Player(2), MAP_CONTROL_USER )
// Player 3
call SetPlayerStartLocation( Player(3), 3 )
call SetPlayerColor( Player(3), ConvertPlayerColor(3) )
call SetPlayerRacePreference( Player(3), RACE_PREF_NIGHTELF )
call SetPlayerRaceSelectable( Player(3), true )
call SetPlayerController( Player(3), MAP_CONTROL_USER )
// Player 4
call SetPlayerStartLocation( Player(4), 4 )
call SetPlayerColor( Player(4), ConvertPlayerColor(4) )
call SetPlayerRacePreference( Player(4), RACE_PREF_HUMAN )
call SetPlayerRaceSelectable( Player(4), true )
call SetPlayerController( Player(4), MAP_CONTROL_USER )
// Player 5
call SetPlayerStartLocation( Player(5), 5 )
call SetPlayerColor( Player(5), ConvertPlayerColor(5) )
call SetPlayerRacePreference( Player(5), RACE_PREF_ORC )
call SetPlayerRaceSelectable( Player(5), true )
call SetPlayerController( Player(5), MAP_CONTROL_USER )
// Player 6
call SetPlayerStartLocation( Player(6), 6 )
call SetPlayerColor( Player(6), ConvertPlayerColor(6) )
call SetPlayerRacePreference( Player(6), RACE_PREF_UNDEAD )
call SetPlayerRaceSelectable( Player(6), true )
call SetPlayerController( Player(6), MAP_CONTROL_USER )
// Player 7
call SetPlayerStartLocation( Player(7), 7 )
call SetPlayerColor( Player(7), ConvertPlayerColor(7) )
call SetPlayerRacePreference( Player(7), RACE_PREF_NIGHTELF )
call SetPlayerRaceSelectable( Player(7), true )
call SetPlayerController( Player(7), MAP_CONTROL_USER )
endfunction
function InitCustomTeams takes nothing returns nothing
// Force: TRIGSTR_012
call SetPlayerTeam( Player(0), 0 )
call SetPlayerTeam( Player(1), 0 )
call SetPlayerTeam( Player(2), 0 )
call SetPlayerTeam( Player(3), 0 )
call SetPlayerTeam( Player(4), 0 )
call SetPlayerTeam( Player(5), 0 )
call SetPlayerTeam( Player(6), 0 )
call SetPlayerTeam( Player(7), 0 )
endfunction
function InitAllyPriorities takes nothing returns nothing
call SetStartLocPrioCount( 0, 2 )
call SetStartLocPrio( 0, 0, 1, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 0, 1, 7, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 1, 2 )
call SetStartLocPrio( 1, 0, 0, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 1, 1, 2, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 2, 2 )
call SetStartLocPrio( 2, 0, 1, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 2, 1, 3, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 3, 2 )
call SetStartLocPrio( 3, 0, 2, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 3, 1, 4, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 4, 2 )
call SetStartLocPrio( 4, 0, 3, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 4, 1, 5, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 5, 2 )
call SetStartLocPrio( 5, 0, 4, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 5, 1, 6, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 6, 2 )
call SetStartLocPrio( 6, 0, 5, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 6, 1, 7, MAP_LOC_PRIO_HIGH )
call SetStartLocPrioCount( 7, 2 )
call SetStartLocPrio( 7, 0, 0, MAP_LOC_PRIO_HIGH )
call SetStartLocPrio( 7, 1, 6, MAP_LOC_PRIO_HIGH )
endfunction
//***************************************************************************
//*
//* Main Initialization
//*
//***************************************************************************
//===========================================================================
function main takes nothing returns nothing
call SetCameraBounds( -8320.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -8448.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 8320.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 8192.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -8320.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 8192.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 8320.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -8448.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
call NewSoundEnvironment( "Default" )
call SetAmbientDaySound( "LordaeronSummerDay" )
call SetAmbientNightSound( "LordaeronSummerNight" )
call SetMapMusic( "Music", true, 0 )
call CreateRegions( )
call CreateAllUnits( )
call InitBlizzard( )
call InitGlobals( )
call InitCustomTriggers( )
call RunInitializationTriggers( )
endfunction
//***************************************************************************
//*
//* Map Configuration
//*
//***************************************************************************
function config takes nothing returns nothing
call SetMapName( "TRIGSTR_000" )
call SetMapDescription( "TRIGSTR_002" )
call SetPlayers( 8 )
call SetTeams( 8 )
call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )
call DefineStartLocation( 0, -1856.0, 6336.0 )
call DefineStartLocation( 1, 4672.0, 6528.0 )
call DefineStartLocation( 2, 6848.0, 1344.0 )
call DefineStartLocation( 3, 7104.0, -4608.0 )
call DefineStartLocation( 4, 1600.0, -7104.0 )
call DefineStartLocation( 5, -3904.0, -6912.0 )
call DefineStartLocation( 6, -6912.0, -1536.0 )
call DefineStartLocation( 7, -6720.0, 3712.0 )
// Player setup
call InitCustomPlayerSlots( )
call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(1), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(2), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(3), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(4), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(5), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(6), MAP_CONTROL_USER )
call SetPlayerSlotAvailable( Player(7), MAP_CONTROL_USER )
call InitGenericPlayerSlots( )
call InitAllyPriorities( )
endfunction