1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  3. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. 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

FormationDefenseBetav0.9.w3x
Variables
Starting Things
Remove Starters
Quest with Changes
Visibility
Grouping
Set Stuff
Set Tips
Range Aliiances
Dialogs
Difficulty Votes
Formation Votes
Choosing Leaders
Random Leader
More Leaders
Chosen Leader
Building and Losing
Buy Units
Refresh Stores
Fletchers
Blacksmiths
Workers
Mage Rep
Magic Upgrades
Unit Death
Tutorial
Tutorial 1
Tutorial 2
Multiboard
Create Multiboard
Multiboard Refresh
Players Leave
Formations
Reassign
FourRowNW
WedgeNW
Box NW
FourRowNE
WedgeNE
Box NE
FourRowSW
WedgeSW
Box SW
FourRowSE
WedgeSE
Box SE
Box Benefits
Wedge Benefits
Additional Formations
Archers Retreat
Archers Advance
Archers Regroup
Cavalry Retreat
Cavalry Charge
Cavalry Regroup
Trample
Spawns
Start Timer
Set Assorted Types
Set Unit Spawn Info
Set TD Spawn Info
Bounty
Spawn
TD Spawn
Villager Spawn
NW Diff
NE Diff
SW Diff
SE Diff
Path Ends
Red Villages
Blue Villages
Teal Villages
Purple Villages
Movement
NW TD 2
NW Unit 1
NW Unit 2
NE TD 2
NE Unit 1
NE Unit 2
SW TD 2
SW Unit 1
SW Unit 2
SE TD 2
SE Unit 1
SE Unit 2
Unit Upgrades
Servant Entry
Militia
Gnoll Maceman
Axeman
Golbin Shredder
Footman
Pikeman
Rock Thrower
Webspinner
Archer
Troll Berserker
Longbowman
Tauren Spirit Walker
Skirmisher
Musketman
Mount Entry
Mounted Mage
Huntress
Archmage
Kodo Beast Rider
Cavalier
Wolf Rider
Knight
Dragonhawk Rider
Centaur Marauder
Priest Entry
Cleric
Field Medic
Surgeon
Necromancer
Building Upgrades
Scout Tower Prep
Voodoo Tower Prep
Shelter
Serpent Ward
Refuge
Totem
Minaret
Cannon Tower
Guard Tower
Keep
Siege Tank
Ballista
Mangonel
Obsidian Destroyer
Onager
Trebuchet
Sanctuary Prep
Bastion
Bunker
Turret
Oil and Frost Prep
Burning Oil
Leader Abilities
Regeneration
Regeneration Loop
Merciless
Two Strikes
Night Vision
Night Vision 2
Big Bad Voodoo
Promote
Hammer of Fate
Mechanized Joints
Absorb
Daze
Spirit of the Hive
Unit Abilities
Leader Archer Activate
Leader Infantry Activate
Miracle Hurt
Miracle Help
Healing Wave
Thunder Flail 1
Thunder Flail 2
Axe Toss Level 1
Axe Toss Level 2
AntiAir Missiles
AntiPer Missiles
Wall of Steel
Horizontal Slice 1
Horizontal Slice 2
Horizontal Slice 3
Caltrop
Grenado 1
Grenado 2
Cavalry Abilities
Leader Cav Activate
Consume
Shock
Shock 2
Building Abilities
Detonate
Deconstruct
Obby Tower Anims
Cripple
Refuge Leaving
Oil Slick
GryZigStart
Mage Enchantments
Disenchant
Fire
Ice
Ice 2
Lightning
Lightning 2
Water
Poison
Poison 2
Smoke
Smoke 2
Ability Upgrades
GoldLumber Merge
Dismember
Dismember 2
Mercenary Upgrades
Mercenary Build Refresh
Goblin Bombers
Gnoll Crossbowman
Spectral Phantom
Tauren Underling
Shaman
Blood Elf Outcast
Centaurian Brute
Nerubian Scorper
Lordaeron Pirate
Dwarven Chopper
Mountain Giant
Ninja
Mercenary Abilities
Dismiss
All Mercs
Leader Merc Acvtivate
SelfDestruct
SelfDestruct2
Activate MultiShot
MultiShot
Sunder
Sunder 2
Poison Shower
Spoils of War
Titanic Strength Activate
Titanic Strength Attack
Titanic Strength Loop
Ceramic Grenade
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.

		
Name Type Is Array Initial Value
Absorb_Group group No
Absorb_Group2 group No
Absorbed_Real real No
Add_Formation_Ints integer Yes
Add_Formation_Points location Yes
Archer_Abi_Points location Yes
Archer_Abi_Possible_Targets group No
Archer_Positions integer Yes
Archer_Upgrade_Group group No
Assorted_Boolean boolean No
Assorted_Population_Caps integer Yes
Assorted_Temp_Int integer No
Assorted_Types unitcode Yes
Axe_Hit_Group group Yes
Blacksmith_Group group No
Blood_Elf_Player player No
Blood_Elf_Point location No
Box_Boolean boolean Yes
Caltrop_Group group No
Caltrop_Point location No
Cavalry_Abi_Points location Yes
Cavalry_Abi_Possible_Targets group No
Cavalry_Poistions integer Yes
Current_Level integer No
DeconstructPoint location No
Difficulty_Dialog dialog No
DifficultyButtons button Yes
DifficultyReals real Yes
Disenchant_Numbers integer Yes
Dismember_Group group No
Enchant_Upgrade_Booleans boolean Yes
Fire_Enchant_Group group No
Flail_Group group Yes
Flail_Point location No
Flail_Unit unit No
Fletcher_Group group No
Formation_Dialog dialog No
Formation_Dialog_Buttons button Yes
Formation_Dialog_Votes integer Yes
Formation_Groups group Yes
Formation_Int_Loops integer Yes
Formation_Ints integer Yes
Formation_Points location Yes
Generic_Loops integer Yes
Grenado_Group group No
Grenado_InstaKillGroup group No
Grenado_Point location Yes
Gryphon_Group group No
Hammer_of_Fate_Group group No
Hammer_of_Fate_Player player No
Hammer_of_Fate_Points location Yes
Healing_Group group No
Hive_Group group No
Ice_Enchant_Group group No
Ice_Enchantment_Point location No
Infantry_Abi_Point location No
Infantry_Abi_Possible_Targets group No
Leader_Check_Group group No
Leader_Spawn_Point location No
Leader_Types unitcode Yes
Leader_Units unit Yes
Light_Enchant_Group group No
Light_Enchant_Point location No
Lives_Lost integer Yes
Longbowman_Upgrade_Group group No
Mage_Rep_Count integer Yes
Mage_Rep_Group group No
Mage_Rep_Point location Yes
Mechanized_Joints_Player player No
Merc_Abi_Point location No
Merc_Abi_Point2 location No
Merc_Abi_Possible_Targets group No
Merc_Captain boolean Yes
Merciless_Effect effect No
Merciless_Point location No
Missile_Group group No
Missile_Loop_Int integer No
Missile_Point location No
Missile_Target unit No
More_Leaders_Boolean boolean Yes
More_Leaders_Group group No
More_Leaders_Loop integer No
Multi_Shot_Group group No
Multiboard_Loops integer No
NEFormation_Units unit Yes
Nerubian_Player player No
Night_Vision_Boolean boolean No
Night_Vision_Group group No
Night_Vision_Player player No
NWFormation_Units unit Yes
Oil_Point location No
Organized_Boolean boolean No
Pikeman_Group group No
Player_Colour_String string Yes
Player_Defeated boolean Yes
Player_Message_Group force Yes
Playing_Players force No
Poison_Enchant_Group group No
Poison_Enchant_Point location No
Poison_Shower_Point location No
Priest_Amount_Groups group Yes
Promote_Effect effect No
Promotion_Level integer No
Random_Leader_Group group No
Random_Leader_Ints integer No
Random_Leader_Point location No
Random_Leader_Types unitcode Yes
RandomLeaderInt integer No
RandomLeaderLoop integer No
Regeneration_Group group No
Regeneration_Player player No
Regeneration_Weather weathereffect No
SEFormation_Units unit Yes
SelfDestruct_Affected group No
SelfDestruct_Group group No
SelfDestruct_Points location Yes
Shock_Effects effect Yes
Shock_Group group No
Shock_Int integer No 1
Shock_Loop integer No
Shock_Point location No
Shredder_Group group No
SimulHealer_Group group No
SimulHealer_Point location No
SliceGroup group Yes
Slicer unit No
Smoke_Enchant_Group group No
Smoke_Enchantment_Point location Yes
Spawn_Group_Loop integer No
Spawn_Points location Yes
Spawn_Timer timer No
Spawn_Timer_Window timerdialog No
Spoils_Int integer No
Spoils_Point location No
Starter_Removal_Group group No
Sunder_Group group No
SWFormation_Units unit Yes
TB_Upgrade_Group group No
TD_Spawn_Number integer No
TD_Spawn_Type unitcode No
TDSpawnMovement location Yes
Temp_Group group No
Tip_Strings string Yes
Titanic_Groups group Yes
Titanic_Points location Yes
Town_Sounds_Boolean boolean Yes
Trample_Group group No
Trample_Loop_Int integer No
Trample_Point location No
Trample_Unit unit No
Tutorial_Boolean boolean No
Tutorial_Dialog dialog No
Tutorial_Dialog_Buttons button Yes
Tutorial_Group force No
Two_Strike_Boolean boolean No
TwoStrike_Point location No
Unit_Position_Amounts group Yes
Unit_Spawn_Number integer No
Unit_Spawn_Type unitcode No
Units_Spawned_Boolean boolean Yes
UnitSpawnMovementPoints location Yes
Villager_Number integer No
Villager_Types unitcode Yes
Voodoo_Caster unit No
Wall_End_Int integer No
Wall_Loop_Int integer No
Wall_Start_Int integer No
Wall_Unit unit Yes
Water_Enchant_Group group No
Wedge_Boolean boolean Yes
Workers_Real real Yes
Ziggurat_Group group No
Remove Starters
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Player 1 (Red) slot status) Not equal to Is playing
      Then - Actions
        Set VariableSet Player_Defeated[1] = True
        Set VariableSet Starter_Removal_Group = (Units owned by Player 1 (Red).)
        Unit Group - Pick every unit in Starter_Removal_Group and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(udg_Starter_Removal_Group)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Player 2 (Blue) slot status) Not equal to Is playing
      Then - Actions
        Set VariableSet Player_Defeated[2] = True
        Set VariableSet Starter_Removal_Group = (Units owned by Player 2 (Blue).)
        Unit Group - Pick every unit in Starter_Removal_Group and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(udg_Starter_Removal_Group)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Player 3 (Teal) slot status) Not equal to Is playing
      Then - Actions
        Set VariableSet Player_Defeated[3] = True
        Set VariableSet Starter_Removal_Group = (Units owned by Player 3 (Teal).)
        Unit Group - Pick every unit in Starter_Removal_Group and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(udg_Starter_Removal_Group)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Player 4 (Purple) slot status) Not equal to Is playing
      Then - Actions
        Set VariableSet Player_Defeated[4] = True
        Set VariableSet Starter_Removal_Group = (Units owned by Player 4 (Purple).)
        Unit Group - Pick every unit in Starter_Removal_Group and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(udg_Starter_Removal_Group)
      Else - Actions
Quest with Changes
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Quest - Create a Optional quest titled Update Notes with the description In Beta version 0.9 the following was changed:-Some unique upgrades could be gained by any team-Multiboard name width and colour adjusted-Boss lives were not being taken properly-Players that leave will not leave men behind-Unit Positions were taken off the minimap, using icon path ReplaceableTextures\CommandButtons\BTNScrollOfProtection.blp
Visibility
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Custom script: call SetRandomSeed(GetRandomInt(0, 1000000))
    Visibility - Disable fog of war
    Visibility - Disable black mask
    Player - Turn Gives bounty On for Player 5 (Yellow)
    Player - Turn Gives bounty On for Player 6 (Orange)
    Player - Turn Gives bounty On for Player 7 (Green)
    Player - Turn Gives bounty On for Player 8 (Pink)
Grouping
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Dialog - Change the title of Difficulty_Dialog to Set Your Desired Difficulty Level
    Dialog - Create a dialog button for Difficulty_Dialog labelled Easy - 50% Health
    Set VariableSet DifficultyButtons[1] = (Last created dialog Button)
    Dialog - Create a dialog button for Difficulty_Dialog labelled Normal - 65% Health
    Set VariableSet DifficultyButtons[2] = (Last created dialog Button)
    Dialog - Create a dialog button for Difficulty_Dialog labelled Hard - 80% Health
    Set VariableSet DifficultyButtons[3] = (Last created dialog Button)
    Dialog - Create a dialog button for Difficulty_Dialog labelled Insane - 100% Health
    Set VariableSet DifficultyButtons[4] = (Last created dialog Button)
    -------- Formation_Dialog --------
    Dialog - Change the title of Formation_Dialog to How Smart Should The Opponents Be?
    Dialog - Create a dialog button for Formation_Dialog labelled Scattered (Easy)
    Set VariableSet Formation_Dialog_Buttons[1] = (Last created dialog Button)
    Dialog - Create a dialog button for Formation_Dialog labelled Organized (Medium)
    Set VariableSet Formation_Dialog_Buttons[2] = (Last created dialog Button)
    Dialog - Create a dialog button for Formation_Dialog labelled Assorted (Hard)
    Set VariableSet Formation_Dialog_Buttons[3] = (Last created dialog Button)
    -------- Tutorial Dialog --------
    Dialog - Change the title of Tutorial_Dialog to Do you wish to view the tutorial?
    Dialog - Create a dialog button for Tutorial_Dialog labelled Yes
    Set VariableSet Tutorial_Dialog_Buttons[1] = (Last created dialog Button)
    Dialog - Create a dialog button for Tutorial_Dialog labelled No
    Set VariableSet Tutorial_Dialog_Buttons[2] = (Last created dialog Button)
    Set VariableSet Formation_Groups[1] = (Units in NW_Army <gen>)
    Set VariableSet Formation_Ints[1] = 0
    Unit Group - Pick every unit in Formation_Groups[1] and do (Actions)
      Loop - Actions
        Set VariableSet Formation_Ints[1] = (Formation_Ints[1] + 1)
        Set VariableSet NWFormation_Units[Formation_Ints[1]] = (Picked unit)
    Set VariableSet Formation_Groups[2] = (Units in NE_Army <gen>)
    Set VariableSet Formation_Ints[1] = 0
    Unit Group - Pick every unit in Formation_Groups[2] and do (Actions)
      Loop - Actions
        Set VariableSet Formation_Ints[1] = (Formation_Ints[1] + 1)
        Set VariableSet NEFormation_Units[Formation_Ints[1]] = (Picked unit)
    Set VariableSet Formation_Groups[3] = (Units in SW_Army <gen>)
    Set VariableSet Formation_Ints[1] = 0
    Unit Group - Pick every unit in Formation_Groups[3] and do (Actions)
      Loop - Actions
        Set VariableSet Formation_Ints[1] = (Formation_Ints[1] + 1)
        Set VariableSet SWFormation_Units[Formation_Ints[1]] = (Picked unit)
    Set VariableSet Formation_Groups[4] = (Units in SE_Army <gen>)
    Set VariableSet Formation_Ints[1] = 0
    Unit Group - Pick every unit in Formation_Groups[4] and do (Actions)
      Loop - Actions
        Set VariableSet Formation_Ints[1] = (Formation_Ints[1] + 1)
        Set VariableSet SEFormation_Units[Formation_Ints[1]] = (Picked unit)
    Trigger - Run FourRowNW <gen> (ignoring conditions)
    Trigger - Run FourRowNE <gen> (ignoring conditions)
    Trigger - Run FourRowSW <gen> (ignoring conditions)
    Trigger - Run FourRowSE <gen> (ignoring conditions)
    Set VariableSet Player_Message_Group[1] = Player Group - Player 1 (Red)
    Set VariableSet Player_Message_Group[2] = Player Group - Player 2 (Blue)
    Set VariableSet Player_Message_Group[3] = Player Group - Player 3 (Teal)
    Set VariableSet Player_Message_Group[4] = Player Group - Player 4 (Purple)
    Set VariableSet Playing_Players = (All players controlled by a User player)
    Player Group - Pick every player in Playing_Players and do (Actions)
      Loop - Actions
        Dialog - Show Difficulty_Dialog for (Picked player)
        Player - Disable Archers Regroup for (Picked player)
        Player - Disable Cavalry Regroup for (Picked player)
        Player - Disable Horizontal Slice Book for (Picked player)
        Player - Disable Phalanx Book for (Picked player)
        Player - Disable Blunt Impact Book for (Picked player)
        Player - Disable Dismember Book for (Picked player)
        Player - Disable Spell Immunity Book for (Picked player)
        Player - Disable Tower Turning Book for (Picked player)
        Player - Disable Tower Turning Book (Both Attacks) for (Picked player)
        Player - Disable Upgrade to Centaur Marauder (Fake) for (Picked player)
        Player - Set the max research level of R005 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R006 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R008 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R009 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00O (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00P (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00Q (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00R (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00M (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00N (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00C (techcode) to 0 for (Picked player)
        Player - Set the max research level of R00D (techcode) to 0 for (Picked player)
        Player - Set the max research level of R015 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R016 (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01K (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01L (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01H (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01I (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01F (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01G (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01N (techcode) to 0 for (Picked player)
        Player - Set the max research level of R01O (techcode) to 0 for (Picked player)
        Player - Add 50 to (Picked player).Current gold
        Player - Add 10 to (Picked player).Current lumber
        Player - Limit training of Gryphon Aviary to 1 for (Picked player)
        Player - Limit training of Special Operations Research Facility to 1 for (Picked player)
        Player - Limit training of Ranger's Guild to 1 for (Picked player)
        Player - Limit training of Stable to 1 for (Picked player)
        Player - Make Glaive Thrower Unavailable for training/construction by (Picked player)
        Player - Make Voodoo Tower Unavailable for training/construction by (Picked player)
        Player - Make Turret Unavailable for training/construction by (Picked player)
        Player - Make Frost Tower Unavailable for training/construction by (Picked player)
        Player - Make Ziggurat Unavailable for training/construction by (Picked player)
    Neutral Building - Add Human Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Orc Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Undead Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Night Elf Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Troll Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Gnoll Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Dwarf Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Goblin Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Blood Elf Leader to all marketplaces with 1 in stock and a max stock of 1
    Neutral Building - Add Tauren Leader to all marketplaces with 1 in stock and a max stock of 1
Set Stuff
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Set VariableSet Leader_Types[1] = Human Leader
    Set VariableSet Leader_Types[2] = Orc Leader
    Set VariableSet Leader_Types[3] = Undead Leader
    Set VariableSet Leader_Types[4] = Night Elf Leader
    Set VariableSet Leader_Types[5] = Troll Leader
    Set VariableSet Leader_Types[6] = Gnoll Leader
    Set VariableSet Leader_Types[7] = Dwarf Leader
    Set VariableSet Leader_Types[8] = Goblin Leader
    Set VariableSet Leader_Types[9] = Blood Elf Leader
    Set VariableSet Leader_Types[10] = Tauren Leader
    Set VariableSet Leader_Types[11] = Nerubian Leader
    Set VariableSet Leader_Types[12] = Centaur Leader
    Set VariableSet Leader_Types[13] = Random Leader (Fake)
    Set VariableSet Villager_Types[1] = Villager (Female 1)
    Set VariableSet Villager_Types[2] = Villager (Female 2)
    Set VariableSet Villager_Types[3] = Villager (Child)
    Set VariableSet Villager_Types[4] = Villager (Child 2)
    Set VariableSet Villager_Types[5] = Villager (Male)
    Set VariableSet Villager_Types[6] = Villager (Male 2)
    Set VariableSet Villager_Number = 2
    Set VariableSet Mage_Rep_Count[1] = 0
    Set VariableSet Mage_Rep_Count[2] = 0
    Set VariableSet Mage_Rep_Count[3] = 0
    Set VariableSet Mage_Rep_Count[4] = 0
    Set VariableSet UnitSpawnMovementPoints[1] = (Center of NW_Unit_Movement_1 <gen>)
    Set VariableSet UnitSpawnMovementPoints[2] = (Center of NW_Unit_Movement_2 <gen>)
    Set VariableSet UnitSpawnMovementPoints[3] = (Center of NE_Unit_Movement_1 <gen>)
    Set VariableSet UnitSpawnMovementPoints[4] = (Center of NE_Unit_Movement_2 <gen>)
    Set VariableSet UnitSpawnMovementPoints[5] = (Center of SW_Unit_Movement_1 <gen>)
    Set VariableSet UnitSpawnMovementPoints[6] = (Center of SW_Unit_Movement_2 <gen>)
    Set VariableSet UnitSpawnMovementPoints[7] = (Center of SE_Unit_Movement_1 <gen>)
    Set VariableSet UnitSpawnMovementPoints[8] = (Center of SE_Unit_Movement_2 <gen>)
    Set VariableSet TDSpawnMovement[1] = (Center of NW_TD_Movement_1 <gen>)
    Set VariableSet TDSpawnMovement[2] = (Center of NW_TD_Movement_2 <gen>)
    Set VariableSet TDSpawnMovement[3] = (Center of NE_TD_Movement_1 <gen>)
    Set VariableSet TDSpawnMovement[4] = (Center of NE_TD_Movement_2 <gen>)
    Set VariableSet TDSpawnMovement[5] = (Center of SW_TD_Movement_1 <gen>)
    Set VariableSet TDSpawnMovement[6] = (Center of SW_TD_Movement_2 <gen>)
    Set VariableSet TDSpawnMovement[7] = (Center of SE_TD_Movement_1 <gen>)
    Set VariableSet TDSpawnMovement[8] = (Center of SE_TD_Movement_2 <gen>)
    Set VariableSet Tutorial_Group = (All players matching (((Owner of (Triggering unit)) Not equal to Player 1 (Red)) and ((Owner of (Triggering unit)) Equal to Player 1 (Red))).)
    Set VariableSet Fire_Enchant_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Ice_Enchant_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Light_Enchant_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Axe_Hit_Group[1] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Axe_Hit_Group[2] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Axe_Hit_Group[3] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Axe_Hit_Group[4] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Flail_Group[1] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet SliceGroup[1] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Grenado_InstaKillGroup = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Dismember_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet SelfDestruct_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Multi_Shot_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Sunder_Group = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Titanic_Groups[1] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Set VariableSet Titanic_Groups[4] = (Units owned by Player 9 (Gray) matching ((((Matching unit) is A structure) Equal to True) and (((Matching unit) is A structure) Not equal to True)).)
    Player - Set the max research level of R002 (techcode) to 0 for Player 1 (Red)
    Player - Set the max research level of R002 (techcode) to 0 for Player 2 (Blue)
    Player - Set the max research level of R002 (techcode) to 0 for Player 3 (Teal)
    Player - Set the max research level of R002 (techcode) to 0 for Player 4 (Purple)
    Set VariableSet Player_Colour_String[1] = |c00ff0000
    Set VariableSet Player_Colour_String[2] = |c000000ff
    Set VariableSet Player_Colour_String[3] = |c0000ffff
    Set VariableSet Player_Colour_String[4] = |c00800800
    Set VariableSet Player_Colour_String[5] = |c00ffff00
    Set VariableSet Player_Colour_String[6] = |c00ff8000
    Set VariableSet Player_Colour_String[7] = |c0000ff00
Set Tips
  Events
    Time - Elapsed game time is 10.00 seconds
  Conditions
  Actions
    Set VariableSet Tip_Strings[1] = Tip: Don't forget that defenders are both your lives and a resource...keep some saved up!
    Set VariableSet Tip_Strings[2] = Tip: Just because an upgrade is available doesn't necessarily mean it's better. Axeman are better than either Footmen or Skirmishers against infantry for example.
    Set VariableSet Tip_Strings[3] = Tip: Try to avoid massing a single type of unit. Without counters to both infantry and cavalry your army is surely doomed.
    Set VariableSet Tip_Strings[4] = Tip: Archers and infantry units gain 100 additional health when you purchase an upgrade for them.
    Set VariableSet Tip_Strings[5] = Tip: Ranger's Guilds, Stables, and Special Operations Facilities contain tons of upgrades for your army.
    Set VariableSet Tip_Strings[6] = Tip: If you're really sucking, try playing your next game as the dwarves. They're a very powerful and straight-forward team.
    Set VariableSet Tip_Strings[7] = Tip: Cavalry deal trample damage when your leader orders them to move or regroup.
    Set VariableSet Tip_Strings[8] = Tip: Mercenaries are there for a reason. Try to negotiate which race each player should be before the game to create unstoppable mercenary combinations.
    Set VariableSet Tip_Strings[9] = Tip: Cavalry rounds can be unreasonably difficult without the use of box formation.
    Set VariableSet Tip_Strings[10] = Tip: Towers healing instead of fighting? Try upgrading Shelters to Refuges...they can heal and attack simultaneously.
    Set VariableSet Tip_Strings[11] = Tip: Found a bug or have a suggestion? Email me at bullet_headtree@hotmail.com.
    Set VariableSet Tip_Strings[12] = Tip: Archers deal low damage at a semi-fast rate. Melee units deal insanely high damage but at such a slow rate that they're primarily meatshields.
    Set VariableSet Tip_Strings[13] = Tip: Cheese and baseball ;)
    Set VariableSet Tip_Strings[14] = Tip: Magic Guild Representatives can give you quite an advantage at the beginning of the game.
    Set VariableSet Tip_Strings[15] = Tip: Don't neglect your army for extra towers, or visa-versa. Try to maintain a nice balance.
    Set VariableSet Tip_Strings[16] = Tip: Mercenaries have deadly abilities that don't require upgrades, but charge 30 gold for each use.
    Set VariableSet Tip_Strings[17] = Tip: Clerics, Surgeons, and Clerics all have their uses. Getting one or more of each is not a bad idea.
    Set VariableSet Tip_Strings[18] = Tip: Cavalry units gain 200 additional health when you purchase an upgrade for them.
Range Aliiances
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Player - Make Player 1 (Red) treat Player 6 (Orange) as an Ally
    Player - Make Player 1 (Red) treat Player 7 (Green) as an Ally
    Player - Make Player 1 (Red) treat Player 8 (Pink) as an Ally
    Player - Make Player 2 (Blue) treat Player 5 (Yellow) as an Ally
    Player - Make Player 2 (Blue) treat Player 7 (Green) as an Ally
    Player - Make Player 2 (Blue) treat Player 8 (Pink) as an Ally
    Player - Make Player 3 (Teal) treat Player 5 (Yellow) as an Ally
    Player - Make Player 3 (Teal) treat Player 6 (Orange) as an Ally
    Player - Make Player 3 (Teal) treat Player 8 (Pink) as an Ally
    Player - Make Player 4 (Purple) treat Player 5 (Yellow) as an Ally
    Player - Make Player 4 (Purple) treat Player 6 (Orange) as an Ally
    Player - Make Player 4 (Purple) treat Player 7 (Green) as an Ally
Difficulty Votes
  Events
    Dialog - A dialog button is clicked for Difficulty_Dialog
  Conditions
  Actions
    If ((Clicked dialog button) Equal to DifficultyButtons[1]) then do (Set VariableSet DifficultyReals[(Player number of (Triggering player))] = 50.00) else do (Do nothing)
    If ((Clicked dialog button) Equal to DifficultyButtons[2]) then do (Set VariableSet DifficultyReals[(Player number of (Triggering player))] = 65.00) else do (Do nothing)
    If ((Clicked dialog button) Equal to DifficultyButtons[3]) then do (Set VariableSet DifficultyReals[(Player number of (Triggering player))] = 80.00) else do (Do nothing)
    If ((Clicked dialog button) Equal to DifficultyButtons[4]) then do (Set VariableSet DifficultyReals[(Player number of (Triggering player))] = 100.00) else do (Do nothing)
    Dialog - Show Formation_Dialog for (Triggering player)
Formation Votes
  Events
    Dialog - A dialog button is clicked for Formation_Dialog
  Conditions
  Actions
    If ((Clicked dialog button) Equal to Formation_Dialog_Buttons[1]) then do (Set VariableSet Formation_Dialog_Votes[1] = (Formation_Dialog_Votes[1] + 1)) else do (Do nothing)
    If ((Clicked dialog button) Equal to Formation_Dialog_Buttons[2]) then do (Set VariableSet Formation_Dialog_Votes[2] = (Formation_Dialog_Votes[2] + 1)) else do (Do nothing)
    If ((Clicked dialog button) Equal to Formation_Dialog_Buttons[3]) then do (Set VariableSet Formation_Dialog_Votes[3] = (Formation_Dialog_Votes[3] + 1)) else do (Do nothing)
    If ((Clicked dialog button) Equal to Formation_Dialog_Buttons[4]) then do (Set VariableSet Formation_Dialog_Votes[4] = (Formation_Dialog_Votes[4] + 1)) else do (Do nothing)
    If ((Triggering player) Equal to Player 1 (Red)) then do (Select Command Center 0114 <gen> for Player 1 (Red)) else do (Do nothing)
    If ((Triggering player) Equal to Player 2 (Blue)) then do (Select Command Center 0125 <gen> for Player 2 (Blue)) else do (Do nothing)
    If ((Triggering player) Equal to Player 3 (Teal)) then do (Select Command Center 0126 <gen> for Player 3 (Teal)) else do (Do nothing)
    If ((Triggering player) Equal to Player 4 (Purple)) then do (Select Command Center 0127 <gen> for Player 4 (Purple)) else do (Do nothing)
    Dialog - Show Tutorial_Dialog for (Triggering player)
Random Leader
  Events
    Unit - A unit enters (Playable map area)
  Conditions
    (Unit-type of (Entering unit)) Equal to Random Leader (Fake)
  Actions
    Set VariableSet Random_Leader_Point = (Position of (Entering unit))
    Set VariableSet RandomLeaderInt = 0
    For each (Integer RandomLeaderLoop) from 1 to 12, do (Actions)
      Loop - Actions
        Set VariableSet Random_Leader_Group = (Units of type Leader_Types[RandomLeaderLoop])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in Random_Leader_Group) Equal to 0
          Then - Actions
            Set VariableSet RandomLeaderInt = (RandomLeaderInt + 1)
            Set VariableSet Random_Leader_Types[RandomLeaderInt] = Leader_Types[RandomLeaderLoop]
          Else - Actions
        Custom script: call DestroyGroup(udg_Random_Leader_Group)
    Unit - Create 1.Random_Leader_Types[(Random integer number between 1 and RandomLeaderInt)] for (Owner of (Entering unit)) at Random_Leader_Point facing Default building facing degrees
    Unit - Remove (Entering unit) from the game
    Custom script: call RemoveLocation(udg_Random_Leader_Point)
More Leaders
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to More Leaders
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        More_Leaders_Boolean[(Player number of (Owner of (Casting unit)))] Equal to False
      Then - Actions
        Set VariableSet More_Leaders_Boolean[(Player number of (Owner of (Casting unit)))] = True
        For each (Integer More_Leaders_Loop) from 1 to 10, do (Actions)
          Loop - Actions
            Set VariableSet More_Leaders_Group = (Units of type Leader_Types[More_Leaders_Loop])
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in More_Leaders_Group) Equal to 0
              Then - Actions
                Neutral Building - Remove Leader_Types[More_Leaders_Loop] from (Casting unit)
              Else - Actions
            Custom script: call DestroyGroup(udg_More_Leaders_Group)
        For each (Integer More_Leaders_Loop) from 11 to 13, do (Actions)
          Loop - Actions
            Set VariableSet More_Leaders_Group = (Units of type Leader_Types[More_Leaders_Loop])
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in More_Leaders_Group) Equal to 0
              Then - Actions
                Neutral Building - Add Leader_Types[More_Leaders_Loop] to (Casting unit) with 1 in stock and a max stock of 1
              Else - Actions
            Custom script: call DestroyGroup(udg_More_Leaders_Group)
      Else - Actions
        Set VariableSet More_Leaders_Boolean[(Player number of (Owner of (Casting unit)))] = False
        For each (Integer More_Leaders_Loop) from 1 to 10, do (Actions)
          Loop - Actions
            Set VariableSet More_Leaders_Group = (Units of type Leader_Types[More_Leaders_Loop])
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in More_Leaders_Group) Equal to 0
              Then - Actions
                Neutral Building - Add Leader_Types[More_Leaders_Loop] to (Casting unit) with 1 in stock and a max stock of 1
              Else - Actions
            Custom script: call DestroyGroup(udg_More_Leaders_Group)
        For each (Integer More_Leaders_Loop) from 11 to 13, do (Actions)
          Loop - Actions
            Set VariableSet More_Leaders_Group = (Units of type Leader_Types[More_Leaders_Loop])
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Number of units in More_Leaders_Group) Equal to 0
              Then - Actions
                Neutral Building - Remove Leader_Types[More_Leaders_Loop] from (Casting unit)
              Else - Actions
            Custom script: call DestroyGroup(udg_More_Leaders_Group)
Chosen Leader
  Events
    Unit - A unit enters (Playable map area)
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Entering unit)) Equal to Human Leader
        (Unit-type of (Entering unit)) Equal to Orc Leader
        (Unit-type of (Entering unit)) Equal to Undead Leader
        (Unit-type of (Entering unit)) Equal to Night Elf Leader
        (Unit-type of (Entering unit)) Equal to Troll Leader
        (Unit-type of (Entering unit)) Equal to Gnoll Leader
        (Unit-type of (Entering unit)) Equal to Dwarf Leader
        (Unit-type of (Entering unit)) Equal to Goblin Leader
        (Unit-type of (Entering unit)) Equal to Blood Elf Leader
        (Unit-type of (Entering unit)) Equal to Tauren Leader
        (Unit-type of (Entering unit)) Equal to Nerubian Leader
        (Unit-type of (Entering unit)) Equal to Centaur Leader
  Actions
    Set VariableSet Leader_Units[(Player number of (Owner of (Entering unit)))] = (Entering unit)
    Neutral Building - Remove (Unit-type of (Triggering unit)) from all marketplaces
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Human Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Pikeman (Replaces Footman)|cffffcc00Unique Building:|r Cannon Tower (Replaces Minaret)|cffffcc00Leader Ability:|r Regeneration|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFHumans are gifted with Pikeman which are a much needed anti-cavalry unit midway through the game. Cannon towers also help out early on, before you can afford the good stuff.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Orc Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Kodo Beast Rider (Replaces Archmage)|cffffcc00Unique Unit #2:|r Wolf Rider (Replaces Cavalier)|cffffcc00Leader Ability:|r Merciless|r|cffffcc00Mercenary:|r Orc Shaman|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFThe Orcs are the only team equipped with two unique units and no unique buildings. Kodo Beast Riders are the strongest cavalry units in the game (open to debate) and Wolf Riders are strong units with absolutely no blacksmith requirements.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Undead Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Necromancer (Replaces Cleric)|cffffcc00Unique Building:|r Obsidian Destroyer (Replaces Mangonel)|cffffcc00Leader Ability:|r Two Strikes, You're Out|cffffcc00Mercenary:|r Spectral Phantom|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFObsidian Destroyers are the fastest attacking unit or building in the game, which is quite worthwhile. Necromancers are very strong, from the beginning of the game to the end. They are adept healers that are also able to raise the dead to aid them.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Night Elf Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Huntress (Replaces Mounted Mage)|cffffcc00Unique Building:|r Glaive Thrower (Replaces Springald)|cffffcc00Leader Ability:|r Night Vision|cffffcc00Mercenary:|r Mountain Giant|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFThe Night Elves have unique bonuses both at the beginning and mid-way through the game. However, their unique units will become inept fairly quickly.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Troll Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Troll Beserker (Replaces Archer)|cffffcc00Unique Building:|r Voodoo Tower (Replaces Scout Tower)|cffffcc00Leader Ability:|r Big Bad Voodoo|cffffcc00Mercenary:|r Troll Ninja|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFTroll Berserkers are incredible, but get replaced fairly quickly. Voodoo Towers, although they are almost free, have a use all the way throughout the game.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Gnoll Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Gnoll Maceman (Replaces Militia)|cffffcc00Unique Building:|r Totem (Replaces Refuge)|cffffcc00Leader Ability:|r Promote|cffffcc00Mercenary:|r Gnoll Crossbowman|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFContrary to popular belief, gnolls are actually very organized and skilled in the way of strategic warfare to make up for their physical disadvantages.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Dwarf Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Musketman (Replaces Skirmisher)|cffffcc00Unique Building:|r Siege Tank (Replaces Keep)|cffffcc00Leader Ability:|r Hammer of Fate|cffffcc00Mercenary:|r Dwarven Chopper|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFThe dwarf leader is ideal for late-game awesomeness, but can you reach that point alive?|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Goblin Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Goblin Shredder (Replaces Axeman)|cffffcc00Unique Building:|r Turret (Replaces Bunker)|cffffcc00Leader Ability:|r Mechanized Joints|cffffcc00Mercenary:|r Goblin Bombers|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFThe goblins don't really have much consistency in their strategies. Their units fit in wherever they can and are good simply because of brute strength instead of strategy.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Blood Elf Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Dragonhawk Rider (Replaces Knight)|cffffcc00Unique Building:|r Frost Tower (Replaces Oil Shooter)|cffffcc00Leader Ability:|r Absorb|cffffcc00Mercenary:|r Blood Elf Outcast|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFThe blood elves have both early and late game units and both have a use from the minute you get them until the end of the game.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Tauren Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Tauren Spirit Walker (Replaces Longbowman)|cffffcc00Unique Building:|r Serpent Ward (Replaces Shelter)|cffffcc00Leader Ability:|r Daze|cffffcc00Mercenary:|r Tauren Underling|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFAs bizarre as it may seem, Taurens are the masters of long-range combat.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Nerubian Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Webspinner (Replaces Rock Thrower)|cffffcc00Unique Building:|r Ziggurat (Replaces Gryphon Aviary)|cffffcc00Leader Ability:|r Spirit of the Hive|cffffcc00Mercenary:|r Nerubian Scorper|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFNerubians are skilled at taking out enemy air units and excel at the end of the game with an improved version of the Gryphon Aviary, which is the best non-unique building in the game.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Centaur Leader) then do (Display to Player_Message_Group[(Player number of (Owner of (Entering unit)))] the text: |cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cffffcc00Unique Unit:|r Centaur Marauder|cffffcc00Unique Building:|r Ziggurat (Replaces Gryphon Aviary)|cffffcc00Leader Ability:|r Nomadic Lifestyle|cffffcc00Mercenary:|r Centaurian Brute|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r|cff0000FFCentaurs excel in boss killing and strategy, bringing the ultimate edge to both cavalry and archer groups. Unfortunately this is reflected in their cost.|r|cff008B00+++++++++++++++++++++++++++++++++++++++++++++++++++|r) else do (Do nothing)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Human Leader
      Then - Actions
        Player - Set the max research level of R00B (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00A (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00O (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R00P (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Night Elf Leader
      Then - Actions
        Player - Make Springald Unavailable for training/construction by (Owner of (Entering unit))
        Player - Make Glaive Thrower Available for training/construction by (Owner of (Entering unit))
        Player - Set the max research level of R01B (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01C (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01K (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R01L (techcode) to 1 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Troll Leader
      Then - Actions
        Player - Make Scout Tower Unavailable for training/construction by (Owner of (Entering unit))
        Player - Make Voodoo Tower Available for training/construction by (Owner of (Entering unit))
        Player - Set the max research level of R00I (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00J (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00M (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R00N (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Gnoll Leader
      Then - Actions
        Player - Set the max research level of R005 (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R006 (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Dwarf Leader
      Then - Actions
        Player - Set the max research level of R00F (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00E (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00C (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R00D (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Goblin Leader
      Then - Actions
        Player - Set the max research level of R007 (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R004 (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R008 (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R009 (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Blood Elf Leader
      Then - Actions
        Player - Make Oil Shooter Unavailable for training/construction by (Owner of (Entering unit))
        Player - Make Frost Tower Available for training/construction by (Owner of (Entering unit))
        Player - Set the max research level of R017 (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R018 (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01H (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R01I (techcode) to 1 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Nerubian Leader
      Then - Actions
        Player - Make Gryphon Aviary Unavailable for training/construction by (Owner of (Entering unit))
        Player - Make Ziggurat Available for training/construction by (Owner of (Entering unit))
        Player - Limit training of Ziggurat to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R00Q (techcode) to 2 for (Owner of (Entering unit))
        Player - Set the max research level of R00R (techcode) to 2 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Tauren Leader
      Then - Actions
        Player - Set the max research level of R00G (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R00H (techcode) to 0 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Orc Leader
      Then - Actions
        Player - Set the max research level of R019 (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01A (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R015 (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R016 (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R01D (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01E (techcode) to 0 for (Owner of (Entering unit))
        Player - Set the max research level of R01F (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R01G (techcode) to 1 for (Owner of (Entering unit))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Centaur Leader
      Then - Actions
        Player - Set the max research level of R01N (techcode) to 1 for (Owner of (Entering unit))
        Player - Set the max research level of R01O (techcode) to 1 for (Owner of (Entering unit))
        Player - Enable Upgrade to Centaur Marauder (Fake) for (Picked player)
      Else - Actions
    Set VariableSet Leader_Check_Group = (Units owned by (Owner of (Entering unit)).)
    Unit Group - Pick every unit in Leader_Check_Group and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Scout Tower
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Human Leader
          Then - Actions
            Unit - Add Upgrade to Cannon Tower (Fake) to (Picked unit)
            Unit - Remove Upgrade to Minaret (Fake) from (Picked unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Minaret
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Human Leader
          Then - Actions
            Unit - Replace (Picked unit) with a Cannon Tower using The new unit's default life and mana
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Rock Thrower
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Troll Leader
          Then - Actions
            Unit - Add Upgrade to Troll Berserker to (Picked unit)
            Unit - Remove Upgrade to Archer (Fake) from (Picked unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Scout Tower
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Troll Leader
          Then - Actions
            Unit - Replace (Picked unit) with a Voodoo Tower using The old unit's relative life and mana
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Servant
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Gnoll Leader
          Then - Actions
            Unit - Add Upgrade to Gnoll Maceman (Fake) to (Picked unit)
            Unit - Remove Upgrade to Militia (Fake) from (Picked unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Scout Tower
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Tauren Leader
          Then - Actions
            Unit - Add Upgrade to Serpent Ward to (Picked unit)
            Unit - Remove Upgrade to Shelter from (Picked unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Servant
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Nerubian Leader
          Then - Actions
            Unit - Add Upgrade to Webspinner to (Picked unit)
            Unit - Remove Upgrade to Rock Thrower from (Picked unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Rock Thrower
            (Unit-type of Leader_Units[(Player number of (Owner of (Picked unit)))]) Equal to Nerubian Leader
          Then - Actions
            Unit - Replace (Picked unit) with a Webspinner using The old unit's relative life and mana
            If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Add (Last replaced unit) to Formation_Groups[1]) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Add (Last replaced unit) to Formation_Groups[2]) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Add (Last replaced unit) to Formation_Groups[3]) else do (Do nothing)
            If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Add (Last replaced unit) to Formation_Groups[4]) else do (Do nothing)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Picked unit)) Equal to Command Center
          Then - Actions
            Neutral Building - Remove Human Leader from (Picked unit)
            Neutral Building - Remove Orc Leader from (Picked unit)
            Neutral Building - Remove Undead Leader from (Picked unit)
            Neutral Building - Remove Night Elf Leader from (Picked unit)
            Neutral Building - Remove Troll Leader from (Picked unit)
            Neutral Building - Remove Gnoll Leader from (Picked unit)
            Neutral Building - Remove Dwarf Leader from (Picked unit)
            Neutral Building - Remove Goblin Leader from (Picked unit)
            Neutral Building - Remove Blood Elf Leader from (Picked unit)
            Neutral Building - Remove Tauren Leader from (Picked unit)
            Neutral Building - Remove Nerubian Leader from (Picked unit)
            Neutral Building - Remove Centaur Leader from (Picked unit)
            Neutral Building - Remove Random Leader (Fake) from (Picked unit)
            Neutral Building - Add Servant (Fake) to (Picked unit) with 18 in stock and a max stock of 18
            Neutral Building - Add Priest (Fake) to (Picked unit) with 5 in stock and a max stock of 5
            Neutral Building - Add Mount (Fake) to (Picked unit) with 18 in stock and a max stock of 18
            Neutral Building - Add Construction Team to (Picked unit) with 1 in stock and a max stock of 1
            Neutral Building - Add Fletcher (Fake) to (Picked unit) with 3 in stock and a max stock of 3
            Neutral Building - Add Blacksmith (Fake) to (Picked unit) with 4 in stock and a max stock of 4
            Neutral Building - Add Magic Guild Representative (Fake) to (Picked unit) with 3 in stock and a max stock of 3
            Neutral Building - Add Mercenary Captain (Fake) to (Picked unit) with 1 in stock and a max stock of 1
            Neutral Building - Add Worker (Fake) to (Picked unit) with 1 in stock and a max stock of 1
            Player - Set the max research level of R002 (techcode) to 3 for (Owner of (Picked unit))
            Unit - Remove More Leaders from (Picked unit)
          Else - Actions
        Player Group - Pick every player in Playing_Players and do (Actions)
          Loop - Actions
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Human Leader) then do (Set the current research level of R00U (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Orc Leader) then do (Set the current research level of R012 (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Undead Leader) then do (Set the current research level of R010 (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Night Elf Leader) then do (Set the current research level of R00Z (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Gnoll Leader) then do (Set the current research level of R00V (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Troll Leader) then do (Set the current research level of R00X (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Dwarf Leader) then do (Set the current research level of R00W (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Goblin Leader) then do (Set the current research level of R00Y (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Blood Elf Leader) then do (Set the current research level of R014 (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Tauren Leader) then do (Set the current research level of R011 (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Nerubian Leader) then do (Set the current research level of R013 (techcode) to 1 for (Picked player)) else do (Do nothing)
            If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Centaur Leader) then do (Set the current research level of R01M (techcode) to 1 for (Picked player)) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Night Elf Leader) then do (Set VariableSet Night_Vision_Player = (Owner of (Entering unit))) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Blood Elf Leader) then do (Set VariableSet Blood_Elf_Player = (Owner of (Entering unit))) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Blood Elf Leader) then do (Turn on Absorb <gen>) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Nerubian Leader) then do (Set VariableSet Nerubian_Player = (Owner of (Entering unit))) else do (Do nothing)
    If ((Unit-type of Leader_Units[(Player number of (Owner of (Entering unit)))]) Equal to Nerubian Leader) then do (Turn on Spirit_of_the_Hive <gen>) else do (Do nothing)
    If ((Owner of (Entering unit)) Equal to Player 1 (Red)) then do (Set VariableSet Leader_Spawn_Point = (Center of Red_Leader <gen>)) else do (Do nothing)
    If ((Owner of (Entering unit)) Equal to Player 2 (Blue)) then do (Set VariableSet Leader_Spawn_Point = (Center of Blue_Leader <gen>)) else do (Do nothing)
    If ((Owner of (Entering unit)) Equal to Player 3 (Teal)) then do (Set VariableSet Leader_Spawn_Point = (Center of Teal_Leader <gen>)) else do (Do nothing)
    If ((Owner of (Entering unit)) Equal to Player 4 (Purple)) then do (Set VariableSet Leader_Spawn_Point = (Center of Purple_Leader <gen>)) else do (Do nothing)
    Camera - Pan camera for (Owner of (Entering unit)) to Leader_Spawn_Point over 1.00 seconds
    Unit - Move (Entering unit) instantly to Leader_Spawn_Point
    Custom script: call RemoveLocation(udg_Leader_Spawn_Point)
    Custom script: call DestroyGroup(udg_Leader_Check_Group)
Buy Units
  Events
    Unit - A unit enters (Playable map area)
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Servant (Fake)
        (Unit-type of (Triggering unit)) Equal to Priest (Fake)
        (Unit-type of (Triggering unit)) Equal to Mount (Fake)
        (Unit-type of (Triggering unit)) Equal to Fletcher (Fake)
        (Unit-type of (Triggering unit)) Equal to Blacksmith (Fake)
        (Unit-type of (Triggering unit)) Equal to Mercenary Captain (Fake)
  Actions
    Set VariableSet Unit_Position_Amounts[1] = (Units owned by Player 1 (Red) of type Unit Position)
    Set VariableSet Unit_Position_Amounts[2] = (Units owned by Player 2 (Blue) of type Unit Position)
    Set VariableSet Unit_Position_Amounts[3] = (Units owned by Player 3 (Teal) of type Unit Position)
    Set VariableSet Unit_Position_Amounts[4] = (Units owned by Player 4 (Purple) of type Unit Position)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Owner of (Triggering unit)) Equal to Player 1 (Red)
      Then - Actions
        For each (Integer Formation_Int_Loops[10]) from 1 to 28, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of NWFormation_Units[Formation_Int_Loops[10]]) Equal to Unit Position
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Unit-type of (Triggering unit)) Equal to Servant (Fake)
                  Then - Actions
                    Unit - Replace NWFormation_Units[Formation_Int_Loops[10]] with a Servant using The new unit's default life and mana
                    Set VariableSet NWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                    Unit Group - Add NWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[1]
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Unit-type of (Triggering unit)) Equal to Priest (Fake)
                      Then - Actions
                        Unit - Replace NWFormation_Units[Formation_Int_Loops[10]] with a Priest using The new unit's default life and mana
                        Set VariableSet NWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                        Unit Group - Add NWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[1]
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Unit-type of (Triggering unit)) Equal to Mount (Fake)
                          Then - Actions
                            Unit - Replace NWFormation_Units[Formation_Int_Loops[10]] with a Mount using The new unit's default life and mana
                            Set VariableSet NWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                            Unit Group - Add NWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[1]
                          Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                (Unit-type of (Triggering unit)) Equal to Mercenary Captain (Fake)
                              Then - Actions
                                Set VariableSet Merc_Captain[1] = True
                                Unit - Replace NWFormation_Units[Formation_Int_Loops[10]] with a Mercenary Captain using The new unit's default life and mana
                                Set VariableSet NWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                                Unit Group - Add NWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[1]
                                Unit Group - Pick every unit in Unit_Position_Amounts[1] and do (Actions)
                                  Loop - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R012 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Orc Shaman to (Picked unit)
                                        Unit - Remove Hire Orc Shaman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R010 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Spectral Phantom to (Picked unit)
                                        Unit - Remove Hire Spectral Phantom (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00V (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Gnoll Crossbowman to (Picked unit)
                                        Unit - Remove Hire Gnoll Crossbowman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00X (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Troll Ninja to (Picked unit)
                                        Unit - Remove Hire Troll Ninja (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Y (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Goblin Bombers to (Picked unit)
                                        Unit - Remove Hire Goblin Bombers (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R014 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Blood Elf Outcast to (Picked unit)
                                        Unit - Remove Hire Blood Elf Outcast (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00W (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Dwarven Chopper to (Picked unit)
                                        Unit - Remove Hire Dwarven Chopper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R011 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Tauren Underling to (Picked unit)
                                        Unit - Remove Hire Tauren Underling (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Z (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Mountain Giant to (Picked unit)
                                        Unit - Remove Hire Mountain Giant (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R013 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Nerubian Scorper to (Picked unit)
                                        Unit - Remove Hire Nerubian Scorper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00U (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Lordaeron Pirate to (Picked unit)
                                        Unit - Remove Hire Lordaeron Pirate (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R01M (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Centaurian Brute to (Picked unit)
                                        Unit - Remove Hire Centaurian Brute (Fake) from (Picked unit)
                                      Else - Actions
                              Else - Actions
                Set VariableSet Priest_Amount_Groups[1] = (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Priest) or (((Unit-type of (Matching unit)) Equal to Cleric) or (((Unit-type of (Matching unit)) Equal to Necromancer) or (((Unit-type of (Matching unit)) Equal to Surgeon) or ((Unit-type of (Matching unit)) Equal to Field Medic))))).)
                Custom script: call DestroyGroup(udg_Unit_Position_Amounts[1])
                Set VariableSet Unit_Position_Amounts[1] = (Units owned by Player 1 (Red) of type Unit Position)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    Formation_Int_Loops[10] Equal to 28
                    (Unit-type of NWFormation_Units[28]) Not equal to Unit Position
                  Then - Actions
                    Neutral Building - Remove Servant (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Priest (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Mount (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Mercenary Captain (Fake) from Command Center 0114 <gen>
                  Else - Actions
                    Neutral Building - Remove Servant (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Priest (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Mount (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Construction Team from Command Center 0114 <gen>
                    Neutral Building - Remove Fletcher (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Blacksmith (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Magic Guild Representative (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Mercenary Captain (Fake) from Command Center 0114 <gen>
                    Neutral Building - Remove Worker (Fake) from Command Center 0114 <gen>
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Number of units in Unit_Position_Amounts[1]) Greater than 0
                      Then - Actions
                        Neutral Building - Add Servant (Fake) to Command Center 0114 <gen> with (Number of units in Unit_Position_Amounts[1]) in stock and a max stock of (Number of units in Unit_Position_Amounts[1])
                        Neutral Building - Add Mount (Fake) to Command Center 0114 <gen> with (Number of units in Unit_Position_Amounts[1]) in stock and a max stock of (Number of units in Unit_Position_Amounts[1])
                        If (Merc_Captain[1] Equal to False) then do (Add Mercenary Captain (Fake) to Command Center 0114 <gen> with 1 in stock and a max stock of 1) else do (Do nothing)
                      Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Number of units in Unit_Position_Amounts[1]) Less than or equal to (5 - (Number of units in Priest_Amount_Groups[1]))
                      Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Number of units in Unit_Position_Amounts[1]) Less than or equal to 0
                          Then - Actions
                          Else - Actions
                            Neutral Building - Add Priest (Fake) to Command Center 0114 <gen> with (Number of units in Unit_Position_Amounts[1]) in stock and a max stock of (Number of units in Unit_Position_Amounts[1])
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (5 - (Number of units in Priest_Amount_Groups[1])) Less than or equal to 0
                          Then - Actions
                          Else - Actions
                            Neutral Building - Add Priest (Fake) to Command Center 0114 <gen> with (5 - (Number of units in Priest_Amount_Groups[1])) in stock and a max stock of (5 - (Number of units in Priest_Amount_Groups[1]))
                    Neutral Building - Add Construction Team to Command Center 0114 <gen> with 1 in stock and a max stock of 1
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        Mage_Rep_Count[1] Less than 3
                      Then - Actions
                        Neutral Building - Add Magic Guild Representative (Fake) to Command Center 0114 <gen> with (3 - Mage_Rep_Count[1]) in stock and a max stock of (3 - Mage_Rep_Count[1])
                      Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Current research level of R000 (techcode) for Player 1 (Red)) Equal to 3
                      Then - Actions
                      Else - Actions
                        Neutral Building - Add Fletcher (Fake) to Command Center 0114 <gen> with (3 - (Current research level of R000 (techcode) for Player 1 (Red))) in stock and a max stock of (3 - (Current research level of R000 (techcode) for Player 1 (Red)))
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Current research level of R001 (techcode) for Player 1 (Red)) Equal to 4
                      Then - Actions
                      Else - Actions
                        Neutral Building - Add Blacksmith (Fake) to Command Center 0114 <gen> with (4 - (Current research level of R001 (techcode) for Player 1 (Red))) in stock and a max stock of (4 - (Current research level of R001 (techcode) for Player 1 (Red)))
                    Neutral Building - Add Worker (Fake) to Command Center 0114 <gen> with 1 in stock and a max stock of 1
                Unit - Remove (Triggering unit) from the game
                Custom script: call DestroyGroup(udg_Priest_Amount_Groups[1])
                Custom script: call DestroyGroup(udg_Unit_Position_Amounts[1])
                Skip remaining actions
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
      Then - Actions
        For each (Integer Formation_Int_Loops[10]) from 1 to 28, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of NEFormation_Units[Formation_Int_Loops[10]]) Equal to Unit Position
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Unit-type of (Triggering unit)) Equal to Servant (Fake)
                  Then - Actions
                    Unit - Replace NEFormation_Units[Formation_Int_Loops[10]] with a Servant using The new unit's default life and mana
                    Set VariableSet NEFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                    Unit Group - Add NEFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[2]
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Unit-type of (Triggering unit)) Equal to Priest (Fake)
                      Then - Actions
                        Unit - Replace NEFormation_Units[Formation_Int_Loops[10]] with a Priest using The new unit's default life and mana
                        Set VariableSet NEFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                        Unit Group - Add NEFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[2]
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Unit-type of (Triggering unit)) Equal to Mount (Fake)
                          Then - Actions
                            Unit - Replace NEFormation_Units[Formation_Int_Loops[10]] with a Mount using The new unit's default life and mana
                            Set VariableSet NEFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                            Unit Group - Add NEFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[2]
                          Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                (Unit-type of (Triggering unit)) Equal to Mercenary Captain (Fake)
                              Then - Actions
                                Set VariableSet Merc_Captain[2] = True
                                Unit - Replace NEFormation_Units[Formation_Int_Loops[10]] with a Mercenary Captain using The new unit's default life and mana
                                Set VariableSet NEFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                                Unit Group - Add NEFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[2]
                                Unit Group - Pick every unit in Unit_Position_Amounts[2] and do (Actions)
                                  Loop - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R012 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Orc Shaman to (Picked unit)
                                        Unit - Remove Hire Orc Shaman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R010 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Spectral Phantom to (Picked unit)
                                        Unit - Remove Hire Spectral Phantom (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00V (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Gnoll Crossbowman to (Picked unit)
                                        Unit - Remove Hire Gnoll Crossbowman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00X (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Troll Ninja to (Picked unit)
                                        Unit - Remove Hire Troll Ninja (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Y (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Goblin Bombers to (Picked unit)
                                        Unit - Remove Hire Goblin Bombers (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R014 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Blood Elf Outcast to (Picked unit)
                                        Unit - Remove Hire Blood Elf Outcast (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00W (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Dwarven Chopper to (Picked unit)
                                        Unit - Remove Hire Dwarven Chopper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R011 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Tauren Underling to (Picked unit)
                                        Unit - Remove Hire Tauren Underling (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Z (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Mountain Giant to (Picked unit)
                                        Unit - Remove Hire Mountain Giant (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R013 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Nerubian Scorper to (Picked unit)
                                        Unit - Remove Hire Nerubian Scorper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00U (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Lordaeron Pirate to (Picked unit)
                                        Unit - Remove Hire Lordaeron Pirate (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R01M (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Centaurian Brute to (Picked unit)
                                        Unit - Remove Hire Centaurian Brute (Fake) from (Picked unit)
                                      Else - Actions
                              Else - Actions
                Set VariableSet Priest_Amount_Groups[2] = (Units owned by Player 2 (Blue) matching (((Unit-type of (Matching unit)) Equal to Priest) or (((Unit-type of (Matching unit)) Equal to Cleric) or (((Unit-type of (Matching unit)) Equal to Necromancer) or (((Unit-type of (Matching unit)) Equal to Surgeon) or ((Unit-type of (Matching unit)) Equal to Field Medic))))).)
                Custom script: call DestroyGroup(udg_Unit_Position_Amounts[2])
                Set VariableSet Unit_Position_Amounts[2] = (Units owned by Player 2 (Blue) of type Unit Position)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Unit-type of NEFormation_Units[28]) Not equal to Unit Position
                  Then - Actions
                    Neutral Building - Remove Servant (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Priest (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Mount (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Mercenary Captain (Fake) from Command Center 0125 <gen>
                  Else - Actions
                    Neutral Building - Remove Servant (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Priest (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Mount (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Construction Team from Command Center 0125 <gen>
                    Neutral Building - Remove Fletcher (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Blacksmith (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Magic Guild Representative (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Mercenary Captain (Fake) from Command Center 0125 <gen>
                    Neutral Building - Remove Worker (Fake) from Command Center 0125 <gen>
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Number of units in Unit_Position_Amounts[2]) Greater than 0
                      Then - Actions
                        Neutral Building - Add Servant (Fake) to Command Center 0125 <gen> with (Number of units in Unit_Position_Amounts[2]) in stock and a max stock of (Number of units in Unit_Position_Amounts[2])
                        Neutral Building - Add Mount (Fake) to Command Center 0125 <gen> with (Number of units in Unit_Position_Amounts[2]) in stock and a max stock of (Number of units in Unit_Position_Amounts[2])
                        If (Merc_Captain[2] Equal to False) then do (Add Mercenary Captain (Fake) to Command Center 0125 <gen> with 1 in stock and a max stock of 1) else do (Do nothing)
                      Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Number of units in Unit_Position_Amounts[2]) Less than or equal to (5 - (Number of units in Priest_Amount_Groups[2]))
                      Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Number of units in Unit_Position_Amounts[2]) Less than or equal to 0
                          Then - Actions
                          Else - Actions
                            Neutral Building - Add Priest (Fake) to Command Center 0125 <gen> with (Number of units in Unit_Position_Amounts[2]) in stock and a max stock of (Number of units in Unit_Position_Amounts[2])
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (5 - (Number of units in Priest_Amount_Groups[2])) Less than or equal to 0
                          Then - Actions
                          Else - Actions
                            Neutral Building - Add Priest (Fake) to Command Center 0125 <gen> with (5 - (Number of units in Priest_Amount_Groups[2])) in stock and a max stock of (5 - (Number of units in Priest_Amount_Groups[2]))
                    Neutral Building - Add Construction Team to Command Center 0125 <gen> with 1 in stock and a max stock of 1
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        Mage_Rep_Count[2] Less than 3
                      Then - Actions
                        Neutral Building - Add Magic Guild Representative (Fake) to Command Center 0125 <gen> with (3 - Mage_Rep_Count[2]) in stock and a max stock of (3 - Mage_Rep_Count[2])
                      Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Current research level of R000 (techcode) for Player 2 (Blue)) Equal to 3
                      Then - Actions
                      Else - Actions
                        Neutral Building - Add Fletcher (Fake) to Command Center 0125 <gen> with (3 - (Current research level of R000 (techcode) for Player 2 (Blue))) in stock and a max stock of (3 - (Current research level of R000 (techcode) for Player 2 (Blue)))
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Current research level of R001 (techcode) for Player 2 (Blue)) Equal to 4
                      Then - Actions
                      Else - Actions
                        Neutral Building - Add Blacksmith (Fake) to Command Center 0125 <gen> with (4 - (Current research level of R001 (techcode) for Player 2 (Blue))) in stock and a max stock of (4 - (Current research level of R001 (techcode) for Player 2 (Blue)))
                    Neutral Building - Add Worker (Fake) to Command Center 0125 <gen> with 1 in stock and a max stock of 1
                Unit - Remove (Triggering unit) from the game
                Custom script: call DestroyGroup(udg_Priest_Amount_Groups[2])
                Custom script: call DestroyGroup(udg_Unit_Position_Amounts[2])
                Skip remaining actions
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
      Then - Actions
        For each (Integer Formation_Int_Loops[10]) from 1 to 28, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of SWFormation_Units[Formation_Int_Loops[10]]) Equal to Unit Position
              Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Unit-type of (Triggering unit)) Equal to Servant (Fake)
                  Then - Actions
                    Unit - Replace SWFormation_Units[Formation_Int_Loops[10]] with a Servant using The new unit's default life and mana
                    Set VariableSet SWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                    Unit Group - Add SWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[3]
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Unit-type of (Triggering unit)) Equal to Priest (Fake)
                      Then - Actions
                        Unit - Replace SWFormation_Units[Formation_Int_Loops[10]] with a Priest using The new unit's default life and mana
                        Set VariableSet SWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                        Unit Group - Add SWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[3]
                      Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            (Unit-type of (Triggering unit)) Equal to Mount (Fake)
                          Then - Actions
                            Unit - Replace SWFormation_Units[Formation_Int_Loops[10]] with a Mount using The new unit's default life and mana
                            Set VariableSet SWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                            Unit Group - Add SWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[3]
                          Else - Actions
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              If - Conditions
                                (Unit-type of (Triggering unit)) Equal to Mercenary Captain (Fake)
                              Then - Actions
                                Set VariableSet Merc_Captain[3] = True
                                Unit - Replace SWFormation_Units[Formation_Int_Loops[10]] with a Mercenary Captain using The new unit's default life and mana
                                Set VariableSet SWFormation_Units[Formation_Int_Loops[10]] = (Last replaced unit)
                                Unit Group - Add SWFormation_Units[Formation_Int_Loops[10]] to Formation_Groups[3]
                                Unit Group - Pick every unit in Unit_Position_Amounts[3] and do (Actions)
                                  Loop - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R012 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Orc Shaman to (Picked unit)
                                        Unit - Remove Hire Orc Shaman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R010 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Spectral Phantom to (Picked unit)
                                        Unit - Remove Hire Spectral Phantom (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00V (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Gnoll Crossbowman to (Picked unit)
                                        Unit - Remove Hire Gnoll Crossbowman (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00X (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Troll Ninja to (Picked unit)
                                        Unit - Remove Hire Troll Ninja (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Y (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Goblin Bombers to (Picked unit)
                                        Unit - Remove Hire Goblin Bombers (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R014 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Blood Elf Outcast to (Picked unit)
                                        Unit - Remove Hire Blood Elf Outcast (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00W (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Dwarven Chopper to (Picked unit)
                                        Unit - Remove Hire Dwarven Chopper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R011 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Tauren Underling to (Picked unit)
                                        Unit - Remove Hire Tauren Underling (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00Z (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Mountain Giant to (Picked unit)
                                        Unit - Remove Hire Mountain Giant (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R013 (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Nerubian Scorper to (Picked unit)
                                        Unit - Remove Hire Nerubian Scorper (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R00U (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Lordaeron Pirate to (Picked unit)
                                        Unit - Remove Hire Lordaeron Pirate (Fake) from (Picked unit)
                                      Else - Actions
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                      If - Conditions
                                        (Current research level of R01M (techcode) for (Owner of (Last replaced unit))) Equal to 1
                                      Then - Actions
                                        Unit - Add Hire Centaurian Brute to (Picked unit)
                                        Unit - Remove Hire Centaurian Brute (Fake) from (Picked unit)
                                      Else - Actions
                              Else - Actions
                Set VariableSet Priest_Amount_Groups[3] = (Units owned by Player 3 (Teal) matching (((Unit-type of (Matching unit)) Equal to Priest) or (((Unit-type of (Matching unit)) Equal to Cleric) or (((Unit-type of (Matching unit)) Equal to Necromancer) or (((Unit-type of (Matching unit)) Equal to Surgeon) or ((Unit-type of (Matching unit)) Equal to Field Medic))))).)
                Custom script: call DestroyGroup(udg_Unit_Position_Amounts[3])