1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  5. Dismiss Notice
  6. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  7. 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

Creep's wars v1.8.w3x
Variables
Initialization
Installation Hooha
Jizn zamka
Jizn zamka Копировать
Info
Info 2
Set AI Creep
Безымянный триггер 001
Game Modes
Question Mode
Mode Choose
Auto Choose Mode
Wave Mode
Wave Setup
Wave Level 1
Wave Level 2
Wave End 1
Wave End 2
Victory 1
Victory 2
Computer AI
Summon Level 1
Summon Level 2
Turn on level 2
Random Hero
Eliminating Players
Not Playing
Give Tower Powers
Mage Tower Death 1
Mage Tower Death 2
Etc
Shock Ward Attack
Win
Heroes
Mover Units
Revive
Fire
Crystal
Crystal Копировать
Shadow assasin
Chaos Warlord
Pyro
Aqua
Ice
Ancient
Earth
Dark
Pit
Bug
Posion
Shock
Storm
Fallen
UnDead
Mech
Alchemist
Astro
Ranger
Warrior
Necro
Raindancer
Elf
Wolf
Vampiric
Magnataur
Crab
Warden
Spell Breaker
Machine
Treant
Tauren
Phisic Mage
Aaron
Income
Add Income Normal
Add Income Goldrush
Reset Income Timer
Summon
Spawn Move
Spawn is Summoned 1
Spawn is Summoned 2
Spawn is Summoned 1 War
Spawn is Summoned 2 War
Spells
Boomerang
Crush
Electric Field
Fire Bombs
Critical Jump
Frost Sphere
Bloody Run
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
cache gamecache No
creep1 unitcode Yes
creep2 unitcode Yes
income integer Yes 25
incometimer timer No
mode integer No 0
modedialog dialog No
modedialogbutton button Yes
teamdefeated boolean Yes
wavelevel integer Yes
waveleveltype unitcode Yes
wavetimer timer Yes
Installation Hooha
  Events
    Time - Elapsed game time is 0.01 seconds
  Conditions
  Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player).Current gold to 50
        Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Playable map area)
        Camera - Pan camera for (Picked player) to (Center of Selection_Region <gen>) over 0.10 seconds
    Game - Display to (All players) the text: |cffaaccffWelcome to Mage Tower Defence Arena. Grab a hero and defend your tower.
    Countdown Timer - Start incometimer as a One-shot timer that will expire in 50.00 seconds
    Countdown Timer - Create a timer window for incometimer with title |cffaaccffNext income...
    Quest - Create a Required quest titled |c00AA88CCHow to Play|r with the description |c00AA88CCThe object of the game is to destroy the enemy's Mage Tower, but protect your own. You must use your Creep Camps to summon creeps to attack your enemies tower and heroes, but you must use your hero and tower to defend from enemy creeps., using icon path ReplaceableTextures\CommandButtons\BTNSpellBookBLS.blp
    Quest - Create a Required quest titled |c00337755Elements|r with the description |c00337755Things to do:|rSummon|c00337755 - Summon creeps to attack the enemy.|rAttack|c00337755 - Move hero down to enemy lines to attack them. Very risky, though. You will leave your tower open to more damage, and be overpowered by enemy heroes.|rSpell|c00337755 - Use Spell Towers to help defeat the enemy's Mage Tower or heroes., using icon path ReplaceableTextures\CommandButtons\BTNScatterRockets.blp
    Quest - Create a Required quest titled |c0088AAFFSpell Tower|r with the description |c0088AAFFThe Spell Tower is a tower that can use various spells within any given range. It has a spell taken from each element, which can hurt enemies or help allies., using icon path ReplaceableTextures\CommandButtons\BTNAbsorbMagic.blp
    Quest - Create a Optional quest titled |c0088FFAAV2 Updates|r with the description Major:|c0088AAFF- Now 2 teams of 5 instead of 4 teams of 2.- Added 3 game modes- Reterrained the map, moving camps, shops, spell towers and fountains near the top or bottom of the screen.|rMinor:|c0088AAFF- Edited and fixed various hero names, attacks and spells.- Lowered tome costs.- Added new item shop, rearranging the items.- Redid the hero selection area.|r, using icon path ReplaceableTextures\CommandButtons\BTNManual3.blp
    Quest - Create a Optional quest titled |c00551188V2.5 Updates|r with the description Major:|c00551188- Fixed a few spells. Turret now summons a single, more powerful tower as it levels up, instead of more of the same weak tower. Lightning Speed is now able to be cast on allies. Pyro Made has a new final move. The Life Sucker Ward is now the Flame Aura.- Completed wave mode.- Fixed the extra timer box.- Fixed creep tooltips that said the name of a diffrent creep.- Made the hero selection larger, adding room for new heroes. Changed the selector model, gave the shops a custom color for no reason. Changed the Faceless summon to an Unbroken, since there is a Hero that looks like it. Added new heroes.- Hero Attributes now level up correctly, so the growth of the hero greatly changes depending on what's higher. It used to increase each by 5 per level. Now it increases by 20 percent of the original attribute. Say a hero started with 5 agility and 20 strength. Your hero will gain 1 agility point per level and 4 strength points per level., using icon path ReplaceableTextures\CommandButtons\BTNNecromancerAdept.blp
    Quest - Create a Optional quest titled |c00DDCC77Modes|r with the description |c00DDCC77Game Modes:Normal|c00DDCC77 - Summon creeps to attack foes.|rGoldrush Mode|c00DDCC77 - Normal Mode, but with crazy gold supply!|rWave Mode|c00DDCC77 - Enemy creeps appear in waves and attack your base. Just like a tower defence, but with heroes.|rWar|c00DDCC77 - Creeps are summoned at your base, and attack towards the enemy tower, battling any enemy creeps it encounters. Also allows heroes to buy buildable towers., using icon path ReplaceableTextures\CommandButtons\BTNManual3.blp
    Unit Group - Pick every unit in (Units in Selection_Region <gen>) and do (Actions)
      Loop - Actions
        Unit - Make (Picked unit) Invulnerable
        Animation - Play (Picked unit)'s stand ready (animationname) animation
    Player - Turn Gives bounty On for Player 11 (Dark Green)
    Player - Turn Gives bounty On for Player 12 (Brown)
    Wait 3.00 seconds
    Game - Display to (All players) the text: |cffaaccffPlayer 1 will choose a mode. If he does not choose within 25 seconds, the mode will be automaticly set to Normal Mode.|r
Jizn zamka
  Events
    Unit - |c005588CCMage Base|r 0009 <gen>'s life becomes Less than 10000.00
  Conditions
  Actions
    Unit - Create 1.Guardian for Player 12 (Brown) at (Center of Base_Red <gen>) facing Default building facing degrees
    Unit - Make |c005588CCMage Base|r 0009 <gen> Invulnerable
    Wait 30.00 seconds
    Unit - Make |c005588CCMage Base|r 0009 <gen> Vulnerable
Jizn zamka Копировать
  Events
    Unit - |c005588CCMage Base|r 0011 <gen>'s life becomes Less than 10000.00
  Conditions
  Actions
    Unit - Create 1.Guardian for Player 11 (Dark Green) at (Center of Base_Orange <gen>) facing Default building facing degrees
    Unit - Make |c005588CCMage Base|r 0011 <gen> Invulnerable
    Wait 30.00 seconds
    Unit - Make |c005588CCMage Base|r 0011 <gen> Vulnerable
Info
  Events
    Time - Elapsed game time is 5.00 seconds
  Conditions
    mode Not equal to 3
  Actions
    Game - Display to (All players) the text: Use these towers to summon creeps to attack the enemies. Use the spell towers to use various spells.
    Cinematic - Ping minimap for Player Group - Player 1 (Red) at (Center of Summoner_1 <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 0.00%, 0.00%)
    Cinematic - Ping minimap for Player Group - Player 2 (Blue) at (Center of Summoner_2 <gen>) for 5.00 seconds, using a Flashy ping of color (0.00%, 0.00%, 100.00%)
    Cinematic - Ping minimap for Player Group - Player 3 (Teal) at (Center of Summoner_3 <gen>) for 5.00 seconds, using a Flashy ping of color (0.00%, 100.00%, 100.00%)
    Cinematic - Ping minimap for Player Group - Player 4 (Purple) at (Center of Summoner_4 <gen>) for 5.00 seconds, using a Flashy ping of color (75.00%, 0.00%, 80.00%)
    Cinematic - Ping minimap for Player Group - Player 5 (Yellow) at (Center of Summoner_5 <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 100.00%, 0.00%)
    Cinematic - Ping minimap for Player Group - Player 6 (Orange) at (Center of Summoner_6 <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 50.00%, 0.00%)
    Cinematic - Ping minimap for Player Group - Player 7 (Green) at (Center of Summoner_7 <gen>) for 5.00 seconds, using a Flashy ping of color (0.00%, 100.00%, 0.00%)
    Cinematic - Ping minimap for Player Group - Player 8 (Pink) at (Center of Summoner_8 <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 50.00%, 75.00%)
    Cinematic - Ping minimap for Player Group - Player 9 (Gray) at (Center of Summoner_9 <gen>) for 5.00 seconds, using a Flashy ping of color (75.00%, 75.00%, 75.00%)
    Cinematic - Ping minimap for Player Group - Player 10 (Light Blue) at (Center of Summoner_10 <gen>) for 5.00 seconds, using a Flashy ping of color (50.00%, 75.00%, 100.00%)
Info 2
  Events
    Time - Elapsed game time is 30.00 seconds
  Conditions
  Actions
    Game - Display to (All players) the text: Make sure that whoever has the Mage Tower upgrades attack and defence!
    Cinematic - Ping minimap for (All allies of Player 1 (Red).) at (Center of Base_Red <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 0.00%, 0.00%)
    Cinematic - Ping minimap for (All allies of Player 6 (Orange).) at (Center of Base_Orange <gen>) for 5.00 seconds, using a Flashy ping of color (100%, 50.00%, 0.00%)
Set AI Creep
  Events
    Time - Elapsed game time is 10.00 seconds
  Conditions
  Actions
    Set VariableSet creep1[1] = Skeleton
    Set VariableSet creep1[2] = Flaming Archer
    Set VariableSet creep1[3] = Satyr
    Set VariableSet creep1[4] = Rifleman
    Set VariableSet creep1[5] = Arachnathid
    Set VariableSet creep1[6] = Centaur
    Set VariableSet creep1[7] = Apprentice Wizard
    Set VariableSet creep1[8] = Couatl
    Set VariableSet creep1[9] = Meat Wagon
    Set VariableSet creep1[10] = Sea Gaint
    Set VariableSet creep1[11] = Black Dragon
    Set VariableSet creep2[1] = Skeletal Mage
    Set VariableSet creep2[2] = Golbin Sapper
    Set VariableSet creep2[3] = Shadow Wolf
    Set VariableSet creep2[4] = Ghost Murloc
    Set VariableSet creep2[5] = Hydra Queen
    Set VariableSet creep2[6] = Huntress
    Set VariableSet creep2[7] = Fire Revenant
    Set VariableSet creep2[8] = Gargantuan Turtle
    Set VariableSet creep2[9] = Unbroken
    Set VariableSet creep2[10] = Frost Wyrm
    Set VariableSet creep2[11] = Infernal Contraption
    Set VariableSet creep2[12] = Golem of the Damned
Безымянный триггер 001
  Events
  Conditions
  Actions
Question Mode
  Events
    Time - Elapsed game time is 0.01 seconds
  Conditions
  Actions
    Dialog - Change the title of modedialog to Choose Mode
    Dialog - Create a dialog button for modedialog labelled |c00228844Normal Mode|r
    Set VariableSet modedialogbutton[1] = (Last created dialog Button)
    Dialog - Create a dialog button for modedialog labelled |c00ffff77Goldrush Mode|r
    Set VariableSet modedialogbutton[2] = (Last created dialog Button)
    Dialog - Create a dialog button for modedialog labelled |c00aa55ccWave Mode|r
    Set VariableSet modedialogbutton[3] = (Last created dialog Button)
    Dialog - Create a dialog button for modedialog labelled |c003366aaWar Mode|r
    Set VariableSet modedialogbutton[4] = (Last created dialog Button)
    Dialog - Show modedialog for Player 1 (Red)
Mode Choose
  Events
    Dialog - A dialog button is clicked for modedialog
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to modedialogbutton[1]
      Then - Actions
        Set VariableSet mode = 1
        Game - Display to (All players) the text: GAME MODE - Normal Mode
        Dialog - Hide modedialog for Player 1 (Red)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to modedialogbutton[2]
      Then - Actions
        Set VariableSet mode = 2
        Game - Display to (All players) the text: GAME MODE - Goldrush ModeIncome timer sped up
        Dialog - Hide modedialog for Player 1 (Red)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to modedialogbutton[3]
      Then - Actions
        Set VariableSet mode = 3
        Game - Display to (All players) the text: GAME MODE - Wave ModeFace wave after wave of enemies to see which team can finish first
        Dialog - Hide modedialog for Player 1 (Red)
        Trigger - Run Wave_Setup <gen> (checking conditions)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to modedialogbutton[4]
      Then - Actions
        Set VariableSet mode = 4
        Game - Display to (All players) the text: GAME MODE - War ModeSummoned units attack from your base, not the spawns.
        Dialog - Hide modedialog for Player 1 (Red)
      Else - Actions
Auto Choose Mode
  Events
    Time - Elapsed game time is 30.00 seconds
  Conditions
    mode Equal to 0
  Actions
    Set VariableSet mode = 1
    Dialog - Hide modedialog for Player 1 (Red)
    Game - Display to (All players) the text: |cffaaccffGame has been automaticly set.|r
    Wait 1.00 seconds
    Game - Display to (All players) the text: GAME MODE - Normal Mode
Wave Setup
  Events
  Conditions
  Actions
    Countdown Timer - Destroy (Last created timer window)
    For each (Integer A) from 1 to 2, do (Start wavetimer[(Integer A)] as a One-shot timer that will expire in 30 seconds)
    Trigger - Turn off Summon_Level_1 <gen>
    Trigger - Turn off Turn_on_level_2 <gen>
    Trigger - Turn off Set_AI_Creep <gen>
    Unit Group - Pick every unit in (Units of type |c00999999Creep Camp Level 1|r) and do (Remove (Picked unit) from the game)
    Unit Group - Pick every unit in (Units of type |c00777777Creep Camp Level 2|r) and do (Remove (Picked unit) from the game)
    Set VariableSet wavelevel[1] = 1
    Set VariableSet wavelevel[2] = 1
    Set VariableSet waveleveltype[1] = Skeleton
    Set VariableSet waveleveltype[2] = Flaming Archer
    Set VariableSet waveleveltype[3] = Satyr
    Set VariableSet waveleveltype[4] = Rifleman
    Set VariableSet waveleveltype[5] = Arachnathid
    Set VariableSet waveleveltype[6] = Centaur
    Set VariableSet waveleveltype[7] = Apprentice Wizard
    Set VariableSet waveleveltype[8] = Couatl
    Set VariableSet waveleveltype[9] = Meat Wagon
    Set VariableSet waveleveltype[10] = Sea Gaint
    Set VariableSet waveleveltype[11] = Black Dragon
    Set VariableSet waveleveltype[12] = Skeletal Mage
    Set VariableSet waveleveltype[13] = Golbin Sapper
    Set VariableSet waveleveltype[14] = Ghost Murloc
    Set VariableSet waveleveltype[15] = Shadow Wolf
    Set VariableSet waveleveltype[16] = Hydra Queen
    Set VariableSet waveleveltype[17] = Huntress
    Set VariableSet waveleveltype[18] = Fire Revenant
    Set VariableSet waveleveltype[19] = Gargantuan Turtle
    Set VariableSet waveleveltype[20] = Unbroken
    Set VariableSet waveleveltype[21] = Frost Wyrm
    Set VariableSet waveleveltype[22] = Infernal Contraption
    Set VariableSet waveleveltype[23] = Golem of the Damned
Wave Level 1
  Events
    Time - wavetimer[1] expires
  Conditions
  Actions
    If (wavelevel[1] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[1]] for Player 11 (Dark Green) at (Center of Spawn_1 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[1] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[1]] for Player 11 (Dark Green) at (Center of Spawn_2 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[1] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[1]] for Player 11 (Dark Green) at (Center of Spawn_3 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[1] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[1]] for Player 11 (Dark Green) at (Center of Spawn_4 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[1] Equal to 23) then do (Create 1.Golem of the Damned for Player 11 (Dark Green) at (Center of Spawn_2 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[1] Equal to 23) then do (Create 1.Golem of the Damned for Player 11 (Dark Green) at (Center of Spawn_3 <gen>) facing Default building facing degrees) else do (Do nothing)
Wave Level 2
  Events
    Time - wavetimer[2] expires
  Conditions
  Actions
    If (wavelevel[2] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[2]] for Player 12 (Brown) at (Center of Spawn_5 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[2] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[2]] for Player 12 (Brown) at (Center of Spawn_6 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[2] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[2]] for Player 12 (Brown) at (Center of Spawn_7 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[2] Not equal to 23) then do (Create 10.waveleveltype[wavelevel[2]] for Player 12 (Brown) at (Center of Spawn_8 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[2] Equal to 23) then do (Create 1.Golem of the Damned for Player 12 (Brown) at (Center of Spawn_6 <gen>) facing Default building facing degrees) else do (Do nothing)
    If (wavelevel[2] Equal to 23) then do (Create 1.Golem of the Damned for Player 12 (Brown) at (Center of Spawn_7 <gen>) facing Default building facing degrees) else do (Do nothing)
Wave End 1
  Events
    Unit - A unit owned by Player 11 (Dark Green).Dies
  Conditions
    (Player 11 (Dark Green) Food used) Equal to 0
  Actions
    Countdown Timer - Start wavetimer[1] as a One-shot timer that will expire in 10.00 seconds
    Set VariableSet wavelevel[1] = (wavelevel[1] + 1)
Wave End 2
  Events
    Unit - A unit owned by Player 12 (Brown).Dies
  Conditions
    (Player 12 (Brown) Food used) Equal to 0
  Actions
    Countdown Timer - Start wavetimer[2] as a One-shot timer that will expire in 10.00 seconds
    Set VariableSet wavelevel[2] = (wavelevel[2] + 1)
Victory 1
  Events
    Unit - A unit owned by Player 11 (Dark Green).Dies
  Conditions
    (Player 11 (Dark Green) Food used) Equal to 0
  Actions
    If (wavelevel[1] Equal to 24) then do (Victory Player 1 (Red) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Victory Player 2 (Blue) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Victory Player 3 (Teal) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Victory Player 4 (Purple) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Victory Player 5 (Yellow) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Defeat Player 6 (Orange) with the message: You were beaten by team 1.) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Defeat Player 7 (Green) with the message: You were beaten by team 1.) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Defeat Player 8 (Pink) with the message: You were beaten by team 1.) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Defeat Player 9 (Gray) with the message: You were beaten by team 1.) else do (Do nothing)
    If (wavelevel[1] Equal to 24) then do (Defeat Player 10 (Light Blue) with the message: You were beaten by team 1.) else do (Do nothing)
Victory 2
  Events
    Unit - A unit owned by Player 12 (Brown).Dies
  Conditions
    (Player 12 (Brown) Food used) Equal to 0
  Actions
    If (wavelevel[2] Equal to 24) then do (Victory Player 6 (Orange) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Victory Player 7 (Green) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Victory Player 8 (Pink) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Victory Player 9 (Gray) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Victory Player 10 (Light Blue) (Show dialogs, Show scores)) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Defeat Player 1 (Red) with the message: You were beaten by team 2.) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Defeat Player 2 (Blue) with the message: You were beaten by team 2.) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Defeat Player 3 (Teal) with the message: You were beaten by team 2.) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Defeat Player 4 (Purple) with the message: You were beaten by team 2.) else do (Do nothing)
    If (wavelevel[2] Equal to 24) then do (Defeat Player 5 (Yellow) with the message: You were beaten by team 2.) else do (Do nothing)
Summon Level 1
  Events
    Time - incometimer expires
  Conditions
    mode Not equal to 3
  Actions
    If ((Player 1 (Red) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0189 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 2 (Blue) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0190 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 3 (Teal) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0191 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 4 (Purple) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0192 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 5 (Yellow) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0193 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 6 (Orange) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0194 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 7 (Green) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0195 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 8 (Pink) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0196 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 9 (Gray) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0029 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
    If ((Player 10 (Light Blue) controller) Equal to Computer) then do (Order |c00999999Creep Camp Level 1|r 0032 <gen> to train/upgrade to a creep1[(Random integer number between 1 and 11)]) else do (Do nothing)
Summon Level 2
  Events
    Time - incometimer expires
  Conditions
    mode Not equal to 3
  Actions
    If ((Player 1 (Red) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0020 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 2 (Blue) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0021 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 3 (Teal) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0022 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 4 (Purple) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0023 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 5 (Yellow) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0024 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 6 (Orange) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0025 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 7 (Green) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0026 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 8 (Pink) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0027 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 9 (Gray) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0010 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
    If ((Player 10 (Light Blue) controller) Equal to Computer) then do (Order |c00777777Creep Camp Level 2|r 0030 <gen> to train/upgrade to a creep2[(Random integer number between 1 and 12)]) else do (Do nothing)
Turn on level 2
  Events
    Time - Elapsed game time is 600.00 seconds
  Conditions
    mode Not equal to 3
  Actions
    Trigger - Turn off Summon_Level_1 <gen>
    Trigger - Turn on Summon_Level_2 <gen>
Random Hero
  Events
    Time - Every 5.00 seconds of game time
  Conditions
  Actions
    If ((Player 1 (Red) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 1 (Red) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 2 (Blue) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 2 (Blue) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 3 (Teal) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 3 (Teal) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 4 (Purple) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 4 (Purple) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 5 (Yellow) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 5 (Yellow) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 6 (Orange) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 6 (Orange) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 7 (Green) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 7 (Green) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 8 (Pink) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 8 (Pink) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 9 (Gray) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 9 (Gray) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
    If ((Player 10 (Light Blue) controller) Equal to Computer) then do (Pick every unit in (Units owned by Player 10 (Light Blue) of type Selector) and do (Order (Picked unit) to Move To.(Random point in Selection_Region <gen>))) else do (Do nothing)
Not Playing
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    If ((Player 1 (Red) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 1 (Red) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 2 (Blue) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 2 (Blue) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 3 (Teal) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 3 (Teal) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 4 (Purple) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 4 (Purple) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 5 (Yellow) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 5 (Yellow) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 6 (Orange) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 6 (Orange) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 7 (Green) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 7 (Green) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 8 (Pink) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 8 (Pink) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 9 (Gray) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 9 (Gray).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
    If ((Player 10 (Light Blue) slot status) Equal to Is unused) then do (Pick every unit in (Units owned by Player 10 (Light Blue) matching ((Unit-type of (Matching unit)) Not equal to |c005588CCMage Base|r).) and do (Remove (Triggering unit) from the game)) else do (Do nothing)
Give Tower Powers
  Events
    Time - Every 15.00 seconds of game time
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 1 (Red) controller) Equal to Computer) or ((Player 1 (Red) slot status) Equal to Is unused)) or ((Player 1 (Red) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0009 <gen>) Equal to Player 1 (Red)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0009 <gen> to Player 2 (Blue) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 2 (Blue) controller) Equal to Computer) or ((Player 2 (Blue) slot status) Equal to Is unused)) or ((Player 2 (Blue) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0009 <gen>) Equal to Player 2 (Blue)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0009 <gen> to Player 3 (Teal) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 3 (Teal) controller) Equal to Computer) or ((Player 3 (Teal) slot status) Equal to Is unused)) or ((Player 2 (Blue) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0009 <gen>) Equal to Player 3 (Teal)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0009 <gen> to Player 3 (Teal) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 4 (Purple) controller) Equal to Computer) or ((Player 4 (Purple) slot status) Equal to Is unused)) or ((Player 4 (Purple) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0009 <gen>) Equal to Player 4 (Purple)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0009 <gen> to Player 5 (Yellow) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 6 (Orange) controller) Equal to Computer) or ((Player 6 (Orange) slot status) Equal to Is unused)) or ((Player 6 (Orange) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0011 <gen>) Equal to Player 6 (Orange)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0011 <gen> to Player 7 (Green) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 7 (Green) controller) Equal to Computer) or ((Player 7 (Green) slot status) Equal to Is unused)) or ((Player 7 (Green) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0011 <gen>) Equal to Player 7 (Green)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0011 <gen> to Player 8 (Pink) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 8 (Pink) controller) Equal to Computer) or ((Player 8 (Pink) slot status) Equal to Is unused)) or ((Player 8 (Pink) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0011 <gen>) Equal to Player 8 (Pink)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0011 <gen> to Player 9 (Gray) and Change color
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (((Player 9 (Gray) controller) Equal to Computer) or ((Player 9 (Gray) slot status) Equal to Is unused)) or ((Player 9 (Gray) slot status) Equal to Has left the game)
        (Owner of |c005588CCMage Base|r 0011 <gen>) Equal to Player 9 (Gray)
      Then - Actions
        Unit - Change ownership of |c005588CCMage Base|r 0011 <gen> to Player 10 (Light Blue) and Change color
      Else - Actions
Mage Tower Death 1
  Events
    Unit - |c005588CCMage Base|r 0009 <gen> Dies
  Conditions
  Actions
    Set VariableSet teamdefeated[1] = True
    Game - Display to (All players) the text: Team 1 was defeated
Mage Tower Death 2
  Events
    Unit - |c005588CCMage Base|r 0011 <gen> Dies
  Conditions
  Actions
    Set VariableSet teamdefeated[2] = True
    Game - Display to (All players) the text: Team 2 was defeated
Shock Ward Attack
  Events
    Unit - A unit Is attacked
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Attacking unit)) Equal to Shock Ward (Level 1)
        (Unit-type of (Attacking unit)) Equal to Shock Ward (Level 2)
  Actions
    Unit - Order (Attacking unit) to Orc Far Seer - Chain Lightning.(Attacked unit)
Win
  Events
    Unit - |c005588CCMage Base|r 0011 <gen> Dies
    Unit - |c005588CCMage Base|r 0009 <gen> Dies
  Conditions
  Actions
    Wait 5.00 seconds
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        teamdefeated[1] Equal to False
        teamdefeated[2] Equal to True
      Then - Actions
        Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
        Game - Victory Player 3 (Teal) (Show dialogs, Show scores)
        Game - Victory Player 4 (Purple) (Show dialogs, Show scores)
        Game - Victory Player 5 (Yellow) (Show dialogs, Show scores)
        Game - Defeat Player 6 (Orange) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 7 (Green) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 8 (Pink) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 9 (Gray) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 10 (Light Blue) with the message: You failed to protect the Mage Tower.
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        teamdefeated[1] Equal to True
        teamdefeated[2] Equal to False
      Then - Actions
        Game - Defeat Player 1 (Red) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 2 (Blue) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 3 (Teal) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 4 (Purple) with the message: You failed to protect the Mage Tower.
        Game - Defeat Player 5 (Yellow) with the message: You failed to protect the Mage Tower.
        Game - Victory Player 6 (Orange) (Show dialogs, Show scores)
        Game - Victory Player 7 (Green) (Show dialogs, Show scores)
        Game - Victory Player 8 (Pink) (Show dialogs, Show scores)
        Game - Victory Player 9 (Gray) (Show dialogs, Show scores)
        Game - Victory Player 10 (Light Blue) (Show dialogs, Show scores)
      Else - Actions
Mover Units
  Events
    Unit - A unit enters Mover <gen>
  Conditions
    ((Triggering unit) is Mechanical) Equal to False
  Actions
    If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Move (Triggering unit) instantly to (Center of Base_Red <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Move (Triggering unit) instantly to (Center of Base_Red <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) then do (Move (Triggering unit) instantly to (Center of Base_Red <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 4 (Purple)) then do (Move (Triggering unit) instantly to (Center of Base_Red <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 5 (Yellow)) then do (Move (Triggering unit) instantly to (Center of Base_Red <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 6 (Orange)) then do (Move (Triggering unit) instantly to (Center of Base_Orange <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 7 (Green)) then do (Move (Triggering unit) instantly to (Center of Base_Orange <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 8 (Pink)) then do (Move (Triggering unit) instantly to (Center of Base_Orange <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 9 (Gray)) then do (Move (Triggering unit) instantly to (Center of Base_Orange <gen>)) else do (Do nothing)
    If ((Owner of (Triggering unit)) Equal to Player 10 (Light Blue)) then do (Move (Triggering unit) instantly to (Center of Base_Orange <gen>)) else do (Do nothing)
Revive
  Events
    Unit - A unit Dies
  Conditions
    ((Dying unit) is A Hero) Equal to True
    teamdefeated[((Player number of (Owner of (Dying unit))) / 2)] Equal to False
  Actions
    If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 0.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 2 (Blue)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 3 (Teal)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 100.00%, 100.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 4 (Purple)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (75.00%, 0.00%, 80.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 5 (Yellow)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 100.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 6 (Orange)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 50.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 7 (Green)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 8 (Pink)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 50.00%, 75.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 9 (Gray)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (75.00%, 75.00%, 75.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 10 (Light Blue)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (50.00%, 75.00%, 100.00%)) else do (Do nothing)
    Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + 's hero was slain and will be revived in 30 seconds.)
    Wait 30.00 seconds
    If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Instantly revive (Dying unit) at (Center of Base_Red <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 2 (Blue)) then do (Instantly revive (Dying unit) at (Center of Base_Red <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 3 (Teal)) then do (Instantly revive (Dying unit) at (Center of Base_Red <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 4 (Purple)) then do (Instantly revive (Dying unit) at (Center of Base_Red <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 5 (Yellow)) then do (Instantly revive (Dying unit) at (Center of Base_Red <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 6 (Orange)) then do (Instantly revive (Dying unit) at (Center of Base_Orange <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 7 (Green)) then do (Instantly revive (Dying unit) at (Center of Base_Orange <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 8 (Pink)) then do (Instantly revive (Dying unit) at (Center of Base_Orange <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 9 (Gray)) then do (Instantly revive (Dying unit) at (Center of Base_Orange <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 10 (Light Blue)) then do (Instantly revive (Dying unit) at (Center of Base_Orange <gen>), Show revival graphics) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 0.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 2 (Blue)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 3 (Teal)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 100.00%, 100.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 4 (Purple)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (75.00%, 0.00%, 80.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 5 (Yellow)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 100.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 6 (Orange)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 50.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 7 (Green)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 8 (Pink)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (100%, 50.00%, 75.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 9 (Gray)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (75.00%, 75.00%, 75.00%)) else do (Do nothing)
    If ((Owner of (Dying unit)) Equal to Player 10 (Light Blue)) then do (Ping minimap for (All allies of (Owner of (Dying unit)).) at (Position of (Dying unit)) for 2.00 seconds, using a Simple ping of color (50.00%, 75.00%, 100.00%)) else do (Do nothing)
Fire
  Events
    Unit - A unit enters Select_Pyro <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ff6633Pyro Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Crystal
  Events
    Unit - A unit enters Crystal_Mage <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|cff00FFFFCrystal mage for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Crystal Копировать
  Events
    Unit - A unit enters _______________059 <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.Blodelf Wizard for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Shadow assasin
  Events
    Unit - A unit enters _______________060 <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.Shadow assasin for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Chaos Warlord
  Events
    Unit - A unit enters Chaos_Warlord <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.Chaos Warlord for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Pyro
  Events
    Unit - A unit enters Select_Fire <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c00ff5555Fire Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Aqua
  Events
    Unit - A unit enters Select_Aqua <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c003377ffAqua Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Ice
  Events
    Unit - A unit enters Select_Ice <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c005588ffIce Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Ancient
  Events
    Unit - A unit enters Select_Ancient <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c0033ff88Ancient Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Earth
  Events
    Unit - A unit enters Select_Earth <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c00884422Earth Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Dark
  Events
    Unit - A unit enters Select_Dark <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c00662288Dark Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Pit
  Events
    Unit - A unit enters Select_Pit <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c0055445APit Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Bug
  Events
    Unit - A unit enters Select_Bug <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c00117733Bug Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Posion
  Events
    Unit - A unit enters Select_Posion <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.|c0066BB66Posion Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
Shock
  Events
    Unit - A unit enters Select_Shock <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00AAAAFFShock Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Storm
  Events
    Unit - A unit enters Select_Storm <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00AAAACCStorm Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Fallen
  Events
    Unit - A unit enters Select_Fallen <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00663333Fallen Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
UnDead
  Events
    Unit - A unit enters Select_UnDead <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00337755UnDead Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Mech
  Events
    Unit - A unit enters Select_Mech <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00777777Mech Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Alchemist
  Events
    Unit - A unit enters Select_Alchemist <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c0077AA77Alchemist Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Astro
  Events
    Unit - A unit enters Select_Astro <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00555555Astro Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Ranger
  Events
    Unit - A unit enters Select_Ranger <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c008866AARanger Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Warrior
  Events
    Unit - A unit enters Select_Warrior <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ff0000Warrior Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Necro
  Events
    Unit - A unit enters Select_Necro <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ff7700Necro Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Raindancer
  Events
    Unit - A unit enters Select_Raindancer <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c002255ffRaindancer|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Elf
  Events
    Unit - A unit enters Select_Elf <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00aa33ccElf Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Wolf
  Events
    Unit - A unit enters Select_Wolf <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00771122Wolf Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Vampiric
  Events
    Unit - A unit enters Select_Vampiric <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c008855bbVampiric Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Magnataur
  Events
    Unit - A unit enters Select_Kyle <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ff6611Cheiftain Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Crab
  Events
    Unit - A unit enters Select_Crab <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00115522Crab Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Warden
  Events
    Unit - A unit enters Select_Warden <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00331166Warden|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Spell Breaker
  Events
    Unit - A unit enters Select_Spell_Breaker <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00cc0000Spell Breaker|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Machine
  Events
    Unit - A unit enters Select_Magic_Machine <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ffcc99Magic Machine|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Treant
  Events
    Unit - A unit enters Select_Treant <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00008844Treant Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Tauren
  Events
    Unit - A unit enters Select_Tauren <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c00ff7733Tauren Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Phisic Mage
  Events
    Unit - A unit enters Phisic_Mage <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.Phisic Mage for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Aaron
  Events
    Unit - A unit enters Select_Aaron <gen>
  Conditions
    (Unit-type of (Triggering unit)) Equal to Selector
  Actions
    Unit - Create 1.|c0099ffffBeast Mage|r for (Owner of (Triggering unit)) at (Center of Mover <gen>) facing Default building facing degrees
    Unit - Remove (Triggering unit) from the game
Add Income Normal
  Events
    Time - incometimer expires
  Conditions
    mode Not equal to 2
    mode Not equal to 3
  Actions
    For each (Integer A) from 1 to 10, do (Add (1 x income[(Player number of (Player((Integer A))))]) to (Player((Integer A))).Current gold)
    If ((Player 1 (Red) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffff0000 + ((Name of Player 1 (Red)) + ( - + (String(income[1])))))) else do (Do nothing)
    If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff0000ff + ((Name of Player 2 (Blue)) + ( - + (String(income[2])))))) else do (Do nothing)
    If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff00ffff + ((Name of Player 3 (Teal)) + ( - + (String(income[3])))))) else do (Do nothing)
    If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffaa00ba + ((Name of Player 4 (Purple)) + ( - + (String(income[4])))))) else do (Do nothing)
    If ((Player 5 (Yellow) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffffff00 + ((Name of Player 5 (Yellow)) + ( - + (String(income[5])))))) else do (Do nothing)
    If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffcc7722 + ((Name of Player 6 (Orange)) + ( - + (String(income[6])))))) else do (Do nothing)
    If ((Player 7 (Green) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff00ff00 + ((Name of Player 7 (Green)) + ( - + (String(income[7])))))) else do (Do nothing)
    If ((Player 8 (Pink) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffff55aa + ((Name of Player 8 (Pink)) + ( - + (String(income[8])))))) else do (Do nothing)
    If ((Player 9 (Gray) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff777777 + ((Name of Player 9 (Gray)) + ( - + (String(income[9])))))) else do (Do nothing)
    If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff55aaff + ((Name of Player 10 (Light Blue)) + ( - + (String(income[10])))))) else do (Do nothing)
Add Income Goldrush
  Events
    Time - incometimer expires
  Conditions
    mode Equal to 2
  Actions
    For each (Integer A) from 1 to 10, do (Add (3 x income[(Player number of (Player((Integer A))))]) to (Player((Integer A))).Current gold)
    If ((Player 1 (Red) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffff0000 + ((Name of Player 1 (Red)) + ( - + (String(income[1])))))) else do (Do nothing)
    If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff0000ff + ((Name of Player 2 (Blue)) + ( - + (String(income[2])))))) else do (Do nothing)
    If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff00ffff + ((Name of Player 3 (Teal)) + ( - + (String(income[3])))))) else do (Do nothing)
    If ((Player 4 (Purple) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffaa00ba + ((Name of Player 4 (Purple)) + ( - + (String(income[4])))))) else do (Do nothing)
    If ((Player 5 (Yellow) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffffff00 + ((Name of Player 5 (Yellow)) + ( - + (String(income[5])))))) else do (Do nothing)
    If ((Player 6 (Orange) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffcc7722 + ((Name of Player 6 (Orange)) + ( - + (String(income[6])))))) else do (Do nothing)
    If ((Player 7 (Green) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff00ff00 + ((Name of Player 7 (Green)) + ( - + (String(income[7])))))) else do (Do nothing)
    If ((Player 8 (Pink) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cffff55aa + ((Name of Player 8 (Pink)) + ( - + (String(income[8])))))) else do (Do nothing)
    If ((Player 9 (Gray) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff777777 + ((Name of Player 9 (Gray)) + ( - + (String(income[9])))))) else do (Do nothing)
    If ((Player 10 (Light Blue) slot status) Equal to Is playing) then do (Display to (All players) the text: (|Cff55aaff + ((Name of Player 10 (Light Blue)) + ( - + (String(income[10])))))) else do (Do nothing)
Reset Income Timer
  Events
    Time - incometimer expires
  Conditions
    mode Not equal to 3
  Actions
    Countdown Timer - Start incometimer as a One-shot timer that will expire in 20.00 seconds
Spawn Move
  Events
    Time - Every 10.00 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
      Loop - Actions
        Unit - Order (Picked unit) to Attack-Move To.(Center of Base_Orange <gen>)
    Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 11 (Dark Green)) and do (Actions)
      Loop - Actions
        Unit - Order (Picked unit) to Attack-Move To.(Center of Base_Red <gen>)
Spawn is Summoned 1
  Events
    Unit - A unit enters Summoner_1 <gen>
    Unit - A unit enters Summoner_2 <gen>
    Unit - A unit enters Summoner_3 <gen>
    Unit - A unit enters Summoner_4 <gen>
    Unit - A unit enters Summoner_5 <gen>
  Conditions
    mode Not equal to 3
    mode Not equal to 4
    ((Triggering unit) is Summoned) Equal to False
    ((Triggering unit) is A structure) Equal to False
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in Spawn_5 <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in Spawn_6 <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in Spawn_7 <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in Spawn_8 <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Set VariableSet income[(Player number of (Owner of (Triggering unit)))] = (income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Triggering unit)))
Spawn is Summoned 2
  Events
    Unit - A unit enters Summoner_6 <gen>
    Unit - A unit enters Summoner_7 <gen>
    Unit - A unit enters Summoner_8 <gen>
    Unit - A unit enters Summoner_9 <gen>
    Unit - A unit enters Summoner_10 <gen>
  Conditions
    mode Not equal to 3
    mode Not equal to 4
    ((Triggering unit) is Summoned) Equal to False
    ((Triggering unit) is A structure) Equal to False
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in Spawn_1 <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in Spawn_2 <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in Spawn_3 <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in Spawn_4 <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Set VariableSet income[(Player number of (Owner of (Triggering unit)))] = (income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Triggering unit)))
Spawn is Summoned 1 War
  Events
    Unit - A unit enters Summoner_1 <gen>
    Unit - A unit enters Summoner_2 <gen>
    Unit - A unit enters Summoner_3 <gen>
    Unit - A unit enters Summoner_4 <gen>
    Unit - A unit enters Summoner_5 <gen>
  Conditions
    mode Equal to 4
    ((Triggering unit) is Summoned) Equal to False
    ((Triggering unit) is A structure) Equal to False
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in War_1_Spawn <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in War_1_Spawn <gen>) facing 270.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Set VariableSet income[(Player number of (Owner of (Triggering unit)))] = (income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Triggering unit)))
Spawn is Summoned 2 War
  Events
    Unit - A unit enters Summoner_6 <gen>
    Unit - A unit enters Summoner_7 <gen>
    Unit - A unit enters Summoner_8 <gen>
    Unit - A unit enters Summoner_9 <gen>
    Unit - A unit enters Summoner_10 <gen>
  Conditions
    mode Equal to 4
    ((Triggering unit) is Summoned) Equal to False
    ((Triggering unit) is A structure) Equal to False
  Actions
    Unit - Remove (Triggering unit) from the game
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in War_2_Spawn <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Unit - Create 1.(Unit-type of (Triggering unit)) for Player 11 (Dark Green) at (Random point in War_2_Spawn <gen>) facing 90.00 degrees
    Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
    Set VariableSet income[(Player number of (Owner of (Triggering unit)))] = (income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Triggering unit)))
//Boomerang by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor

//Constants
scope Boomerang
  globals
     private constant integer SpellId='A000'
     private constant integer DummyId='e000'
     private constant string MissileEffectMdl="Abilities\\Weapons\\ShadowHunterMissile\\ShadowHunterMissile.mdl"
     private constant string DamageEffectMdl="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
     private constant string DamageAttachPoint="chest"
     private constant string MissileAttachPoint="chest"
     private constant real MissileSpeed=15.00
     private constant real PeriodicEvent=0.03
     private constant real Range=90.00
     private constant string Code="Bo_Group"
     private constant string RFunction="Bo_React"
  endglobals

  private constant function Bo_Damage takes integer lvl returns integer
   return (30*lvl)+30    //damage the victim units gets
  endfunction

  private constant function Bo_TurnSpeed takes real ctmp returns real
   return (1.1*ctmp)+2  //Turn Speed of the missiles
  endfunction

  //Conditions

  private function Trig_Boomerang_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellId
  endfunction

  //Actions

  private function Bo_EnumDamage takes nothing returns nothing
   local unit c  =I2U(GetStoredInteger(GC(),Code,"c"))
   local unit a  =GetEnumUnit()
   local unit u  =I2U(GetStoredInteger(GC(),Code,"u"))
   local group g =I2G(GetStoredInteger(GC(),Code,"g"))
   if IsUnitNotImmun(u,a) and not IsUnitInGroup(a,g) then
      call GroupAddUnit(g,a)
      call UnitDamageTarget(c,a,I2R(Bo_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
      call DestroyEffect(AddSpecialEffectTarget(DamageEffectMdl,a,DamageAttachPoint))
   endif
   set c=null
   set a=null
   set u=null
   set g=null
  endfunction

  function Bo_React takes nothing returns nothing
     call StoreBoolean(GC(),HS(tc),"back",true)
  endfunction

  private struct BoomerangDatas
    real dx
    real dy
    real distance
    real angle
    unit caster
    real ctmp
    real dtmp
    unit missile1
    unit missile2
    group rdyg1
    group rdyg2
    effect gfx1
    effect gfx2
  endstruct

  private function BoomerangMotion takes nothing returns nothing
    local timer t             =GetExpiredTimer()
    local BoomerangDatas datas=GetStoredInteger(GC(),HS(t),"datas")
    local real x              =0
    local real y              =0
    local group g

    local boolean back         =GetStoredBoolean(GC(),HS(datas.caster),"back")

      set g=GetUnitsInRange(Range,GetUnitX(datas.missile1),GetUnitY(datas.missile1),null,true)
      call StoreInteger(GC(),Code,"c",H2I(datas.caster))
      call StoreInteger(GC(),Code,"u",H2I(datas.missile1))
      call StoreInteger(GC(),Code,"g",H2I(datas.rdyg1))
      call ForGroup(g,function Bo_EnumDamage)
      call AB_DestroyGroup(g)
      call FlushStoredMission(GC(),Code)

      set g=GetUnitsInRange(Range,GetUnitX(datas.missile2),GetUnitY(datas.missile2),null,true)
      call StoreInteger(GC(),Code,"c",H2I(datas.caster))
      call StoreInteger(GC(),Code,"u",H2I(datas.missile2))
      call StoreInteger(GC(),Code,"g",H2I(datas.rdyg2))
      call ForGroup(g,function Bo_EnumDamage)
      call AB_DestroyGroup(g)
      call FlushStoredMission(GC(),Code)

    if datas.dtmp<=datas.distance and datas.ctmp<=180 then

      call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle+25)

      call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle-25)
      set datas.dtmp=datas.dtmp+MissileSpeed
    elseif datas.ctmp<=180 then
      set datas.ctmp=Bo_TurnSpeed(datas.ctmp)
      call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle-datas.ctmp)
      call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle+datas.ctmp)
    elseif datas.ctmp>180 and datas.dtmp>datas.distance then
      call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile1,GetUnitX(datas.missile1),GetUnitY(datas.missile1),0,datas.caster,MissileSpeed,RFunction)
      call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile2,GetUnitX(datas.missile2),GetUnitY(datas.missile2),0,datas.caster,MissileSpeed,RFunction)
      set datas.dtmp=0
    endif

    if not back then
    call TimerStart(t,PeriodicEvent,false,function BoomerangMotion)

    elseif back then
    call DestroyEffect(datas.gfx1)
    call DestroyEffect(datas.gfx2)
    call AB_DestroyGroup(datas.rdyg1)
    call AB_DestroyGroup(datas.rdyg2)
    call RemoveUnit(datas.missile1)
    call RemoveUnit(datas.missile2)
    call FlushStoredMission(GC(),HS(datas.caster))
    call FlushStoredMission(GC(),HS(t))
    call BoomerangDatas.destroy(datas)
    call AB_DestroyTimer(t)
    endif
  endfunction

  private function Trig_Boomerang_Actions takes nothing returns nothing
    local location loc        =GetSpellTargetLoc()
    local timer t             =CreateTimer()
    local BoomerangDatas datas=BoomerangDatas.create()
    local unit u              =GetTriggerUnit()
    local real x              =GetUnitX(u)
    local real y              =GetUnitY(u)
    local real angle          =A2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
    local real distance       =D2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
    local real dx
    local real dy

    local unit missile1       =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle+15)
    local unit missile2       =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle-15)

    local effect gfx1         =AddSpecialEffectTarget(MissileEffectMdl,missile1,MissileAttachPoint)
    local effect gfx2         =AddSpecialEffectTarget(MissileEffectMdl,missile2,MissileAttachPoint)
   
    set distance=(distance*75)/100
    set dx=x+distance*Cos(angle*3.14159/180)
    set dy=y+distance*Sin(angle*3.14159/180)

    call TimerStart(t,0,false,function BoomerangMotion)
    set datas.dx=dx
    set datas.dy=dy
    set datas.distance=distance
    set datas.angle=angle
    set datas.caster=u
    set datas.missile1=missile1
    set datas.missile2=missile2
    set datas.rdyg1=CreateGroup()
    set datas.rdyg2=CreateGroup()
    set datas.gfx1=gfx1
    set datas.gfx2=gfx2
    set datas.ctmp=0
    set datas.dtmp=0
    call StoreInteger(GC(),HS(t),"datas",datas)

    call RemoveLocation(loc)
    set t=null
  endfunction

//===========================================================================
function InitTrig_Boomerang takes nothing returns nothing
    set gg_trg_Boomerang = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Boomerang, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Boomerang, Condition( function Trig_Boomerang_Conditions ) )
    call TriggerAddAction( gg_trg_Boomerang, function Trig_Boomerang_Actions )
endfunction
endscope
 
//Crush by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor

//Constants
scope Crush
  globals
     private constant integer SpellId='A001'
     private constant integer BuffAddId='A002'
     private constant string BuffOrder="berserk"
     private constant real MotionSpeed=10.00
     private constant real PeriodicTime=0.03
     private constant real MaxPushTime=0.50
     private constant string PushMdl="Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
     private constant string PushAtt="origin"
  endglobals

  private constant function Cr_Percent takes real lvl returns real
    return 10+(5*lvl)
  endfunction

  //Conditions

  private function Trig_Crush_Conditions takes nothing returns boolean
    return GetUnitAbilityLevelSwapped(SpellId, GetAttacker()) > 0
  endfunction

  //Actions
  private struct CrushDatas
    real tt
    unit attacked
    real angle
  endstruct

  private function CrushMotion takes nothing returns nothing
    local timer t       =GetExpiredTimer()
    local CrushDatas datas=GetStoredInteger(GC(),HS(t),"datas")

    local real x        =GetUnitX(datas.attacked)
    local real y        =GetUnitY(datas.attacked)

    call VUnitPolarXY(datas.attacked,MotionSpeed,datas.angle)
    call DestroyEffect(AddSpecialEffectTarget(PushMdl,datas.attacked,PushAtt))
    set datas.tt=PeriodicTime+datas.tt

    if datas.tt<=MaxPushTime then
      call TimerStart(t,PeriodicTime,false,function CrushMotion)
    else
      call CrushDatas.destroy(datas)
      call FlushStoredMission(GC(),HS(t))
      call AB_DestroyTimer(t)
    endif
  endfunction

  private function CrushBegin takes nothing returns nothing
    local unit attacked=GetTriggerUnit()
    local timer t      =CreateTimer()
    local unit u       =GetEventDamageSource()
    local CrushDatas datas=CrushDatas.create()
    local real ang     =A2PXY(GetUnitX(u),GetUnitY(u),GetUnitX(attacked),GetUnitY(attacked))

    call UnitAddAbility(attacked,BuffAddId)
    call IssueImmediateOrder(attacked,BuffOrder)
    call UnitRemoveAbility(attacked,BuffAddId)

    call TimerStart(t,0,false,function CrushMotion)
    set datas.tt=0.00
    set datas.attacked=attacked
    set datas.angle=ang
    call StoreInteger(GC(),HS(t),"datas",datas)

    call DestroyDamageTrig_Vars(GetTriggeringTrigger())
    set t=null
  endfunction

  private function Trig_Crush_Actions takes nothing returns nothing
    local real rndm    =GetRandomReal(0,100)
    if Cr_Percent(I2R(GetUnitAbilityLevelSwapped(SpellId, GetAttacker())))>=rndm then
       call Add_DamageTrigger(GetTriggerUnit(),4,GetAttacker(),function CrushBegin)
    endif
  endfunction

//===========================================================================
function InitTrig_Crush takes nothing returns nothing
    set gg_trg_Crush = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Crush, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Crush, Condition( function Trig_Crush_Conditions ) )
    call TriggerAddAction( gg_trg_Crush, function Trig_Crush_Actions )
endfunction
endscope
 
//Electrical Field made by OrkOfMordor aka Hanky aka MDZ-OrkOfMordor

//Constants
scope ElectricFlield
  globals
     private constant integer SpellId='A004'
     private constant integer BuffSpellId='A003'
     private constant integer MaxMissiles=6
     private constant real MaxSpeed=10.00
     private constant real MaxRange=250.00
     private constant integer DummyId='e000'
     private constant string MissileMdl="Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
     private constant string MissileAttachPoint="origin"
     private constant string BuffOrder="thunderclap"
     private constant real MissileDamageRange=120.00
     private constant real MovementPerOfMissiles=0.03
     private constant string Code="ElectroFlieldExpl"  
  endglobals  

  private function EF_MissileFlyHeight takes nothing returns real
   return GetRandomReal(500,700)
  endfunction

  private constant function EF_Damage takes integer lvl returns integer
    return (15*lvl)+30
  endfunction

  //Conditions

  private function Trig_Electric_Field_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellId
  endfunction

  private function ElectroFieldFilerConditions takes nothing returns boolean
     local unit c   =I2U(GetStoredInteger(GC(),Code,"c"))
     return IsUnitNotImmun(c,GetFilterUnit())
  endfunction

//Actions

  private function ElectroFieldDamage takes nothing returns nothing
    local unit c   =I2U(GetStoredInteger(GC(),Code,"c"))
    call UnitDamageTarget(c,GetEnumUnit(),I2R(EF_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
    set c=null
  endfunction

  private struct ElectroBombs
    unit caster
    unit missile
    effect gfx
  endstruct

  private function ElectroFlieldExpl takes nothing returns nothing
    local timer t            =GetExpiredTimer()
    local ElectroBombs datas =GetStoredInteger(GC(),HS(t),"datas")
    local group g

    call DestroyEffect(datas.gfx)

    call StoreInteger(GC(),Code,"c",H2I(datas.caster))
    set g=GetUnitsInRange(MissileDamageRange,GetUnitX(datas.missile),GetUnitY(datas.missile),Condition(function ElectroFieldFilerConditions),true)
    call ForGroup(g,function ElectroFieldDamage)
    call AB_DestroyGroup(g)
    call FlushStoredMission(GC(),Code)

   
    call UnitAddAbility(datas.missile,BuffSpellId)
    call SetUnitAbilityLevel(datas.missile,BuffSpellId,GetUnitAbilityLevel(datas.caster,SpellId))
    call IssueImmediateOrder(datas.missile,BuffOrder)
    call U2Null(datas.missile,0.5)

    call ElectroBombs.destroy(datas)
    call FlushStoredMission(GC(),HS(t))
    call AB_DestroyTimer(t)
  endfunction

  private function Trig_Electric_Field_Actions takes nothing returns nothing
    local timer t            =null
    local unit tempunit      =null
    local real randomA       =0
    local real randomB       =0
    local real randomY       =0
    local real randomX       =0
    local integer int        =1
    local effect tempgfx     =null
    local ElectroBombs datas
    local unit u             =GetTriggerUnit()
    local location loc       =GetSpellTargetLoc()

    local real x             =GetUnitX(u)
    local real y             =GetUnitY(u)
    local real Rx            =GetLocationX(loc)
    local real Ry            =GetLocationY(loc)


    loop
       exitwhen int>MaxMissiles
            set t         =CreateTimer()            

            set randomA   =GetRandomReal(0,360)
            set randomB   =GetRandomReal(0,MaxRange)

            set randomX   =Rx+randomB*Cos(randomA*bj_DEGTORAD)
            set randomY   =Ry+randomB*Sin(randomA*bj_DEGTORAD)

            set tempunit  =CreateUnit(GetOwningPlayer(u),DummyId,x,y,0)
            set tempgfx   =AddSpecialEffectTarget(MissileMdl,tempunit,MissileAttachPoint)
           
            call LaunchMissileAtPointEx(tempunit,x,y,45,EF_MissileFlyHeight(),randomX,randomY,MaxSpeed)
            call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,randomX,randomY),MaxSpeed,MovementPerOfMissiles),false,function ElectroFlieldExpl)


            set datas=ElectroBombs.create()
            set datas.caster=u
            set datas.missile=tempunit
            set datas.gfx=tempgfx
            call StoreInteger(GC(),HS(t),"datas",datas)
           
            set t=null
       set int=int+1
    endloop

    call RemoveLocation(loc)
  endfunction

//===========================================================================
function InitTrig_Electric_Field takes nothing returns nothing
    set gg_trg_Electric_Field = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Electric_Field, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Electric_Field, Condition( function Trig_Electric_Field_Conditions ) )
    call TriggerAddAction( gg_trg_Electric_Field, function Trig_Electric_Field_Actions )
endfunction
endscope
 
//Fire Bombs by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor

//Constants
scope FireBombs
  globals
     private constant integer SpellId='A007'
     private constant integer BuffSpellId='A00A'
     private constant string BuffOrder="unholyfrenzy"
     private constant integer MaxMissiles=6
     private constant integer DummyId='e000'
     private constant real MaxRange=250.00
     private constant real MissileDamageRange=120.00
     private constant real MaxSpeed=10.00
     private constant string ExplMdl="Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
     private constant string MissileMdl="Abilities\\Weapons\\BatTrollMissile\\BatTrollMissile.mdl"
     private constant string MissileAttachPoint="origin"
     private constant string Code="FireBombsExpl"
     private constant real MovementPerOfMissiles=0.03
  endglobals

  private function FB_MissileFlyHeight takes nothing returns real
    return GetRandomReal(500,700)
  endfunction

  private constant function FB_Damage takes integer lvl returns integer
    return 50*lvl
  endfunction


  //conditions

  private function FireBombFilerConditions takes nothing returns boolean
     local unit c   =I2U(GetStoredInteger(GC(),Code,"c"))
     return IsUnitNotImmun(c,GetFilterUnit())
  endfunction

  private function Trig_Fire_Bombs_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SpellId
  endfunction

  //actions

  private function FireBombsDamage takes nothing returns nothing
    local unit c   =I2U(GetStoredInteger(GC(),Code,"c"))
    local unit a   =GetEnumUnit()
    local unit u   =CreateUnit(GetOwningPlayer(c),DummyId,GetUnitX(a),GetUnitY(a),0)
    call UnitDamageTarget(c,a,I2R(FB_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)

    if IsUnitNotImmun(c,a) then
    call UnitAddAbility(u,BuffSpellId)
    call SetUnitAbilityLevel(u,BuffSpellId,GetUnitAbilityLevel(c,SpellId))
    call IssueTargetOrder(u,BuffOrder,a)
    call U2Null(u,0.5)
    endif
   
    set u=null
    set c=null
    set a=null
  endfunction

  private struct FireBombs
    unit caster
    unit missile
    effect gfx
  endstruct

  private function FireBombsExpl takes nothing returns nothing
    local timer t            =GetExpiredTimer()
    local FireBombs datas    =GetStoredInteger(GC(),HS(t),"datas")
    local group g

    call DestroyEffect(AddSpecialEffect(ExplMdl,GetUnitX(datas.missile),GetUnitY(datas.missile)))
    call DestroyEffect(datas.gfx)

    call StoreInteger(GC(),Code,"c",H2I(datas.caster))
    set g=GetUnitsInRange(MissileDamageRange,GetUnitX(datas.missile),GetUnitY(datas.missile),Condition(function FireBombFilerConditions),true)
    call ForGroup(g,function FireBombsDamage)
    call AB_DestroyGroup(g)
    call FlushStoredMission(GC(),Code)

    call RemoveUnit(datas.missile)
    call FireBombs.destroy(datas)
    call FlushStoredMission(GC(),HS(t))
    call AB_DestroyTimer(t)
  endfunction

  private function Trig_Fire_Bombs_Actions takes nothing returns nothing
    local timer t            =null
    local unit tempunit      =null
    local real randomA       =0
    local real randomB       =0
    local real randomY       =0
    local real randomX       =0
    local integer int        =1
    local effect tempgfx     =null
    local FireBombs datas
    local unit u             =GetTriggerUnit()
    local location loc       =GetSpellTargetLoc()

    local real x             =GetUnitX(u)
    local real y             =GetUnitY(u)
    local real Rx            =GetLocationX(loc)
    local real Ry            =GetLocationY(loc)


    loop
       exitwhen int>MaxMissiles
            set t         =CreateTimer()            

            set randomA   =GetRandomReal(0,360)
            set randomB   =GetRandomReal(0,MaxRange)

            set randomX   =Rx+randomB*Cos(randomA*bj_DEGTORAD)
            set randomY   =Ry+randomB*Sin(randomA*bj_DEGTORAD)

            set tempunit  =CreateUnit(GetOwningPlayer(u),DummyId,x,y,0)
            set tempgfx   =AddSpecialEffectTarget(MissileMdl,tempunit,MissileAttachPoint)
           
            call LaunchMissileAtPointEx(tempunit,x,y,45,FB_MissileFlyHeight(),randomX,randomY,MaxSpeed)
            call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,randomX,randomY),MaxSpeed,MovementPerOfMissiles),false,function FireBombsExpl)

            set datas=FireBombs.create()
            set datas.caster=u
            set datas.missile=tempunit
            set datas.gfx=tempgfx
            call StoreInteger(GC(),HS(t),"datas",datas)
           
            set t=null
       set int=int+1
    endloop

    call RemoveLocation(loc)
  endfunction

  //===========================================================================
  function InitTrig_Fire_Bombs takes nothing returns nothing
    set gg_trg_Fire_Bombs = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Bombs, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Fire_Bombs, Condition( function Trig_Fire_Bombs_Conditions ) )
    call TriggerAddAction( gg_trg_Fire_Bombs, function Trig_Fire_Bombs_Actions )
  endfunction
endscope
 
//Critical Jump by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor

//Constants
scope CriticalJump
  globals
      private constant integer SpellId='A009'
      private constant string EndEffect="Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
      private constant integer BuffSpellId='A008'
      private constant string BuffOrder="berserk"
      private constant real JumpSpeed=15.00
      private constant real Range=250.00
      private constant string Code="CriticalJumpEnd"
      private constant real MovementPerOfMissiles=0.03
  endglobals

  private constant function CJ_Damage takes integer lvl returns integer
    return 50+(75*lvl)
  endfunction

  private constant function CJ_MaxFlyHeight takes real distance returns real
    return distance*1.1
  endfunction

  //conditions

  private function Trig_Critical_Jump_Conditions takes nothing returns boolean
    return GetSpellAbilityId()==SpellId
  endfunction

  //actions

  private function CJ_GetDamage takes nothing returns nothing
   local unit c  =I2U(GetStoredInteger(GC(),Code,"c"))
   local unit u  =GetEnumUnit()
   if IsUnitNotImmun(c,u) then
     call UnitAddAbility(u,BuffSpellId)
     call IssueImmediateOrder(u,BuffOrder)
     call UnitRemoveAbility(u,BuffSpellId)

      call UnitDamageTarget(c,u,I2R(CJ_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
   endif
   set c=null
   set u=null  
  endfunction

  private function CriticalJumpEnd takes nothing returns nothing
    local timer t          =GetExpiredTimer()
    local unit caster      =I2U(GetStoredInteger(GC(),HS(t),"caster"))
    local real x           =GetUnitX(caster)
    local real y           =GetUnitY(caster)
    local group g          =GetUnitsInRange(Range,x,y,null,true)

    call DestroyEffect(AddSpecialEffect(EndEffect,x,y))
    call TerrainDeformationRippleXY(1,false,x,y,0,Range,90,0.5,200)

    call StoreInteger(GC(),Code,"c",H2I(caster))
    call ForGroup(g,function CJ_GetDamage)
    call FlushStoredMission(GC(),Code)

    call BugUse_AddFlyAbility(caster)
    call SetUnitFlyHeight(caster,0,0)

    call SetUnitAnimation(caster,"attack")
    call SetUnitPathing(caster,true)
   
    call AB_DestroyGroup(g)
    call FlushStoredMission(GC(),HS(t))
    call AB_DestroyTimer(t)
  endfunction

  private function Trig_Critical_Jump_Actions takes nothing returns nothing
    local timer t          =CreateTimer()
    local location loc     =GetSpellTargetLoc()
    local unit u           =GetTriggerUnit()

    local real x           =GetUnitX(u)
    local real y           =GetUnitY(u)
    local real lx          =GetLocationX(loc)
    local real ly          =GetLocationY(loc)

    call SetUnitPathing(u,false)
    call LaunchMissileAtPointEx(u,x,y,0,CJ_MaxFlyHeight(D2PXY(x,y,lx,ly)),lx,ly,JumpSpeed)

    call SetUnitFacing(u,A2PXY(x,y,lx,ly))
   
    call TimerStart(t,CalculateMaxMotionTime(D2PXY(x,y,lx,ly),JumpSpeed,MovementPerOfMissiles),false,function CriticalJumpEnd)

    call StoreInteger(GC(),HS(t),"caster",H2I(u))
 
    call RemoveLocation(loc)  
    set t=null
  endfunction

  //===========================================================================
  function InitTrig_Critical_Jump takes nothing returns nothing
    set gg_trg_Critical_Jump = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Critical_Jump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Critical_Jump, Condition( function Trig_Critical_Jump_Conditions ) )
    call TriggerAddAction( gg_trg_Critical_Jump, function Trig_Critical_Jump_Actions )
  endfunction
endscope

 
//Frost Sphere by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor

//Constants
scope FrostSphere

  globals
     private constant integer SpellId='A005'
     private constant integer BuffSpellId='A006'
     private constant string BuffOrder="berserk"
     private constant real PerSecondCreate=0.25
     private constant integer DummyId='e000'
     private constant real SphereSpeed=10.00
     private constant real MissileSpeed=15.00
     private constant real PeriodicTime=0.03
     private constant real TurnSpeed=45.00
     private constant real MissileDistance=1000.00
     private constant real MaxSphereDistance=2000.00
     private constant string MissileMdl="Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl"
     private constant string MissileAttackPoint="chest"
     private constant string SMissileMdl="Abilities\\Weapons\\LichMissile\\LichMissile.mdl"
     private constant string ExplMissileMdl="Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
     private constant string ExplSphereMdl="Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl"
     private constant string SMissileAttackPoint="chest"
     private constant string MCode="FS_MissileHit"
  endglobals

  private constant function FS_MissileDamage takes integer lvl returns integer
     return 90*lvl+5
  endfunction

  //conditions

  private function Trig_Frost_Sphere_Conditions takes nothing returns boolean
      return GetSpellAbilityId()==SpellId
  endfunction

  //actions

  private function FS_DamageOfMissile takes nothing returns nothing
     local unit caster  =I2U(GetStoredInteger(GC(),MCode,"c"))
     local unit missile =I2U(GetStoredInteger(GC(),MCode,"m"))
     local unit u       =GetEnumUnit()
        if IsUnitNotImmun(caster,u) and missile!=u then
             call UnitAddAbility(u,BuffSpellId)
             call IssueImmediateOrder(u,BuffOrder)
             call UnitRemoveAbility(u,BuffSpellId)
             call UnitDamageTarget(caster,u,I2R(FS_MissileDamage(GetUnitAbilityLevel(caster,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        endif
     set caster =null
     set missile=null
     set u      =null
  endfunction

  function FS_MissileHit takes nothing returns nothing
     local unit caster  =tc
     local unit missile =tm

     local real x       =GetUnitX(tm)
     local real y       =GetUnitY(tm)

     local group g      =GetUnitsInRange(120,x,y,null,true)
     local effect gfx   =I2E(GetStoredInteger(GC(),HS(missile),"gfx"))

     if CountUnitsInGroup(g)>0 then
     call StoreInteger(GC(),MCode,"c",H2I(caster))
     call StoreInteger(GC(),MCode,"M",H2I(missile))
     call ForGroup(g,function FS_DamageOfMissile)
     call FlushStoredMission(GC(),MCode)
     endif

     call E2Null(AddSpecialEffect(ExplMissileMdl,x,y),1)

     call DestroyEffect(gfx)
     call AB_DestroyGroup(g)
     
     call FlushStoredMission(GC(),HS(missile))
     call RemoveUnit(missile)
     set caster=null
  endfunction

  private struct FrostSphereDatas
    unit sphere
    unit caster
    effect gfx
    real circ
    real angl
    real tdis
    real ttim
  endstruct

  private function FrostSphereMotion takes nothing returns nothing
    local timer t       =GetExpiredTimer()
    local FrostSphereDatas datas=GetStoredInteger(GC(),HS(t),"datas")

    local unit missile  =null
    local real mx       =0
    local real my       =0
    local real ux       =0
    local real uy       =0
    local effect mgfx

    call VUnitPolarXY(datas.sphere,SphereSpeed,datas.angl)
    set datas.tdis=SphereSpeed+datas.tdis

    set ux=GetUnitX(datas.sphere)
    set uy=GetUnitY(datas.sphere)

    if datas.ttim>PerSecondCreate and datas.tdis<=MaxSphereDistance then
         set datas.ttim=0
         call DestroyEffect(datas.gfx)
         set datas.gfx=AddSpecialEffectTarget(MissileMdl,datas.sphere,MissileAttackPoint)
         set datas.circ=datas.circ+TurnSpeed

         set mx=ux+MissileDistance*Cos(datas.circ*bj_DEGTORAD)
         set my=uy+MissileDistance*Sin(datas.circ*bj_DEGTORAD)
 
         set missile=CreateUnit(GetOwningPlayer(datas.caster),DummyId,ux,uy,A2PXY(ux,uy,mx,my))
         set mgfx=AddSpecialEffectTarget(SMissileMdl,missile,SMissileAttackPoint)

         call LaunchNormalCollisionMissileAtPointEx(datas.caster,missile,ux,uy,0,mx,my,MissileSpeed,90,MCode)

         call StoreInteger(GC(),HS(missile),"gfx",H2I(mgfx))
       elseif datas.ttim<=PerSecondCreate then
         set datas.ttim=datas.ttim+PeriodicTime
    endif

    if datas.tdis>MaxSphereDistance then
      call DestroyEffect(AddSpecialEffect(ExplSphereMdl,ux,uy))
      call DestroyEffect(AddSpecialEffect(MissileMdl,ux,uy))
      call DestroyEffect(datas.gfx)
      call RemoveUnit(datas.sphere)
      call FrostSphereDatas.destroy(datas)
      call FlushStoredMission(GC(),HS(t))
      call AB_DestroyTimer(t)
    else
      call TimerStart(t,PeriodicTime,false,function FrostSphereMotion)
      set t=null
    endif
  endfunction

  private function Trig_Frost_Sphere_Actions takes nothing returns nothing
    local timer t       =CreateTimer()
    local location loc  =GetSpellTargetLoc()

    local FrostSphereDatas datas=FrostSphereDatas.create()
    local unit u        =GetTriggerUnit()
    local real x        =GetUnitX(u)
    local real y        =GetUnitY(u)
    local real lx       =GetLocationX(loc)
    local real ly       =GetLocationY(loc)

    local real angle    =A2PXY(x,y,lx,ly)

    local unit sphere   =CreateUnit(Player(14),DummyId,x,y,angle)
    local effect gfx    =AddSpecialEffectTarget(MissileMdl,sphere,MissileAttackPoint)
   
    call TimerStart(t,0,false,function FrostSphereMotion)

    set datas.gfx=gfx
    set datas.sphere=sphere
    set datas.caster=u
    set datas.angl=angle
    set datas.circ=0
    set datas.tdis=0
    set datas.ttim=0
    call StoreInteger(GC(),HS(t),"datas",datas)

    call RemoveLocation(loc)
    set t=null
  endfunction

//===========================================================================
function InitTrig_Frost_Sphere takes nothing returns nothing
    set gg_trg_Frost_Sphere = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Sphere, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Frost_Sphere, Condition( function Trig_Frost_Sphere_Conditions ) )
    call TriggerAddAction( gg_trg_Frost_Sphere, function Trig_Frost_Sphere_Actions )
endfunction
endscope

 
//Bloody Run by Hanky aka OrkOfMordor aka MDZ-OrkOfMordor

scope BloodyRun

   globals
     private constant integer SpellId='A00C'
     private constant string RunOrder="move"
     private constant string StopOrder="stop"
     private constant string Code    ="BloodyRunMotion"
     private constant real Periodic  =0.03
     private constant real Speed     =10.00
     private rect MaxArea            =null
     private constant real Range     =120.00
     private constant string dmgGFX  ="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
     private constant string dmgAtt  ="origin"
     private constant string uGFX    ="Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl"
     private constant string uAtt    ="origin"
   endglobals

   private constant function Damage takes real lvl returns real
     return 25+50*lvl
   endfunction

   private struct BloodyRunDatas
      unit caster
      real distance
      real angle
      real Nspeed
      effect gfx
      group notDamage
   endstruct

   private function Trig_Bloody_Run_Conditions takes nothing returns boolean
      return GetSpellAbilityId()==SpellId
   endfunction

   private function GroupDamage takes nothing returns nothing
      local group AddGroup=I2G(GetStoredInteger(GC(),Code,"AddGroup"))
      local unit Caster   =I2U(GetStoredInteger(GC(),Code,"Caster"))
      local unit u        =GetEnumUnit()
        if not IsUnitInGroup(u,AddGroup) and IsUnitNotImmun(Caster,u) then
          call DestroyEffect(AddSpecialEffectTarget(dmgGFX,u,dmgAtt))
          call GroupAddUnit(AddGroup,u)
          call UnitDamageTarget(Caster,u,Damage(I2R(GetUnitAbilityLevel(Caster,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        endif
      set AddGroup=null
      set Caster=null
      set u=null
   endfunction

   private function BloodyRunMotion takes nothing returns nothing
      local timer t             =GetExpiredTimer()
      local BloodyRunDatas datas=GetStoredInteger(GC(),HS(t),"datas")
      local real x              =GetUnitX(datas.caster)+Speed*Cos(datas.angle*3.14159/180)
      local real y              =GetUnitY(datas.caster)+Speed*Sin(datas.angle*3.14159/180)
      local group g

      if datas.distance>0 and GetUnitStateSwap(UNIT_STATE_LIFE,datas.caster)>0 and RectContainsCoords(MaxArea,x,y) and CountDestructableInRangeOfXY(x,y,Range)<=0 then
        call SetUnitX(datas.caster,x)
        call SetUnitY(datas.caster,y)
        call StoreInteger(GC(),Code,"AddGroup",H2I(datas.notDamage))
        call StoreInteger(GC(),Code,"Caster",H2I(datas.caster))
        set g=GetUnitsInRange(Range,x,y,null,true)
        call ForGroup(g,function GroupDamage)
        call AB_DestroyGroup(g)
        call FlushStoredMission(GC(),Code)
        set datas.distance=datas.distance-Speed
        call TimerStart(t,Periodic,false,function BloodyRunMotion)
         else
        call SetUnitMoveSpeed(datas.caster,datas.Nspeed)
        call SetUnitPathing(datas.caster,true)
        call IssueImmediateOrder(datas.caster,StopOrder)
        call SetUnitVertexColor(datas.caster,255,255,255,255)
        call DestroyEffect(datas.gfx)
        call AB_DestroyGroup(datas.notDamage)
        call BloodyRunDatas.destroy(datas)
        call FlushStoredMission(GC(),HS(t))
        call DestroyTimer(t)
      endif
   endfunction

   private function Trig_Bloody_Run_Actions takes nothing returns nothing
      local BloodyRunDatas datas=BloodyRunDatas.create()
      local location OrderPoint =GetSpellTargetLoc()
      local timer t             =CreateTimer()
      local unit u              =GetTriggerUnit()
      local real ux             =GetUnitX(u)
      local real uy             =GetUnitY(u)
      local real ttx            =GetLocationX(OrderPoint)
      local real tty            =GetLocationY(OrderPoint)

      set datas.caster=u
      set datas.distance=D2PXY(ux,uy,ttx,tty)-(GetUnitMoveSpeed(u)/D2PXY(ux,uy,ttx,tty))
      set datas.angle=A2PXY(ux,uy,ttx,tty)
      set datas.gfx=AddSpecialEffectTarget(uGFX,u,uAtt)
      set datas.notDamage=CreateGroup()
      call SetUnitVertexColor(u,255,50,50,75)

      set datas.Nspeed=GetUnitMoveSpeed(u)
      call SetUnitMoveSpeed(u,1)
      call SetUnitPathing(u,false)
      call IssuePointOrder(u,RunOrder,ttx,tty)

      call TimerStart(t,Periodic,false,function BloodyRunMotion)

      call StoreInteger(GC(),HS(t),"datas",datas)

      set t=null
      set u=null
      call RemoveLocation(OrderPoint)
   endfunction

  //===========================================================================
  function InitTrig_Bloody_Run takes nothing returns nothing
    set gg_trg_Bloody_Run = CreateTrigger(  )
    set MaxArea=GetWorldBounds()
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Bloody_Run, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Bloody_Run, Condition( function Trig_Bloody_Run_Conditions ) )
    call TriggerAddAction( gg_trg_Bloody_Run, function Trig_Bloody_Run_Actions )
  endfunction

endscope