-
Are you planning to upload your awesome map to Hive? Please review the rules here.Dismiss Notice
-
Dismiss Notice
Awaken what lies in the heart of your swarm. The 17th Techtree Contest has arrived!
-
Dismiss Notice
The Hive Workshop is launching its first HD modelling contest. How HD should it be?
-
Dismiss Notice
Check out the Staff Job Openings thread.
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.
Trigger Viewer





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
//TESH.scrollpos=44 //TESH.alwaysfold=0 //*************************************************************************** //* //* Altered Melee Starting AI Scripts //* //*************************************************************************** //=========================================================================== function AlteredMeleeShowAIRaceDialog takes nothing returns nothing local integer index set index = 1 loop if ( udg_AM_AI_PlayerNum == 0 ) then if ( udg_AM_RaceChosen[index] == 0 ) then if ( GetPlayerController(Player(index - 1)) == MAP_CONTROL_COMPUTER ) then set udg_AM_AI_PlayerNum = index call DialogSetMessageBJ( udg_AM_RaceDialog_AI_1, ( "Pick the race of Computer Player " + I2S(udg_AM_AI_PlayerNum) ) ) call DialogDisplayBJ( true, udg_AM_RaceDialog_AI_1, Player(0) ) endif endif endif set index = index + 1 exitwhen index == 12 endloop endfunction //=========================================================================== function AlteredMeleeStartingAI takes nothing returns nothing local integer index local player indexPlayer local integer indexRace set index = 0 loop set indexPlayer = Player(index) if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then set indexRace = udg_AM_RaceChosen[index + 1] if (GetPlayerController(indexPlayer) == MAP_CONTROL_COMPUTER) then // Run a race-specific melee AI script. if (indexRace == 1) then call PickMeleeAI(indexPlayer, "human.ai", null, null) elseif (indexRace == 2) then call PickMeleeAI(indexPlayer, "orc.ai", null, null) elseif (indexRace == 3) then call PickMeleeAI(indexPlayer, "undead.ai", null, null) call RecycleGuardPosition(bj_ghoul[index]) elseif (indexRace == 4) then call PickMeleeAI(indexPlayer, "elf.ai", null, null) else call PickMeleeAI(indexPlayer, udg_AM_AI_FilePath[indexRace], null, null) endif call ShareEverythingWithTeamAI(indexPlayer) endif endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop endfunction //*************************************************************************** //* //* Altered Melee Starting Units Scripts //* //*************************************************************************** //=========================================================================== // Starting Units for Custom Race Players // - 1 Tier1 Hall, placed at start location // - 5 Primary Workers or 3 Primary Workers and 1 Seconday Worker, placed between start location and nearest gold mine // function MeleeStartingUnitsCustom takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload, integer whichRace returns nothing local boolean useRandomHero = IsMapFlagSet(MAP_RANDOM_HERO) local real unitSpacing = 64.00 local unit nearestMine local unit hallT1 local location nearMineLoc local location nearTownLoc local location exactMineLoc local location heroLoc local location tempLoc1 local real primaryX local real primaryY local real secondaryX local real secondaryY local integer mineGold set nearestMine = MeleeFindNearestMine(startLoc, bj_MELEE_MINE_SEARCH_RADIUS) if (nearestMine != null) then set tempLoc1 = GetUnitLoc(nearestMine) set nearMineLoc = MeleeGetProjectedLoc(tempLoc1, startLoc, 320, 0) set primaryX = GetLocationX(nearMineLoc) set primaryY = GetLocationY(nearMineLoc) set nearTownLoc = MeleeGetProjectedLoc(startLoc, tempLoc1, 288, 0) set secondaryX = GetLocationX(nearTownLoc) set secondaryY = GetLocationY(nearTownLoc) set exactMineLoc = MeleeGetProjectedLoc(tempLoc1, startLoc, 0, 0) set mineGold = GetResourceAmount(nearestMine) call RemoveLocation(tempLoc1) else set nearMineLoc = startLoc set primaryX = GetLocationX(startLoc) set primaryY = GetLocationY(startLoc) - 224.00 set nearTownLoc = startLoc set secondaryX = primaryX set secondaryY = primaryY set exactMineLoc = startLoc set mineGold = 19000 endif //Check to see if race has a special goldmining structure if (udg_AM_UnitType_Goldmine[whichRace] != null) then //Check to see if Tier1 Hall entangles gold mines if (udg_AM_HallEntanglesGoldmine[whichRace] != true) then call RemoveUnit(nearestMine) //Check to see if the goldmining structure is that race's townhall if (udg_AM_UnitType_Goldmine[whichRace] == udg_AM_UnitType_TownhallT1[whichRace]) then // Create a Tier1 Hall to replace the Gold Mine. set nearestMine = CreateUnitAtLoc(whichPlayer, udg_AM_UnitType_TownhallT1[whichRace], exactMineLoc, bj_UNIT_FACING) call SetResourceAmount(nearestMine, mineGold) else // Create a Racial Gold Mine to replace the Gold Mine. if (nearestMine != null) then set nearestMine = CreateUnitAtLoc(whichPlayer, udg_AM_UnitType_Goldmine[whichRace], exactMineLoc, bj_UNIT_FACING) call SetResourceAmount(nearestMine, mineGold) endif // Spawn Tier1 Hall at the start location. set hallT1 = CreateUnitAtLoc(whichPlayer, udg_AM_UnitType_TownhallT1[whichRace], startLoc, bj_UNIT_FACING) endif else // Spawn Tier1 Hall near goldmine. set hallT1 = CreateUnitAtLoc(whichPlayer, udg_AM_UnitType_TownhallT1[whichRace], nearMineLoc, bj_UNIT_FACING) call IssueTargetOrder(hallT1, "entangleinstant", nearestMine) endif else // Spawn Tier1 Hall at the start location. set hallT1 = CreateUnitAtLoc(whichPlayer, udg_AM_UnitType_TownhallT1[whichRace], startLoc, bj_UNIT_FACING) endif // Spawn Primary Workers near the mine. call CreateUnit(whichPlayer, udg_AM_UnitType_PrimaryWorker[whichRace], primaryX + 0.00 * unitSpacing, primaryY + 1.00 * unitSpacing, bj_UNIT_FACING) call CreateUnit(whichPlayer, udg_AM_UnitType_PrimaryWorker[whichRace], primaryX + 1.00 * unitSpacing, primaryY + 0.15 * unitSpacing, bj_UNIT_FACING) call CreateUnit(whichPlayer, udg_AM_UnitType_PrimaryWorker[whichRace], primaryX - 1.00 * unitSpacing, primaryY + 0.15 * unitSpacing, bj_UNIT_FACING) //If secondary workers exist then spawn 1 instead of 2 more primary workers. if (udg_AM_UnitType_SecondaryWorker[whichRace] != null) then // Spawn Secondary Workers near the Tier1 Hall. call CreateUnit(whichPlayer, udg_AM_UnitType_SecondaryWorker[whichRace], secondaryX + 0.60 * unitSpacing, secondaryY - 1.00 * unitSpacing, bj_UNIT_FACING) else call CreateUnit(whichPlayer, udg_AM_UnitType_PrimaryWorker[whichRace], primaryX + 0.60 * unitSpacing, primaryY - 1.00 * unitSpacing, bj_UNIT_FACING) call CreateUnit(whichPlayer, udg_AM_UnitType_PrimaryWorker[whichRace], primaryX - 0.60 * unitSpacing, primaryY - 1.00 * unitSpacing, bj_UNIT_FACING) endif //Check to see if race starts with blight around starting area if (udg_AM_StartsWithBlight[whichRace] == true) then // Create a patch of blight near the mine. call SetBlightLoc(whichPlayer,nearMineLoc, 768, true) endif // Set random hero spawn point to be near workers. set heroLoc = Location(primaryX, primaryY - 2.00 * unitSpacing) 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, udg_AM_UnitType_Hero1[whichRace], udg_AM_UnitType_Hero2[whichRace], udg_AM_UnitType_Hero3[whichRace], udg_AM_UnitType_Hero4[whichRace], 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, primaryX, primaryY ) call SetCameraQuickPositionForPlayer(whichPlayer, primaryX, primaryY ) endif call RemoveLocation(nearMineLoc) call RemoveLocation(nearTownLoc) call RemoveLocation(exactMineLoc) call RemoveLocation(heroLoc) endfunction //=========================================================================== function AlteredMeleeStartingUnits takes nothing returns nothing local integer index local player indexPlayer local location indexStartLoc call Preloader( "scripts\\SharedMelee.pld" ) set index = 0 loop set indexPlayer = Player(index) if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then set indexStartLoc = GetStartLocationLoc(GetPlayerStartLocation(indexPlayer)) // Create initial race-specific starting units if (udg_AM_RaceChosen[index + 1] == 1) then call MeleeStartingUnitsHuman(indexPlayer, indexStartLoc, true, true, true) elseif (udg_AM_RaceChosen[index + 1] == 2) then call MeleeStartingUnitsOrc(indexPlayer, indexStartLoc, true, true, true) elseif (udg_AM_RaceChosen[index + 1] == 3) then call MeleeStartingUnitsUndead(indexPlayer, indexStartLoc, true, true, true) elseif (udg_AM_RaceChosen[index + 1] == 4) then call MeleeStartingUnitsNightElf(indexPlayer, indexStartLoc, true, true, true) else call MeleeStartingUnitsCustom(indexPlayer, indexStartLoc, true, true, true, udg_AM_RaceChosen[index + 1]) endif call RemoveLocation(indexStartLoc) endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop endfunction //*************************************************************************** //* //* Altered Melee Template Victory / Defeat Conditions //* //*************************************************************************** //=========================================================================== // Count buildings currently owned by all allies, including the player themself. // function AlteredMeleeGetAllyStructureCount takes player whichPlayer returns integer local integer playerIndex local integer buildingCount local player indexPlayer // Count the number of buildings controlled by all not-yet-defeated co-allies. set buildingCount = 0 set playerIndex = 0 loop set indexPlayer = Player(playerIndex) // uncomment to cause defeat even if you have control of ally structures, but yours have been nixed //if (PlayersAreCoAllied(whichPlayer, indexPlayer) and not bj_meleeDefeated[playerIndex]) then if (PlayersAreCoAllied(whichPlayer, indexPlayer)) then set buildingCount = buildingCount + GetPlayerStructureCount(indexPlayer, true) endif set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop return buildingCount endfunction //=========================================================================== // Counts key structures owned by a player and his or her allies, including // structures currently upgrading or under construction. // // Key structures: Town Hall, Great Hall, Tree of Life, Necropolis // function AlteredMeleeGetAllyKeyStructureCount takes player whichPlayer returns integer local integer playerIndex local player indexPlayer local integer keyStructs local integer raceIndex // Count the number of buildings controlled by all not-yet-defeated co-allies. set keyStructs = 0 set playerIndex = 0 loop set indexPlayer = Player(playerIndex) if (PlayersAreCoAllied(whichPlayer, indexPlayer)) then set keyStructs = keyStructs + GetPlayerTypedUnitCount(indexPlayer, "townhall", true, true) set keyStructs = keyStructs + GetPlayerTypedUnitCount(indexPlayer, "greathall", true, true) set keyStructs = keyStructs + GetPlayerTypedUnitCount(indexPlayer, "treeoflife", true, true) set keyStructs = keyStructs + GetPlayerTypedUnitCount(indexPlayer, "necropolis", true, true) set raceIndex = 5 loop set keyStructs = keyStructs + CountLivingPlayerUnitsOfTypeId(udg_AM_UnitType_TownhallT1[raceIndex], indexPlayer) set keyStructs = keyStructs + CountLivingPlayerUnitsOfTypeId(udg_AM_UnitType_TownhallT2[raceIndex], indexPlayer) set keyStructs = keyStructs + CountLivingPlayerUnitsOfTypeId(udg_AM_UnitType_TownhallT3[raceIndex], indexPlayer) set raceIndex = raceIndex + 1 exitwhen raceIndex == (udg_AM_NumOfRaceChoices + 1) endloop endif set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop return keyStructs endfunction //=========================================================================== // Test each player to determine if anyone has been defeated. // function AlteredMeleeCheckForLosersAndVictors takes nothing returns nothing local integer playerIndex local player indexPlayer local force defeatedPlayers = CreateForce() local force victoriousPlayers local boolean gameOver = false // If the game is already over, do nothing if (bj_meleeGameOver) then return endif // If the game was disconnected then it is over, in this case we // don't want to report results for anyone as they will most likely // conflict with the actual game results if (GetIntegerGameState(GAME_STATE_DISCONNECTED) != 0) then set bj_meleeGameOver = true return endif // Check each player to see if he or she has been defeated yet. set playerIndex = 0 loop set indexPlayer = Player(playerIndex) if (not bj_meleeDefeated[playerIndex] and not bj_meleeVictoried[playerIndex]) then //call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "Player"+I2S(playerIndex)+" has "+I2S(AlteredMeleeGetAllyStructureCount(indexPlayer))+" ally buildings.") if (AlteredMeleeGetAllyStructureCount(indexPlayer) <= 0) then // Keep track of each defeated player so that we can give // them a defeat later. call ForceAddPlayer(defeatedPlayers, Player(playerIndex)) // Set their defeated flag now so MeleeCheckForVictors // can detect victors. set bj_meleeDefeated[playerIndex] = true endif endif set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop // Now that the defeated flags are set, check if there are any victors set victoriousPlayers = MeleeCheckForVictors() // Defeat all defeated players call ForForce(defeatedPlayers, function MeleeDoDefeatEnum) // Give victory to all victorious players call ForForce(victoriousPlayers, function MeleeDoVictoryEnum) // If the game is over we should remove all observers if (bj_meleeGameOver) then call MeleeRemoveObservers() endif endfunction //=========================================================================== // Returns a race-specific "build X or be revealed" message. // function AlteredMeleeGetCrippledWarningMessage takes player whichPlayer returns string local integer indexPlayer = GetPlayerId(whichPlayer)+ 1 if (udg_AM_RaceChosen[indexPlayer] == 1) then return GetLocalizedString("CRIPPLE_WARNING_HUMAN") elseif (udg_AM_RaceChosen[indexPlayer] == 2) then return GetLocalizedString("CRIPPLE_WARNING_ORC") elseif (udg_AM_RaceChosen[indexPlayer] == 3) then return GetLocalizedString("CRIPPLE_WARNING_NIGHTELF") elseif (udg_AM_RaceChosen[indexPlayer] == 4) then return GetLocalizedString("CRIPPLE_WARNING_UNDEAD") else return udg_AM_RevealMessage[udg_AM_RaceChosen[indexPlayer]] endif endfunction //=========================================================================== // Returns a race-specific "build X" label for cripple timers. // function AlteredMeleeGetCrippledTimerMessage takes player whichPlayer returns string local integer indexPlayer = GetPlayerId(whichPlayer)+ 1 if (udg_AM_RaceChosen[indexPlayer] == 1) then return GetLocalizedString("CRIPPLE_TIMER_HUMAN") elseif (udg_AM_RaceChosen[indexPlayer] == 2) then return GetLocalizedString("CRIPPLE_TIMER_ORC") elseif (udg_AM_RaceChosen[indexPlayer] == 3) then return GetLocalizedString("CRIPPLE_TIMER_NIGHTELF") elseif (udg_AM_RaceChosen[indexPlayer] == 4) then return GetLocalizedString("CRIPPLE_TIMER_UNDEAD") else return udg_AM_BuildWindow[udg_AM_RaceChosen[indexPlayer]] endif endfunction //=========================================================================== function AlteredMeleePlayerIsCrippled takes player whichPlayer returns boolean local integer allyStructures = AlteredMeleeGetAllyStructureCount(whichPlayer) local integer allyKeyStructures = AlteredMeleeGetAllyKeyStructureCount(whichPlayer) // Dead teams are not considered to be crippled. return (allyStructures > 0) and (allyKeyStructures <= 0) endfunction //=========================================================================== // Test each player to determine if anyone has become crippled. // function AlteredMeleeCheckForCrippledPlayers takes nothing returns nothing local integer playerIndex local player indexPlayer local force crippledPlayers = CreateForce() local boolean isNowCrippled // The "finish soon" exposure of all players overrides any "crippled" exposure if bj_finishSoonAllExposed then return endif // Check each player to see if he or she has been crippled or uncrippled. set playerIndex = 0 loop set indexPlayer = Player(playerIndex) set isNowCrippled = AlteredMeleePlayerIsCrippled(indexPlayer) if (not bj_playerIsCrippled[playerIndex] and isNowCrippled) then // Player became crippled; start their cripple timer. set bj_playerIsCrippled[playerIndex] = true call TimerStart(bj_crippledTimer[playerIndex], bj_MELEE_CRIPPLE_TIMEOUT, false, function MeleeCrippledPlayerTimeout) if (GetLocalPlayer() == indexPlayer) then // Use only local code (no net traffic) within this block to avoid desyncs. // Show the timer window. call TimerDialogDisplay(bj_crippledTimerWindows[playerIndex], true) // Display a warning message. call DisplayTimedTextToPlayer(indexPlayer, 0, 0, bj_MELEE_CRIPPLE_MSG_DURATION, AlteredMeleeGetCrippledWarningMessage(indexPlayer)) endif elseif (bj_playerIsCrippled[playerIndex] and not isNowCrippled) then // Player became uncrippled; stop their cripple timer. set bj_playerIsCrippled[playerIndex] = false call PauseTimer(bj_crippledTimer[playerIndex]) if (GetLocalPlayer() == indexPlayer) then // Use only local code (no net traffic) within this block to avoid desyncs. // Hide the timer window for this player. call TimerDialogDisplay(bj_crippledTimerWindows[playerIndex], false) // Display a confirmation message if the player's team is still alive. if (AlteredMeleeGetAllyStructureCount(indexPlayer) > 0) then if (bj_playerIsExposed[playerIndex]) then call DisplayTimedTextToPlayer(indexPlayer, 0, 0, bj_MELEE_CRIPPLE_MSG_DURATION, GetLocalizedString("CRIPPLE_UNREVEALED")) else call DisplayTimedTextToPlayer(indexPlayer, 0, 0, bj_MELEE_CRIPPLE_MSG_DURATION, GetLocalizedString("CRIPPLE_UNCRIPPLED")) endif endif endif // If the player granted shared vision, deny that vision now. call MeleeExposePlayer(indexPlayer, false) endif set playerIndex = playerIndex + 1 exitwhen playerIndex == bj_MAX_PLAYERS endloop endfunction //=========================================================================== // Determine if the lost unit should result in any defeats or victories. // function AlteredMeleeCheckLostUnit takes unit lostUnit returns nothing local player lostUnitOwner = GetOwningPlayer(lostUnit) // We only need to check for mortality if this was the last building. if (GetPlayerStructureCount(lostUnitOwner, true) <= 0) then call AlteredMeleeCheckForLosersAndVictors() endif // Check if the lost unit has crippled or uncrippled the player. // (A team with 0 units is dead, and thus considered uncrippled.) call AlteredMeleeCheckForCrippledPlayers() endfunction //=========================================================================== // Determine if the gained unit should result in any defeats, victories, // or cripple-status changes. // function AlteredMeleeCheckAddedUnit takes unit addedUnit returns nothing local player addedUnitOwner = GetOwningPlayer(addedUnit) // If the player was crippled, this unit may have uncrippled him/her. if (bj_playerIsCrippled[GetPlayerId(addedUnitOwner)]) then call AlteredMeleeCheckForCrippledPlayers() endif endfunction //=========================================================================== function AlteredMeleeTriggerActionConstructCancel takes nothing returns nothing call AlteredMeleeCheckLostUnit(GetCancelledStructure()) endfunction //=========================================================================== function AlteredMeleeTriggerActionUnitDeath takes nothing returns nothing if (IsUnitType(GetDyingUnit(), UNIT_TYPE_STRUCTURE)) then call AlteredMeleeCheckLostUnit(GetDyingUnit()) endif endfunction //=========================================================================== function AlteredMeleeTriggerActionUnitConstructionStart takes nothing returns nothing call AlteredMeleeCheckAddedUnit(GetConstructingStructure()) endfunction //=========================================================================== function AlteredMeleeTriggerActionPlayerDefeated takes nothing returns nothing local player thePlayer = GetTriggerPlayer() call CachePlayerHeroData(thePlayer) if (MeleeGetAllyCount(thePlayer) > 0) then // If at least one ally is still alive and kicking, share units with // them and proceed with death. call ShareEverythingWithTeam(thePlayer) if (not bj_meleeDefeated[GetPlayerId(thePlayer)]) then call MeleeDoDefeat(thePlayer) endif else // If no living allies remain, swap all units and buildings over to // neutral_passive and proceed with death. call MakeUnitsPassiveForTeam(thePlayer) if (not bj_meleeDefeated[GetPlayerId(thePlayer)]) then call MeleeDoDefeat(thePlayer) endif endif call AlteredMeleeCheckForLosersAndVictors() endfunction //=========================================================================== function AlteredMeleeTriggerActionPlayerLeft takes nothing returns nothing local player thePlayer = GetTriggerPlayer() // Just show game over for observers when they leave if (IsPlayerObserver(thePlayer)) then call RemovePlayerPreserveUnitsBJ(thePlayer, PLAYER_GAME_RESULT_NEUTRAL, false) return endif call CachePlayerHeroData(thePlayer) // This is the same as defeat except the player generates the message // "player left the game" as opposed to "player was defeated". if (MeleeGetAllyCount(thePlayer) > 0) then // If at least one ally is still alive and kicking, share units with // them and proceed with death. call ShareEverythingWithTeam(thePlayer) call MeleeDoLeave(thePlayer) else // If no living allies remain, swap all units and buildings over to // neutral_passive and proceed with death. call MakeUnitsPassiveForTeam(thePlayer) call MeleeDoLeave(thePlayer) endif call AlteredMeleeCheckForLosersAndVictors() endfunction //=========================================================================== function AlteredMeleeTriggerActionAllianceChange takes nothing returns nothing call AlteredMeleeCheckForLosersAndVictors() call AlteredMeleeCheckForCrippledPlayers() endfunction //=========================================================================== function AlteredMeleeInitVictoryDefeat takes nothing returns nothing local trigger trig local integer index local player indexPlayer // Create a timer window for the "finish soon" timeout period, it has no timer // because it is driven by real time (outside of the game state to avoid desyncs) set bj_finishSoonTimerDialog = CreateTimerDialog(null) // Set a trigger to fire when we receive a "finish soon" game event set trig = CreateTrigger() call TriggerRegisterGameEvent(trig, EVENT_GAME_TOURNAMENT_FINISH_SOON) call TriggerAddAction(trig, function MeleeTriggerTournamentFinishSoon) // Set a trigger to fire when we receive a "finish now" game event set trig = CreateTrigger() call TriggerRegisterGameEvent(trig, EVENT_GAME_TOURNAMENT_FINISH_NOW) call TriggerAddAction(trig, function MeleeTriggerTournamentFinishNow) // Set up each player's mortality code. set index = 0 loop set indexPlayer = Player(index) // Make sure this player slot is playing. if (GetPlayerSlotState(indexPlayer) == PLAYER_SLOT_STATE_PLAYING) then set bj_meleeDefeated[index] = false set bj_meleeVictoried[index] = false // Create a timer and timer window in case the player is crippled. set bj_playerIsCrippled[index] = false set bj_playerIsExposed[index] = false set bj_crippledTimer[index] = CreateTimer() set bj_crippledTimerWindows[index] = CreateTimerDialog(bj_crippledTimer[index]) call TimerDialogSetTitle(bj_crippledTimerWindows[index], AlteredMeleeGetCrippledTimerMessage(indexPlayer)) // Set a trigger to fire whenever a building is cancelled for this player. set trig = CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL, null) call TriggerAddAction(trig, function AlteredMeleeTriggerActionConstructCancel) // Set a trigger to fire whenever a unit dies for this player. set trig = CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_DEATH, null) call TriggerAddAction(trig, function AlteredMeleeTriggerActionUnitDeath) // Set a trigger to fire whenever a unit begins construction for this player set trig = CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig, indexPlayer, EVENT_PLAYER_UNIT_CONSTRUCT_START, null) call TriggerAddAction(trig, function AlteredMeleeTriggerActionUnitConstructionStart) // Set a trigger to fire whenever this player defeats-out set trig = CreateTrigger() call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_DEFEAT) call TriggerAddAction(trig, function AlteredMeleeTriggerActionPlayerDefeated) // Set a trigger to fire whenever this player leaves set trig = CreateTrigger() call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_LEAVE) call TriggerAddAction(trig, function AlteredMeleeTriggerActionPlayerLeft) // Set a trigger to fire whenever this player changes his/her alliances. set trig = CreateTrigger() call TriggerRegisterPlayerAllianceChange(trig, indexPlayer, ALLIANCE_PASSIVE) call TriggerRegisterPlayerStateEvent(trig, indexPlayer, PLAYER_STATE_ALLIED_VICTORY, EQUAL, 1) call TriggerAddAction(trig, function AlteredMeleeTriggerActionAllianceChange) else set bj_meleeDefeated[index] = true set bj_meleeVictoried[index] = false // Handle leave events for observers if (IsPlayerObserver(indexPlayer)) then // Set a trigger to fire whenever this player leaves set trig = CreateTrigger() call TriggerRegisterPlayerEvent(trig, indexPlayer, EVENT_PLAYER_LEAVE) call TriggerAddAction(trig, function AlteredMeleeTriggerActionPlayerLeft) endif endif set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop // Test for victory / defeat at startup, in case the user has already won / lost. // Allow for a short time to pass first, so that the map can finish loading. call TimerStart(CreateTimer(), 2.0, false, function AlteredMeleeTriggerActionAllianceChange) endfunction
Name | Type | Is Array | Initial Value |
AccuracyRushGroup | group | No | |
AllUnits | group | No | |
AM_AI_ButtonToRace | integer | Yes | |
AM_AI_FilePath | string | Yes | |
AM_AI_PlayerNum | integer | No | |
AM_BuildWindow | string | Yes | |
AM_HallEntanglesGoldmine | boolean | Yes | |
AM_NumOfRaceChoices | integer | No | |
AM_NumofRacesWithAI | integer | No | |
AM_OtherButton | button | Yes | |
AM_RaceButton_AI | button | Yes | |
AM_RaceButton_PL | button | Yes | |
AM_RaceChosen | integer | Yes | |
AM_RaceDialog_AI_1 | dialog | No | |
AM_RaceDialog_AI_2 | dialog | No | |
AM_RaceDialog_AI_3 | dialog | No | |
AM_RaceDialog_PL_1 | dialog | No | |
AM_RaceDialog_PL_2 | dialog | No | |
AM_RaceDialog_PL_3 | dialog | No | |
AM_RaceName | string | Yes | |
AM_RevealMessage | string | Yes | |
AM_StartsWithBlight | boolean | Yes | |
AM_UnitType_Goldmine | unitcode | Yes | |
AM_UnitType_Hero1 | unitcode | Yes | |
AM_UnitType_Hero2 | unitcode | Yes | |
AM_UnitType_Hero3 | unitcode | Yes | |
AM_UnitType_Hero4 | unitcode | Yes | |
AM_UnitType_PrimaryWorker | unitcode | Yes | |
AM_UnitType_SecondaryWorker | unitcode | Yes | |
AM_UnitType_TownhallT1 | unitcode | Yes | |
AM_UnitType_TownhallT2 | unitcode | Yes | |
AM_UnitType_TownhallT3 | unitcode | Yes | |
ArchmaidenErrors | group | No | |
BlizzardGroupTemp | group | No | |
BlizzardHashtable | hashtable | No | |
BowMageGroup | group | No | |
Cast_ShieldUnit | unit | No | UnitNull |
CastShield2 | handle | No | |
CastShieldHash1 | hashtable | No | |
CCamp1 | group | No | |
CCamp10 | group | No | |
CCamp2 | group | No | |
CCamp3 | group | No | |
CCamp4 | group | No | |
CCamp5 | group | No | |
CCamp6 | group | No | |
CCamp7 | group | No | |
CCamp8 | group | No | |
CCamp9 | group | No | |
ChaosWill | group | No | |
CreepCampslvl1 | group | No | |
CritterOffGroup | group | No | |
CryptBurrow | group | No | |
DamageBonusDet2Reset | group | No | |
DamageTaken | real | No | |
DarkRitualLich | group | No | |
DeadlyFeromoneGroup | group | No | |
DeathandDecay | group | No | |
DragonDanceGroup | group | No | |
DragonflyBlack | group | No | |
DragonflyBronze | group | No | |
DragonflyIndex | player | No | |
DragonflyRect | rect | No | |
DragonflySaph | group | No | |
DragonWrathGroup | group | No | |
DrassilianMaskIncome | group | No | |
DreadSlowGroup | group | No | |
FelMagicAbsorbtionGroup | group | No | |
FeralPackGroup | group | No | |
FimbulwinterTyr | group | No | |
FirelordHeal | group | No | |
Game_Time_Minutes | integer | No | |
Game_Time_Seconds | integer | No | |
Game_Time_String | string | No | |
Game_Time_TenSeconds | integer | No | |
GroupValkyr | group | No | |
HealAttackType | attacktype | No | |
HealDamageType | damagetype | No | |
Hero1 | unit | No | |
Hero10 | unit | No | |
Hero11 | unit | No | |
Hero12 | unit | No | |
Hero2 | unit | No | |
Hero3 | unit | No | |
Hero4 | unit | No | |
Hero5 | unit | No | |
Hero6 | unit | No | |
Hero7 | unit | No | |
Hero8 | unit | No | |
Hero9 | unit | No | |
HibernationBearGroup | group | No | |
HydraGrowth | group | No | |
IMR | real | No | |
IngamePlayers | force | No | |
ItemRegulationGroup | group | No | |
KissFrogGroup1 | group | No | |
KissFrogGroup2 | group | No | |
LightflyGroup | group | No | |
MultiBoard | multiboard | No | |
NibelungRingIncome | group | No | |
NorthrendStrikeGroup | group | No | |
Num_Player_Ingame | integer | No | |
OceanLureDeath | group | No | |
PackGroup | group | No | |
PhoenixAshesGroup | group | No | |
PhoenixWarriorGroup | group | No | |
Players_Alliance_East | force | No | |
Players_Horde_West | force | No | |
PureAttack | attacktype | No | |
PureDamage | damagetype | No | |
RandomRealValue | real | No | |
RealValueTemp | real | No | |
RelicBlackLotus | group | No | |
RelicBlackLotus2 | group | No | |
RelicBookOfThot | group | No | |
RelicBookOfThot2 | group | No | |
RelicDrassilianMask | group | No | |
RelicDrassilianMask2 | group | No | |
RelicHephaestusShield | group | No | |
RelicHephaestusShield2 | group | No | |
RelicLaceofGaia | group | No | |
RelicLaceofGaia2 | group | No | |
RelicNibelungRing | group | No | |
RelicNibelungRing2 | group | No | |
RelicQuetzalArrows | group | No | |
RelicQuetzalArrows2 | group | No | |
RelicSwordOfTheUnknown | group | No | |
RelicSwordOfTheUnknown2 | group | No | |
RelicTyrHand | group | No | |
RelicTyrHand2 | group | No | |
RelicWinterHeart | group | No | |
RelicWinterHeart2 | group | No | |
RemainingMana_Time | integer | No | |
SleepConversionGroup | group | No | |
SoulBurnSecondaryIII | group | No | |
StyxBloodGroup | group | No | |
SubstituteGroup | group | No | |
SweetDreamsGroup | group | No | |
Temp_CasterShield1 | group | No | |
Temp_Group | group | No | |
Temp_Group2 | group | No | |
Temp_Group3 | group | No | |
Temp_Group4 | group | No | |
Temp_PhoenixSlicer | group | No | |
Temp_PlayerGroup | force | No | |
Temp_Point | location | No | |
Temp_Point2 | location | No | |
Temp_Point3 | location | No | |
Temp_Point4 | location | No | |
Temp_Point5 | location | No | |
Temp_Point6 | location | No | |
Temp_Region | rect | No | |
Temp_Unit | unit | No | |
Temp_Unit2 | unit | No | |
TempInt | integer | No | |
TempItem | item | No | |
TempItem2 | item | No | |
TempItem3 | item | No | |
TempItem4 | item | No | |
TempItem5 | item | No | |
TempItem6 | item | No | |
TempItemSlot | integer | No | |
TempItemType | itemcode | No | |
TempPlayer | player | No | |
TempString | string | No | |
TempUnit | unit | No | |
TempValue | integer | No | |
TestTurn | integer | No | |
This_Player_Is_Playing | boolean | Yes | |
ToonBoomDeathGroup | group | No | |
TornadoDownGroup | group | No | |
TornadoEmpowerGroup | group | No | |
Total_Num_Players | integer | No | |
UndeadNecropolisGroup | group | No | |
WarptenPGroup | force | No | |
WarTranceUnits | group | No | |
WateryWardGroup | group | No | |
WindshifterGroup | group | No | |
WindWalkGroup1 | group | No | |
WindWalkGroup2 | group | No | |
WindWalkGroup3 | group | No | |
WyvernStingGroup | group | No |
Default melee game initialization for all players































Here is where you add your race to the Altered Melee triggers. Fill out each variable for your race, naga and draenei are already set as examples.































































































































































































































































































































































































Appears at the beginning of the game. This trigger will determine which players are controled by AI and which are not it will then show user-controlled players a dialog that will allow them to select the race they wish to play as. It will also automatically pick races for everyone if "Random Races" is checked in the pregame lobby.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.

















































































































































































































































This will automatically set up dialog boxes with races that user-controlled players can select.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.





















































































































































































































































































































































































































This will automatically set up dialog boxes with races that user-controlled players can select.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.
























































































































































































































































































































































































































This will automatically set up dialog boxes with races that user-controlled players can select.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.










































































































































































































































































































































































































































This will automatically set up dialog boxes with races that computer-controlled players can play as.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.






































































































































































































































































































































































































































































































This trigger will detemine what race the player picked for themselves.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.


























































































































































































































































































































































































































































































































































































































































This trigger will detemine what race the player picked for the AI.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.



































































































































































































































































































































































































































































































































































































































































































This trigger waits for all players to have chosen their race then it initiates the victory/defeat conditions.
Everything in this trigger should not need to be adjusted.
Everything in this trigger should not need to be adjusted.






























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































