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. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  8. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  9. 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

Great Battles - Middle Ages 15.4.w3x
Variables
Initialization
Melee Initialization
King Dies
Queen Dies
Player Looses
Suicide
Explode
Win Alternate
Settings
Leaver
RAM Attacks
Set Name
Dragon Killed
Quest menu
Events
Buy Centercamp
AI
Summon Heroes
Leveling Skill 1
Leveling Attribute Bonus
: Leveling
Leveling Leo
Leveling Jaina
Leveling Lilly
/ Leveling
Gates
Open H
Open V
Close H
Close V
Heroes Summoned
Hero summoned
Leo Summoned
Jaina Summoned
Lilly Summoned
Ally System by Maker
Melee Initialization Copy
Propose Alliance
Accept Alliance
Break Alliance
War
Other Dialogs
Add Events
Defend
Retreat
Dialogs
Initializing Dialog
ID Key 1
ID Key 2
ID Key 3
ID Key 4
Leo
Illusion Slash
Legendary Sky fall
Jaina
Force Increase
Holy Bless
Holy Bless Loop
Lilly
Quick Act
QA Cast
Arrow Armageddon
AA Setup
AA Cast
AA Loop
Bonus Range
Bonus Range

		
Name Type Is Array Initial Value
AbilityLevel real No
abilvl integer No
AIHero integer No
Ally_Status integer Yes
ArrowCount real No
ArrowCountPerLevel real No
ArrowDamage real No
ArrowHashtable hashtable No
BlastArrowAOE real No
bonusrange integer No
CenterCamp group No
Computer_Allies integer Yes
CurrentFlyingHeight real No
DamagePerArrow real No
Dialog dialog No
Dialog2 dialog No
Dialog3 dialog No
Dialog4 dialog No
DialogButtons button Yes
DialogButtons_Center button Yes
ETBTemp location No
fakeTower unit No
GetLevels integer No
HandleID integer No
HeroesKings group No
HeroesQueens group No
HolyBless group No
IDKey1Bool boolean No
IDKey1Bool2 boolean No
IDKey3 integer No
Jainas group No
Kills integer Yes
KING unit Yes
Kings integer No
KingsMax integer No
Leaderboard leaderboard No
LeoEvils group No
Leos group No
LocalGold integer No
LocalWood integer No
loopA integervar No
ms real No
Names string Yes
Player integer No 1
Player_Colours string Yes
Player_ColoursCodes string Yes
Player_Strings string Yes
PlayerUnits group No
Point location Yes
QAGroup group No
RainingArrowGroup group No
realTower unit No
Temp_Player_1 player No
Temp_Player_2 player No
Temp_Player_Group force No
Temp_String string No
Tempgroup group No
TGI integer No
timer timer No
timer2 timer No
timer3 timer No
Tokens group No
u unit No
Unit unit Yes
x real No
y real No
Melee Initialization
  Events
    Map initialization
  Conditions
  Actions
    Set VariableSet Names[1] = John
    Set VariableSet Names[2] = Andro
    Set VariableSet Names[3] = Zeon
    Set VariableSet Names[4] = Aon
    Set VariableSet Names[5] = Selcabrio
    Set VariableSet Names[6] = Zera
    Set VariableSet Names[7] = Neon
    Set VariableSet Names[8] = Cambrio
    Set VariableSet Names[9] = :)
    Set VariableSet Names[10] = Pook
    Set VariableSet Names[11] = Miol
    Set VariableSet Names[12] = Terrorist
    Set VariableSet Names[13] = Zombie
    Set VariableSet Names[14] = Ganp
    Set VariableSet Names[15] = :D
    Set VariableSet Names[16] = Ray
    Set VariableSet Names[17] = :O
    Set VariableSet Names[18] = xD
    Set VariableSet Names[19] = ^^
    Set VariableSet Names[20] = //\\o.o//\\
    Set VariableSet Names[21] = :P
    Set VariableSet Names[22] = Luri
    Set VariableSet Names[23] = Runo
    Set VariableSet Names[24] = ME!
    Set VariableSet Names[25] = I'm goin' to die
    For each (Integer A) from Player to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player(Player)) controller) Equal to User
          Then - Actions
            Set VariableSet Player = (Player + 1)
          Else - Actions
            AI - Start melee AI script for (Player(Player)): war3mapImported\GB v25.ai (aiscript)
            Player - Set name of (Player(Player)) to Names[(Random integer number between 1 and 25)]
            Set VariableSet Player = (Player + 1)
    Melee Game - Use melee time of day (for all players)
    Melee Game - Limit Heroes to 1 per Hero-type (for all players)
    Melee Game - Set starting resources (for all players)
    Melee Game - Remove creeps and critters from used start locations (for all players)
    Melee Game - Create starting units (for all players)
    Melee Game - Run melee AI scripts (for computer players)
    Game - Display to (All players) for 30.00 seconds the text: |cff00ff00Please wait for Player 1(Red) to select a game mode.|r
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Hero - Make (Picked player) Heroes gain 250.00% experience from future kills
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    Player - Set name of Neutral Hostile to Neutral Creeps
    Set VariableSet CenterCamp = (Units in Center_Camp <gen> owned by Player 1 (Red))
    Set VariableSet Player = 1
    For each (Integer A) from Player to 12, do (Actions)
      Loop - Actions
        Unit - Replace (Random unit from (Units owned by (Player(Player)) matching (((Matching unit) is A town-hall-type unit) Equal to True).)) with a Fortress using The old unit's relative life and mana
        Unit Group - Pick every unit in (Units owned by (Player(Player)) matching (((Matching unit) is A peon-type unit) Equal to True).) and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit Group - Pick every unit in (Units owned by (Player(Player)) matching ((Unit-type of (Matching unit)) Equal to Ghoul).) and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit Group - Pick every unit in (Units owned by (Player(Player)) of type Haunted Gold Mine) and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit Group - Pick every unit in (Units owned by (Player(Player)) of type Entangled Gold Mine) and do (Remove (Picked unit) from the game)
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit - Create 1.Token for (Player(Player)) at (Position of (Random unit from (Units owned by (Player(Player)) of type Fortress))) facing Default building facing degrees
        Set VariableSet Player = (Player + 1)
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
King Dies
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to King
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Triggering unit) is an illusion) Equal to False
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
          Then - Actions
            Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Triggering unit))) + (s King was killed by + (Name of (Owner of (Killing unit)))))
            Set VariableSet GetLevels = ((Level of (Triggering unit)) / 3)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                GetLevels Greater than 5
              Then - Actions
                Set VariableSet GetLevels = 5
              Else - Actions
            Hero - Set KING[(Player number of (Owner of (Killing unit)))] Hero-level to ((Level of KING[(Player number of (Owner of (Killing unit)))]) + GetLevels), Show level-up graphics
            Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = No unit
          Else - Actions
            Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Triggering unit))) + has killed his own King.)
            Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = No unit
      Else - Actions
Queen Dies
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Queen
        (Unit-type of (Triggering unit)) Equal to Queen
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Triggering unit) is an illusion) Equal to False
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
          Then - Actions
            Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Triggering unit))) + (s Queen was killed by + (Name of (Owner of (Killing unit)))))
            Set VariableSet GetLevels = ((Level of (Triggering unit)) / 3)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                GetLevels Greater than 5
              Then - Actions
                Set VariableSet GetLevels = 5
              Else - Actions
            Hero - Set KING[(Player number of (Owner of (Killing unit)))] Hero-level to ((Level of KING[(Player number of (Owner of (Killing unit)))]) + GetLevels), Show level-up graphics
            Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = No unit
          Else - Actions
            Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Triggering unit))) + has killed his own Queen.)
            Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = No unit
      Else - Actions
Player Looses
  Events
    Unit - A unit Dies
  Conditions
    Or - Any (Conditions) are true
      Conditions
        And - All (Conditions) are true
          Conditions
            ((Triggering unit) is A town-hall-type unit) Equal to True
            (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A town-hall-type unit) Equal to True).)) Equal to 1
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Triggering unit) is an illusion) Equal to False
      Then - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
          Then - Actions
            Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Owner of (Triggering unit)))] + (Name of (Owner of (Triggering unit)))) + (|r + ( has been defeated by the forces of + (|cff + ((Player_Colours[(Player number of (Owner of (Killing unit)))] + (Name of (Owner of (Killing unit)))) + |r))))))
            Game - Display to (Player group((Owner of (Triggering unit)))) for 1000000000.00 seconds the text: (You have been defeated by the forces of + (Name of (Owner of (Killing unit))))
          Else - Actions
            Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Owner of (Triggering unit)))] + (Name of (Owner of (Triggering unit)))) + (|r + has given up and destroyed himself.)))
            Game - Display to (Player group((Owner of (Triggering unit)))) for 1000000000.00 seconds the text: You have destroyed yourself.
        Hero - Set KING[(Player number of (Owner of (Killing unit)))] Hero-level to ((Level of KING[(Player number of (Owner of (Killing unit)))]) + 3), Show level-up graphics
        Set VariableSet Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility across (Entire map)
        Leaderboard - Change the value for (Owner of (Killing unit)) in Leaderboard to Kills[(Player number of (Owner of (Killing unit)))]
        Leaderboard - Sort Leaderboard by Value in Descending order
        Leaderboard - Remove (Owner of (Triggering unit)) from Leaderboard.
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Token) and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True).) and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            IDKey1Bool2 Equal to True
          Then - Actions
            Player - Add ((Owner of (Triggering unit)) Current gold) to (Owner of (Killing unit)).Current gold
            Player - Add ((Owner of (Triggering unit)) Current lumber) to (Owner of (Killing unit)).Current lumber
          Else - Actions
        Player - Set (Owner of (Triggering unit)).Current gold to 0
        Player - Set (Owner of (Triggering unit)).Current lumber to 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            IDKey1Bool Equal to True
          Then - Actions
            Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) and do (Actions)
              Loop - Actions
                Unit - Change ownership of (Picked unit) to (Owner of (Killing unit)) and Change color
            Custom script: call DestroyGroup(bj_lastCreatedGroup)
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KING[(Player number of (Owner of (Killing unit)))] Not equal to No unit
              Then - Actions
                Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) and do (Actions)
                  Loop - Actions
                    Unit - Cause KING[(Player number of (Owner of (Killing unit)))] to damage (Picked unit), dealing 1000000000.00 damage of attack type Chaos and damage type Universal
                Custom script: call DestroyGroup(bj_lastCreatedGroup)
              Else - Actions
                Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)).) and do (Actions)
                  Loop - Actions
                    Unit - Cause (Random unit from (Units owned by (Owner of (Killing unit)) matching (((Matching unit) is A town-hall-type unit) Equal to True).)) to damage (Picked unit), dealing 1000000000.00 damage of attack type Chaos and damage type Universal
                Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Unit - Remove (Triggering unit) from the game
      Else - Actions
Suicide
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Kill This Unit
  Actions
    Unit - Kill (Triggering unit)
Explode
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Explode This Building
  Actions
    Set VariableSet ETBTemp = (Position of (Triggering unit))
    Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 1000000000.00 damage of attack type Chaos and damage type Sonic
    Special Effect - Create a special effect at ETBTemp using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
    Custom script: call RemoveLocation(udg_ETBTemp)
    Custom script: set udg_ETBTemp = null
Win Alternate
  Events
    Time - Every 2.50 seconds of game time
  Conditions
  Actions
    Set VariableSet Tokens = (Units of type Token)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of units in Tokens) Equal to 1
      Then - Actions
        Game - Display to (All players) for 9999999.00 seconds the text: (|cff + (Player_Colours[(Player number of (Owner of (Random unit from (Units of type Token))))] + ============================================))
        Game - Display to (All players) for 9999999.00 seconds the text: (((|cff + Player_Colours[(Player number of (Owner of (Random unit from (Units of type Token))))]) + (Name of (Owner of (Random unit from (Units of type Token))))) + has won the game.|r)
        Game - Display to (All players) for 9999999.00 seconds the text: (|cff + (Player_Colours[(Player number of (Owner of (Random unit from (Units of type Token))))] + The game has ended and any remaining players may leave if they want.))
        Game - Display to (All players) for 9999999.00 seconds the text: (|cff + (Player_Colours[(Player number of (Owner of (Random unit from (Units of type Token))))] + ============================================))
        Player Group - Pick every player in (All players) and do (Actions)
          Loop - Actions
            Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Entire map)
        Custom script: call DestroyGroup(bj_lastCreatedGroup)
        Custom script: call DestroyTrigger(GetTriggeringTrigger())
      Else - Actions
    Custom script: call DestroyGroup(udg_Tokens)
Settings
  Events
    Time - Elapsed game time is 1.00 seconds
  Conditions
  Actions
    Leaderboard - Create a leaderboard for (All players) titled Kings Killed
    Set VariableSet Leaderboard = (Last created leaderboard)
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Leaderboard - Add (Picked player) to Leaderboard with label (Name of (Picked player)) and value 0
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    For each (Integer B) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Player((Integer B))) slot status) Equal to Is unused
          Then - Actions
            Unit Group - Pick every unit in (Units owned by (Player((Integer B))).) and do (Actions)
              Loop - Actions
                Unit - Remove (Picked unit) from the game
            Custom script: call DestroyGroup(bj_lastCreatedGroup)
            Leaderboard - Remove (Player((Integer B))) from Leaderboard.
          Else - Actions
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
Leaver
  Events
    Player - Player 1 (Red) leaves the game
    Player - Player 2 (Blue) leaves the game
    Player - Player 3 (Teal) leaves the game
    Player - Player 4 (Purple) leaves the game
    Player - Player 5 (Yellow) leaves the game
    Player - Player 6 (Orange) leaves the game
    Player - Player 7 (Green) leaves the game
    Player - Player 8 (Pink) leaves the game
    Player - Player 9 (Gray) leaves the game
    Player - Player 10 (Light Blue) leaves the game
    Player - Player 11 (Dark Green) leaves the game
    Player - Player 12 (Brown) leaves the game
  Conditions
  Actions
    Sound - Play Player_leaves <gen>
    Leaderboard - Remove (Triggering player) from Leaderboard.
    Game - Display to (All players) for 20.00 seconds the text: ( + ((Name of (Triggering player)) + |cffffff00 has left the game!|r))
    Unit Group - Pick every unit in (Units owned by (Triggering player).) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope RAMATK initializer InitTrig_RAM_Attacks

private function Conditions takes nothing returns boolean
   return GetUnitTypeId(GetAttacker()) == 'o003'
endfunction

private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetUnitLoc(u)
    call AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" ,l )
set u = null
call RemoveLocation(l)
endfunction

//===========================================================================
private function InitTrig_RAM_Attacks takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction
endscope

 
Set Name
  Events
    Player - Player 1 (Red) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 2 (Blue) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 3 (Teal) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 4 (Purple) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 5 (Yellow) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 6 (Orange) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 7 (Green) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 8 (Pink) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 9 (Gray) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 10 (Light Blue) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 11 (Dark Green) types a chat message containing name = (stringnoformat) as A substring
    Player - Player 12 (Brown) types a chat message containing name = (stringnoformat) as A substring
  Conditions
  Actions
    Player - Set name of (Triggering player) to (Substring((Entered chat string), 8, 100))
Dragon Killed
  Events
    Unit - A unit owned by Neutral Hostile.Dies
  Conditions
    (Unit-type of (Triggering unit)) Equal to Legendary Dragon
  Actions
    Game - Display to (All players) for 15.00 seconds the text: (|cffff0000A Black Dragon has been slain by + ((Name of (Owner of (Killing unit))) + |r))
Quest menu
  Events
    Map initialization
  Conditions
  Actions
    Quest - Create a Required quest titled The Map Team with the description Ironside = Project LeaderVikus = Grammar checkkrisserz = Trigger check8Ball777 = Object edtorWasp = TerrainerCyberDuelX16 = Grammar check, Map Testing, Tooltip fixKraZy_Marm4SET = Grammar Checkeclyptk = Terrainer, using icon path ReplaceableTextures\WorldEditUI\Editor-MultipleUnits.blp
    Quest - Create a Required quest titled Commands with the description # is the the color of a player (example -ally light blue).-ally # ---> requests alliance towards player #.-accept # ---> accepts alliance towards player #.-war # ---> declare war on player #.-retreat ---> tells that you are retreating.-defend ---> tells that you are defending your castle., using icon path ReplaceableTextures\WorldEditUI\Editor-Force.blp
Buy Centercamp
  Events
    Unit - A unit enters (Entire map)
  Conditions
    (Unit-type of (Triggering unit)) Equal to Buy Centercamp
  Actions
    Game - Display to (All players) the text: (|cffff0000 + ((Name of (Owner of (Triggering unit))) + ( has bought the Center Camp! + |r)))
    Neutral Building - Remove Buy Centercamp from Unknown Man 0317 <gen>
    Unit Group - Pick every unit in CenterCamp and do (Actions)
      Loop - Actions
        Unit - Change ownership of (Picked unit) to (Owner of (Triggering unit)) and Change color
    Unit - Remove (Triggering unit) from the game
Summon Heroes
  Events
    Unit - A unit Finishes construction
  Conditions
    And - All (Conditions) are true
      Conditions
        (Unit-type of (Triggering unit)) Equal to Citadel of Glory
        ((Owner of (Triggering unit)) controller) Equal to Computer
  Actions
    Set VariableSet AIHero = (Random integer number between 1 and 3)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIHero Equal to 1
      Then - Actions
        Unit - Order (Triggering unit) to train/upgrade to a King
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIHero Equal to 2
      Then - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Queen
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIHero Equal to 3
      Then - Actions
        Unit - Order (Triggering unit) to train/upgrade to a Queen
      Else - Actions
Leveling Skill 1
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to King
            (Unit-type of (Triggering unit)) Equal to Queen
            (Unit-type of (Triggering unit)) Equal to Queen
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to King
      Then - Actions
        Hero - Learn skill for (Triggering unit): Combo Attacker
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Queen
      Then - Actions
        Hero - Learn skill for (Triggering unit): Force Increase
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Queen
      Then - Actions
        Hero - Learn skill for (Triggering unit): Quick Act
      Else - Actions
Leveling Attribute Bonus
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to King
            (Unit-type of (Triggering unit)) Equal to Queen
            (Unit-type of (Triggering unit)) Equal to Queen
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Greater than 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Attribute Bonus
      Else - Actions
Leveling Leo
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to King
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
      Then - Actions
        Hero - Learn skill for (Triggering unit): Combo Attacker
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Kings Holy Sword
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 13
            (Level of (Triggering unit)) Equal to 14
      Then - Actions
        Hero - Learn skill for (Triggering unit): Death Strike
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Legendary Sky-fall
      Else - Actions
Leveling Jaina
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Queen
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
      Then - Actions
        Hero - Learn skill for (Triggering unit): Force Increase
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Charm
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 13
            (Level of (Triggering unit)) Equal to 14
      Then - Actions
        Hero - Learn skill for (Triggering unit): Spirit
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Holy Bless
      Else - Actions
Leveling Lilly
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Queen
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
      Then - Actions
        Hero - Learn skill for (Triggering unit): Quick Act
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Poison Arrows
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 13
            (Level of (Triggering unit)) Equal to 14
      Then - Actions
        Hero - Learn skill for (Triggering unit): Burning Arrow
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Arrow Armageddon
      Else - Actions
Open H
  Events
    Unit - A unit Begins casting an ability
  Conditions
    And - All (Conditions) are true
      Conditions
        (Ability being cast) Equal to Open Gate H
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
  Actions
    Unit - Replace (Triggering unit) with a Gate (O) (H) using The old unit's relative life and mana
    Animation - Play (Last replaced unit)'s Death Alternate (animationname) animation
Open V
  Events
    Unit - A unit Begins casting an ability
  Conditions
    And - All (Conditions) are true
      Conditions
        (Ability being cast) Equal to Open Gate V
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
  Actions
    Unit - Replace (Triggering unit) with a Gate (O)(V) using The old unit's relative life and mana
    Animation - Play (Last replaced unit)'s Death Alternate (animationname) animation
Close H
  Events
    Unit - A unit Begins casting an ability
  Conditions
    And - All (Conditions) are true
      Conditions
        (Ability being cast) Equal to Close Gate H
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
  Actions
    Unit - Replace (Triggering unit) with a Gate (Horizional) (C) (H) using The old unit's relative life and mana
    Animation - Play (Last replaced unit)'s stand (animationname) animation
Close V
  Events
    Unit - A unit Begins casting an ability
  Conditions
    And - All (Conditions) are true
      Conditions
        (Ability being cast) Equal to Close Gate V
        (Owner of (Triggering unit)) Not equal to Neutral Hostile
  Actions
    Unit - Replace (Triggering unit) with a Gate (Vertical) (C) (V) using The old unit's relative life and mana
    Animation - Play (Last replaced unit)'s stand (animationname) animation
Hero summoned
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Triggering unit) is an illusion) Equal to False
  Actions
    Player - Limit training of Heroes to 0 for (Owner of (Triggering unit))
Leo Summoned
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True).)) Equal to 1
        (Unit-type of (Triggering unit)) Equal to King
        ((Triggering unit) is an illusion) Equal to False
  Actions
    Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Citadel of Glory) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
        Unit - Create 1.Citadel of Glory (new) for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    Unit Group - Add (Triggering unit) to HeroesKings
    Game - Display to (All players) for 15.00 seconds the text: ((|cff + Player_Colours[(Player number of (Owner of (Triggering unit)))]) + ((Name of (Owner of (Triggering unit))) + ( has summoned King Leo. There are now + ((String((Number of units in HeroesKings))) + ( Kings alive and + ((String((Number of units in HeroesQueens))) + Queens.))))))
    Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Jaina Summoned
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True).)) Equal to 1
        (Unit-type of (Triggering unit)) Equal to Queen
        ((Triggering unit) is an illusion) Equal to False
  Actions
    Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Citadel of Glory) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
        Unit - Create 1.Citadel of Glory (new) for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    Unit Group - Add (Triggering unit) to HeroesQueens
    Game - Display to (All players) for 15.00 seconds the text: ((|cff + Player_Colours[(Player number of (Owner of (Triggering unit)))]) + ((Name of (Owner of (Triggering unit))) + ( has summoned Queen Jaina. There are now + ((String((Number of units in HeroesKings))) + ( Kings alive and + ((String((Number of units in HeroesQueens))) + Queens.))))))
    Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Lilly Summoned
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        (Number of units in (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True).)) Equal to 1
        (Unit-type of (Triggering unit)) Equal to Queen
        ((Triggering unit) is an illusion) Equal to False
  Actions
    Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Citadel of Glory) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
        Unit - Create 1.Citadel of Glory (new) for (Owner of (Triggering unit)) at (Position of (Picked unit)) facing Default building facing degrees
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    Unit Group - Add (Triggering unit) to HeroesQueens
    Game - Display to (All players) for 15.00 seconds the text: ((|cff + Player_Colours[(Player number of (Owner of (Triggering unit)))]) + ((Name of (Owner of (Triggering unit))) + ( has summoned Queen Lilly. There are now + ((String((Number of units in HeroesKings))) + ( Kings alive and + ((String((Number of units in HeroesQueens))) + Queens.))))))
    Set VariableSet KING[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Default melee game initialization for all players
Melee Initialization Copy
  Events
    Map initialization
  Conditions
  Actions
    Melee Game - Use melee time of day (for all players)
    -------- ---------------------------------------- --------
    For each (Integer loopA) from 1 to 12, do (Actions)
      Loop - Actions
        Trigger - Add to Propose_Alliance <gen> the event ((Player(loopA)) types a chat message containing (stringnoformat) as A substring)
        Trigger - Add to Accept_Alliance <gen> the event ((Player(loopA)) types a chat message containing (stringnoformat) as A substring)
        Trigger - Add to Break_Alliance <gen> the event ((Player(loopA)) types a chat message containing (stringnoformat) as A substring)
        Trigger - Add to War <gen> the event ((Player(loopA)) types a chat message containing (stringnoformat) as A substring)
    -------- ---------------------------------------- --------
    Set VariableSet Player_Strings[1] = red
    Set VariableSet Player_Strings[2] = blue
    Set VariableSet Player_Strings[3] = teal
    Set VariableSet Player_Strings[4] = purple
    Set VariableSet Player_Strings[5] = yellow
    Set VariableSet Player_Strings[6] = orange
    Set VariableSet Player_Strings[7] = green
    Set VariableSet Player_Strings[8] = pink
    Set VariableSet Player_Strings[9] = gray
    Set VariableSet Player_Strings[10] = light blue
    Set VariableSet Player_Strings[11] = dark green
    Set VariableSet Player_Strings[12] = brown
    -------- ---------------------------------------- --------
    Set VariableSet Player_Colours[1] = FF0303
    Set VariableSet Player_Colours[2] = 0042FF
    Set VariableSet Player_Colours[3] = 1CE6B9
    Set VariableSet Player_Colours[4] = 540081
    Set VariableSet Player_Colours[5] = FFFC01
    Set VariableSet Player_Colours[6] = FE8A0E
    Set VariableSet Player_Colours[7] = 20C000
    Set VariableSet Player_Colours[8] = E55BB0
    Set VariableSet Player_Colours[9] = 959697
    Set VariableSet Player_Colours[10] = 7EBFF1
    Set VariableSet Player_Colours[11] = 106246
    Set VariableSet Player_Colours[12] = 4E2A04
    -------- ---------------------------------------- --------
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
Propose Alliance
  Events
  Conditions
    (Substring((Entered chat string), 1, 6)) Equal to -ally
  Actions
    Set VariableSet Temp_String = (String((Entered chat string)) as Lower case.)
    Set VariableSet Temp_Player_1 = (Triggering player)
    Player Group - Add Temp_Player_1 to Temp_Player_Group
    For each (Integer loopA) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Substring(Temp_String, 7, (Length of Temp_String))) Equal to Player_Strings[loopA]
          Then - Actions
            Set VariableSet Temp_Player_2 = (Player(loopA))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Temp_Player_1 is an ally of Temp_Player_2.) Equal to True
              Then - Actions
                Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00Players are already allied.|r
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Temp_Player_2 controller) Equal to User
                  Then - Actions
                    Player Group - Add Temp_Player_2 to Temp_Player_Group
                    Game - Display to Temp_Player_Group for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of Temp_Player_1)] + (Name of Temp_Player_1)) + (|r + ( requests to be allies with + (|cff + ((Player_Colours[loopA] + (Name of Temp_Player_2)) + |r))))))
                    Player Group - Remove Temp_Player_2 from Temp_Player_Group.
                    Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_1) - 1)) + (Player number of Temp_Player_2))] = 1
                  Else - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      If - Conditions
                        (Temp_Player_2 controller) Equal to Computer
                      Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          If - Conditions
                            Computer_Allies[(Player number of Temp_Player_1)] Equal to 0
                          Then - Actions
                            Player - Make Temp_Player_1 treat Temp_Player_2 as an Ally with shared vision
                            Player - Make Temp_Player_2 treat Temp_Player_1 as an Ally with shared vision
                            Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of Temp_Player_1)] + (Name of Temp_Player_1)) + (|r + ( has allied with + (|cff + ((Player_Colours[loopA] + (Name of Temp_Player_2)) + |r))))))
                            Set VariableSet Computer_Allies[(Player number of Temp_Player_1)] = 1
                          Else - Actions
                            Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00You can only have one computer ally.|r
                      Else - Actions
            Player Group - Remove Temp_Player_1 from Temp_Player_Group.
            Skip remaining actions
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Temp_Player_Group) Equal to 1
      Then - Actions
        Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00Invalid player.|r
      Else - Actions
    Player Group - Remove Temp_Player_1 from Temp_Player_Group.
Accept Alliance
  Events
  Conditions
    (Substring((Entered chat string), 1, 8)) Equal to -accept
  Actions
    Set VariableSet Temp_String = (String((Entered chat string)) as Lower case.)
    Set VariableSet Temp_Player_1 = (Triggering player)
    Player Group - Add Temp_Player_1 to Temp_Player_Group
    For each (Integer loopA) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Substring(Temp_String, 9, (Length of Temp_String))) Equal to Player_Strings[loopA]
          Then - Actions
            Set VariableSet Temp_Player_2 = (Player(loopA))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Ally_Status[((12 x ((Player number of Temp_Player_2) - 1)) + (Player number of Temp_Player_1))] Equal to 1
              Then - Actions
                Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of Temp_Player_1)] + (Name of Temp_Player_1)) + (|r + ( has allied with + (|cff + ((Player_Colours[loopA] + (Name of Temp_Player_2)) + |r))))))
                Player - Make Temp_Player_1 treat Temp_Player_2 as an Ally with shared vision
                Player - Make Temp_Player_2 treat Temp_Player_1 as an Ally with shared vision
                Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_1) - 1)) + (Player number of Temp_Player_2))] = 2
                Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_2) - 1)) + (Player number of Temp_Player_1))] = 2
              Else - Actions
                Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00There is no pending alliance request from that player.|r
            Player Group - Remove Temp_Player_1 from Temp_Player_Group.
            Skip remaining actions
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Temp_Player_Group) Equal to 1
      Then - Actions
        Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00Invalid player.|r
      Else - Actions
    Player Group - Remove Temp_Player_1 from Temp_Player_Group.
Break Alliance
  Events
  Conditions
    (Substring((Entered chat string), 1, 8)) Equal to -unally
  Actions
    Set VariableSet Temp_String = (String((Entered chat string)) as Lower case.)
    Set VariableSet Temp_Player_1 = (Triggering player)
    Player Group - Add Temp_Player_1 to Temp_Player_Group
    For each (Integer loopA) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Substring(Temp_String, 9, (Length of Temp_String))) Equal to Player_Strings[loopA]
          Then - Actions
            Set VariableSet Temp_Player_2 = (Player(loopA))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Temp_Player_1 is an enemy of Temp_Player_2.) Equal to False
              Then - Actions
                Game - Display to (All players) for 15.00 seconds the text: (|cff + ((Player_Colours[(Player number of Temp_Player_1)] + (Name of Temp_Player_1)) + (|r + ('s alliance has been terminated with + (|cff + ((Player_Colours[loopA] + (Name of Temp_Player_2)) + |r))))))
                Player - Make Temp_Player_1 treat Temp_Player_2 as an Enemy
                Player - Make Temp_Player_2 treat Temp_Player_1 as an Enemy
                Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_1) - 1)) + (Player number of Temp_Player_2))] = 0
                Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_2) - 1)) + (Player number of Temp_Player_1))] = 0
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Temp_Player_2 controller) Equal to Computer
                  Then - Actions
                    Set VariableSet Computer_Allies[(Player number of Temp_Player_1)] = 0
                  Else - Actions
              Else - Actions
                Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00You are already enemies with that player.|r
            Player Group - Remove Temp_Player_1 from Temp_Player_Group.
            Skip remaining actions
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Temp_Player_Group) Equal to 1
      Then - Actions
        Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00Invalid player.|r
      Else - Actions
    Player Group - Remove Temp_Player_1 from Temp_Player_Group.
War
  Events
  Conditions
    (Substring((Entered chat string), 1, 5)) Equal to -war
  Actions
    Set VariableSet Temp_String = (String((Entered chat string)) as Lower case.)
    Set VariableSet Temp_Player_1 = (Triggering player)
    Player Group - Add Temp_Player_1 to Temp_Player_Group
    For each (Integer loopA) from 1 to 12, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Substring(Temp_String, 6, (Length of Temp_String))) Equal to Player_Strings[loopA]
          Then - Actions
            Player Group - Add Temp_Player_2 to Temp_Player_Group
            Set VariableSet Temp_Player_2 = (Player(loopA))
            Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of Temp_Player_1)] + (Name of Temp_Player_1)) + (|r + ( has declared war with + (|cff + ((Player_Colours[loopA] + (Name of Temp_Player_2)) + |r))))))
            Player - Make Temp_Player_1 treat Temp_Player_2 as an Enemy
            Player - Make Temp_Player_2 treat Temp_Player_1 as an Enemy
            Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_1) - 1)) + (Player number of Temp_Player_2))] = 0
            Set VariableSet Ally_Status[((12 x ((Player number of Temp_Player_2) - 1)) + (Player number of Temp_Player_1))] = 0
            Player Group - Remove Temp_Player_1 from Temp_Player_Group.
            Player Group - Remove Temp_Player_2 from Temp_Player_Group.
            Skip remaining actions
          Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Number of players in Temp_Player_Group) Equal to 1
      Then - Actions
        Game - Display to Temp_Player_Group for 10.00 seconds the text: |cffFFDC00Invalid player.|r
      Else - Actions
    Player Group - Remove Temp_Player_1 from Temp_Player_Group.
Add Events
  Events
    Map initialization
  Conditions
  Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Trigger - Add to Defend <gen> the event ((Picked player) types a chat message containing -defend (stringnoformat) as An exact match)
        Trigger - Add to Retreat <gen> the event ((Picked player) types a chat message containing -retreat (stringnoformat) as An exact match)
Defend
  Events
  Conditions
  Actions
    Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r + is defending his castle.)))
Retreat
  Events
  Conditions
  Actions
    Game - Display to (All players) for 30.00 seconds the text: (|cff + ((Player_Colours[(Player number of (Triggering player))] + (Name of (Triggering player))) + (|r + is retreating.)))
Initializing Dialog
  Events
    Time - Elapsed game time is 0.50 seconds
  Conditions
  Actions
    Unit - Pause all units
    Dialog - Clear Dialog
    Dialog - Change the title of Dialog to When a king dies, what will happen?
    Dialog - Create a dialog button for Dialog labelled Change Owner
    Set VariableSet DialogButtons[1] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog labelled Kill (Gain full EXP)
    Set VariableSet DialogButtons[2] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog labelled Change Owner , Get Resources
    Set VariableSet DialogButtons[3] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog labelled Kill (Gain full EXP) , Get Resources
    Set VariableSet DialogButtons[4] = (Last created dialog Button)
    Dialog - Show Dialog for Player 1 (Red)
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
ID Key 1
  Events
    Dialog - A dialog button is clicked for Dialog
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[1]
      Then - Actions
        Set VariableSet IDKey1Bool = True
        Set VariableSet IDKey1Bool2 = False
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 1 Selected: |rWhen a king dies it will result in all of his troops surrendering to the killing kings rule.
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[2]
      Then - Actions
        Set VariableSet IDKey1Bool = False
        Set VariableSet IDKey1Bool2 = False
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 1 Selected: |rWhen a king dies all his troops die with him, giving extra EXP
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[3]
      Then - Actions
        Set VariableSet IDKey1Bool = True
        Set VariableSet IDKey1Bool2 = True
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 1 Selected: |rWhen a king dies it will result in all of his troops surrendering to the killing kings rule, the killing king will gain ALL of the dying kings resources.
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[4]
      Then - Actions
        Set VariableSet IDKey1Bool = False
        Set VariableSet IDKey1Bool2 = True
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 1 Selected: |rKilling a king will result in all of his people being slaughtered(giving extra EXP) and ALL of his resources being looted by the killing king.
      Else - Actions
    Dialog - Clear Dialog2
    Dialog - Change the title of Dialog2 to Can players use theDevil Contract spell andbecome the Corrupted King?|cffff0000[Yes] is currently disabled.|r
    Set VariableSet DialogButtons[5] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog2 labelled No
    Set VariableSet DialogButtons[6] = (Last created dialog Button)
    Dialog - Show Dialog2 for Player 1 (Red)
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
ID Key 2
  Events
    Dialog - A dialog button is clicked for Dialog2
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[6]
      Then - Actions
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 2 Selected: |rDevil Contract is now disabled for this game. Kings cannot become Corrupted.
      Else - Actions
    Dialog - Clear Dialog3
    Dialog - Change the title of Dialog3 to Who will Guard the center camp?
    Dialog - Create a dialog button for Dialog3 labelled Neutral Hostile
    Set VariableSet DialogButtons_Center[1] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog3 labelled None (The camp will be removed)
    Set VariableSet DialogButtons_Center[2] = (Last created dialog Button)
    Dialog - Show Dialog3 for Player 1 (Red)
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
ID Key 3
  Events
    Dialog - A dialog button is clicked for Dialog3
  Conditions
  Actions
    If ((Clicked dialog button) Equal to DialogButtons_Center[1]) then do (Set VariableSet IDKey3 = 1) else do (Do nothing)
    If ((Clicked dialog button) Equal to DialogButtons_Center[2]) then do (Set VariableSet IDKey3 = 2) else do (Do nothing)
    Set VariableSet CenterCamp = (Units in Center_Camp <gen> owned by Neutral Hostile)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        IDKey3 Equal to 2
      Then - Actions
        Game - Display to (All players) for 20.00 seconds the text: (|cff00ff00Mode Key 3 Selected: |rCenter Camp will not be protected. + )
        Unit Group - Pick every unit in CenterCamp and do (Actions)
          Loop - Actions
            Unit - Remove (Picked unit) from the game
      Else - Actions
        Game - Display to (All players) for 20.00 seconds the text: (|cff00ff00Mode Key 3 Selected: |rThe Center Camp will be protected by + Neutral Hostile.)
        Neutral Building - Add Buy Centercamp to Unknown Man 0317 <gen> with 1 in stock and a max stock of 1
    Dialog - Clear Dialog4
    Dialog - Change the title of Dialog4 to Select Resources Mode:
    Dialog - Create a dialog button for Dialog4 labelled Normal mode: 500, 150
    Set VariableSet DialogButtons[7] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog4 labelled Rush: 1000, 300
    Set VariableSet DialogButtons[8] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog4 labelled Ultra Rush: 5000, 1000
    Set VariableSet DialogButtons[9] = (Last created dialog Button)
    Dialog - Create a dialog button for Dialog4 labelled Death Match: 10000, 5000
    Set VariableSet DialogButtons[10] = (Last created dialog Button)
    Dialog - Show Dialog4 for Player 1 (Red)
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
ID Key 4
  Events
    Dialog - A dialog button is clicked for Dialog4
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Clicked dialog button) Equal to DialogButtons[7]
      Then - Actions
        Set VariableSet LocalGold = 500
        Set VariableSet LocalWood = 150
        Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 4 Selected: |rNormal Mode, Teams will start with 500 Gold And 150 Lumber
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Clicked dialog button) Equal to DialogButtons[8]
          Then - Actions
            Set VariableSet LocalGold = 1000
            Set VariableSet LocalWood = 300
            Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 4 Selected: |rRush Mode, Teams will start with 1000 Gold And 300 Lumber
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Clicked dialog button) Equal to DialogButtons[9]
              Then - Actions
                Set VariableSet LocalGold = 5000
                Set VariableSet LocalWood = 1000
                Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 4 Selected: |rUltra Rush Mode, Teams will start with 5000 Gold And 1000 Lumber
              Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Clicked dialog button) Equal to DialogButtons[10]
                  Then - Actions
                    Set VariableSet LocalGold = 10000
                    Set VariableSet LocalWood = 5000
                    Game - Display to (All players) for 20.00 seconds the text: |cff00ff00Mode Key 4 Selected: |rDeathmatch Mode, Teams will start with 10000 Gold And 5000 Lumber
                  Else - Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player).Current gold to LocalGold
        Player - Set (Picked player).Current lumber to LocalWood
    Custom script: call DestroyGroup(bj_lastCreatedGroup)
    Unit - Unpause all units
    Sound - Play Game_countdown_started <gen>
    Custom script: call DestroyTrigger(GetTriggeringTrigger())
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope Combo initializer InitTrig_Illusion_Slash

//  SETTINGS

globals
private constant integer dummy_id = 'h00R'                             // the ID of the dummy unit
private constant integer spell_id = 'A006'                             // the ID of the spell
private constant real anim_delay = 1.00                                // the delay before the dummy dies
private constant integer red = 100                                     // the color red of the dummy
private constant integer green = 100                                   // the color green of the dummy
private constant integer blue = 100                                    // the color blue of the dummy
private constant integer alpha = 75                                    // the color transparency of the dummy
private constant integer red_c = 255                                   // the color red of the caster
private constant integer green_c = 255                                 // the color green of the caster
private constant integer blue_c = 255                                  // the color blue of the caster
private constant integer alpha_c = 100                                 // the color transparency of the caster
private constant real tag_red = 100                                    // the text tag color : red
private constant real tag_green = 10                                   // the text tag color : green
private constant real tag_blue = 10                                    // the text tag color : blue
private constant string animation = "slam"                             // the animation the dummy will play
private constant boolean attack = true                                 // is the spell a attack?
private constant boolean ranged = false                                // is the spell ranged?
private constant attacktype atk_type = ATTACK_TYPE_CHAOS               // the attack type of the dummy damage
private constant damagetype dmg_type = DAMAGE_TYPE_NORMAL              // the damage type of the dummy damage
private constant weapontype wep_type = WEAPON_TYPE_WHOKNOWS            // the weapon type of the dummy damage
private constant boolean enable_texttag = true                         // if set to true, it will show the damage dealt by the dummy
private constant string special_effect = "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl"
private constant string attachment_point = "origin"                    // this is where the above special effect is placed
private real array extra_damage                                        // set the extra damage bellow in function Settings
private integer array chance                                           // set the chance bellow in function Settings
endglobals

function Settings takes nothing returns nothing
// set the chances:
set chance[1] = 20
set chance[2] = 25
set chance[3] = 30
set chance[4] = 35

// set the extra damage values
set extra_damage[1] = 25
set extra_damage[2] = 50
set extra_damage[3] = 75
set extra_damage[4] = 100
endfunction

//  END OF SETTINGS

private function Conditions takes nothing returns boolean
   return GetUnitAbilityLevel(GetAttacker(), spell_id ) >= 1
endfunction

private function Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit t = GetTriggerUnit()
local unit dummy
local integer lvl = GetUnitAbilityLevel(u , spell_id)
local real dmg = extra_damage[lvl]
local real angle = GetUnitFacing(t) + 180
local player owner = GetOwningPlayer(u)
local location l = GetUnitLoc(u)
local location l2
local integer ch = GetRandomInt(1 , 100)
local texttag text
local real pos = 60.
local effect eff

if t == u then
set u = null
set t = null
set dummy = null
call RemoveLocation(l)
call RemoveLocation(l2)
set l = null
set l2 = null
return

else
// We call the chance function
call Settings()

if chance[lvl] >= ch then
set eff = AddSpecialEffectTarget(special_effect , u , attachment_point)
call SetUnitVertexColor(u, red_c , green_c, blue_c, alpha_c)
set dummy = CreateUnitAtLoc(owner, dummy_id , l , angle)
set l2 = GetUnitLoc(dummy)
call PauseUnit(dummy, true)
call SetUnitVertexColor(dummy , red , green, blue, alpha)
call SetUnitAnimation(dummy , animation)
if enable_texttag == true then
set text = CreateTextTagLocBJ( R2S(dmg)+"!" , l2, pos, 12, tag_red, tag_green, tag_blue, 0 )
call SetTextTagVelocityBJ( text, 60.00, 90 )
call SetTextTagPermanent( text, false )
call SetTextTagLifespan( text, 1)
call SetTextTagFadepoint( text, 0.1)
endif
call TriggerSleepAction(anim_delay)
call UnitDamageTarget(u, t, dmg, attack, ranged, atk_type , dmg_type , wep_type)
call RemoveUnit(dummy)
call DestroyEffect(eff)
call SetUnitVertexColor(u, 255 , 255, 255, 255)
endif

set u = null
set t = null
set dummy = null
call RemoveLocation(l)
call RemoveLocation(l2)
set l = null
set l2 = null
endif
endfunction

//===========================================================================
private function InitTrig_Illusion_Slash takes nothing returns nothing
  local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction
endscope

 
//TESH.scrollpos=6
//TESH.alwaysfold=0
scope Skyfall initializer InitTrig_Legendary_Sky_fall

private function Conditions takes nothing returns boolean
  return GetSpellAbilityId() == 'A008'
endfunction

private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetSpellTargetLoc()
local location l2 = GetUnitLoc(u)
local real t1 = 3.00
local real t2 = 1.00
local real t3 = 0.5
local integer lvl = GetUnitAbilityLevel(u, 'A008')
call TriggerSleepAction(t3)
call PauseUnit(u , true)
call TerrainDeformationRippleBJ( 10.00, true, l2 , 1024, 1024, 65.00, 1, 400.00 )
call SetUnitAnimation(u , "stand ready")
call TriggerSleepAction(t1)
call AddSpecialEffectTarget("Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl", u, "origin")
call UnitAddAbility(u , 'Amrf' )
call SetUnitFlyHeight( u, 1500.00, 1500.00 )
call SetUnitInvulnerable(u, true)
call TriggerSleepAction(t2 + t3)
call SetUnitPositionLoc(u, l)
call SetUnitAnimation(u , "slam")
call TriggerSleepAction(t1-(t2+t2))
call SetUnitFlyHeight( u, 0.00, 4000.00 )
call UnitRemoveAbility(u , 'Amrf' )
call TriggerSleepAction(t2-t3)
call AddSpecialEffectTarget("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", u, "origin" )
call TerrainDeformationRippleBJ( 10.00, true, l , 1024, 1024, 65.00, 1, 400.00 )
call UnitDamagePointLoc( u, 0, 500.00 + (lvl * 150),l, 100 * lvl, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call PauseUnit(u, false)
call SetUnitInvulnerable(u, false)
set u = null
call RemoveLocation(l)
call RemoveLocation(l2)
set l = null
set l2 = null
endfunction

//===========================================================================
private function InitTrig_Legendary_Sky_fall takes nothing returns nothing
   local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction
endscope
 
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ForceIncrease initializer InitTrig_Force_Increase

private function Conditions takes nothing returns boolean
  return GetSpellAbilityId() == 'A00I'
endfunction

private function Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local real t = 60.

call UnitAddItemById(u, 'I003')
call TriggerSleepAction(t)
call UnitAddItemById(u, 'I004')

set u = null
endfunction

//===========================================================================
private function InitTrig_Force_Increase takes nothing returns nothing
   local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
endfunction
endscope

 
Holy Bless
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Holy Bless
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Target unit of ability being cast) is A Hero) Equal to False
      Then - Actions
        Unit Group - Add (Target unit of ability being cast) to HolyBless
      Else - Actions
Holy Bless Loop
  Events
    Unit - A unit Dies
  Conditions
    ((Triggering unit) is in HolyBless.) Equal to True
  Actions
    Custom script: local real HolyBlessTime = 2.
    Unit Group - Remove (Triggering unit) from HolyBless.
    Custom script: call TriggerSleepAction( HolyBlessTime )
    Unit - Create 1.(Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
    Special Effect - Create a special effect attached to the origin (attachpoint) of (Last created unit) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
defskull
QA Cast
  Events
    Unit - A unit Is attacked
  Conditions
    (Level of Quick Act for (Attacking unit)) Greater than 0
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Random integer number between 1 and 100) Less than or equal to (10 + ((Level of Quick Act for (Attacking unit)) x 5))
      Then - Actions
        Set VariableSet Unit[1] = (Attacking unit)
        Set VariableSet Point[1] = (Position of Unit[1])
        Set VariableSet QAGroup = (Units within 700.00 of Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Unit[1]).) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))).)
        Unit - Create 1.Dummy Shoots Arrow for (Owner of Unit[1]) at Point[1] facing Default building facing degrees
        Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        Unit - Set level of Stun Arrow for (Last created unit) to (Level of Quick Act for Unit[1])
        Unit - Order (Last created unit) to Human Mountain King - Storm Bolt.(Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Number of units in QAGroup) Equal to 0
          Then - Actions
            Custom script: call RemoveLocation(udg_Point[1])
            Custom script: call DestroyGroup(udg_QAGroup)
            Skip remaining actions
          Else - Actions
        Animation - Change Unit[1]'s animation speed to 300.00% of its original speed
        Animation - Play Unit[1]'s stand victory (animationname) animation
        Animation - Queue Unit[1]'s stand (animationname) animation
        Animation - Change Unit[1]'s animation speed to 100.00% of its original speed
        Unit Group - Pick every unit in QAGroup and do (Actions)
          Loop - Actions
            Unit - Create 1.Dummy Shoots Arrow for (Owner of Unit[1]) at Point[1] facing Default building facing degrees
            Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
            Unit - Set level of Stun Arrow for (Last created unit) to (Level of Quick Act for Unit[1])
            Unit - Order (Last created unit) to Human Mountain King - Storm Bolt.(Picked unit)
        Custom script: call RemoveLocation(udg_Point[1])
        Custom script: call DestroyGroup(udg_QAGroup)
      Else - Actions
AA Setup
  Events
    Time - Elapsed game time is 0.00 seconds
  Conditions
  Actions
    Set VariableSet ArrowCountPerLevel = 10.00
    Set VariableSet DamagePerArrow = 100.00
    Set VariableSet BlastArrowAOE = 150.00
    Hashtable - Create a hashtable
    Set VariableSet ArrowHashtable = (Last created hashtable)
AA Cast
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Arrow Armageddon
  Actions
    Set VariableSet Unit[1] = (Triggering unit)
    Set VariableSet Point[1] = (Target point of ability being cast)
    Set VariableSet AbilityLevel = (Real((Level of Arrow Armageddon for Unit[1])))
    Set VariableSet ArrowCount = (AbilityLevel x ArrowCountPerLevel)
    Set VariableSet ArrowDamage = 100.00
    Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Visibility from Point[1] to a radius of 600.00.
    For each (Integer A) from 1 to (Integer(ArrowCount)), do (Actions)
      Loop - Actions
        Set VariableSet Point[2] = (Point[1] offset by (Random real number between 0 and 500.00) towards (Random angle) degrees.)
        Unit - Create 1.Raining Arrows for (Triggering player) at Point[2] facing Default building facing degrees
        Set VariableSet Unit[2] = (Last created unit)
        Set VariableSet HandleID = (Key (Last created unit).)
        Unit - Add Crow Form to Unit[2]
        Unit - Remove Crow Form from Unit[2]
        Hashtable - Save ArrowDamage as (Key ArrowDamage.) of HandleID in ArrowHashtable.
        Unit Group - Add Unit[2] to RainingArrowGroup
        Custom script: call RemoveLocation(udg_Point[2])
    Custom script: call RemoveLocation(udg_Point[1])
    Trigger - Turn on AA_Loop <gen>
AA Loop
  Events
    Time - Every 0.03 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in RainingArrowGroup and do (Actions)
      Loop - Actions
        Set VariableSet HandleID = (Key (Picked unit).)
        Set VariableSet Unit[1] = (Picked unit)
        Set VariableSet ArrowDamage = (Load (Key ArrowDamage.) of HandleID from ArrowHashtable.)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Unit[1] is alive) Equal to True
          Then - Actions
            Set VariableSet CurrentFlyingHeight = (Current flying height of Unit[1])
            Animation - Change Unit[1] flying height to (CurrentFlyingHeight - 15.00) at 0.00
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Current flying height of Unit[1]) Less than or equal to 5.00
              Then - Actions
                Set VariableSet Point[1] = (Position of Unit[1])
                Special Effect - Create a special effect at Point[1] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                Special Effect - Destroy (Last created special effect)
                Unit - Kill Unit[1]
                Custom script: set bj_wantDestroyGroup = true
                Unit Group - Pick every unit in (Units within BlastArrowAOE of Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Unit[1]).) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))).) and do (Actions)
                  Loop - Actions
                    Unit - Cause Unit[1] to damage (Picked unit), dealing ArrowDamage damage of attack type Spells and damage type Normal
                Visibility - Create an initially Disabled visibility modifier for (Owner of Unit[1]) emitting Visibility from Point[1] to a radius of 750.00.
                Custom script: call RemoveLocation(udg_Point[1])
              Else - Actions
          Else - Actions
Bonus Range
  Events
    Unit - A unit Learns a skill
  Conditions
    (Learned Hero Skill) Equal to Poison Arrows
  Actions
    Player - Set the current research level of R00B (techcode) to (Level of Poison Arrows for (Triggering unit)) for (Owner of (Triggering unit))