1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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

Age of War Protected.w3x
Variables
Init
Gametext
String
Units
Music
Player
Region
Debug
Integer
Floating Text
Game
Unit
Player Trained
Player Ordered
Killing Unit
All Age Group
Base Kill First
Base Kill First 2
Base Kill
Utility
Center Upgrade
Center Upgrade Finish
Center Upgrade Cancel
Center Upgrade Begins
Dummy Upgrade
Income Upgrade
Income Upgrade Status
Income Mana Reached
Player Respawn
Player Respawn 2
Player
AI
AI Starts
AI Upgrade Tower 1
AI Upgrade Tower List
AI Upgrade Center
AI Spawns
AI Unit Spawn Integer
AI Upgrade Stage
AI Stage Upgraded
Trigger Player
Player Defeat
Player Left
Quest
Quests
Ability
Meteor Strike
Space Command
Archer Tank
Heli Attack
Sky Bash
Sky Attack
Region
Special Unit R1
Special Unit R2
Special Unit R3
Special Unit R4
Special Unit R5
Special Unit R6
Special Unit R7
Special Unit R8
DEBUG
Info
DEBUG BaseKill
DEBUG Player ID
DEBUG Area ID
DEBUG Showall
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
ActivePlayers player Yes
AI_Research integer Yes
AI_Stage integer Yes
AI_UnitSpawnRandom integer Yes
AIPlayer player Yes
AmountOfPlayer integer No
DEBUG_AreaID texttag Yes
DEBUG_AreaIDBol boolean No
DEBUG_BaseKillSpawn location No
DEBUG_BaseKillSpawnerId integer No
DEBUG_BaseKillTargetId integer No
DEBUG_PlayerID texttag Yes
DEBUG_PlayerIDBol boolean No
DEBUGMODE boolean No false
DyingPlayer player No
FirstPlayerDefeat boolean No
FutureAgeUnit unitcode Yes
IdlePlayer player Yes
IncomeUnitRegion rect Yes
KillingPlayer player No
MainBaseR rect Yes
MedievalAgeUnit unitcode Yes
MidFuturisticAgeUnit unitcode Yes
ModernAgeUnit unitcode Yes
OpposingBaseR rect Yes
PlayerArea rect Yes
PlayerEnemy integer Yes
PlayerName string Yes
PlayerOpposition rect Yes
PlayerOppositionP player Yes
PlayerTower rect Yes
RennaissanceAgeUnit unitcode Yes
SpartianlAgeUnit unitcode Yes
SpecAbiUnit unitcode Yes
SpecUnitRegion rect Yes
StoneAgeUnit unitcode Yes
TempInt integer No 1
TempLoc location No
UnitBase unit Yes
UnitStopSpawn boolean Yes
UnitTrained integer Yes
UpgradeCenterR rect Yes
Gametext
  Events
  Conditions
  Actions
    Game - Display to (All players) the text: Welcome in Age of War.Enjoy the game and have fun!
String
  Events
    Map initialization
  Conditions
  Actions
    Set VariableSet PlayerName[0] = |cff808080N/A|r
    Set VariableSet PlayerName[1] = (|CFFFF0303 + ((Name of (Player(1))) + |r))
    Set VariableSet PlayerName[2] = (|CFF0042FF + ((Name of (Player(2))) + |r))
    Set VariableSet PlayerName[3] = (|cff00ffff + ((Name of (Player(3))) + |r))
    Set VariableSet PlayerName[4] = (|CFF540081 + ((Name of (Player(4))) + |r))
    Set VariableSet PlayerName[5] = (|CFFFFFF01 + ((Name of (Player(5))) + |r))
    Set VariableSet PlayerName[6] = (|CFFFE8A0E + ((Name of (Player(6))) + |r))
    Set VariableSet PlayerName[7] = (|CFF20C000 + ((Name of (Player(7))) + |r))
    Set VariableSet PlayerName[8] = (|CFFE55BB0 + ((Name of (Player(8))) + |r))
    Set VariableSet PlayerName[9] = (|CFF959697 + ((Name of (Player(9))) + |r))
    Set VariableSet PlayerName[10] = (|CFF7EBFF1 + ((Name of (Player(10))) + |r))
    Set VariableSet PlayerName[11] = (|CFF106246 + ((Name of (Player(11))) + |r))
    Set VariableSet PlayerName[12] = (|CFF4E2A04 + ((Name of (Player(12))) + |r))
Units
  Events
  Conditions
  Actions
    Set VariableSet MidFuturisticAgeUnit[1] = Assault Drone
    Set VariableSet MidFuturisticAgeUnit[2] = Tank Drone
    Set VariableSet MidFuturisticAgeUnit[3] = Mini-Tank Drone
    Set VariableSet MidFuturisticAgeUnit[4] = Flamethrower Tank
    Set VariableSet MidFuturisticAgeUnit[5] = Volt Drone
    Set VariableSet MidFuturisticAgeUnit[6] = Mega Assault Drone
    Set VariableSet MidFuturisticAgeUnit[7] = Alpha Tank Drone
    Set VariableSet MidFuturisticAgeUnit[8] = Tesla Mini-Tank Drone
    Set VariableSet MidFuturisticAgeUnit[9] = Inferno Tank
    Set VariableSet MidFuturisticAgeUnit[10] = Tesla Drone
    Set VariableSet FutureAgeUnit[1] = Robotic Warrior
    Set VariableSet FutureAgeUnit[2] = Robotic Marine
    Set VariableSet FutureAgeUnit[3] = Advanced Robotic Warrior
    Set VariableSet FutureAgeUnit[4] = Advanced Robotic Marine
    Set VariableSet FutureAgeUnit[5] = Titanium Robotic Warrior
    Set VariableSet FutureAgeUnit[6] = Titanium Robotic Marine
    Set VariableSet FutureAgeUnit[7] = Advanced Titanium Robotic Warrior
    Set VariableSet FutureAgeUnit[8] = Advanced Titanium Robotic Marine
    Set VariableSet FutureAgeUnit[9] = Hunter
    Set VariableSet ModernAgeUnit[1] = Infantry
    Set VariableSet ModernAgeUnit[2] = Rocketeer
    Set VariableSet ModernAgeUnit[3] = M-163
    Set VariableSet ModernAgeUnit[4] = Tank
    Set VariableSet ModernAgeUnit[5] = Elite Infantry
    Set VariableSet ModernAgeUnit[6] = Elite Rocketeer
    Set VariableSet ModernAgeUnit[7] = Advanced M-163
    Set VariableSet ModernAgeUnit[8] = Advanced Tank
    Set VariableSet ModernAgeUnit[9] = Helicopter (Unit)
    Set VariableSet RennaissanceAgeUnit[1] = Duelist
    Set VariableSet RennaissanceAgeUnit[2] = Musketeer
    Set VariableSet RennaissanceAgeUnit[3] = Cannoneer
    Set VariableSet RennaissanceAgeUnit[4] = Rennaissance Knight
    Set VariableSet RennaissanceAgeUnit[5] = Elite Duelist
    Set VariableSet RennaissanceAgeUnit[6] = Elite Musketeer
    Set VariableSet RennaissanceAgeUnit[7] = Elite Cannoneer
    Set VariableSet RennaissanceAgeUnit[8] = Elite Rennaissance Knight
    Set VariableSet RennaissanceAgeUnit[9] = Gyrocopter
    Set VariableSet MedievalAgeUnit[1] = Footman
    Set VariableSet MedievalAgeUnit[2] = Archer
    Set VariableSet MedievalAgeUnit[3] = Knight
    Set VariableSet MedievalAgeUnit[4] = Siege Tank
    Set VariableSet MedievalAgeUnit[5] = Swordman
    Set VariableSet MedievalAgeUnit[6] = Wizard
    Set VariableSet MedievalAgeUnit[7] = Blood Elf Lieutenant
    Set VariableSet MedievalAgeUnit[8] = Spell Breaker
    Set VariableSet MedievalAgeUnit[9] = Green Drake
    Set VariableSet SpartianlAgeUnit[1] = Spartan
    Set VariableSet SpartianlAgeUnit[2] = Advanced Spartan
    Set VariableSet SpartianlAgeUnit[3] = Imperial Spartan
    Set VariableSet SpartianlAgeUnit[4] = Advanced Imperial Spartan
    Set VariableSet SpartianlAgeUnit[5] = Elite Spartan
    Set VariableSet SpartianlAgeUnit[6] = Advanced Elite Spartan
    Set VariableSet SpartianlAgeUnit[7] = Elite Imperial Spartan
    Set VariableSet SpartianlAgeUnit[8] = Advanced Elite Imperial Spartan
    Set VariableSet StoneAgeUnit[1] = Caveman
    Set VariableSet StoneAgeUnit[2] = Stone Piercer
    Set VariableSet StoneAgeUnit[3] = Clubman
    Set VariableSet StoneAgeUnit[4] = Dino Rider
    Set VariableSet StoneAgeUnit[5] = Intermidete Caveman
    Set VariableSet StoneAgeUnit[6] = Intermidete Stone Piercer
    Set VariableSet StoneAgeUnit[7] = Blood Elf Lieutenant
    Set VariableSet StoneAgeUnit[8] = Intermidete Dino Rider
    Set VariableSet StoneAgeUnit[9] = Stone Rider
    -------- Special Ability Units --------
    Set VariableSet SpecAbiUnit[1] = Armored Wooden Tank
    Set VariableSet SpecAbiUnit[2] = Gryphon Rider
    Set VariableSet SpecAbiUnit[3] = Flying Machine
    Set VariableSet SpecAbiUnit[4] = Helicopter
    Set VariableSet SpecAbiUnit[5] = Spaceship
    Set VariableSet TempInt = 0
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Picked player) Not equal to Player 9 (Gray)
          Then - Actions
            Set VariableSet TempLoc = (Center of MainBaseR[PlayerEnemy[(Player number of (Picked player))]])
            Unit - Create 1.Empty Base for (Picked player) at TempLoc facing Default building facing degrees
            Set VariableSet UnitBase[(Player number of (Picked player))] = (Last created unit)
            Unit - Order (Last created unit) to train/upgrade to a Cavemen's Den
            Custom script: call RemoveLocation(udg_TempLoc)
            Set VariableSet TempLoc = (Center of PlayerTower[PlayerEnemy[(Player number of (Picked player))]])
            Unit - Create 1.Empty Lot for (Picked player) at TempLoc facing Default building facing degrees
            Custom script: call RemoveLocation(udg_TempLoc)
            Set VariableSet TempLoc = (Center of UpgradeCenterR[PlayerEnemy[(Player number of (Picked player))]])
            Unit - Create 1.Upgrade Center for (Picked player) at TempLoc facing Default building facing degrees
            Unit - Remove Rally from (Last created unit)
            Custom script: call RemoveLocation(udg_TempLoc)
            Set VariableSet TempLoc = (Center of IncomeUnitRegion[PlayerEnemy[(Player number of (Picked player))]])
            Unit - Create 1.Empty Lot (Income) for (Picked player) at TempLoc facing Default building facing degrees
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        -------- Dummy Upgrade --------
        Player - Limit training of Improved Caveman Training (Stone Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Clubman Training (Stone Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Dino Rider Training (Stone Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Stone Piercer Training (Stone Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Stone Rider Research (Stone Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Spartan Training (Spartan Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Imperial Spartan Training (Spartan Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Advanced Spartan Training (Spartan Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Advanced Imperial Spartan Training (Spartan Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Green Drake Research (Medieval Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Footman Training (Medieval Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Knight Training (Medieval Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Spell Breaker Training (Medieval Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Wizard Training (Medieval Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Gyrocopter Research (Rennaissance Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Duelist Training (Rennaissance Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Musketeer Training (Rennaissance Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Cannoneer Training (Rennaissance Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Rennaissance Knight Training (Rennaissance Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Infantry Training (Modern Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Rocketeer Training (Modern Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved M-163 Research (Modern Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Tank Research (Modern Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Helicopter Research (Modern Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Robotic Warrior (Early Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Improved Robotic Marine (Early Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Advanced Robotic Marine (Early Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Advanced Robotic Warrior (Early Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Hunter Research (Early Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Alpha Tank Drone (Middle Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Tesla Drone (Middle Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Tesla Mini-Tank Drone (Middle Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Inferno Tank (Middle Future Age Upgrade) to 1 for (Picked player)
        Player - Limit training of Mega Assault Drone (Middle Future Age Upgrade) to 1 for (Picked player)
    For each (Integer A) from 1 to 4, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (ActivePlayers[(((Integer A) x 2) - 1)] slot status) Equal to Is playing
            (ActivePlayers[((Integer A) x 2)] slot status) Not equal to Is playing
          Then - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by ActivePlayers[(((Integer A) x 2) - 1)].) and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Set VariableSet IdlePlayer[0] = ActivePlayers[(((Integer A) x 2) - 1)]
            Game - Display to (Player group(ActivePlayers[(((Integer A) x 2) - 1)])) the text: |cffffcc00There's not enough players to duel with.You have to wait for any player to beat their opponent.|r
          Else - Actions
Music
  Events
  Conditions
  Actions
    Sound - Play Waterflame___Glorious_morning <gen>
Player
  Events
    Time - Elapsed game time is 0.00 seconds
  Conditions
  Actions
    Set VariableSet PlayerOppositionP[1] = Player 3 (Teal)
    Set VariableSet PlayerOppositionP[2] = Player 4 (Purple)
    Set VariableSet PlayerOppositionP[3] = Player 1 (Red)
    Set VariableSet PlayerOppositionP[4] = Player 2 (Blue)
    Set VariableSet PlayerOppositionP[5] = Player 8 (Pink)
    Set VariableSet PlayerOppositionP[6] = Player 7 (Green)
    Set VariableSet PlayerOppositionP[7] = Player 6 (Orange)
    Set VariableSet PlayerOppositionP[8] = Player 5 (Yellow)
    Set VariableSet PlayerOppositionP[9] = Player 12 (Brown)
    Set VariableSet PlayerOppositionP[10] = Player 11 (Dark Green)
    Set VariableSet PlayerOppositionP[11] = Player 10 (Light Blue)
    Set VariableSet PlayerOppositionP[12] = Player 9 (Gray)
    For each (Integer A) from 1 to 8, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player((Integer A))) slot status) Equal to Is playing
          Then - Actions
            Set VariableSet PlayerEnemy[(Integer A)] = TempInt
            If (TempInt Equal to 2) then do (Set VariableSet PlayerEnemy[(Integer A)] = 3) else do (Do nothing)
            If (TempInt Equal to 3) then do (Set VariableSet PlayerEnemy[(Integer A)] = 2) else do (Do nothing)
            If (TempInt Equal to 5) then do (Set VariableSet PlayerEnemy[(Integer A)] = 6) else do (Do nothing)
            If (TempInt Equal to 6) then do (Set VariableSet PlayerEnemy[(Integer A)] = 7) else do (Do nothing)
            If (TempInt Equal to 7) then do (Set VariableSet PlayerEnemy[(Integer A)] = 5) else do (Do nothing)
            Set VariableSet ActivePlayers[TempInt] = (Player((Integer A)))
            Set VariableSet TempInt = (TempInt + 1)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player((Integer A))) slot status) Not equal to Is playing
          Then - Actions
            Set VariableSet PlayerName[(Integer A)] = PlayerName[0]
          Else - Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Visibility_1 <gen>
        Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Visibility_2 <gen>
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Picked player) controller) Equal to Computer
          Then - Actions
            Set VariableSet AIPlayer[(Player number of (Picked player))] = (Picked player)
            Set VariableSet AI_UnitSpawnRandom[(Player number of (Picked player))] = 2
          Else - Actions
        Player - Turn Gives bounty On for (Picked player)
        Player - Set (Picked player).Current gold to 300
        For each (Integer A) from 1 to 8, do (Actions)
          Loop - Actions
            For each (Integer B) from 1 to 8, do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Integer A) Not equal to (Integer B)
                  Then - Actions
                    Player - Make (Player((Integer A))) treat (Player((Integer B))) as an Enemy
                  Else - Actions
Region
  Events
    Map initialization
  Conditions
  Actions
    -------- Opposing Base --------
    Set VariableSet OpposingBaseR[1] = Base_3 <gen>
    Set VariableSet OpposingBaseR[2] = Base_4 <gen>
    Set VariableSet OpposingBaseR[3] = Base_1 <gen>
    Set VariableSet OpposingBaseR[4] = Base_2 <gen>
    Set VariableSet OpposingBaseR[5] = Base_8 <gen>
    Set VariableSet OpposingBaseR[6] = Base_7 <gen>
    Set VariableSet OpposingBaseR[7] = Base_6 <gen>
    Set VariableSet OpposingBaseR[8] = Base_5 <gen>
    -------- Player Base --------
    Set VariableSet MainBaseR[1] = Base_1 <gen>
    Set VariableSet MainBaseR[2] = Base_2 <gen>
    Set VariableSet MainBaseR[3] = Base_3 <gen>
    Set VariableSet MainBaseR[4] = Base_4 <gen>
    Set VariableSet MainBaseR[5] = Base_5 <gen>
    Set VariableSet MainBaseR[6] = Base_6 <gen>
    Set VariableSet MainBaseR[7] = Base_7 <gen>
    Set VariableSet MainBaseR[8] = Base_8 <gen>
    -------- Upgrade Center Region --------
    Set VariableSet UpgradeCenterR[1] = UpgradeCenter1 <gen>
    Set VariableSet UpgradeCenterR[2] = UpgradeCenter2 <gen>
    Set VariableSet UpgradeCenterR[3] = UpgradeCenter3 <gen>
    Set VariableSet UpgradeCenterR[4] = UpgradeCenter4 <gen>
    Set VariableSet UpgradeCenterR[5] = UpgradeCenter5 <gen>
    Set VariableSet UpgradeCenterR[6] = UpgradeCenter6 <gen>
    Set VariableSet UpgradeCenterR[7] = UpgradeCenter7 <gen>
    Set VariableSet UpgradeCenterR[8] = UpgradeCenter8 <gen>
    -------- Player Tower --------
    Set VariableSet PlayerTower[1] = PlayerTower1 <gen>
    Set VariableSet PlayerTower[2] = PlayerTower2 <gen>
    Set VariableSet PlayerTower[3] = PlayerTower3 <gen>
    Set VariableSet PlayerTower[4] = PlayerTower4 <gen>
    Set VariableSet PlayerTower[5] = PlayerTower5 <gen>
    Set VariableSet PlayerTower[6] = PlayerTower6 <gen>
    Set VariableSet PlayerTower[7] = PlayerTower7 <gen>
    Set VariableSet PlayerTower[8] = PlayerTower8 <gen>
    -------- Special Ability Region --------
    Set VariableSet SpecUnitRegion[1] = Special_Ability_1 <gen>
    Set VariableSet SpecUnitRegion[2] = Special_Ability_2 <gen>
    Set VariableSet SpecUnitRegion[3] = Special_Ability_3 <gen>
    Set VariableSet SpecUnitRegion[4] = Special_Ability_4 <gen>
    Set VariableSet SpecUnitRegion[5] = Special_Ability_5 <gen>
    Set VariableSet SpecUnitRegion[6] = Special_Ability_6 <gen>
    Set VariableSet SpecUnitRegion[7] = Special_Ability_7 <gen>
    Set VariableSet SpecUnitRegion[8] = Special_Ability_8 <gen>
    -------- Income Unit --------
    Set VariableSet IncomeUnitRegion[1] = Income_R_1 <gen>
    Set VariableSet IncomeUnitRegion[2] = Income_R_2 <gen>
    Set VariableSet IncomeUnitRegion[3] = Income_R_3 <gen>
    Set VariableSet IncomeUnitRegion[4] = Income_R_4 <gen>
    Set VariableSet IncomeUnitRegion[5] = Income_R_5 <gen>
    Set VariableSet IncomeUnitRegion[6] = Income_R_6 <gen>
    Set VariableSet IncomeUnitRegion[7] = Income_R_7 <gen>
    Set VariableSet IncomeUnitRegion[8] = Income_R_8 <gen>
    -------- Player Opposition --------
    Set VariableSet PlayerOpposition[1] = Special_Ability_3 <gen>
    Set VariableSet PlayerOpposition[2] = Special_Ability_4 <gen>
    Set VariableSet PlayerOpposition[3] = Special_Ability_1 <gen>
    Set VariableSet PlayerOpposition[4] = Special_Ability_2 <gen>
    Set VariableSet PlayerOpposition[5] = Special_Ability_8 <gen>
    Set VariableSet PlayerOpposition[6] = Special_Ability_7 <gen>
    Set VariableSet PlayerOpposition[7] = Special_Ability_6 <gen>
    Set VariableSet PlayerOpposition[8] = Special_Ability_5 <gen>
    -------- Player Area --------
    Set VariableSet PlayerArea[1] = Area_1 <gen>
    Set VariableSet PlayerArea[2] = Area_2 <gen>
    Set VariableSet PlayerArea[3] = Area_2 <gen>
    Set VariableSet PlayerArea[4] = Area_1 <gen>
    Set VariableSet PlayerArea[5] = Area_4 <gen>
    Set VariableSet PlayerArea[6] = Area_3 <gen>
    Set VariableSet PlayerArea[7] = Area_3 <gen>
    Set VariableSet PlayerArea[8] = Area_4 <gen>
Debug
  Events
    Map initialization
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUGMODE Equal to True
      Then - Actions
        Quest - Create a Optional quest titled |cff8080c0Debug|r with the description |cffffcc00Available Commands:|r-debug basekill <Player's ID> <Area ID> <Target Player's ID>-debug showplayer-debug showarea-debug showall, using icon path ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
      Else - Actions
Integer
  Events
    Map initialization
  Conditions
  Actions
    For each (Integer A) from 1 to 8, do (Actions)
      Loop - Actions
        Set VariableSet PlayerEnemy[(Integer A)] = (Integer A)
    Set VariableSet AmountOfPlayer = ((Number of players in (All players)) - 1)
Floating Text
  Events
    Map initialization
  Conditions
  Actions
    For each (Integer A) from 1 to 8, do (Actions)
      Loop - Actions
        Set VariableSet TempLoc = ((Player((Integer A))) start location)
        Floating Text - Create floating text that reads (Player + (String((Integer A)))) at TempLoc with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
        Custom script: call RemoveLocation(udg_TempLoc)
        Floating Text - Change (Last created floating text): Enable permanence
        Set VariableSet DEBUG_PlayerID[(Integer A)] = (Last created floating text)
        Floating Text - Hide DEBUG_PlayerID[(Integer A)] for (All players)
    -------- Area ID --------
    Set VariableSet TempLoc = (Center of Area_1 <gen>)
    Floating Text - Create floating text that reads Area 0 at TempLoc with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Custom script: call RemoveLocation(udg_TempLoc)
    Floating Text - Change (Last created floating text): Enable permanence
    Set VariableSet DEBUG_AreaID[0] = (Last created floating text)
    Floating Text - Hide DEBUG_AreaID[0] for (All players)
    Set VariableSet TempLoc = (Center of Area_2 <gen>)
    Floating Text - Create floating text that reads Area 1 at TempLoc with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Custom script: call RemoveLocation(udg_TempLoc)
    Floating Text - Change (Last created floating text): Enable permanence
    Set VariableSet DEBUG_AreaID[1] = (Last created floating text)
    Floating Text - Hide DEBUG_AreaID[1] for (All players)
    Set VariableSet TempLoc = (Center of Area_3 <gen>)
    Floating Text - Create floating text that reads Area 2 at TempLoc with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Custom script: call RemoveLocation(udg_TempLoc)
    Floating Text - Change (Last created floating text): Enable permanence
    Set VariableSet DEBUG_AreaID[2] = (Last created floating text)
    Floating Text - Hide DEBUG_AreaID[2] for (All players)
    Set VariableSet TempLoc = (Center of Area_4 <gen>)
    Floating Text - Create floating text that reads Area 3 at TempLoc with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Custom script: call RemoveLocation(udg_TempLoc)
    Floating Text - Change (Last created floating text): Enable permanence
    Set VariableSet DEBUG_AreaID[3] = (Last created floating text)
    Floating Text - Hide DEBUG_AreaID[3] for (All players)
Game
  Events
    Time - Elapsed game time is 2.00 seconds
  Conditions
  Actions
    Game - Display to (All players) for 10.00 seconds the text: |cffffcc00Duels: |r
    For each (Integer A) from 1 to 4, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (ActivePlayers[(((Integer A) x 2) - 1)] slot status) Equal to Is playing
            (ActivePlayers[((Integer A) x 2)] slot status) Equal to Is playing
          Then - Actions
            Game - Display to (All players) the text: ((Name of ActivePlayers[(((Integer A) x 2) - 1)]) + ( vs + (Name of ActivePlayers[((Integer A) x 2)])))
          Else - Actions
    Wait 2 seconds
    Trigger - Run Gametext <gen> (checking conditions)
    Trigger - Run Units <gen> (checking conditions)
    Trigger - Run Music <gen> (checking conditions)
    Trigger - Turn on AI_Starts <gen>
Player Trained
  Events
    Unit - A unit Finishes training a unit
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Owner of (Trained unit)) Equal to Player 1 (Red)
        (Owner of (Trained unit)) Equal to Player 2 (Blue)
        (Owner of (Trained unit)) Equal to Player 3 (Teal)
        (Owner of (Trained unit)) Equal to Player 4 (Purple)
        (Owner of (Trained unit)) Equal to Player 5 (Yellow)
        (Owner of (Trained unit)) Equal to Player 6 (Orange)
        (Owner of (Trained unit)) Equal to Player 7 (Green)
        (Owner of (Trained unit)) Equal to Player 8 (Pink)
  Actions
    Set VariableSet TempLoc = (Center of OpposingBaseR[PlayerEnemy[(Player number of (Owner of (Trained unit)))]])
    Unit - Order (Trained unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Trained unit)))]])
    Custom script: call RemoveLocation(udg_TempLoc)
Player Ordered
  Events
    Unit - A unit Is issued an order with no target
    Unit - A unit Is issued an order targeting a point
    Unit - A unit Is issued an order targeting an object
  Conditions
    And - All (Conditions) are true
      Conditions
        Or - Any (Conditions) are true
          Conditions
            (Owner of (Ordered unit)) Equal to Player 1 (Red)
            (Owner of (Ordered unit)) Equal to Player 2 (Blue)
            (Owner of (Ordered unit)) Equal to Player 3 (Teal)
            (Owner of (Ordered unit)) Equal to Player 4 (Purple)
            (Owner of (Ordered unit)) Equal to Player 5 (Yellow)
            (Owner of (Ordered unit)) Equal to Player 6 (Orange)
            (Owner of (Ordered unit)) Equal to Player 7 (Green)
            (Owner of (Ordered unit)) Equal to Player 8 (Pink)
        (Unit-type of (Ordered unit)) Not equal to Ender (Debugger)
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        UnitTrained[(Player number of (Owner of (Ordered unit)))] Equal to 0
      Then - Actions
        Set VariableSet UnitTrained[(Player number of (Owner of (Ordered unit)))] = 1
        Set VariableSet TempLoc = (Center of OpposingBaseR[PlayerEnemy[(Player number of (Owner of (Ordered unit)))]])
        Unit - Order (Ordered unit) to Attack-Move To.TempLoc
        Custom script: call RemoveLocation(udg_TempLoc)
        For each (Integer A) from 1 to 5, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Ordered unit)) Equal to SpecAbiUnit[(Integer A)]
              Then - Actions
                Set VariableSet TempLoc = (Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Ordered unit)))]])
                Unit - Order (Ordered unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Ordered unit)))]])
                Custom script: call RemoveLocation(udg_TempLoc)
              Else - Actions
        Set VariableSet UnitTrained[(Player number of (Owner of (Ordered unit)))] = 0
      Else - Actions
All Age Group
  Events
    Unit - A unit Dies
  Conditions
  Actions
    For each (Integer A) from 1 to 9000, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to FutureAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 170 and 200) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 130 and 160) to (Owner of (Dying unit)).Current lumber
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to ModernAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 140 and 170) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 100 and 130) to (Owner of (Dying unit)).Current lumber
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to RennaissanceAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 110 and 140) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 70 and 100) to (Owner of (Dying unit)).Current lumber
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to MedievalAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 80 and 110) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 70 and 100) to (Owner of (Dying unit)).Current lumber
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to SpartianlAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 50 and 80) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 40 and 70) to (Owner of (Dying unit)).Current lumber
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit-type of (Dying unit)) Equal to StoneAgeUnit[(Integer A)]
          Then - Actions
            Player - Add (Random integer number between 20 and 50) to (Owner of (Killing unit)).Current lumber
            Player - Add (Random integer number between 10 and 40) to (Owner of (Dying unit)).Current lumber
          Else - Actions
Base Kill First
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Dying unit) Equal to UnitBase[1]
        (Dying unit) Equal to UnitBase[2]
        (Dying unit) Equal to UnitBase[3]
        (Dying unit) Equal to UnitBase[4]
        (Dying unit) Equal to UnitBase[5]
        (Dying unit) Equal to UnitBase[6]
        (Dying unit) Equal to UnitBase[7]
        (Dying unit) Equal to UnitBase[8]
        (Dying unit) Equal to UnitBase[9]
        (Dying unit) Equal to UnitBase[10]
        (Dying unit) Equal to UnitBase[11]
        (Dying unit) Equal to UnitBase[12]
    FirstPlayerDefeat Equal to False
  Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Set VariableSet DyingPlayer = (Owner of (Dying unit))
    Set VariableSet KillingPlayer = (Owner of (Killing unit))
Base Kill First 2
  Events
    Unit - A unit Dies
  Conditions
    FirstPlayerDefeat Equal to False
  Actions
    Set VariableSet FirstPlayerDefeat = True
    Trigger - Turn on Base_Kill <gen>
Base Kill
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Dying unit) Equal to UnitBase[1]
        (Dying unit) Equal to UnitBase[2]
        (Dying unit) Equal to UnitBase[3]
        (Dying unit) Equal to UnitBase[4]
        (Dying unit) Equal to UnitBase[5]
        (Dying unit) Equal to UnitBase[6]
        (Dying unit) Equal to UnitBase[7]
        (Dying unit) Equal to UnitBase[8]
        (Dying unit) Equal to UnitBase[9]
        (Dying unit) Equal to UnitBase[10]
        (Dying unit) Equal to UnitBase[11]
        (Dying unit) Equal to UnitBase[12]
  Actions
    Custom script: if(udg_IdlePlayer[0] == null) then
    Set VariableSet IdlePlayer[0] = (Owner of (Killing unit))
    Custom script: elseif(udg_IdlePlayer[1] == null) then
    Set VariableSet IdlePlayer[1] = (Owner of (Killing unit))
    Custom script: endif
    Set VariableSet AmountOfPlayer = (AmountOfPlayer - 1)
    -------- Function --------
    Game - Display to (All players) the text: (PlayerName[(Player number of (Owner of (Killing unit)))] + ( has defeated + (PlayerName[(Player number of (Owner of (Dying unit)))] + !)))
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Set VariableSet DyingPlayer = (Owner of (Dying unit))
    Set VariableSet KillingPlayer = (Owner of (Killing unit))
Center Upgrade
  Events
    Unit - A unit Finishes an upgrade
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Castle
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) 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 Upgrade Center
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 1.5
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Keep
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) 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 Upgrade Center 1.5
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 2
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Futuristic Base
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) 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 Upgrade Center 2
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 3
              Else - Actions
      Else - Actions
Center Upgrade Finish
  Events
    Unit - A unit Finishes an upgrade
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Upgrade Center
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 1.5
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 2
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 3
  Actions
    Unit - Remove Rally from (Triggering unit)
Center Upgrade Cancel
  Events
    Unit - A unit Cancels an upgrade
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Upgrade Center
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 1.5
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 2
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 3
  Actions
    Unit - Remove Rally from (Triggering unit)
Center Upgrade Begins
  Events
    Unit - A unit Begins an upgrade
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Upgrade Center
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 1.5
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 2
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 3
  Actions
    Unit - Remove Rally from (Triggering unit)
Dummy Upgrade
  Events
    Unit - A unit Finishes training a unit
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Upgrade Center
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 1.5
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 2
        (Unit-type of (Triggering unit)) Equal to Upgrade Center 3
  Actions
    Set VariableSet TempLoc = (Center of Dummy_Upgrade_Pos <gen>)
    Unit - Move (Trained unit) instantly to TempLoc
    Custom script: call RemoveLocation(udg_TempLoc)
Income Upgrade
  Events
    Unit - A unit Finishes an upgrade
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Cavemen's Den
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Empty Lot (Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Well (Stone-Age Income)
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Picked unit)) Equal to Empty Lot
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Stone Age Tower Lvl 1
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Spartan Barrack
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Well (Stone-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Gold Mine (Spartan-Age Income)
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Castle
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Gold Mine (Spartan-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Marketplace (Medieval-Age Income)
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Keep
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Marketplace (Medieval-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Rennaissance Marketplace (Rennaissance-Age Income)
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Powerplant Barrack
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Rennaissance Marketplace (Rennaissance-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Powerplant (Modern-Age Income)
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Futuristic Base
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Powerplant (Modern-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Atom Harvester (Futuristic-Age Income)
              Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Futuristic Citadel
      Then - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of (Triggering unit))) 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 Atom Harvester (Futuristic-Age Income)
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Pulse Generator (Middle Futuristic-Age Income)
              Else - Actions
      Else - Actions
Income Upgrade Status
  Events
    Unit - A unit Begins an upgrade
    Unit - A unit Cancels an upgrade
    Unit - A unit Finishes an upgrade
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Empty Lot (Income)
        (Unit-type of (Triggering unit)) Equal to Well (Stone-Age Income)
        (Unit-type of (Triggering unit)) Equal to Gold Mine (Spartan-Age Income)
        (Unit-type of (Triggering unit)) Equal to Marketplace (Medieval-Age Income)
        (Unit-type of (Triggering unit)) Equal to Rennaissance Marketplace (Rennaissance-Age Income)
        (Unit-type of (Triggering unit)) Equal to Powerplant (Modern-Age Income)
        (Unit-type of (Triggering unit)) Equal to Atom Harvester (Futuristic-Age Income)
        (Unit-type of (Triggering unit)) Equal to Pulse Generator (Middle Futuristic-Age Income)
  Actions
    Unit - Set mana of (Triggering unit) to 0
Income Mana Reached
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units in (Playable map area)) 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 Well (Stone-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 100 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Gold Mine (Spartan-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 500 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Marketplace (Medieval-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 600 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Rennaissance Marketplace (Rennaissance-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 750 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Powerplant (Modern-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 850 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Atom Harvester (Futuristic-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 1300 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Unit-type of (Picked unit)) Equal to Pulse Generator (Middle Futuristic-Age Income)) and ((Mana of (Picked unit)) Greater than or equal to 30.00)
          Then - Actions
            Unit - Set mana of (Picked unit) to 0
            Player - Add 1800 to (Owner of (Picked unit)).Current gold
            Set VariableSet TempLoc = (Position of (Picked unit))
            Special Effect - Create a special effect at TempLoc using Objects\InventoryItems\PotofGold\PotofGold.mdl
            Special Effect - Destroy (Last created special effect)
            Custom script: call RemoveLocation(udg_TempLoc)
          Else - Actions
function Trig_Player_Respawn_Actions takes nothing returns nothing
    local integer i = 0
    local integer countU = 0
    local boolean isFound = false
    local group ug = CreateGroup()
    if(udg_IdlePlayer[0] != null and udg_IdlePlayer[1] != null) then
        loop
            exitwhen i == 9
            set i = i + 1
            call GroupEnumUnitsInRect(ug, udg_PlayerArea[i], null)
            set countU = CountUnitsInGroup(ug)
           
            if(countU == 0) then
                set isFound = true
            endif
           
            exitwhen isFound == true
        endloop
       
        if(i == 1 or i == 3) then
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[0])] = 1
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[1])] = 3
            call ConditionalTriggerExecute(gg_trg_Player_Respawn_2)
        elseif(i == 2 or i == 4) then
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[0])] = 2
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[1])] = 4
            call ConditionalTriggerExecute(gg_trg_Player_Respawn_2)
        elseif(i == 5 or i == 8) then
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[0])] = 5
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[1])] = 8
            call ConditionalTriggerExecute(gg_trg_Player_Respawn_2)
        elseif(i == 6 or i == 7) then
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[0])] = 6
            set udg_PlayerEnemy[GetConvertedPlayerId(udg_IdlePlayer[1])] = 7
            call ConditionalTriggerExecute(gg_trg_Player_Respawn_2)
        endif
    endif
    call DestroyGroup(ug)
endfunction

//===========================================================================
function InitTrig_Player_Respawn takes nothing returns nothing
    set gg_trg_Player_Respawn = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Player_Respawn, 5.00 )
    call TriggerAddAction( gg_trg_Player_Respawn, function Trig_Player_Respawn_Actions )
endfunction

 
Player Respawn 2
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AmountOfPlayer Equal to 2
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: |cff8000ffDuel Stage:|r |cffffcc00Final|r
        Sound - Play ClanInvitation <gen>
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AmountOfPlayer Equal to 4
          Then - Actions
            Game - Display to (All players) for 10.00 seconds the text: |cff8000ffDuel Stage:|r |cffffcc00Semi-Final|r
          Else - Actions
            Game - Display to (All players) for 10.00 seconds the text: |cff8000ffDuel Stage:|r |cffffcc00Normal|r
    Game - Display to (All players) the text: ((Name of IdlePlayer[0]) + ( vs + (Name of IdlePlayer[1])))
    -------- P 1 --------
    Set VariableSet TempLoc = (Center of MainBaseR[PlayerEnemy[(Player number of IdlePlayer[0])]])
    Unit - Create 1.Empty Base for IdlePlayer[0] at TempLoc facing Default building facing degrees
    Set VariableSet UnitBase[(Player number of IdlePlayer[0])] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a Cavemen's Den
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of PlayerTower[PlayerEnemy[(Player number of IdlePlayer[0])]])
    Unit - Create 1.Empty Lot for IdlePlayer[0] at TempLoc facing Default building facing degrees
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of UpgradeCenterR[PlayerEnemy[(Player number of IdlePlayer[0])]])
    Unit - Create 1.Upgrade Center for IdlePlayer[0] at TempLoc facing Default building facing degrees
    Unit - Remove Rally from (Last created unit)
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of IncomeUnitRegion[PlayerEnemy[(Player number of IdlePlayer[0])]])
    Unit - Create 1.Empty Lot (Income) for IdlePlayer[0] at TempLoc facing Default building facing degrees
    Custom script: call RemoveLocation(udg_TempLoc)
    -------- P 2 --------
    Set VariableSet TempLoc = (Center of MainBaseR[PlayerEnemy[(Player number of IdlePlayer[1])]])
    Unit - Create 1.Empty Base for IdlePlayer[1] at TempLoc facing Default building facing degrees
    Set VariableSet UnitBase[(Player number of IdlePlayer[1])] = (Last created unit)
    Unit - Order (Last created unit) to train/upgrade to a Cavemen's Den
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of PlayerTower[PlayerEnemy[(Player number of IdlePlayer[1])]])
    Unit - Create 1.Empty Lot for IdlePlayer[1] at TempLoc facing Default building facing degrees
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of UpgradeCenterR[PlayerEnemy[(Player number of IdlePlayer[1])]])
    Unit - Create 1.Upgrade Center for IdlePlayer[1] at TempLoc facing Default building facing degrees
    Unit - Remove Rally from (Last created unit)
    Custom script: call RemoveLocation(udg_TempLoc)
    Set VariableSet TempLoc = (Center of IncomeUnitRegion[PlayerEnemy[(Player number of IdlePlayer[1])]])
    Unit - Create 1.Empty Lot (Income) for IdlePlayer[1] at TempLoc facing Default building facing degrees
    Custom script: call RemoveLocation(udg_TempLoc)
    -------- END --------
    Custom script: set udg_IdlePlayer[0] = null
    Custom script: set udg_IdlePlayer[1] = null
AI Starts
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area) owned by AIPlayer[(Integer A)]) 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 Empty Base
              Then - Actions
                Unit - Order (Picked unit) to train/upgrade to a Cavemen's Den
                Set VariableSet AI_Stage[(Player number of AIPlayer[(Integer A)])] = (AI_Stage[(Player number of AIPlayer[(Integer A)])] + 1)
              Else - Actions
    Wait 5.50 seconds
    Trigger - Turn on AI_Spawns <gen>
    Trigger - Turn on AI_Unit_Spawn_Integer <gen>
    Trigger - Turn on AI_Upgrade_Stage <gen>
    Trigger - Turn on AI_Stage_Upgraded <gen>
    Trigger - Turn on AI_Upgrade_Tower_List <gen>
    Trigger - Run AI_Upgrade_Tower_1 <gen> (checking conditions)
AI Upgrade Tower 1
  Events
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Picked player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Empty Lot) and do (Actions)
              Loop - Actions
                Unit - Order (Picked unit) to train/upgrade to a Stone Age Tower Lvl 1
AI Upgrade Tower List
  Events
    Time - Every 2.00 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Stone Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 200
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Stone Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Stone Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Stone Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Stone Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 900
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Spartian Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Spartian Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 1500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Spartian Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Spartian Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 2000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Spartian Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Spartian Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 2400
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Medieval Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Medieval Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 2700
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Medieval Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Medieval Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 3000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Medieval Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Medieval Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 3500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Rennaissance Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Rennaissance Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 4250
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Rennaissance Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Rennaissance Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 5750
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Rennaissance Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Rennaissance Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 6500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Modern Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Modern Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 7300
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Modern Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Modern Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 7950
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Modern Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Modern Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 9000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Future Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Future Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 12500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Future Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Future Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 14000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Future Age Tower Lvl 3
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Future Age Tower Lvl 3) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 15500
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Middle Future Age Tower Lvl 1
                  Else - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Middle Future Age Tower Lvl 1) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 18000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Middle Future Age Tower Lvl 2
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Middle Future Age Tower Lvl 2) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current gold) Greater than or equal to 20000
                  Then - Actions
                    Unit - Order (Picked unit) to train/upgrade to a Middle Future Age Tower Lvl 3
                  Else - Actions
AI Upgrade Center
  Events
    Time - Every 2.00 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Upgrade Center 2) and do (Actions)
              Loop - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 3
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Upgrade Center) and do (Actions)
              Loop - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 1.5
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Upgrade Center 1.5) and do (Actions)
              Loop - Actions
                Unit - Order (Picked unit) to train/upgrade to a Upgrade Center 2
AI Spawns
  Events
    Time - Every 3.50 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Picked player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                UnitStopSpawn[(Player number of (Picked player))] Equal to False
              Then - Actions
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Futuristic Citadel) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a MidFuturisticAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Futuristic Base) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a FutureAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Powerplant Barrack) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a ModernAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Keep) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a RennaissanceAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Castle) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a MedievalAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Spartan Barrack) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a SpartianlAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units owned by AIPlayer[(Player number of (Picked player))] of type Cavemen's Den) and do (Actions)
                  Loop - Actions
                    Unit - Order (Picked unit) to train/upgrade to a StoneAgeUnit[(Random integer number between 1 and AI_UnitSpawnRandom[(Player number of (Picked player))])]
              Else - Actions
AI Unit Spawn Integer
  Events
    Time - Every 60.00 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Player number of (Matching player))]).) and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                AI_Stage[(Player number of AIPlayer[(Integer A)])] Equal to 1
                AI_UnitSpawnRandom[(Player number of (Picked player))] Less than 9
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Picked player))] = (AI_UnitSpawnRandom[(Player number of (Picked player))] + 1)
              Else - Actions
AI Upgrade Stage
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Futuristic Base) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 17500
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Futuristic Citadel
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Powerplant Barrack) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 12000
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Futuristic Base
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Keep) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 8000
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Powerplant Barrack
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Castle) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 6500
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Keep
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Spartan Barrack) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 3500
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Castle
                  Else - Actions
            Custom script: set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Picked player) of type Cavemen's Den) and do (Actions)
              Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    ((Picked player) Current lumber) Greater than or equal to 1500
                  Then - Actions
                    Set VariableSet UnitStopSpawn[(Player number of (Picked player))] = True
                    Unit - Order (Picked unit) to train/upgrade to a Spartan Barrack
                  Else - Actions
AI Stage Upgraded
  Events
    Unit - A unit Finishes an upgrade
  Conditions
  Actions
    For each (Integer A) from 1 to 12, do (Actions)
      Loop - Actions
        Player Group - Pick every player in (All players matching ((Matching player) Equal to AIPlayer[(Integer A)]).) and do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Futuristic Citadel
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Futuristic Base
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Powerplant Barrack
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Keep
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Castle
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Unit-type of (Triggering unit)) Equal to Spartan Barrack
              Then - Actions
                Set VariableSet AI_UnitSpawnRandom[(Player number of (Owner of (Triggering unit)))] = 2
                Set VariableSet UnitStopSpawn[(Player number of (Owner of (Triggering unit)))] = False
                Set VariableSet AI_Research[(Player number of (Owner of (Triggering unit)))] = 0
              Else - Actions
Player Defeat
  Events
    Unit - A unit Dies
  Conditions
    (Dying unit) Equal to UnitBase[(Player number of (Owner of (Dying unit)))]
  Actions
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: set bj_wantDestroyGroup = true
    Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit)).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
Player Left
  Events
    Player - Player 1 (Red) leaves the game
    Player - Player 2 (Blue) leaves the game
    Player - Player 3 (Teal) leaves the game
    Player - Player 4 (Purple) leaves the game
    Player - Player 5 (Yellow) leaves the game
    Player - Player 6 (Orange) leaves the game
    Player - Player 7 (Green) leaves the game
    Player - Player 8 (Pink) leaves the game
    Player - Player 9 (Gray) leaves the game
    Player - Player 10 (Light Blue) leaves the game
    Player - Player 11 (Dark Green) leaves the game
    Player - Player 12 (Brown) leaves the game
  Conditions
  Actions
    Game - Display to (All players) the text: (PlayerName[(Player number of (Triggering player))] + has left the game!)
Quests
  Events
    Map initialization
  Conditions
  Actions
    Quest - Create a Required quest titled Credits with the description [Model]Vermillion Edict.Kofi Bananeubz [Ken-E]JB McKnightFingolfinThe SilentSystemfre1Tarrasquekillst4rKitabatakeM0rbid [Amigurumi]FingolfinBlinkBoywingednoseringepsilonqassamzedjk2pacholofmolemanEm!General Frank[Icon]KimboIllidan(Evil)XGhostThrusterNFWarZombieThe SilentikillforeyoudansaDiscoepsilon[Music]Waterflame, using icon path ReplaceableTextures\CommandButtons\BTNSpellBookBLS.blp
    Quest - Create a Optional quest titled How to Play with the description 1. Upgrade the Empty base to Cavemen's Den2. Train units to automatically attack your enemy base.3. Be sure to upgrade your base if you have enough lumber to upgrade it.[Tips]1. Upgrade your tower to protect your base better.2. Train cheap units to save your cash and train faster.3. Research techs to unlock new units.4. If your enemy almost reached your base, Activate the ability to kill and destroy your enemies. Some of them might survived the ability., using icon path ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
    Quest - Create a Optional quest titled Bug Report with the description Spotted a bug or glitces? Be sure to reply on my thread so I can fix it. http://www.hiveworkshop.com/forums/maps-564/age-war-257409/?prev=status%3Dp, using icon path ReplaceableTextures\CommandButtons\BTNNecromancerMaster.blp
    Quest - Create a Optional quest titled FAQ with the description Q: Why does some of the units have same stats but it's cost?A: It's because it help you to save more money to train or something., using icon path ReplaceableTextures\CommandButtons\BTNGreaterRejuvScroll.blp
function Trig_Meteor_Strike_Func001C takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A00C' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Meteor_Strike_Conditions takes nothing returns boolean
    if ( not Trig_Meteor_Strike_Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Meteor_Strike_Func002Func001C takes nothing returns boolean
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(0) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(1) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(2) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(3) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(4) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(5) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(6) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(7) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(8) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(9) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(10) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(11) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 100 ) ) then
        return true
    endif
    return false
endfunction

function Trig_Meteor_Strike_Func002C takes nothing returns boolean
    if ( not Trig_Meteor_Strike_Func002Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Meteor_Strike_Actions takes nothing returns nothing
    local unit MS_Caster = null
    local integer MS_LoopTime = 0
   
    local unit MS_PickedUnit = null
   
    local group array MS_Group
    local location array MS_AttackLoc
    local effect array MS_Effect
   
    set MS_Caster = GetSpellAbilityUnit()
    if ( Trig_Meteor_Strike_Func002C() ) then
        call AdjustPlayerStateBJ( -100, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
       
        loop
            set MS_LoopTime = MS_LoopTime + 1
            exitwhen MS_LoopTime >= 8
            set MS_AttackLoc[0] = GetRandomLocInRect(udg_PlayerArea[udg_PlayerEnemy[GetPlayerId(GetOwningPlayer(MS_Caster)) + 1]])
            set MS_AttackLoc[1] = GetRandomLocInRect(udg_PlayerArea[udg_PlayerEnemy[GetPlayerId(GetOwningPlayer(MS_Caster)) + 1]])
            set MS_AttackLoc[2] = GetRandomLocInRect(udg_PlayerArea[udg_PlayerEnemy[GetPlayerId(GetOwningPlayer(MS_Caster)) + 1]])
            set MS_AttackLoc[3] = GetRandomLocInRect(udg_PlayerArea[udg_PlayerEnemy[GetPlayerId(GetOwningPlayer(MS_Caster)) + 1]])
            set MS_AttackLoc[4] = GetRandomLocInRect(udg_PlayerArea[udg_PlayerEnemy[GetPlayerId(GetOwningPlayer(MS_Caster)) + 1]])
           
            set MS_Effect[0] = AddSpecialEffectLocBJ(MS_AttackLoc[0], "Units\\Demon\\Infernal\\InfernalBirth.mdl")
            set MS_Effect[1] = AddSpecialEffectLocBJ(MS_AttackLoc[1], "Units\\Demon\\Infernal\\InfernalBirth.mdl")
            set MS_Effect[2] = AddSpecialEffectLocBJ(MS_AttackLoc[2], "Units\\Demon\\Infernal\\InfernalBirth.mdl")
            set MS_Effect[3] = AddSpecialEffectLocBJ(MS_AttackLoc[3], "Units\\Demon\\Infernal\\InfernalBirth.mdl")
            set MS_Effect[4] = AddSpecialEffectLocBJ(MS_AttackLoc[4], "Units\\Demon\\Infernal\\InfernalBirth.mdl")
           
            set MS_Group[0] = CreateGroup()
            set MS_Group[1] = CreateGroup()
            set MS_Group[2] = CreateGroup()
            set MS_Group[3] = CreateGroup()
            set MS_Group[4] = CreateGroup()
           
            call PolledWait(0.5)
            /*Function Here*/
            call GroupEnumUnitsInRangeOfLoc(MS_Group[0], MS_AttackLoc[0], 256, null)
            call GroupEnumUnitsInRangeOfLoc(MS_Group[1], MS_AttackLoc[1], 256, null)
            call GroupEnumUnitsInRangeOfLoc(MS_Group[2], MS_AttackLoc[2], 256, null)
            call GroupEnumUnitsInRangeOfLoc(MS_Group[3], MS_AttackLoc[3], 256, null)
            call GroupEnumUnitsInRangeOfLoc(MS_Group[4], MS_AttackLoc[4], 256, null)
           
            loop
                set MS_PickedUnit = FirstOfGroup(MS_Group[0])
                exitwhen MS_PickedUnit == null
                if (GetOwningPlayer(MS_PickedUnit) != GetOwningPlayer(MS_Caster) and not IsUnitType(MS_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(MS_Caster, MS_PickedUnit, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE, null)
                endif
                call GroupRemoveUnit(MS_Group[0], MS_PickedUnit)
            endloop
           
            loop
                set MS_PickedUnit = FirstOfGroup(MS_Group[1])
                exitwhen MS_PickedUnit == null
                if (GetOwningPlayer(MS_PickedUnit) != GetOwningPlayer(MS_Caster) and not IsUnitType(MS_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(MS_Caster, MS_PickedUnit, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE, null)
                endif
                call GroupRemoveUnit(MS_Group[1], MS_PickedUnit)
            endloop
           
            loop
                set MS_PickedUnit = FirstOfGroup(MS_Group[2])
                exitwhen MS_PickedUnit == null
                if (GetOwningPlayer(MS_PickedUnit) != GetOwningPlayer(MS_Caster) and not IsUnitType(MS_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(MS_Caster, MS_PickedUnit, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE, null)
                endif
                call GroupRemoveUnit(MS_Group[2], MS_PickedUnit)
            endloop
           
            loop
                set MS_PickedUnit = FirstOfGroup(MS_Group[3])
                exitwhen MS_PickedUnit == null
                if (GetOwningPlayer(MS_PickedUnit) != GetOwningPlayer(MS_Caster) and not IsUnitType(MS_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(MS_Caster, MS_PickedUnit, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE, null)
                endif
                call GroupRemoveUnit(MS_Group[3], MS_PickedUnit)
            endloop
           
            loop
                set MS_PickedUnit = FirstOfGroup(MS_Group[4])
                exitwhen MS_PickedUnit == null
                if (GetOwningPlayer(MS_PickedUnit) != GetOwningPlayer(MS_Caster) and not IsUnitType(MS_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(MS_Caster, MS_PickedUnit, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE, null)
                endif
                call GroupRemoveUnit(MS_Group[4], MS_PickedUnit)
            endloop
            /*Function Here*/
           
            call RemoveLocation(MS_AttackLoc[0])
            call RemoveLocation(MS_AttackLoc[1])
            call RemoveLocation(MS_AttackLoc[2])
            call RemoveLocation(MS_AttackLoc[3])
            call RemoveLocation(MS_AttackLoc[4])
           
            call DestroyEffect(MS_Effect[0])
            call DestroyEffect(MS_Effect[1])
            call DestroyEffect(MS_Effect[2])
            call DestroyEffect(MS_Effect[3])
            call DestroyEffect(MS_Effect[4])
           
            call DestroyGroup(MS_Group[0])
            call DestroyGroup(MS_Group[1])
            call DestroyGroup(MS_Group[2])
            call DestroyGroup(MS_Group[3])
            call DestroyGroup(MS_Group[4])
           
            call PolledWait(.8)
        endloop
    else
        call PolledWait(0.01)
        call UnitResetCooldown(MS_Caster)
    endif
endfunction

//===========================================================================
function InitTrig_Meteor_Strike takes nothing returns nothing
    set gg_trg_Meteor_Strike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Meteor_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Meteor_Strike, Condition( function Trig_Meteor_Strike_Conditions ) )
    call TriggerAddAction( gg_trg_Meteor_Strike, function Trig_Meteor_Strike_Actions )
endfunction

 
Space Command
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Spaceship Command
  Actions
    Custom script: local unit SC_Caster = GetSpellAbilityUnit()
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Owner of (Casting unit)) Equal to Player 1 (Red)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 2 (Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 3 (Teal)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 4 (Purple)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 5 (Yellow)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 6 (Orange)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 7 (Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 8 (Pink)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 9 (Gray)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 10 (Light Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 11 (Dark Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
            ((Owner of (Casting unit)) Equal to Player 12 (Brown)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1300)
      Then - Actions
        Player - Add -1300 to (Owner of (Casting unit)).Current lumber
        Unit - Create 1.Spaceship for (Owner of (Casting unit)) at (Center of SpecUnitRegion[PlayerEnemy[(Player number of (Owner of (Casting unit)))]]) facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to PlayerEnemy[(Player number of (Owner of (Last created unit)))]
        Unit - Order (Last created unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Casting unit)))]])
      Else - Actions
        Wait 0.01 seconds
        Custom script: call UnitResetCooldown(SC_Caster)
Archer Tank
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Archer Tank
  Actions
    Custom script: local unit AT_Caster = GetSpellAbilityUnit()
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Owner of (Casting unit)) Equal to Player 1 (Red)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 2 (Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 3 (Teal)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 4 (Purple)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 5 (Yellow)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 6 (Orange)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 7 (Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 8 (Pink)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 9 (Gray)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 10 (Light Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 11 (Dark Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
            ((Owner of (Casting unit)) Equal to Player 12 (Brown)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 500)
      Then - Actions
        Player - Add -500 to (Owner of (Casting unit)).Current lumber
        Unit - Create 1.Armored Wooden Tank for (Owner of (Casting unit)) at (Center of SpecUnitRegion[PlayerEnemy[(Player number of (Owner of (Casting unit)))]]) facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to PlayerEnemy[(Player number of (Owner of (Last created unit)))]
        Unit - Order (Last created unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Casting unit)))]])
      Else - Actions
        Wait 0.01 seconds
        Custom script: call UnitResetCooldown(AT_Caster)
Heli Attack
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Helicopter Attack
  Actions
    Custom script: local unit HA_Caster = GetSpellAbilityUnit()
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Owner of (Casting unit)) Equal to Player 1 (Red)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 2 (Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 3 (Teal)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 4 (Purple)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 5 (Yellow)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 6 (Orange)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 7 (Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 8 (Pink)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 9 (Gray)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 10 (Light Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 11 (Dark Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
            ((Owner of (Casting unit)) Equal to Player 12 (Brown)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 1100)
      Then - Actions
        Player - Add -1100 to (Owner of (Casting unit)).Current lumber
        Unit - Create 1.Helicopter for (Owner of (Casting unit)) at (Center of SpecUnitRegion[PlayerEnemy[(Player number of (Owner of (Casting unit)))]]) facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to PlayerEnemy[(Player number of (Owner of (Last created unit)))]
        Unit - Order (Last created unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Casting unit)))]])
      Else - Actions
        Wait 0.01 seconds
        Custom script: call UnitResetCooldown(HA_Caster)
function Trig_Sky_Bash_Func001C takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A004' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Sky_Bash_Conditions takes nothing returns boolean
    if ( not Trig_Sky_Bash_Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Sky_Bash_Func002Func001C takes nothing returns boolean
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(0) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(1) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(2) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(3) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(4) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(5) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(6) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(7) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(8) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(9) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(10) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    if ( ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(11) ) and ( GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER) >= 700 ) ) then
        return true
    endif
    return false
endfunction

function Trig_Sky_Bash_Func002C takes nothing returns boolean
    if ( not Trig_Sky_Bash_Func002Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Sky_Bash_Actions takes nothing returns nothing
    local unit GR = null
    local group GR_DamageGroup = null
    local location GR_AttackLoc = null
    local effect GR_Effect = null
   
    local unit GR_PickedUnit = null
   
    local unit GR_Caster = GetSpellAbilityUnit()
    if ( Trig_Sky_Bash_Func002C() ) then
        call AdjustPlayerStateBJ( -700, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
        call CreateNUnitsAtLoc( 1, 'h01T', GetOwningPlayer(GetSpellAbilityUnit()), GetRectCenter(udg_SpecUnitRegion[udg_PlayerEnemy[GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))]]), bj_UNIT_FACING )
        set GR = GetLastCreatedUnit()
        call SetUnitUserData(GR, udg_PlayerEnemy[GetConvertedPlayerId(GetOwningPlayer(GR))])
        call IssuePointOrderLocBJ( GR, "move", GetRectCenter(udg_PlayerOpposition[udg_PlayerEnemy[GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))]]) )
       
        loop
            exitwhen GetUnitState(GR, UNIT_STATE_LIFE) <= 0
            set GR_AttackLoc = GetUnitLoc(GR)
            set GR_Effect = AddSpecialEffectLocBJ( GR_AttackLoc, "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
           
            set GR_DamageGroup = CreateGroup()
            call GroupEnumUnitsInRangeOfLoc(GR_DamageGroup, GR_AttackLoc, 256, null)
            loop
                set GR_PickedUnit = FirstOfGroup(GR_DamageGroup)
                exitwhen GR_PickedUnit == null
                if( (GetOwningPlayer(GR_PickedUnit) != GetOwningPlayer(GR) and GetUnitTypeId(GR_PickedUnit)  != 'h01T' ) and not IsUnitType(GR_PickedUnit, UNIT_TYPE_STRUCTURE)) then
                    call UnitDamageTarget(GR, GR_PickedUnit, 200, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_LIGHTNING, null)
                endif
                call GroupRemoveUnit(GR_DamageGroup, GR_PickedUnit)
            endloop
            call DestroyGroup(GR_DamageGroup)
            call DestroyEffect(GR_Effect)
            call RemoveLocation(GR_AttackLoc)
            call PolledWait(1)
        endloop
    else
        call PolledWait(.01)
        call UnitResetCooldown(GR_Caster)
    endif
endfunction

//===========================================================================
function InitTrig_Sky_Bash takes nothing returns nothing
    set gg_trg_Sky_Bash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Sky_Bash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Sky_Bash, Condition( function Trig_Sky_Bash_Conditions ) )
    call TriggerAddAction( gg_trg_Sky_Bash, function Trig_Sky_Bash_Actions )
endfunction

 
Sky Attack
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Sky Attack
  Actions
    Custom script: local unit SA_Caster = GetSpellAbilityUnit()
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            ((Owner of (Casting unit)) Equal to Player 1 (Red)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 2 (Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 3 (Teal)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 4 (Purple)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 5 (Yellow)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 6 (Orange)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 7 (Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 8 (Pink)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 9 (Gray)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 10 (Light Blue)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 11 (Dark Green)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
            ((Owner of (Casting unit)) Equal to Player 12 (Brown)) and (((Owner of (Casting unit)) Current lumber) Greater than or equal to 900)
      Then - Actions
        Player - Add -900 to (Owner of (Casting unit)).Current lumber
        Unit - Create 1.Flying Machine for (Owner of (Casting unit)) at (Center of SpecUnitRegion[PlayerEnemy[(Player number of (Owner of (Casting unit)))]]) facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to PlayerEnemy[(Player number of (Owner of (Last created unit)))]
        Unit - Order (Last created unit) to Move To.(Center of PlayerOpposition[PlayerEnemy[(Player number of (Owner of (Casting unit)))]])
      Else - Actions
        Wait 0.01 seconds
        Custom script: call UnitResetCooldown(SA_Caster)
Special Unit R1
  Events
    Unit - A unit enters Special_Ability_1 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 3
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R2
  Events
    Unit - A unit enters Special_Ability_2 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 4
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R3
  Events
    Unit - A unit enters Special_Ability_3 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 1
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R4
  Events
    Unit - A unit enters Special_Ability_4 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 2
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R5
  Events
    Unit - A unit enters Special_Ability_5 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 8
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R6
  Events
    Unit - A unit enters Special_Ability_6 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 7
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R7
  Events
    Unit - A unit enters Special_Ability_7 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 6
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
Special Unit R8
  Events
    Unit - A unit enters Special_Ability_8 <gen>
  Conditions
  Actions
    For each (Integer A) from 1 to 5, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of (Entering unit)) Equal to 5
            (Unit-type of (Entering unit)) Equal to SpecAbiUnit[(Integer A)]
          Then - Actions
            Unit - Kill (Entering unit)
          Else - Actions
This folder is used only for game-testing purposes. This will not affect the gameplay and using these commands could cause a bug that would break the game.
These commands is only accessible to Player 1 and it's supposed to be named WorldEdit

AVAILABLE COMMANDS
-debug basekill <Player ID> <Area ID> <Target ID>
-debug showplayer
-debug showarea
-debug showall
DEBUG BaseKill
  Events
    Player - Player 1 (Red) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 2 (Blue) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 3 (Teal) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 4 (Purple) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 5 (Yellow) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 6 (Orange) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 7 (Green) types a chat message containing -debug basekill (stringnoformat) as A substring
    Player - Player 8 (Pink) types a chat message containing -debug basekill (stringnoformat) as A substring
  Conditions
  Actions
    -------- Player ID --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Substring((Entered chat string), 17, 17)) Equal to 1
            (Substring((Entered chat string), 17, 17)) Equal to 3
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawnerId = (Integer((Substring((Entered chat string), 17, 17))))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Substring((Entered chat string), 17, 17)) Equal to 2
            (Substring((Entered chat string), 17, 17)) Equal to 4
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawnerId = (Integer((Substring((Entered chat string), 17, 17))))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Substring((Entered chat string), 17, 17)) Equal to 6
            (Substring((Entered chat string), 17, 17)) Equal to 7
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawnerId = (Integer((Substring((Entered chat string), 17, 17))))
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Substring((Entered chat string), 17, 17)) Equal to 5
            (Substring((Entered chat string), 17, 17)) Equal to 8
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawnerId = (Integer((Substring((Entered chat string), 17, 17))))
      Else - Actions
    -------- Area ID --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Substring((Entered chat string), 19, 19)) Equal to 0
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawn = (Center of Area_1 <gen>)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Substring((Entered chat string), 19, 19)) Equal to 1
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawn = (Center of Area_2 <gen>)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Substring((Entered chat string), 19, 19)) Equal to 2
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawn = (Center of Area_3 <gen>)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Substring((Entered chat string), 19, 19)) Equal to 3
      Then - Actions
        Set VariableSet DEBUG_BaseKillSpawn = (Center of Area_4 <gen>)
      Else - Actions
    -------- Target ID --------
    Set VariableSet DEBUG_BaseKillTargetId = (Integer((Substring((Entered chat string), 21, 21))))
    -------- Spawning Unit --------
    Custom script: if (udg_DEBUG_BaseKillTargetId != null) then
    Unit - Create 1.Ender (Debugger) for (Player(DEBUG_BaseKillSpawnerId)) at DEBUG_BaseKillSpawn facing Default building facing degrees
    Cinematic - Ping minimap for (All players) at DEBUG_BaseKillSpawn for 1 seconds, using a Simple ping of color (0.00%, 100%, 0.00%)
    Custom script: call RemoveLocation(udg_DEBUG_BaseKillSpawn)
    Unit - Add a 60 second Generic expiration timer to (Last created unit)
    Custom script: if (udg_DEBUG_BaseKillTargetId != 0) then
    Set VariableSet TempLoc = ((Player(DEBUG_BaseKillTargetId)) start location)
    Unit - Order (Last created unit) to Attack-Move To.((Player(DEBUG_BaseKillTargetId)) start location)
    Custom script: call RemoveLocation(udg_TempLoc)
    Custom script: endif
    Set VariableSet DEBUG_BaseKillTargetId = 0
    Custom script: endif
DEBUG Player ID
  Events
    Player - Player 1 (Red) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 2 (Blue) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 3 (Teal) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 4 (Purple) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 5 (Yellow) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 6 (Orange) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 7 (Green) types a chat message containing -debug showplayer (stringnoformat) as An exact match
    Player - Player 8 (Pink) types a chat message containing -debug showplayer (stringnoformat) as An exact match
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG_PlayerIDBol Equal to False
      Then - Actions
        Game - Display to (Player group(Player 1 (Red))) the text: |cffffcc00Floating Text (Player's ID)|r: On
        Set VariableSet DEBUG_PlayerIDBol = True
        For each (Integer A) from 1 to 8, do (Actions)
          Loop - Actions
            Floating Text - Show DEBUG_PlayerID[(Integer A)] for (All players)
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG_PlayerIDBol Equal to True
          Then - Actions
            Game - Display to (Player group(Player 1 (Red))) the text: |cffffcc00Floating Text (Player's ID)|r: Off
            Set VariableSet DEBUG_PlayerIDBol = False
            For each (Integer A) from 1 to 8, do (Actions)
              Loop - Actions
                Floating Text - Hide DEBUG_PlayerID[(Integer A)] for (All players)
          Else - Actions
DEBUG Area ID
  Events
    Player - Player 1 (Red) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 2 (Blue) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 3 (Teal) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 4 (Purple) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 5 (Yellow) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 6 (Orange) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 7 (Green) types a chat message containing -debug showarea (stringnoformat) as An exact match
    Player - Player 8 (Pink) types a chat message containing -debug showarea (stringnoformat) as An exact match
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG_AreaIDBol Equal to False
      Then - Actions
        Game - Display to (Player group(Player 1 (Red))) the text: |cffffcc00Floating Text (Areas' ID)|r: On
        Set VariableSet DEBUG_AreaIDBol = True
        For each (Integer A) from 0 to 3, do (Actions)
          Loop - Actions
            Floating Text - Show DEBUG_AreaID[(Integer A)] for (All players)
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG_AreaIDBol Equal to True
          Then - Actions
            Game - Display to (Player group(Player 1 (Red))) the text: |cffffcc00Floating Text (Areas' ID)|r: Off
            Set VariableSet DEBUG_AreaIDBol = False
            For each (Integer A) from 0 to 3, do (Actions)
              Loop - Actions
                Floating Text - Hide DEBUG_AreaID[(Integer A)] for (All players)
          Else - Actions
DEBUG Showall
  Events
    Player - Player 1 (Red) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 2 (Blue) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 3 (Teal) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 4 (Purple) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 5 (Yellow) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 6 (Orange) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 7 (Green) types a chat message containing -debug showall (stringnoformat) as An exact match
    Player - Player 8 (Pink) types a chat message containing -debug showall (stringnoformat) as An exact match
  Conditions
  Actions
    Trigger - Run DEBUG_Player_ID <gen> (checking conditions)
    Trigger - Run DEBUG_Area_ID <gen> (checking conditions)