1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

(11)Deadly Hate.w3x
Variables
Initialization
Melee Initialization Copy
Altered Melee
SetRaceVariables
Init Race Choice
AlteredMeleeCreatePlayerDialogII
AlteredMeleeCreatePlayerDialog
AlteredMeleeCreatePlayerDialog Copy
AlteredMeleeCreateComputerDialog
RacesDialogClickDetection Player
RacesDialogClickDetection Computer
CreateAlteredMeleeStartingUnits
Dh
DummyInventoryDeath
Initialization2
GameTimeEvents
Beetles
NB areas
ObelisksTP
CenterTeleport II
RevivedHeroManaRestore
Commands
BaseCommands
TesterCommands
Test
CreepCamps
CreepCamp1
CreepCamp2
CreepCamp3
CreepCamp4
CreepCamp5
CreepCamp6
CreepCamp7
CreepCamp8
CreepCamp9
CreepCamp10
Creeps1Drop
Creeps1Drop II
CreepsDeathRemoval
CreepsChangeOwnerRemoval
Critters
TurtleNoOutOne
TurtleNoOutTwo
SpiritOwlNoOut
CrabNoOut
BlueSpiderNoOut
BlueSpiderNoOut2
FrogNoOut
CavePassage1
CavePassage2
WTC 1 REAL IN
WTC 2 REAL IN
WTC BRIGE1 REAL IN
WTC BRIGE2 REAL IN
WTC 4 REAL IN
WTC 5 REAL IN
WTC 6 REAL IN
WTC 7 REAL IN
WTC 9 REAL IN
WTC 10 REAL IN
WTCBRIDGE3 IN
WTCBRIDGE4 IN
HeroSelectionAnimOrc
HeroSelectionAnimOrc2
HeroSelectionAnimNE
HeroSelectionAnimNE2
HeroSelectionAnimHuman
HeroSelectionAnimHuman2
HeroSelectionAnimUD
HeroSelectionAnimUD2
Abilities
Fan of Knives Especial
Vengeance Especial
Vengeance Dummy Special
Auras
Shield Bonus
Glacial Skin Slow
Lightning
Lightning dummy unit
Lightning dummy unit III
Archer Abilities
Archer Hero Especial I
Archer Hero Especial II
AI neutral hostile
FireboltDPS
WateryAttackI
Eat Tree UNIT
TrincketCast
Furbolg
FurbolgDeath
Heretic
HereticRainCastArt
HereticRainCastArt II
HereticCustomRaise1
HereticCustomRaise2
HereticCustomRaise3
HauntedManor
HauntedManorDeath
Researchs
HauntedPower
SpectralPower
RaiseDust
Earthshock
Rabid Throwers
IceCrusherOn
IceCrusherOff
WetAttBonus
WetAttBonus Off
IncinerateLavaBonus
IncinerateLavaBonus OFF
Breath of Sapphire
GolemQuake
GhostCoil Death
GhostCoilAdd
ASD
Undead
UndeadRacial
ExhumeCast
Other UNd Kill
Necromancer Kill
Split Kill
AbominationSplit
Meat Wagon Kill
Undead Racial Kill
Lich
DeathAndDecay Activate
BlinkWolves
FrostShield ExtraFrost
DarkRitualBonus
DummyRemove
Lich10
FreezingSpellsLearn
FrostNova
DRitualBonusInt
FrostbiteCast
CloudCast
NoAttDAC
DK
DeathwinterDamage
SummonValkyr
DeathMinionDeathDUH
ChooseBlood
ChooseFrost
ChooseUnholy
Valkyr Death
Valkyr Death Copy
BloodStrike
NorthrendStrike
Dream of Deathwinter
StyxBloodCast
Slaughter
DKLEARNS
Death Coiling
SeekerOfDeaths
SeekerOfDeathsMinion
UnholyAura bonus
DeathCoilBonus
DK10
AnimateDead10
DarkRanger
SilenceDamageBonus
SilenceDamageBonus Off
BlackArrow bonus
Life Drain Especial
DarkRanger10
CharmEffect
SoulDisplace
SoulDisplace Art2
VanishmentStart
PhaseShiftI
PhaseShiftII
VanishmentFinish
VanishmentStop
CryptLord
BurrowLord
BurrowLord 2
SpikedSummon
CarrionSpikedDeath
SpikedCapareace
SpikedDeath
CarrionSpikeLearn
CryptLord10
BeetlesLearn
ImplodeCrypt
ImpledeBurrowsLearn
CryptLord10 Spawn
CryptFiend
InfestedLay
InfestCorpse
InfestSpawn
Necromancer
ExhumeSoul
Destroyer
BoltOfNegation
Shadekill
UndeadTier
NecropolisZombie
NecropolisZombieII
NecropolisZombieIII
FrostWyrm
LastBreath II
Art
FrostShieldCast
FrostNovaCast II
FrostNovaCast III
Death Coil I
Death Coil II
Death Pact
Death Pact II
IceRuneCaster
IceRune II
Human
Archmage
BlizzardCast
BlizzardCastII
WisdomOfTheMage
BlizzardColdingEffect
ArchmageSealed On
Recall Anim
Recall Anim II
Brillance Aura Especial
Archmage10
Return
Divide
Paladin
Devotion Aura Especial
Light Blessed
Light Blessed II
Paladin10
Resurrection10
Pack
Pack Stop
Pack Finish
Monk
BlessOfMercy
SanctuaryChannel
SanctuaryChannel Copy
Art
Blizzard Cast
Blizzard Cast II
MassTPCAST
MassTPCAST II
SWaterElemental
SWaterElemental II
SWaterElemental III
ResurrectionCast
Mountain King Cast
Mountain King Cast two
Naga
Snake Recovery
Snake Recovery
Snake Recovery Hero
SnakeCasting Recovery
SnakeCasting Recovery Hero
MutativeBonuses
MutationBonus
Tidal Guardian
Guardian Attack
Sea Giant
Taunt Stomp
Taunt Stomp II
Hydra
HydraSpawn
HydraGrowthCast
HydraGrowthFinish
MurgulSlave
MurSlaveTakeWeap
Blood-Gill
Blood Heal cast
Royal Guard
WetSoulPurge extra damage AoE
WetSoulPurge extra damage AoE II
LightningShieldPurge
CleavingBASH
SoulPurge I
SoulPurge II
SoulPurge III
RoyalGuard10
Mur'gul Oceanweaver
Watery Ward
WateryWardGroup
Watery Minions
Disolve
OceanHealing
Oceanweaver 10
NagaSeaWitch
ForkedLightning
FieldOfTornados
TornadoEmpower
TornadoDownGroup
SeaWitch10
NagaItems
OceanLureSummon
OceanLureDeath
NagaSafeCall
SafeCall NAGA
SafeCall Return NAGA
Return to Work Aqcuaire NAGA
Safe Call Aqcuaire NAGA
Dreadsnake
ToxicSpit
PoisonCourtain
PoisonCourtain Attack
ToxicSprayLearn
MutationFreakLearn
PoisonCourtainLearn
MutationFreakSummon
VenomBringerCast
VenomBringerLearn
Dreadsnake 10
Art
Royal Guard
CleavingBash Sphere
LightningShield
Siren
ParasiteCast
ParasiteCast II
FrostArmorCast
CrushingWaveI
CrushingWaveII
CrushingWaveIII
FrostArmorCast II
Blood Elf
Blood Mage
Siphon Mana Especial
Banish Special
Phoenix Attack Switch
Phoenix Attack Switch II
BloodMage10
PhoenixRevenge
PhoenixKaboom
Phoenix Blader
PhoenixAshesLearn
Phoenix Slicer Damage
Phoenix Slicer Damage 10
FireShield
Flaming Attacker
PhoenixBlader10
PhoenixMarkDrop
PhoenixRevive
SunMarkDeath
SunMarkRevenge
SunFury
PhoenixBladerBorn1
PhoenixBladerBorn2
Ranger
Feralstrike damage return
Feralstrike Learnfix
Arcane Arrow
Arcane Arrow dummy unit
Arcane Arrow dummy unit II
Arcane Arrow dummy unit III
Arcane Arrow 10
Rejuvenation 10
SalvoLearn
BowMageLearn
Salvo
Salvo II
Salvo III
Windshifter
WindcasterSpellsLearn
AccuracyRushKill
RapidKillingBonusDamage
AAimDetection
BowMageKill
Ranger10
Archmaiden
ArcaneErrorGroupRemoval
ArcaneErrorGroupRemoval 2
CasterShield
CasterShieldHeal
CasterShieldHeal2
CasterShield Off
CasterShield Off2
CasterShield Off3
ValkyrSpawn
Mana Shield Especial
Magic Shackles Trigger Unit II
Magic Shackles Trigger Unit
Arcane Vortex Slam
Arcane Vortex Slam II
Arcane Vortex Slam III
Archmaiden10
Epic Mana Bolt
Buildings
Improved Guard
Improved Guard II
Hurl Arrows
NoHurlArrows
NoHurlArrows II
NoHurlArrows III
HurlArrowsAllies
SafeCall
SafeCall Return
Return to Work Aqcuaire
Safe Call Aqcuaire
Archer -Unit-
Solarium Active
Solarium Disabled
SolariumLvlUp
Swordsmen -Unit-
Aggro
Oportunism
Arcane Guardian -Unit-
Refill
Automaticysm
Nether Dragon -Unit-
Essence Stealer
EssenceStealerKill
ConsumeMagic
Wagon
InvisibleNONload
MagicalSiege
MagicalWielderSpeedBonus
MagicalWielderTrain
Art
Archmaiden
ArcaneError
Arcane Vortex
Arcane Vortex II
Arcane Shackles
Arcane Shackles II
ArcaneFieldArt
Arcane Field Sphere
Arcane Field Sphere II
PhoenixBlader
FireShieldCast
Priest
DispelMagicCast
DispelMagicCast I
DispelMagicCast II
InnerFireCast
Sorceress
InvisibilityCast
PolymorphCast
Ranger
Arcane Arrow Cast
BloodMage
Flaming Strike Cast
Flaming Strike Cast II
Siphon Mana Cast
Siphon Mana II
Banish Cast
Banish Cast II
Phoenix Cast
Demon
DevilHound
Hellswarm Howl Death
DemonTier
SafeCall Demon
SafeCall Return Demon
Return to Work Aqcuaire Demon
Safe Call Aqcuaire Demon
Red Dragon
Red Dragon ground
Red Dragon Air
Demon Kill Fury
DemonFury Normal
DemonFury Hero
QoP Fury
Dreadlord
VampiricAura Bonus
DreadKill
Dreadlord10
CarrionSwarmBonus
Inferno 10
BatifyCast
BatifyCastII
BatifyCastIII
SleepCast
SleepConversion1
SleepDreadGroup
PitLord
MeteorDoomCastArt
MeteorDoomCastArtII
MeteorDoomCastArtIII
DoomTarget
Cleaving Attack Especial
PitLord10
HowlCast
SummonPit
SummonPit Copy
PitDeath
QueenOfPain
GlamourSpellsLearn
SeductionTimer
FingerOfPain
DeathKiss
DeathFeromoneGroup
CrushStunDummyBlehhh
CrushDeathRemoveEffect
ChaosWill
CW debuff
Hellfire Spawn
Blood Surge
ChaosTransfusionCast
ChaosTransfusionStop
ChaosTransfusionStop II
ConstructionFinish
LivingBlood
Healing Blood
Kilrogg
Kilrogg Kill
Kilrogg Death
Kilrogg Watch
Kilrogg Watch End
ChaosContraption
ContraptionAnimAlterMorph
Pyrelisk
Pyrelisk Death
ImplodeLisk
ImplodeLisk Art
Ignite Magic Caster
Felhound
ShadowBite Copy
FelhoundSpellBLAH
FelEatMana
MagicAbsorbtion
DisruptionCast
MagicAbsorbtionADD
ChaosWillHoundFIX
Art
Warlock
SummonImpGroups
DemonPact
ImpShield
ImpShieldCast
WarlockFireboltCast
WarlockDemonSpiritCast I
Night Elf
NEDruids
DruidCast I
DruidCast III
Hibernation
HubernationAffect
MarkOfTheTalon
MarkOfTheClaw
Nightime!
Moonlight Active
Moonlight Disabled
DruidRage
DruidRage
DruidRageOff
Priestess of the Moon
Trueshot Aura Hero Special
Sentinel Scout
Sentinel Scout II
Sentinel Scout Art
Sentinel Scout Art II
Moon Focus
Starfall EndArt
Starfall EndArt II
Moon Focus Death
Moon Focus Death II
MoonFocus Uncontrolable
MoonPriestess10
DemonHunter
ManaBurnOficial
Evasion Special
Metamorphosis
DemonAttack
DemonHunter10
Immolation10
Immolation10 Off
Keeper of the Grove
Thorns Aura Hero Especial
TreantSummon
Enroot
Regrowth
Tranquility10
Sprout
Sprout II
SummonWisp
ForceofNature Special
EntangleBonus
Tranquility Cast I
Tranquility Cast II
Tranquility Cast III
KeeperoftheGrove10
Tranquility Hero Especial
EntForm
NatureLearnSpells
EntFormBooks
Warden
ShadowStrike bonus
FanOfKnivesLearn
Blink Special
SpiritofVengeanceAttack
Vengeance cast
Vengeance cast II
FanOfKnivesCast
Warden10
Warden10 Death
FanOfKnivesCastArt
FanOKCA II
VengefulMoonDeath
TreeofLife
LoadTreeofLife
UnloadTreeofLife
SafeCall NE
SafeCall Return NE
Return to Work Aqcuaire NE
Safe Call Aqcuaire NE
Art
Orc
OrcRacial
WarBringers
Elite Breeding
WyvernSting
Far Seer
Feral Spirit
Wolf Spirit Learn
Wolf Spirit
Wolf Spirit Shaman
Lightning Eye
EarthquakeSummonFocus
EarthquakeDummyCastRemove
FarSeer10
Blademaster
DeceitSpells Learn
ReplacementSwitch
ReplacementSwitchRemove
WindWalkRemove
WindWalk
BattleStandardSummon
MartialityKill
CriticalStrike special
Blademaster10
SpiritChanter
SpiritTrance
ParanoiaTaunt
Chaosmancer
Supression
ChaosmancerArt
ChaosmancerArt Copy
ChaosmancerArt II
ChaosmancerArt III
ChaosTorrent
ChaosTorrent2
ChaosTorrent3
Art
Dwarf
TClap
StormBolt
MountainKing10
Bash
Troll
ShadowHunter
SerpentWard bonus
ShadowHunter10
Dragonflayer
Draconian Law
Dragonfly
DragonflayerAspects
DragonDance
DragonflayerAspectsDragonfly
DragonflyLearn
Dragon Wrath Learn
Tauren
Chieftain
CommandAura special
Chieftain10
NeutralHeroes
Firelord
SoulBurnAoE
Incinerate Special
SoulBurn10
SoulBurn10 2
Firelord10
Thinker
EngineUp especial
Clockwerk Summon
ArtClockwerkDeath
Thinker10
LandMinePlace
Brewmaster
BrawlerBonus
BrewmasterLearns
Primal Split
DW fury
DW fury II
PrimalSplitDead
Brewmaster10
Alchemist
Alchemist 10
TransmuteKill
TransmuteKill II
MisteryConcoctionCast
ALCHMORE CAST
ALCHMORE CAST II
ALCH LEARNS
BitterSpike
LocomotionInyection
Molotov
BlizzOBoom
LocomotionBladeDeath
Items
ItemNumberControl
TestNumber
ItemAbilities
IonAuraPurge Copy
PunishmentAura
RegrowthItem
IonAuraPurge
HPMPStone Use
Stat Essences
EssenceofCelerity
EssenceofCelerityPWUP
EssenceofCelerityPWUPControl
EssenceofSpeed
EssenceofSpeedPWUP
EssenceofSpeedPWUPControl
EssenceofStrength
EssenceofStrenghtPWUP
EssenceofStrenghtPWUPControl
EssenceofAgility
EssenceofAgilityPWUP
EssenceofAgilityPWUPControl
EssenceofIntelligence
EssenceofIntelligencePWUP
EssenceofIntelligencePWUPControl
EssenceofForce
EssenceofForcePWUP
EssenceofForcePWUPControl
EssenceofProtection
EssenceofProtectionPWUP
EssenceofProtectionPWUPControl
EssenceofEnchant
EssenceofEnchantPWUP
EssenceofEnchantPWUPControl
EssenceofPerseverance
EssenceofPerseverancePWUP
EssenceofPerseverancePWUPControl
EssenceofBrightness
EssenceofBrightnessPWUP
EssenceofBrightnessPWUPControl
EssenceofMana
EssenceofManaPWUP
EssenceofManaPWUPControl
EssenceofLife
EssenceofLifePWUP
EssenceofLifePWUPControl
Magical Essences
AirEssence
ArcaneEssence
DarknessEssence
DeathEssence
EarthEssence
FrostEssence
HolyEssence
NatureEssence
PyroEssence
ThunderEssence
WaterEssence
Gems
GemsPWUP
GemsPWUPControl
Components
Components
ComponentsPWUPControl
Recipes
RecipesUSE
RecipesBUY
Scrolls
ScrollsPWPGet
ScrollsTrueGet
ScrollsBuy
Item Abilities
Shadowsight
EvasionTalisShift
Shadowsight II
Ice Revenant Summon
Escope Vision
Escope Vision Kill
Escope Vision Kill II
Kaboom Barrel Hide
MechDeath
SweetDreams
BoxOfDreamsHealBonus
KisstheFrog
MysticalFrogDeath
KisstheFrogGroupDeaths
FaerieDustMiscStuff
FaerieMiscDeaths
FaerieDustChargued
StandBackStaff
Flamethrower
Bazooka
MachineGun
Lightning Attack
Relichs
RelicTable
RelicBoxDeath
BlackLotusUse
Get Relich
Get Relich2
Get Relich3
NoRelichUnit
NoRelichHero
NoRelichAltar
AltarRelichDeath
DropRelichCast
TyrCast
QuetzalCast
TyrCast 2
HephaestusCast
UnknownSwordCast
Incomes
NibelungBonus
FimbulwinterWolvesBonusDamage
Relic UnitsDeath
NothRainCast
NorthRainFreezeBuilding
DummyRainRemove
NorthRainBegin
ItemLimitations&Larderboard
RunIMR
RunIMR 2
RunIMR 3
ItemInMapRegulation
BurrowCheck
Initialize Players
Game Time
Multiboard Create
DamageDetection
Damage Detection Events
Add Events to Damage Detection 2
Add Events to Damage Detection 1
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
Melee Initialization Copy
  Events
    Map initialization
  Conditions
  Actions
    Melee Game - Use melee time of day (for all players)
    Melee Game - Limit Heroes to 1 per Hero-type (for all players)
    Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
    Melee Game - Set starting resources (for all players)
    Melee Game - Run melee AI scripts (for computer players)
    Melee Game - Remove creeps and critters from used start locations (for all players)
    Trigger - Run SetRaceVariables <gen> (checking conditions)
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.
SetRaceVariables
  Events
  Conditions
  Actions
    -------- Set the variable below to the total number of races included in the map. --------
    Set AM_NumOfRaceChoices = 9
    -------- Race1 Alliance --------
    -------- Race2 Horde --------
    -------- Race3 Scourge --------
    -------- Race4 Sentinels --------
    -------- Race5 Naga //If the below variable is left blank it will not show up on the dialog boxes and won't be able to be picked. --------
    Set AM_RaceName[5] = Blood Elf
    -------- Below limits and sets this race's heroes. None of these can be blank or else player may not have a hero when (Random Hero) is set in the lobby. --------
    Set AM_UnitType_Hero1[5] = Blood Mage
    Set AM_UnitType_Hero2[5] = Ranger
    Set AM_UnitType_Hero3[5] = Phoenix Warrior
    Set AM_UnitType_Hero4[5] = Archmaiden
    -------- Below sets this races town hall structure. T2 and T3 can be blank if this race has no structures for them. These structures prevent the player from being revealed for having no town hall unit. --------
    Set AM_UnitType_TownhallT1[5] = Town Hall
    Set AM_UnitType_TownhallT2[5] = Keep
    Set AM_UnitType_TownhallT3[5] = Castle
    -------- Below sets this race's gold-mining structure. This can be left blank if they can harvest gold like humans and orcs. If the race's tier1 townhall is the same as this structure, it will spawn the townhall over the goldmine. --------
    Set AM_UnitType_Goldmine[5] = No unit-type
    -------- Below set this race's primary worker unit. If secondary worker is left blank 5 of these will spawn instead of 3. --------
    Set AM_UnitType_PrimaryWorker[5] = Worker (Blood Elf)
    -------- Below sets this race's secondary worker unit. Spawns 1 unit of this type. Can be left blank. --------
    Set AM_UnitType_SecondaryWorker[5] = No unit-type
    -------- Below sets this race's build X or be revealed message. Will be displayed to the player if they have no units of the type set for the Town hall variables. --------
    Set AM_RevealMessage[5] = You will be revealed unless you build a Town Hall
    -------- Below set the text shown for this race's reveal countdown timer. --------
    Set AM_BuildWindow[5] = Build Town Hall
    -------- Below creates blight around players start location if set to true. --------
    Set AM_StartsWithBlight[5] = False
    -------- Below causes townhall to entangle nearby mine if set to true. --------
    Set AM_HallEntanglesGoldmine[5] = False
    -------- Below sets the path for this race's AI. It must be the same as it is in the Import Manager. If blank, this race will not be available for computer players. --------
    Set AM_AI_FilePath[5] =
    -------- Below limits each player to only one of each type of hero for the different races. --------
    -------- Race6 Demon --------
    Set AM_RaceName[6] = Demon
    Set AM_UnitType_Hero1[6] = Dreadlord
    Set AM_UnitType_Hero2[6] = Pit Lord
    Set AM_UnitType_Hero3[6] = Dreadlord
    Set AM_UnitType_Hero4[6] = Pit Lord
    Set AM_UnitType_TownhallT1[6] = Hellforge
    Set AM_UnitType_TownhallT2[6] = Hellfire Tower
    Set AM_UnitType_TownhallT3[6] = Chaos Citadel
    Set AM_UnitType_Goldmine[6] = No unit-type
    Set AM_UnitType_PrimaryWorker[6] = Peon
    Set AM_UnitType_SecondaryWorker[6] = Hellfire Spawn
    Set AM_RevealMessage[6] = You will be revealed unless you build a Hellforge
    Set AM_BuildWindow[6] = Build Hellforge
    Set AM_StartsWithBlight[6] = False
    Set AM_HallEntanglesGoldmine[6] = False
    Set AM_AI_FilePath[6] =
    -------- Race7 Naga --------
    Set AM_RaceName[7] = Naga
    Set AM_UnitType_Hero1[7] = Naga Sea Witch
    Set AM_UnitType_Hero2[7] = Naga Royal Guard
    Set AM_UnitType_Hero3[7] = Dreadsnake
    Set AM_UnitType_Hero4[7] = Mur'gul Oceanweaver
    Set AM_UnitType_TownhallT1[7] = Temple of Tides
    Set AM_UnitType_TownhallT2[7] = Sanctuary of the Depths
    Set AM_UnitType_TownhallT3[7] = Palace of Azshara
    Set AM_UnitType_Goldmine[7] = No unit-type
    Set AM_UnitType_PrimaryWorker[7] = Mur'gul Slave
    Set AM_UnitType_SecondaryWorker[7] = No unit-type
    Set AM_RevealMessage[7] = You will be revealed unless you build a Temple of the Tides
    Set AM_BuildWindow[7] = Build Temple of the Tides
    Set AM_StartsWithBlight[7] = False
    Set AM_HallEntanglesGoldmine[7] = False
    Set AM_AI_FilePath[7] =
    -------- Race8 Orc --------
    Set AM_RaceName[8] = Orc
    Set AM_UnitType_Hero1[8] = Blademaster
    Set AM_UnitType_Hero2[8] = Far Seer
    Set AM_UnitType_Hero3[8] = War Chanter
    Set AM_UnitType_Hero4[8] = Beastmaster
    Set AM_UnitType_TownhallT1[8] = Great Hall
    Set AM_UnitType_TownhallT2[8] = Stronghold
    Set AM_UnitType_TownhallT3[8] = Fortress
    Set AM_UnitType_Goldmine[8] = No unit-type
    Set AM_UnitType_PrimaryWorker[8] = Peon
    Set AM_UnitType_SecondaryWorker[8] = No unit-type
    Set AM_RevealMessage[8] = You will be revealed unless you build a Great Hall
    Set AM_BuildWindow[8] = Build Great Hall
    Set AM_StartsWithBlight[8] = False
    Set AM_HallEntanglesGoldmine[8] = False
    Set AM_AI_FilePath[8] =
    -------- Race9 Human --------
    Set AM_RaceName[9] = Human
    Set AM_UnitType_Hero1[9] = Paladin
    Set AM_UnitType_Hero2[9] = Archmage
    Set AM_UnitType_Hero3[9] = Dark Knight
    Set AM_UnitType_Hero4[9] = Admiral
    Set AM_UnitType_TownhallT1[9] = Town Hall
    Set AM_UnitType_TownhallT2[9] = Keep
    Set AM_UnitType_TownhallT3[9] = Castle
    Set AM_UnitType_Goldmine[9] = No unit-type
    Set AM_UnitType_PrimaryWorker[9] = Peasant
    Set AM_UnitType_SecondaryWorker[9] = No unit-type
    Set AM_RevealMessage[9] = You will be revealed unless you build a Town Hall
    Set AM_BuildWindow[9] = Build Town Hall
    Set AM_StartsWithBlight[9] = False
    Set AM_HallEntanglesGoldmine[9] = False
    Set AM_AI_FilePath[9] =
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player - Limit training of Heroes to 3 for (Player((Integer A)))
        -------- Limit them to one of each type of custom hero --------
        -------- Custom Heroes --------
        For each (Integer B) from 5 to AM_NumOfRaceChoices, do (Actions)
          Loop - Actions
            Player - Limit training of AM_UnitType_Hero1[(Integer B)] to 1 for (Player((Integer A)))
            Player - Limit training of AM_UnitType_Hero2[(Integer B)] to 1 for (Player((Integer A)))
            Player - Limit training of AM_UnitType_Hero3[(Integer B)] to 1 for (Player((Integer A)))
            Player - Limit training of AM_UnitType_Hero4[(Integer B)] to 1 for (Player((Integer A)))
    -------- Below automatically sets up the Dialog box for Computer players with Races that have AI --------
    Trigger - Run AlteredMeleeCreatePlayerDialog <gen> (checking conditions)
    Trigger - Turn on CreateAlteredMeleeStartingUnits <gen>
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.
Init Race Choice
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    -------- Below sets random race for players if (Use Random Race) is selected in lobby. Shows race choice dialog if not set. --------
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player((Integer A))) slot status) Equal to Is playing
            ((Player((Integer A))) controller) Equal to User
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Use random races is set) Equal to True
              Then - Actions
                Set AM_RaceChosen[(Integer A)] = (Random integer number between 1 and AM_NumOfRaceChoices)
              Else - Actions
                Dialog - Show AM_RaceDialog_PL_1 for (Player((Integer A)))
          Else - Actions
            -------- Below sets Computer player's race since no AI is included for extended races. --------
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                ((Player((Integer A))) slot status) Equal to Is playing
                ((Player((Integer A))) controller) Equal to Computer
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Use random races is set) Equal to True
                  Then - Actions
                    Set AM_RaceChosen[(Integer A)] = AM_AI_ButtonToRace[(Random integer number between 1 and AM_NumofRacesWithAI)]
                  Else - Actions
              Else - Actions
                Set AM_RaceChosen[(Integer A)] = -1
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.
AlteredMeleeCreatePlayerDialogII
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AM_NumOfRaceChoices Less than or equal to 9
      Then - Actions
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_NumOfRaceChoices Greater than or equal to 10
            AM_NumOfRaceChoices Less than or equal to 19
          Then - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
          Else - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[2] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[4] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
    Set AM_RaceButton_PL[3] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Night Elf
    Set AM_RaceButton_PL[4] = (Last created dialog Button)
    For each (Integer A) from 5 to AM_NumOfRaceChoices, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_RaceName[(Integer A)] Not equal to
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Integer A) Less than or equal to 9
              Then - Actions
                Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled AM_RaceName[(Integer A)]
                Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    AM_NumofRacesWithAI Less than or equal to 19
                  Then - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
                  Else - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
          Else - Actions
    Trigger - Run AlteredMeleeCreateComputerDialog <gen> (checking conditions)
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.
AlteredMeleeCreatePlayerDialog
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AM_NumOfRaceChoices Less than or equal to 9
      Then - Actions
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_NumOfRaceChoices Greater than or equal to 10
            AM_NumOfRaceChoices Less than or equal to 19
          Then - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
          Else - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[2] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[4] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Undead
    Set AM_RaceButton_PL[3] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Night Elf
    Set AM_RaceButton_PL[4] = (Last created dialog Button)
    For each (Integer A) from 5 to AM_NumOfRaceChoices, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_RaceName[(Integer A)] Not equal to
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Integer A) Less than or equal to 9
              Then - Actions
                Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled AM_RaceName[(Integer A)]
                Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    AM_NumofRacesWithAI Less than or equal to 19
                  Then - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
                  Else - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
          Else - Actions
    Trigger - Run AlteredMeleeCreateComputerDialog <gen> (checking conditions)
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.
AlteredMeleeCreatePlayerDialog Copy
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AM_NumOfRaceChoices Less than or equal to 9
      Then - Actions
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_NumOfRaceChoices Greater than or equal to 10
            AM_NumOfRaceChoices Less than or equal to 19
          Then - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
          Else - Actions
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Next
            Set AM_OtherButton[1] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Next
            Set AM_OtherButton[2] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Next
            Set AM_OtherButton[3] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Previous
            Set AM_OtherButton[4] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled Previous
            Set AM_OtherButton[5] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled Previous
            Set AM_OtherButton[6] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Random
    Set AM_OtherButton[7] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Human
    Set AM_RaceButton_PL[1] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Orc
    Set AM_RaceButton_PL[2] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Undead
    Set AM_RaceButton_PL[3] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled Night Elf
    Set AM_RaceButton_PL[4] = (Last created dialog Button)
    For each (Integer A) from 5 to AM_NumOfRaceChoices, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_RaceName[(Integer A)] Not equal to
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Integer A) Less than or equal to 9
              Then - Actions
                Dialog - Create a dialog button for AM_RaceDialog_PL_1 labelled AM_RaceName[(Integer A)]
                Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    AM_NumofRacesWithAI Less than or equal to 19
                  Then - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_2 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
                  Else - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_PL_3 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_PL[(Integer A)] = (Last created dialog Button)
          Else - Actions
    Trigger - Run AlteredMeleeCreateComputerDialog <gen> (checking conditions)
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.
AlteredMeleeCreateComputerDialog
  Events
  Conditions
  Actions
    -------- Below automatically sets up the Dialog box for Computer players with Races that have AI --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AM_NumofRacesWithAI Less than or equal to 9
      Then - Actions
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_NumofRacesWithAI Greater than or equal to 10
            AM_NumofRacesWithAI Less than or equal to 19
          Then - Actions
            Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Next
            Set AM_OtherButton[8] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_2 labelled Next
            Set AM_OtherButton[10] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Previous
            Set AM_OtherButton[13] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_2 labelled Previous
            Set AM_OtherButton[12] = (Last created dialog Button)
          Else - Actions
            Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Next
            Set AM_OtherButton[8] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_2 labelled Next
            Set AM_OtherButton[9] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_3 labelled Next
            Set AM_OtherButton[10] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Previous
            Set AM_OtherButton[11] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_2 labelled Previous
            Set AM_OtherButton[12] = (Last created dialog Button)
            Dialog - Create a dialog button for AM_RaceDialog_AI_3 labelled Previous
            Set AM_OtherButton[13] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Random
    Set AM_OtherButton[14] = (Last created dialog Button)
    Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Human
    Set AM_RaceButton_AI[1] = (Last created dialog Button)
    Set AM_AI_ButtonToRace[1] = 1
    Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Orc
    Set AM_RaceButton_AI[2] = (Last created dialog Button)
    Set AM_AI_ButtonToRace[2] = 2
    Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Undead
    Set AM_RaceButton_AI[3] = (Last created dialog Button)
    Set AM_AI_ButtonToRace[3] = 3
    Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled Night Elf
    Set AM_RaceButton_AI[4] = (Last created dialog Button)
    Set AM_AI_ButtonToRace[4] = 4
    Set AM_NumofRacesWithAI = 4
    For each (Integer A) from 5 to AM_NumOfRaceChoices, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AM_RaceName[(Integer A)] Not equal to
            AM_AI_FilePath[(Integer A)] Not equal to
          Then - Actions
            Set AM_NumofRacesWithAI = (AM_NumofRacesWithAI + 1)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                AM_NumofRacesWithAI Less than or equal to 9
              Then - Actions
                Dialog - Create a dialog button for AM_RaceDialog_AI_1 labelled AM_RaceName[(Integer A)]
                Set AM_RaceButton_AI[AM_NumofRacesWithAI] = (Last created dialog Button)
                Set AM_AI_ButtonToRace[AM_NumofRacesWithAI] = (Integer A)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    AM_NumofRacesWithAI Less than or equal to 19
                  Then - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_AI_2 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_AI[AM_NumofRacesWithAI] = (Last created dialog Button)
                    Set AM_AI_ButtonToRace[AM_NumofRacesWithAI] = (Integer A)
                  Else - Actions
                    Dialog - Create a dialog button for AM_RaceDialog_AI_3 labelled AM_RaceName[(Integer A)]
                    Set AM_RaceButton_AI[AM_NumofRacesWithAI] = (Last created dialog Button)
                    Set AM_AI_ButtonToRace[AM_NumofRacesWithAI] = (Integer A)
          Else - Actions
This trigger will detemine what race the player picked for themselves.


Everything in this trigger should not need to be adjusted.
RacesDialogClickDetection Player
  Events
    Dialog - A dialog button is clicked for AM_RaceDialog_PL_1
    Dialog - A dialog button is clicked for AM_RaceDialog_PL_2
    Dialog - A dialog button is clicked for AM_RaceDialog_PL_3
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to AM_OtherButton[1]
      Then - Actions
        Dialog - Show AM_RaceDialog_PL_2 for (Triggering player)
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Clicked dialog button) Equal to AM_OtherButton[2]
          Then - Actions
            Dialog - Show AM_RaceDialog_PL_3 for (Triggering player)
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Clicked dialog button) Equal to AM_OtherButton[3]
              Then - Actions
                Dialog - Show AM_RaceDialog_PL_1 for (Triggering player)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Clicked dialog button) Equal to AM_OtherButton[4]
                  Then - Actions
                    Dialog - Show AM_RaceDialog_PL_3 for (Triggering player)
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Clicked dialog button) Equal to AM_OtherButton[5]
                      Then - Actions
                        Dialog - Show AM_RaceDialog_PL_1 for (Triggering player)
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Clicked dialog button) Equal to AM_OtherButton[6]
                          Then - Actions
                            Dialog - Show AM_RaceDialog_PL_2 for (Triggering player)
                          Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                (Clicked dialog button) Equal to AM_OtherButton[7]
                              Then - Actions
                                Set AM_RaceChosen[(Player number of (Triggering player))] = (Random integer number between 1 and AM_NumOfRaceChoices)
                              Else - Actions
                                For each (Integer A) from 1 to AM_NumOfRaceChoices, do (Actions)
                                  Loop - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Clicked dialog button) Equal to AM_RaceButton_PL[(Integer A)]
                                      Then - Actions
                                        Set AM_RaceChosen[(Player number of (Triggering player))] = (Integer A)
                                      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Triggering player) Equal to Player 1 (Red)
        AM_RaceChosen[1] Not equal to 0
        (Use random races is set) Equal to False
      Then - Actions
        Custom script: call AlteredMeleeShowAIRaceDialog()
      Else - Actions
This trigger will detemine what race the player picked for the AI.


Everything in this trigger should not need to be adjusted.
RacesDialogClickDetection Computer
  Events
    Dialog - A dialog button is clicked for AM_RaceDialog_AI_1
    Dialog - A dialog button is clicked for AM_RaceDialog_AI_2
    Dialog - A dialog button is clicked for AM_RaceDialog_AI_3
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to AM_OtherButton[8]
      Then - Actions
        Dialog - Show AM_RaceDialog_AI_2 for (Triggering player)
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Clicked dialog button) Equal to AM_OtherButton[9]
          Then - Actions
            Dialog - Show AM_RaceDialog_AI_3 for (Triggering player)
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Clicked dialog button) Equal to AM_OtherButton[10]
              Then - Actions
                Dialog - Show AM_RaceDialog_AI_1 for (Triggering player)
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Clicked dialog button) Equal to AM_OtherButton[11]
                  Then - Actions
                    Dialog - Show AM_RaceDialog_AI_3 for (Triggering player)
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Clicked dialog button) Equal to AM_OtherButton[12]
                      Then - Actions
                        Dialog - Show AM_RaceDialog_AI_1 for (Triggering player)
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Clicked dialog button) Equal to AM_OtherButton[13]
                          Then - Actions
                            Dialog - Show AM_RaceDialog_AI_2 for (Triggering player)
                          Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                (Clicked dialog button) Equal to AM_OtherButton[14]
                              Then - Actions
                                Set AM_RaceChosen[AM_AI_PlayerNum] = AM_AI_ButtonToRace[(Random integer number between 1 and AM_NumofRacesWithAI)]
                                Set AM_AI_PlayerNum = 0
                                Custom script: call AlteredMeleeShowAIRaceDialog()
                              Else - Actions
                                For each (Integer A) from 1 to AM_NumofRacesWithAI, do (Actions)
                                  Loop - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Clicked dialog button) Equal to AM_RaceButton_AI[(Integer A)]
                                      Then - Actions
                                        Set AM_RaceChosen[AM_AI_PlayerNum] = AM_AI_ButtonToRace[(Integer A)]
                                        Set AM_AI_PlayerNum = 0
                                        Custom script: call AlteredMeleeShowAIRaceDialog()
                                      Else - Actions
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.
CreateAlteredMeleeStartingUnits
  Events
    Time - Every 1.00 seconds of game time
  Conditions
    AM_RaceChosen[1] Not equal to 0
    AM_RaceChosen[2] Not equal to 0
    AM_RaceChosen[3] Not equal to 0
    AM_RaceChosen[4] Not equal to 0
    AM_RaceChosen[5] Not equal to 0
    AM_RaceChosen[6] Not equal to 0
    AM_RaceChosen[7] Not equal to 0
    AM_RaceChosen[8] Not equal to 0
    AM_RaceChosen[9] Not equal to 0
    AM_RaceChosen[10] Not equal to 0
    AM_RaceChosen[11] Not equal to 0
    AM_RaceChosen[12] Not equal to 0
  Actions
    Trigger - Turn off (This trigger)
    Custom script: call AlteredMeleeStartingUnits()
    Custom script: call AlteredMeleeInitVictoryDefeat()
    Custom script: call AlteredMeleeStartingAI()
DummyInventoryDeath
  Events
    Unit - A unit Uses an item
    Unit - A unit Loses an item
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Level of Inventory (Dummy) for (Dying unit)) Equal to 1
        (Level of Inventory (Dummy) for (Hero manipulating item)) Equal to 1
  Actions
    Item - Remove (Item carried by (Dying unit) in slot 1)
    Item - Remove (Item carried by (Dying unit) in slot 2)
    Item - Remove (Item carried by (Dying unit) in slot 3)
    Item - Remove (Item carried by (Dying unit) in slot 4)
    Item - Remove (Item carried by (Dying unit) in slot 5)
    Item - Remove (Item carried by (Dying unit) in slot 6)
    Item - Remove (Item being manipulated)
Initialization2
  Events
    Map initialization
  Conditions
  Actions
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 1 (Red)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 2 (Blue)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 3 (Teal)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 4 (Purple)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 5 (Yellow)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 6 (Orange)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 7 (Green)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 8 (Pink)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 9 (Gray)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 10 (Light Blue)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 11 (Dark Green)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Player 12 (Brown)
    Player - For Neutral Extra, turn Alliance (non-aggression) On toward Neutral Hostile
    Player - For Player 1 (Red), turn Shared vision On toward Neutral Extra
    Player - For Player 2 (Blue), turn Shared vision On toward Neutral Extra
    Player - For Player 3 (Teal), turn Shared vision On toward Neutral Extra
    Player - For Player 4 (Purple), turn Shared vision On toward Neutral Extra
    Player - For Player 5 (Yellow), turn Shared vision On toward Neutral Extra
    Player - For Player 6 (Orange), turn Shared vision On toward Neutral Extra
    Player - For Player 7 (Green), turn Shared vision On toward Neutral Extra
    Player - For Player 8 (Pink), turn Shared vision On toward Neutral Extra
    Player - For Player 9 (Gray), turn Shared vision On toward Neutral Extra
    Player - For Player 10 (Light Blue), turn Shared vision On toward Neutral Extra
    Player - For Player 11 (Dark Green), turn Shared vision On toward Neutral Extra
    Player - For Player 12 (Brown), turn Shared vision On toward Neutral Extra
    Visibility - Create an initially Enabled visibility modifier for Neutral Extra emitting Visibility across (Playable map area)
    Hashtable - Create a hashtable
    Animation - Change Force Bridge 5489 <gen>'s animation speed to 200.00% of its original speed
    Animation - Change Force Bridge 5302 <gen>'s animation speed to 200.00% of its original speed
    Unit - Order Turtle 0018 <gen> to Patrol To (Center of Turtle_Patrol <gen>)
    Unit - Order Turtle 0015 <gen> to Attack Ground (Center of Turtle_Attack_1 <gen>)
    Unit - Order Turtle 0017 <gen> to Attack Ground (Center of Turtle_Attack_2 <gen>)
    Unit - Order Turtle 0016 <gen> to Attack Ground (Center of Turtle_Attack_3 <gen>)
    Unit - Order 0025 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0024 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0028 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0027 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0014 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0023 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0019 <gen> to Attack Ground (Center of Blue_Spider_attack <gen>)
    Unit - Order 0041 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0040 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0039 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0049 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0048 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0047 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0046 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0045 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0044 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0043 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0042 <gen> to Attack Ground (Center of Ant_attack <gen>)
    Unit - Order 0053 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0054 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0055 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0051 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0052 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0056 <gen> to Patrol To (Center of Ant_Patrol_1 <gen>)
    Unit - Order 0061 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order 0060 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order 0059 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order 0058 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order 0057 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order 0050 <gen> to Patrol To (Center of Ant_Patrol_2 <gen>)
    Unit - Order Rat 0065 <gen> to Patrol To (Center of Rat_Patrol_1 <gen>)
    Unit - Order Rat 0069 <gen> to Patrol To (Center of Rat_Patrol_1 <gen>)
    Unit - Order Rat 0068 <gen> to Patrol To (Center of Rat_Patrol_1 <gen>)
    Unit - Order Rat 0067 <gen> to Patrol To (Center of Rat_Patrol_1 <gen>)
    Unit - Order Rat 0064 <gen> to Patrol To (Center of Rat_Patrol_2 <gen>)
    Unit - Order Rat 0030 <gen> to Patrol To (Center of Rat_Patrol_2 <gen>)
    Unit - Order Rat 0063 <gen> to Patrol To (Center of Rat_Patrol_2 <gen>)
    Unit - Order Mini Water 0157 <gen> to Attack Ground (Center of WaterElementalAttack <gen>)
    Unit - Order Mini Water 0176 <gen> to Attack Ground (Center of WaterElementalAttack <gen>)
    Unit - Order Mini Water 0177 <gen> to Attack Ground (Center of WaterElementalAttack <gen>)
    Unit - Order Mini Frost 0125 <gen> to Attack Ground (Center of FrostAtt <gen>)
    Unit - Order Mini Frost 0124 <gen> to Attack Ground (Center of ForstAtt2 <gen>)
    Unit - Order Mini Frost 0123 <gen> to Attack Ground (Center of FrostAtt3 <gen>)
    Unit - Order Mini Frost 0235 <gen> to Attack Ground (Center of FrostAtt4 <gen>)
    Unit - Order Mini Lava 0236 <gen> to Attack Ground (Center of FireAtt1 <gen>)
    Set Temp_Group = (Units of type RelicBox)
    Unit Group - Pick every unit in Temp_Group and do (Actions)
      Loop - Actions
        Animation - Change (Picked unit)'s vertex coloring to (100%, 100%, 0.00%) with 35.00% transparency
    Custom script: call DestroyGroup (udg_Temp_Group)
    Animation - Change Undead Heroes 0418 <gen>'s vertex coloring to (100%, 100%, 100%) with 45.00% transparency
    Animation - Change Human Heroes 0420 <gen>'s vertex coloring to (100%, 100%, 100%) with 45.00% transparency
    Animation - Change Night Elf Heroes 0422 <gen>'s vertex coloring to (100%, 100%, 100%) with 45.00% transparency
    Animation - Change Orc Heroes 0421 <gen>'s vertex coloring to (100%, 100%, 100%) with 45.00% transparency
    Player - Set the current research level of R02T (techcode) to 3 for Neutral Hostile
    Player - Set the current research level of R02R (techcode) to 3 for Neutral Hostile
    Player - Set the current research level of R02S (techcode) to 1 for Neutral Hostile
    Player - Set the current research level of R02Q (techcode) to 2 for Neutral Hostile
    Player - Set the current research level of R01X (techcode) to 1 for Neutral Hostile
    Player - Set the current research level of R01U (techcode) to 3 for Neutral Hostile
    Player - Set the current research level of R01V (techcode) to 3 for Neutral Hostile
    Player - Set the current research level of R01W (techcode) to 2 for Neutral Hostile
    Set LightflyGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to D-Attacker Deathwinter))
    Wait 3.00 seconds
    Trigger - Run Solarium_Active <gen> (ignoring conditions)
    Trigger - Run Moonlight_Disabled <gen> (ignoring conditions)
    Trigger - Run ItemInMapRegulation <gen> (ignoring conditions)
    Unit Group - Add Skeleton Warrior 0076 <gen> to CCamp1
    Unit Group - Add Skeleton Warrior 0029 <gen> to CCamp1
    Unit Group - Add Fallen Priest 0009 <gen> to CCamp1
    Unit Group - Add Fallen Priest 0010 <gen> to CCamp1
    Unit Group - Add Skeletal Marksman 0011 <gen> to CCamp1
    Unit Group - Add Skeletal Marksman 0013 <gen> to CCamp1
    Unit Group - Add Skeleton Warrior 0079 <gen> to CCamp2
    Unit Group - Add Skeletal Orc 0084 <gen> to CCamp2
    Unit Group - Add Skeletal Orc 0137 <gen> to CCamp2
    Unit Group - Add Skeleton Warrior 0138 <gen> to CCamp2
    Unit Group - Add Skeleton Archer 0136 <gen> to CCamp2
    Unit Group - Add Skeleton Archer 0086 <gen> to CCamp2
    Unit Group - Add Frost Treant 0161 <gen> to CCamp3
    Unit Group - Add Frost Treant 0160 <gen> to CCamp3
    Unit Group - Add Satyr Trickster 0164 <gen> to CCamp3
    Unit Group - Add Satyr Trickster 0162 <gen> to CCamp3
    Unit Group - Add Satyr Shadowdancer 0165 <gen> to CCamp3
    Unit Group - Add Satyr Shadowdancer 0163 <gen> to CCamp3
    Unit Group - Add Troll Darksinger 0139 <gen> to CCamp4
    Unit Group - Add Troll Darksinger 0140 <gen> to CCamp4
    Unit Group - Add Troll Shadeslicer 0141 <gen> to CCamp4
    Unit Group - Add Troll Shadeslicer 0142 <gen> to CCamp4
    Unit Group - Add Spider 0145 <gen> to CCamp4
    Unit Group - Add Spider 0144 <gen> to CCamp4
    Unit Group - Add Blue Dragonspawn Meddler 0355 <gen> to CCamp5
    Unit Group - Add Blue Dragonspawn Meddler 0225 <gen> to CCamp5
    Unit Group - Add Turtle Hatchling 0356 <gen> to CCamp5
    Unit Group - Add Turtle Hatchling 0357 <gen> to CCamp5
    Unit Group - Add Frost Treant 0303 <gen> to CCamp5
    Unit Group - Add Frost Treant 0304 <gen> to CCamp5
    Unit Group - Add Burning Archer 0395 <gen> to CCamp6
    Unit Group - Add Burning Archer 0396 <gen> to CCamp6
    Unit Group - Add Skeleton Archer 0300 <gen> to CCamp6
    Unit Group - Add Skeleton Archer 0301 <gen> to CCamp6
    Unit Group - Add Skeleton Warrior 0394 <gen> to CCamp6
    Unit Group - Add Skeleton Warrior 0308 <gen> to CCamp6
    Unit Group - Add Frost Treant 0338 <gen> to CCamp7
    Unit Group - Add Frost Treant 0425 <gen> to CCamp7
    Unit Group - Add Mammoth 0334 <gen> to CCamp7
    Unit Group - Add Mammoth 0337 <gen> to CCamp7
    Unit Group - Add Turtle Hatchling 0751 <gen> to CCamp7
    Unit Group - Add Turtle Hatchling 0423 <gen> to CCamp7
    Unit Group - Add Troll Darksinger 0411 <gen> to CCamp8
    Unit Group - Add Troll Darksinger 0412 <gen> to CCamp8
    Unit Group - Add Troll Shadeslicer 0405 <gen> to CCamp8
    Unit Group - Add Troll Shadeslicer 0416 <gen> to CCamp8
    Unit Group - Add Spider 0417 <gen> to CCamp8
    Unit Group - Add Spider 0419 <gen> to CCamp8
    Unit Group - Add Ghost 0191 <gen> to CCamp9
    Unit Group - Add Ghost 0190 <gen> to CCamp9
    Unit Group - Add Satyr Trickster 0397 <gen> to CCamp9
    Unit Group - Add Satyr Trickster 0192 <gen> to CCamp9
    Unit Group - Add Frost Treant 0414 <gen> to CCamp9
    Unit Group - Add Frost Treant 0413 <gen> to CCamp9
    Unit Group - Add Reef Elemental 0151 <gen> to CCamp10
    Unit Group - Add Reef Elemental 0150 <gen> to CCamp10
    Unit Group - Add Revenant of the Tides 0156 <gen> to CCamp10
    Unit Group - Add Revenant of the Tides 0386 <gen> to CCamp10
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 50
        Player - Turn Gives bounty On for (Picked player)
    Unit - Turn collision for Turtle 0241 <gen> On
    Unit - Turn collision for Turtle 0537 <gen> On
    Unit - Turn collision for Turtle 0752 <gen> On
    Unit - Turn collision for Turtle 0753 <gen> On
    Unit - Turn collision for Trilobite 0757 <gen> On
    Unit - Turn collision for Trilobite 0758 <gen> On
    Unit - Turn collision for Trilobite 0760 <gen> On
    Unit - Turn collision for Trilobite 0759 <gen> On
    Unit - Turn collision for Trilobite 0761 <gen> On
    Unit - Turn collision for Trilobite 0762 <gen> On
    Unit - Turn collision for Trilobite 0763 <gen> On
    Unit - Turn collision for Trilobite 0764 <gen> On
    Unit - Turn collision for Trilobite 0765 <gen> On
    Unit - Turn collision for Trilobite 0766 <gen> On
    Custom script: call DestroyTrigger( GetTriggeringTrigger() )
GameTimeEvents
  Events
    Map initialization
  Conditions
  Actions
    Wait 15.00 game-time seconds
    Melee Game - Enforce victory/defeat conditions (for all players)
    Game - Display to (All players) the text: You may use the commands -SPR (no-hero unit supression), -MS (movespeed consult)-CRITTSOFF (Player 1 command, removes critters) -TEST (Tester commands, must be used by player 1)...
    Wait 45.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 50. (Food Cap increases as game goes)Up to a 200 Food Cap!!!NEXT INCREASE IN: 14 minutes (75 food)RELICS will be UNBLOCKED in 9 minutes.
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        TestTurn Equal to 0
      Then - Actions
        Trigger - Turn off Test <gen>
        Game - Display to (All players) the text: Test command disabled.
      Else - Actions
        Do nothing
    Wait 840.00 game-time seconds
    Quest - Display to (All players) the Hint message: RELIC BOXES UNBLOCKED!
    Set Temp_Group = (Units of type RelicBox)
    Unit Group - Pick every unit in Temp_Group and do (Actions)
      Loop - Actions
        Unit - Remove Invulnerable (Neutral) from (Picked unit)
    Custom script: call DestroyGroup (udg_Temp_Group)
    Set Temp_Group = (Units of type RelicAura1)
    Unit Group - Pick every unit in Temp_Group and do (Actions)
      Loop - Actions
        Unit - Remove Invulnerable (Neutral) from (Picked unit)
    Wait 300.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 75. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (100 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 75
    Wait 600.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 100. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 30 minutes (120 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 100
    Wait 900.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 120. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (140 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 120
    Wait 900.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 140. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (160 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 140
    Wait 900.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 160. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (180 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 160
    Wait 900.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 160. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (180 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 180
    Wait 900.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 160. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (180 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 200
    Wait 600.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 160. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (180 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 225
    Wait 600.00 game-time seconds
    Quest - Display to (All players) the Hint message: Your Food Cap is set to 160. Food Cap increases as game goes.Up to a 200 Food Cap!!!NEXT INCREASE IN: 15 minutes (180 food)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player) Food max to 250
Beetles
  Events
    Time - Every 1.10 seconds of game time
  Conditions
  Actions
    Animation - Play Force Bridge 5302 <gen>'s birth animation
    Animation - Play Force Bridge 5489 <gen>'s birth animation
    Unit - Order 0155 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0285 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0263 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0146 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0148 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0159 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0158 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0149 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0147 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0153 <gen> to Undead Crypt Fiend - Unburrow
    Wait 1.00 seconds
    Unit - Order 0155 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0285 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0263 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0146 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0148 <gen> to Undead Crypt Fiend - Unburrow
    Unit - Order 0159 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0158 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0149 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0147 <gen> to Undead Crypt Fiend - Burrow
    Unit - Order 0153 <gen> to Undead Crypt Fiend - Burrow
NB areas
  Events
    Unit - A unit Begins construction
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (NoCastNobuid1 <gen> contains (Constructing structure)) Equal to True
        (NcNb2 <gen> contains (Constructing structure)) Equal to True
        (NcNb3 <gen> contains (Constructing structure)) Equal to True
        (NcNb4 <gen> contains (Constructing structure)) Equal to True
        (NcNb5 <gen> contains (Constructing structure)) Equal to True
        (NcNb6 <gen> contains (Constructing structure)) Equal to True
        (NcNb7 <gen> contains (Constructing structure)) Equal to True
        (NcNb8 <gen> contains (Constructing structure)) Equal to True
        (NcNb9 <gen> contains (Constructing structure)) Equal to True
  Actions
    Unit - Kill (Constructing structure)
ObelisksTP
  Events
    Unit - A unit Sells a unit
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Selling unit) Equal to Summoning Obelisk 0350 <gen>
        (Selling unit) Equal to Summoning Obelisk 0309 <gen>
        (Selling unit) Equal to Summoning Obelisk 0339 <gen>
        (Selling unit) Equal to Summoning Obelisk 0353 <gen>
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Selling unit) Equal to Summoning Obelisk 0350 <gen>
      Then - Actions
        Set Temp_Point = (Position of Summoning Obelisk 0352 <gen>)
        Unit - Remove (Sold unit) from the game
        Unit - Create 1 Dummy Summoner for (Owner of (Buying unit)) at Temp_Point facing Default building facing degrees
        Unit - Order (Last created unit) to Special - Dark Summoning (Position of (Selling unit))
        Custom script: call RemoveLocation (udg_Temp_Point)
      Else - Actions
        Do nothing
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Selling unit) Equal to Summoning Obelisk 0309 <gen>
      Then - Actions
        Set Temp_Point = (Position of Summoning Obelisk 0352 <gen>)
        Unit - Remove (Sold unit) from the game
        Unit - Create 1 Dummy Summoner for (Owner of (Buying unit)) at Temp_Point facing Default building facing degrees
        Unit - Order (Last created unit) to Special - Dark Summoning (Position of (Selling unit))
        Custom script: call RemoveLocation (udg_Temp_Point)
      Else - Actions
        Do nothing
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Selling unit) Equal to Summoning Obelisk 0339 <gen>
      Then - Actions
        Set Temp_Point = (Position of Summoning Obelisk 0305 <gen>)
        Unit - Remove (Sold unit) from the game
        Unit - Create 1 Dummy Summoner for (Owner of (Buying unit)) at Temp_Point facing Default building facing degrees
        Unit - Order (Last created unit) to Special - Dark Summoning (Position of (Selling unit))
        Custom script: call RemoveLocation (udg_Temp_Point)
      Else - Actions
        Do nothing
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Selling unit) Equal to Summoning Obelisk 0353 <gen>
      Then - Actions
        Set Temp_Point = (Position of Summoning Obelisk 0305 <gen>)
        Unit - Remove (Sold unit) from the game
        Unit - Create 1 Dummy Summoner for (Owner of (Buying unit)) at Temp_Point facing Default building facing degrees
        Unit - Order (Last created unit) to Special - Dark Summoning (Position of (Selling unit))
        Custom script: call RemoveLocation (udg_Temp_Point)
      Else - Actions
        Do nothing
CenterTeleport II
  Events
    Unit - A unit Finishes casting an ability
    Unit - A unit Stops casting an ability
  Conditions
    (Ability being cast) Equal to Dark Summoning (center)
  Actions
    Unit - Remove (Casting unit) from the game
    Unit - Remove (Casting unit) from the game
RevivedHeroManaRestore
  Events
    Unit - A unit Finishes reviving
  Conditions
  Actions
    Unit - Set mana of (Reviving Hero) to (Max mana of (Reviving Hero))
BaseCommands
  Events
    Player - Player 1 (Red) types a chat message containing -SPR as An exact match
    Player - Player 2 (Blue) types a chat message containing -SPR as An exact match
    Player - Player 3 (Teal) types a chat message containing -SPR as An exact match
    Player - Player 4 (Purple) types a chat message containing -SPR as An exact match
    Player - Player 5 (Yellow) types a chat message containing -SPR as An exact match
    Player - Player 6 (Orange) types a chat message containing -SPR as An exact match
    Player - Player 7 (Green) types a chat message containing -SPR as An exact match
    Player - Player 8 (Pink) types a chat message containing -SPR as An exact match
    Player - Player 9 (Gray) types a chat message containing -SPR as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -SPR as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -SPR as An exact match
    Player - Player 12 (Brown) types a chat message containing -SPR as An exact match
    Player - Player 1 (Red) types a chat message containing -MS as An exact match
    Player - Player 2 (Blue) types a chat message containing -MS as An exact match
    Player - Player 3 (Teal) types a chat message containing -MS as An exact match
    Player - Player 4 (Purple) types a chat message containing -MS as An exact match
    Player - Player 5 (Yellow) types a chat message containing -MS as An exact match
    Player - Player 6 (Orange) types a chat message containing -MS as An exact match
    Player - Player 7 (Green) types a chat message containing -MS as An exact match
    Player - Player 8 (Pink) types a chat message containing -MS as An exact match
    Player - Player 9 (Gray) types a chat message containing -MS as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -MS as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -MS as An exact match
    Player - Player 12 (Brown) types a chat message containing -MS as An exact match
    Player - Player 1 (Red) types a chat message containing -CRITTSOFF as An exact match
  Conditions
  Actions
    -------- MovementSpeedConsult --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -ms
            (Entered chat string) Equal to -MS
      Then - Actions
        Set Temp_Group = (Units currently selected by (Triggering player))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Real((Number of units in Temp_Group))) Equal to 1.00
              Then - Actions
                Set Temp_PlayerGroup = (All players matching ((Matching player) Equal to (Triggering player)))
                Game - Display to Temp_PlayerGroup for 5.00 seconds the text: ((Movement speed of + (Name of (Picked unit))) + ( equal to + (String((Abs((Integer((Current movement speed of (Picked unit))))))))))
              Else - Actions
                Do nothing
      Else - Actions
        Do nothing
    Custom script: call DestroyGroup (udg_Temp_Group)
    -------- Supress --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -SPR
            (Entered chat string) Equal to -spr
      Then - Actions
        Set Temp_Group = (Units currently selected by (Triggering player))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Or - Any (Conditions) are true
                  Conditions
                    ((Picked unit) is A Hero) Equal to True
                    (Owner of (Picked unit)) Not equal to (Triggering player)
              Then - Actions
                Unit Group - Remove (Picked unit) from Temp_Group
              Else - Actions
                Unit - Kill (Picked unit)
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- CritterRemotion --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Triggering player) Equal to Player 1 (Red)
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -CRITTSOFF
            (Entered chat string) Equal to -critsoff
      Then - Actions
        Game - Display to (All players) the text: Critters Removed!
        Set Temp_Group = (Units owned by Neutral Passive of type Ant (Critter))
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Beetle)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Black Spider)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type BlackOwl (Critter))
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Blue Spider)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type BurrowedBeetle)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Green Spider)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Ancient (Critter))
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Mini Frost)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Mini Lava)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Mini Water)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Trilobite)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Turtle)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Turtle float)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Frog)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Rat)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Neutral Passive of type Spirit Owl)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Set Temp_Group = (Units owned by Player 11 (Dark Green) of type Trilobite)
        Unit Group - Add all units of Temp_Group to CritterOffGroup
        Unit Group - Pick every unit in CritterOffGroup and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
TesterCommands
  Events
    Player - Player 1 (Red) types a chat message containing -Repick as An exact match
    Player - Player 2 (Blue) types a chat message containing -Repick as An exact match
    Player - Player 3 (Teal) types a chat message containing -Repick as An exact match
    Player - Player 4 (Purple) types a chat message containing -Repick as An exact match
    Player - Player 5 (Yellow) types a chat message containing -Repick as An exact match
    Player - Player 6 (Orange) types a chat message containing -Repick as An exact match
    Player - Player 7 (Green) types a chat message containing -Repick as An exact match
    Player - Player 8 (Pink) types a chat message containing -Repick as An exact match
    Player - Player 9 (Gray) types a chat message containing -Repick as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -Repick as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -Repick as An exact match
    Player - Player 12 (Brown) types a chat message containing -Repick as An exact match
    Player - Player 1 (Red) types a chat message containing -LVLUP as An exact match
    Player - Player 2 (Blue) types a chat message containing -LVLUP as An exact match
    Player - Player 3 (Teal) types a chat message containing -LVLUP as An exact match
    Player - Player 4 (Purple) types a chat message containing -LVLUP as An exact match
    Player - Player 5 (Yellow) types a chat message containing -LVLUP as An exact match
    Player - Player 6 (Orange) types a chat message containing -LVLUP as An exact match
    Player - Player 7 (Green) types a chat message containing -LVLUP as An exact match
    Player - Player 8 (Pink) types a chat message containing -LVLUP as An exact match
    Player - Player 9 (Gray) types a chat message containing -LVLUP as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -LVLUP as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -LVLUP as An exact match
    Player - Player 12 (Brown) types a chat message containing -LVLUP as An exact match
    Player - Player 1 (Red) types a chat message containing -greed as An exact match
    Player - Player 2 (Blue) types a chat message containing -greed as An exact match
    Player - Player 3 (Teal) types a chat message containing -greed as An exact match
    Player - Player 4 (Purple) types a chat message containing -greed as An exact match
    Player - Player 5 (Yellow) types a chat message containing -greed as An exact match
    Player - Player 6 (Orange) types a chat message containing -greed as An exact match
    Player - Player 7 (Green) types a chat message containing -greed as An exact match
    Player - Player 8 (Pink) types a chat message containing -greed as An exact match
    Player - Player 9 (Gray) types a chat message containing -greed as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -greed as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -greed as An exact match
    Player - Player 12 (Brown) types a chat message containing -greed as An exact match
    Player - Player 1 (Red) types a chat message containing -REFRESH as An exact match
    Player - Player 2 (Blue) types a chat message containing -REFRESH as An exact match
    Player - Player 3 (Teal) types a chat message containing -REFRESH as An exact match
    Player - Player 4 (Purple) types a chat message containing -REFRESH as An exact match
    Player - Player 5 (Yellow) types a chat message containing -REFRESH as An exact match
    Player - Player 6 (Orange) types a chat message containing -REFRESH as An exact match
    Player - Player 7 (Green) types a chat message containing -REFRESH as An exact match
    Player - Player 8 (Pink) types a chat message containing -REFRESH as An exact match
    Player - Player 9 (Gray) types a chat message containing -REFRESH as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -REFRESH as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -REFRESH as An exact match
    Player - Player 12 (Brown) types a chat message containing -REFRESH as An exact match
    Player - Player 1 (Red) types a chat message containing -REVIVE as An exact match
    Player - Player 2 (Blue) types a chat message containing -REVIVE as An exact match
    Player - Player 3 (Teal) types a chat message containing -REVIVE as An exact match
    Player - Player 4 (Purple) types a chat message containing -REVIVE as An exact match
    Player - Player 5 (Yellow) types a chat message containing -REVIVE as An exact match
    Player - Player 6 (Orange) types a chat message containing -REVIVE as An exact match
    Player - Player 7 (Green) types a chat message containing -REVIVE as An exact match
    Player - Player 8 (Pink) types a chat message containing -REVIVE as An exact match
    Player - Player 9 (Gray) types a chat message containing -REVIVE as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -REVIVE as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -REVIVE as An exact match
    Player - Player 12 (Brown) types a chat message containing -REVIVE as An exact match
    Player - Player 1 (Red) types a chat message containing -SUMMON as An exact match
    Player - Player 2 (Blue) types a chat message containing -SUMMON as An exact match
    Player - Player 3 (Teal) types a chat message containing -SUMMON as An exact match
    Player - Player 4 (Purple) types a chat message containing -SUMMON as An exact match
    Player - Player 5 (Yellow) types a chat message containing -SUMMON as An exact match
    Player - Player 6 (Orange) types a chat message containing -SUMMON as An exact match
    Player - Player 7 (Green) types a chat message containing -SUMMON as An exact match
    Player - Player 8 (Pink) types a chat message containing -SUMMON as An exact match
    Player - Player 9 (Gray) types a chat message containing -SUMMON as An exact match
    Player - Player 10 (Light Blue) types a chat message containing -SUMMON as An exact match
    Player - Player 11 (Dark Green) types a chat message containing -SUMMON as An exact match
    Player - Player 12 (Brown) types a chat message containing -SUMMON as An exact match
  Conditions
  Actions
    -------- Repick --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -REPICK
            (Entered chat string) Equal to -repick
            (Entered chat string) Equal to -Repick
      Then - Actions
        Set Temp_Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
            Player - Limit training of Heroes to 1000 for (Triggering player)
            Player - Limit training of Heroes to 1 for (Triggering player)
            Player - Set (Triggering player) Available free Heroes to 1
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Current research level of R01T (techcode) for (Triggering player)) Greater than or equal to 1
              Then - Actions
                Do nothing
              Else - Actions
                Player - Set the current research level of R01T (techcode) to 1 for (Triggering player)
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- LVLUP --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -LVLUP
            (Entered chat string) Equal to -lvlup
            (Entered chat string) Equal to -Lvlup
      Then - Actions
        Set Temp_Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            Hero - Set (Picked unit) Hero-level to 10, Show level-up graphics
            Floating Text - Create floating text that reads LVLUP! above (Picked unit) with Z offset 0, using font size 7.00, color (100%, 80.00%, 0.00%), and 0% transparency
            Floating Text - Set the velocity of (Last created floating text) to ((Random real number between 0.10 and 0.15) x 1000.00) towards 75.00 degrees
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- Revive --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -revive
            (Entered chat string) Equal to -REVIVE
            (Entered chat string) Equal to -Revive
      Then - Actions
        Set Temp_Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                ((Picked unit) is dead) Equal to True
              Then - Actions
                Set Temp_Point = (Target of current camera view)
                Hero - Instantly revive (Picked unit) at Temp_Point, Show revival graphics
                Floating Text - Create floating text that reads Revived! above (Picked unit) with Z offset 0, using font size 7.00, color (100%, 80.00%, 0.00%), and 0% transparency
                Floating Text - Set the velocity of (Last created floating text) to ((Random real number between 0.10 and 0.15) x 1000.00) towards 75.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                Custom script: call RemoveLocation (udg_Temp_Point)
              Else - Actions
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- Summon --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -SUMMON
            (Entered chat string) Equal to -summon
            (Entered chat string) Equal to -Summon
      Then - Actions
        Set Temp_Group = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
        Set Temp_Point = (Target of current camera view)
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            Unit - Move (Picked unit) instantly to Temp_Point
            Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Summoned! above (Picked unit) with Z offset 0, using font size 7.00, color (100%, 80.00%, 0.00%), and 0% transparency
            Floating Text - Set the velocity of (Last created floating text) to ((Random real number between 0.10 and 0.15) x 1000.00) towards 75.00 degrees
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
        Custom script: call RemoveLocation (udg_Temp_Point)
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- Refresh --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -refresh
            (Entered chat string) Equal to -REFRESH
      Then - Actions
        Set Temp_Group = (Units owned by (Triggering player))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
          Loop - Actions
            Unit - Set life of (Picked unit) to (Max life of (Picked unit))
            Unit - Set mana of (Picked unit) to (Max mana of (Picked unit))
            Unit - Reset ability cooldowns for (Picked unit)
            Unit - Remove Negative buffs considered Magic or physical from (Picked unit) (Include expiration timers, Include auras)
            Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
            Special Effect - Destroy (Last created special effect)
            Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
            Special Effect - Destroy (Last created special effect)
            Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\ReplenishMana\SpiritTouchTarget.mdl
            Special Effect - Destroy (Last created special effect)
            Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\ReplenishMana\SpiritTouchTarget.mdl
            Special Effect - Destroy (Last created special effect)
            Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
            Special Effect - Destroy (Last created special effect)
            Floating Text - Create floating text that reads Refresh! above (Picked unit) with Z offset 0, using font size 7.00, color (100%, 80.00%, 0.00%), and 0% transparency
            Floating Text - Set the velocity of (Last created floating text) to ((Random real number between 0.10 and 0.15) x 1000.00) towards 75.00 degrees
            Floating Text - Change (Last created floating text): Disable permanence
            Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
        Custom script: call DestroyGroup (udg_Temp_Group)
      Else - Actions
        Do nothing
    -------- Greed --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Entered chat string) Equal to -greed
            (Entered chat string) Equal to -GREED
      Then - Actions
        Player - Set (Triggering player) Food max to 300
        Player - Set (Triggering player) Current gold to 100000000
        Player - Set (Triggering player) Current lumber to 100000000
      Else - Actions
        Do nothing
Test
  Events
    Player - Player 1 (Red) types a chat message containing -TEST as An exact match
  Conditions
  Actions
    Set TestTurn = 1
    Trigger - Turn on TesterCommands <gen>
    Game - Display to (All players) the text: You may use the commands -REPICK (hero repick), -LVLUP (sets heroes to max lvl) -Greed (max food, lumber and gold), -REVIVE (revives dead heroes), -REFRESH (total heal and cd restore), -SUMMON (summons heroes to the location of the player screen)...
CreepCamp1
  Events
    Time - Every 30.00 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in CCamp1 and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            Or - Any (Conditions) are true
              Conditions
                ((Picked unit) is dead) Equal to True
                (Owner of (Picked unit)) Not equal to Neutral Hostile
          Then - Actions
            Unit Group - Remove (Picked unit) from CCamp1
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Real((Number of units in CCamp1))) Equal to 0.00
      Then - Actions
        Set RandomRealValue = (Random real number between 0.01 and 0.04)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            RandomRealValue Equal to 0.01
          Then - Actions
            Set Temp_Point = (Center of cc1c5 <gen>)
            Unit - Create 1 Mammoth for Neutral Hostile at Temp_Point facing 180.00 degrees
            Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
            Special Effect - Destroy (Last created special effect)
            Unit - Set (Last created unit) acquisition range to 300.00
            Unit Group - Add (Last created unit) to CCamp1
            Unit Group - Add (Last created unit) to CreepCampslvl1
            Custom script: call RemoveLocation (udg_Temp_Point)
            Set Temp_Point = (Center of cc1c6 <gen>)
            Unit - Create 1 Mammoth for Neutral Hostile at Temp_Point facing 180.00 degrees
            Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
            Special Effect - Destroy (Last created special effect)
            Unit - Set (Last created unit) acquisition range to 300.00
            Unit Group - Add (Last created unit) to CCamp1
            Unit Group - Add (Last created unit) to CreepCampslvl1
            Custom script: call RemoveLocation (udg_Temp_Point)
            Set Temp_Point = (Center of cc1c1 <gen>)
            Unit - Create 1 Winter Lizard for Neutral Hostile at Temp_Point facing 180.00 degrees
            Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
            Special Effect - Destroy (Last created special effect)
            Unit - Set (Last created unit) acquisition range to 300.00
            Unit Group - Add (Last created unit) to CCamp1
            Custom script: call RemoveLocation (udg_Temp_Point)
            Set Temp_Point = (Center of cc1c2 <gen>)
            Unit - Create 1 Winter Lizard for Neutral Hostile at Temp_Point facing 180.00 degrees
            Special Effect - Create a special effect attached to the origin of (Last created unit) using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
            Special Effect - Destroy (Last created special effect)
            Unit - Set (Last created unit) acquisition range to 300.00
            Unit Group - Add (Last created unit) to CCamp1
            Custom script: call RemoveLocation (udg_Temp_Point)