• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Please Critique this Obnoxiously Long Trigger and Offer Suggestions to Improve

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
This trigger seems to cause an in game stutter perhaps from spawning so many units? There has got to be a better way.
  • main spawn
    • Events
      • Time - nextwave_timer expires
    • Conditions
    • Actions
      • -------- Clear Memory Leaks --------
      • Set VariableSet ran_target = No unit
      • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
      • -------- Check if Victory --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than or equal to 30
          • defeat_counter Less than 5
        • 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 13 (Maroon) (Show dialogs, Show scores)
          • Game - Victory Player 14 (Navy) (Show dialogs, Show scores)
          • Game - Victory Player 15 (Turquoise) (Show dialogs, Show scores)
          • Game - Victory Player 16 (Violet) (Show dialogs, Show scores)
          • Game - Defeat Player 7 (Green) with the message: Defeat!
          • Unit - Make Tree of Eternity 0008 <gen> Invulnerable
          • Unit - Make Ancient of Lore 0009 <gen> Invulnerable
          • Unit - Make Ancient of Wind 0010 <gen> Invulnerable
          • Unit - Make Ancient of War 0011 <gen> Invulnerable
          • Unit - Make Ancient of Wonders 0016 <gen> Invulnerable
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • victory Equal to False
            • Then - Actions
              • Quest - Mark quest_array[0] as Completed
              • Quest - Display to (All players) the Quest Completed message: (Mainl Quest Complete --- Defend the Ancients --- Complete 30 Rounds with an Ancient Surviving + (( + (string_defeat_counter + /5|r))))
              • Unit Group - Pick every unit in heroes_grp[1] and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 500000.00
                  • Unit - Set life of (Picked unit) to 100.00%
              • Unit Group - Pick every unit in heroes_grp[2] and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 500000.00
                  • Unit - Set life of (Picked unit) to 100.00%
              • Unit Group - Pick every unit in heroes_grp[3] and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 500000.00
                  • Unit - Set life of (Picked unit) to 100.00%
              • Unit Group - Pick every unit in heroes_grp[4] and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 500000.00
                  • Unit - Set life of (Picked unit) to 100.00%
              • Unit Group - Pick every unit in demon_grp and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 1.00%
              • Unit Group - Pick every unit in death_attk_demon_grp and do (Actions)
                • Loop - Actions
                  • Unit - Set life of (Picked unit) to 1.00%
              • Unit Group - Pick every unit in demon_flyer and do (Actions)
                • Loop - Actions
                  • Unit - Kill (Picked unit)
              • Game - Victory Player 6 (Orange) (Show dialogs, Show scores)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ancient of Lore 0009 <gen> is dead) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in death victory lore <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is in demon_grp.) Equal to True
                              • ((Picked unit) is in death_attk_demon_grp.) Equal to True
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Wait 0.01 seconds
                          • Unit - Kill (Picked unit)
                        • Else - Actions
                  • Unit - Create 1 Ancient of Lore for Player 6 (Orange) at ran_tar_pt[1] facing Default building facing degrees
                  • Set VariableSet rebuild_victory_ancients[1] = (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                • Else - Actions
              • Game - Victory Player 8 (Pink) (Show dialogs, Show scores)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ancient of War 0011 <gen> is dead) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in death victory war <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is in demon_grp.) Equal to True
                              • ((Picked unit) is in death_attk_demon_grp.) Equal to True
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Wait 0.01 seconds
                          • Unit - Kill (Picked unit)
                        • Else - Actions
                  • Unit - Create 1 Ancient of War for Player 8 (Pink) at ran_tar_pt[2] facing Default building facing degrees
                  • Set VariableSet rebuild_victory_ancients[2] = (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                • Else - Actions
              • Game - Victory Player 9 (Gray) (Show dialogs, Show scores)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ancient of Wind 0010 <gen> is dead) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in death victory wind <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is in demon_grp.) Equal to True
                              • ((Picked unit) is in death_attk_demon_grp.) Equal to True
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Wait 0.01 seconds
                          • Unit - Kill (Picked unit)
                        • Else - Actions
                  • Unit - Create 1 Ancient of Wind for Player 9 (Gray) at ran_tar_pt[3] facing Default building facing degrees
                  • Set VariableSet rebuild_victory_ancients[3] = (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ancient of Wonders 0016 <gen> is dead) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in death victory wonders <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is in demon_grp.) Equal to True
                              • ((Picked unit) is in death_attk_demon_grp.) Equal to True
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Wait 0.01 seconds
                          • Unit - Kill (Picked unit)
                        • Else - Actions
                  • Unit - Create 1 Ancient of Wonders for Player 5 (Yellow) at ran_tar_pt[4] facing Default building facing degrees
                  • Set VariableSet rebuild_victory_ancients[4] = (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                • Else - Actions
              • Game - Victory Player 5 (Yellow) (Show dialogs, Show scores)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Tree of Eternity 0008 <gen> is dead) Equal to True
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in death victory tree <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is in demon_grp.) Equal to True
                              • ((Picked unit) is in death_attk_demon_grp.) Equal to True
                        • Then - Actions
                          • Unit - Kill (Picked unit)
                          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Wait 0.01 seconds
                        • Else - Actions
                  • Unit - Create 1 Tree of Life for Player 5 (Yellow) at ran_tar_pt[5] facing Default building facing degrees
                  • Set VariableSet rebuild_victory_ancients[5] = (Last created unit)
                  • Unit - Make (Last created unit) Invulnerable
                • Else - Actions
              • For each (Integer A) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Unit - Order rebuild_victory_ancients[(Integer A)] to Night Elf Ancients - Root (Position of rebuild_victory_ancients[(Integer A)])
                  • Animation - Play rebuild_victory_ancients[(Integer A)]'s birth animation
              • Animation - Play rebuild_victory_ancients[5]'s birth alternate animation
              • Unit - Order rebuild_victory_ancients[5] to Night Elf Ancients - Root (Position of rebuild_victory_ancients[(Integer A)])
              • Countdown Timer - Start rebuild_victory_ancients_ani[1] as a One-shot timer that will expire in 60.00 seconds
              • Cinematic - Turn cinematic mode On for (All players)
              • Visibility - Show Sky Box: True
              • Environment - Set fog to style Linear, z-start 3000.00, z-end 7500.00, density 0.00 and color (0.39%, 19.61%, 12.55%)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
            • Then - Actions
              • Cinematic - Send transmission to (All players) from a Player 5 (Yellow).Tree of Eternity named Tree of Eternity at shop_pt: Play TreeOfLifeYes2 <gen> and display Good job heroes. En.... Modify duration: Add 72.00 seconds and Don't wait
              • Player Group - Pick every player in players_grp and do (Actions)
                • Loop - Actions
                  • Camera - Apply Camera 035 <gen> for (Picked player) over 2.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ancient of Lore 0009 <gen> is alive) Equal to True
                • Then - Actions
                  • Cinematic - Send transmission to (All players) from a Player 5 (Yellow).Ancient of Lore named Ancient of Lore at shop_pt: Play AncientOfTheEarthYesAttack2 <gen> and display Good job heroes. En.... Modify duration: Add 72.00 seconds and Don't wait
                  • Player Group - Pick every player in players_grp and do (Actions)
                    • Loop - Actions
                      • Camera - Apply Camera 031 <gen> for (Picked player) over 2.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ancient of Wind 0010 <gen> is alive) Equal to True
                    • Then - Actions
                      • Cinematic - Send transmission to (All players) from a Player 5 (Yellow).Ancient of Lore named Ancient of Wind at shop_pt: Play AncientOfTheWildYes3 <gen> and display Good job heroes. En.... Modify duration: Add 72.00 seconds and Don't wait
                      • Player Group - Pick every player in players_grp and do (Actions)
                        • Loop - Actions
                          • Camera - Apply Camera 033 <gen> for (Picked player) over 2.00 seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Ancient of War 0011 <gen> is alive) Equal to True
                        • Then - Actions
                          • Cinematic - Send transmission to (All players) from a Player 5 (Yellow).Ancient of War named Ancient of War at shop_pt: Play AncientOfTheMoonYes3 <gen> and display Good job heroes. En.... Modify duration: Add 72.00 seconds and Don't wait
                          • Player Group - Pick every player in players_grp and do (Actions)
                            • Loop - Actions
                              • Camera - Apply Camera 032 <gen> for (Picked player) over 2.00 seconds
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
                            • Then - Actions
                              • Cinematic - Send transmission to (All players) from a Player 5 (Yellow).Ancient of Wonders named Ancient of Wonders at shop_pt: Play AncientOfTheMoonYes3 <gen> and display Good job heroes. En.... Modify duration: Add 72.00 seconds and Don't wait
                              • Player Group - Pick every player in players_grp and do (Actions)
                                • Loop - Actions
                                  • Camera - Apply Camera 034 <gen> for (Picked player) over 2.00 seconds
                            • Else - Actions
          • Wait 2.00 seconds
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 7 (Green)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 11 (Dark Green)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 19 (Mint)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 21 (Coal)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 22 (Snow)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 23 (Emerald)) and do (Actions)
            • Loop - Actions
              • Unit - Kill (Picked unit)
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • explor_bool Equal to True
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: <|cff808080Explorat...
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 0
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: Easy
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 1
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: Normal
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 2
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 3
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 4
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Equal to 5
            • Then - Actions
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
              • Quest - Display to (All players) the Quest Completed message: Difficulty: |cffff0...
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • demon_yes_no_string Equal to |cff00ff00No|r
            • Then - Actions
              • Quest - Mark quest_array[7] as Completed
              • Quest - Display to (All players) the Quest Completed message: Optional Quest Comp...
            • Else - Actions
              • Sound - Play N06Illidan26 <gen>
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 034 <gen> for (Picked player) over 12.00 seconds
          • Wait 12.00 seconds
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 032 <gen> for (Picked player) over 12.00 seconds
          • Wait 12.00 seconds
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 033 <gen> for (Picked player) over 12.00 seconds
          • Wait 12.00 seconds
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 031 <gen> for (Picked player) over 12.00 seconds
          • Wait 12.00 seconds
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 035 <gen> for (Picked player) over 12.00 seconds
          • Wait 12.00 seconds
          • Player Group - Pick every player in players_grp and do (Actions)
            • Loop - Actions
              • Camera - Apply Camera 031 <gen> for (Picked player) over 12.00 seconds
          • Set VariableSet victory = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • cinematic_counter Equal to 3
            • Then - Actions
              • Cinematic - Turn cinematic mode Off for (All players)
              • Camera - Apply red cam <gen> for Player 1 (Red) over 0.00 seconds
              • Camera - Apply red cam <gen> for Player 13 (Maroon) over 0.00 seconds
              • Camera - Apply blue cam <gen> for Player 2 (Blue) over 0.00 seconds
              • Camera - Apply blue cam <gen> for Player 14 (Navy) over 0.00 seconds
              • Camera - Apply teal cam <gen> for Player 3 (Teal) over 0.00 seconds
              • Camera - Apply teal cam <gen> for Player 15 (Turquoise) over 0.00 seconds
              • Camera - Apply purp cam <gen> for Player 4 (Purple) over 0.00 seconds
              • Camera - Apply purp cam <gen> for Player 16 (Violet) over 0.00 seconds
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • Set VariableSet cinematic_counter = (cinematic_counter + 1)
              • Trigger - Run main spawn <gen> (ignoring conditions)
              • Skip remaining actions
        • Else - Actions
      • Cinematic - Ping minimap for (All players) at spawn_pt for 2.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
      • Set VariableSet spawn_counter = (spawn_counter + 1)
      • Quest - Display to (All players) the Simple Hint message: (Current wave: + (String(spawn_counter)))
      • -------- Set Random Target --------
      • Set VariableSet ran_num = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • defeat_counter Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ran_num Equal to 1
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ran_num Equal to 2
            • Then - Actions
              • Set VariableSet ran_target = Ancient of War 0011 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ran_num Equal to 3
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ran_num Equal to 4
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ran_num Equal to 5
            • Then - Actions
              • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • defeat_counter Equal to 1
        • Then - Actions
          • Set VariableSet ran_num = (Random integer number between 1 and 4)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 4
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 4
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 4
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 4
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 4
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • defeat_counter Equal to 2
        • Then - Actions
          • Set VariableSet ran_num = (Random integer number between 1 and 3)
          • -------- 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of War 0011 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • -------- 3 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
          • -------- 4 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
              • (Ancient of War 0011 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 5 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
            • Else - Actions
          • -------- 6 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to True
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                  • (Tree of Eternity 0008 <gen> is alive) Equal to True
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
            • Else - Actions
          • -------- 7 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 8 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 9 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
              • (Ancient of War 0011 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • -------- 10 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
              • (Ancient of War 0011 <gen> is alive) Equal to True
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 3
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • defeat_counter Equal to 3
        • Then - Actions
          • Set VariableSet ran_num = (Random integer number between 1 and 2)
          • -------- 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
          • -------- 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of War 0011 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
          • -------- 3 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • -------- 4 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
              • (Ancient of War 0011 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
          • -------- 5 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • -------- 6 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to False
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
              • (Tree of Eternity 0008 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 7 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
                • Else - Actions
            • Else - Actions
          • -------- 8 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of War 0011 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
                • Else - Actions
            • Else - Actions
          • -------- 9 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
              • (Ancient of Lore 0009 <gen> is alive) Equal to False
              • (Ancient of War 0011 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
                • Else - Actions
            • Else - Actions
          • -------- 10 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to False
              • (Ancient of War 0011 <gen> is alive) Equal to False
              • (Ancient of Wonders 0016 <gen> is alive) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 1
                • Then - Actions
                  • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ran_num Equal to 2
                • Then - Actions
                  • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
                  • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • defeat_counter Equal to 4
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tree of Eternity 0008 <gen> is alive) Equal to True
            • Then - Actions
              • Set VariableSet ran_target = Tree of Eternity 0008 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[5]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of War 0011 <gen> is alive) Equal to True
            • Then - Actions
              • Set VariableSet ran_target = Ancient of War 0011 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wind 0010 <gen> is alive) Equal to True
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Wind 0010 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[3]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Wonders 0016 <gen> is alive) Equal to True
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Wonders 0016 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[4]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ancient of Lore 0009 <gen> is alive) Equal to True
            • Then - Actions
              • Set VariableSet ran_target = Ancient of Lore 0009 <gen>
              • Set VariableSet ran_tar_pt_two = ran_tar_pt[1]
            • Else - Actions
        • Else - Actions
      • Cinematic - Ping minimap for (All players) at ran_tar_pt_two for 40.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
      • -------- Spawn Units --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • difficulty_setting Greater than or equal to 2
          • spawn_counter Greater than 3
        • Then - Actions
          • Unit - Create 1 Infernal Contraption for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
          • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
          • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to defeat_counter, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Infernal Juggernaut for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • difficulty_setting Greater than or equal to 3
            • Then - Actions
              • Unit - Create 1 Nether Dragon for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_flyer
              • Unit - Create 1 Nether Dragon Hatchling for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_flyer
              • Unit - Create 1 Infernal Machine for Player 21 (Coal) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • difficulty_setting Greater than or equal to 4
                • Then - Actions
                  • Unit - Create 1 Eredar Diabolist for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
                  • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
                  • Unit Group - Add (Last created unit) to demon_grp
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • difficulty_setting Equal to 5
                      • spawn_counter Equal to 5
                    • Then - Actions
                      • Quest - Display to (All players) the Quest Discovered message: Optional Quest Acqu...
                      • Quest - Create a Optional quest titled Archimonde with the description Slay the warlock be..., using icon path ReplaceableTextures\CommandButtons\BTNArchimonde.blp
                      • Set VariableSet quest_array[9] = (Last created quest)
                      • Unit - Move Archimonde 0069 <gen> instantly to spawn_pt
                      • Unit Group - Add Archimonde 0069 <gen> to demon_grp
                      • Special Effect - Create a special effect attached to the origin of Archimonde 0069 <gen> using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shrine 0040 <gen> is dead) Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Felguard for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Draenei Guardian for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • For each (Integer A) from 0 to spawn_counter, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Fel Beast for Player 23 (Emerald) at spawn_pt facing 90.00 degrees
          • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
          • Unit Group - Add (Last created unit) to demon_grp
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Less than 2
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Corrupted Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Poison Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Plague Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 0 to 0, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Infernal Juggernaut for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Less than 5
          • spawn_counter Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Corrupted Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Poison Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Plague Treant for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
          • For each (Integer A) from 1 to 3, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Satyr Shadowdancer for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than or equal to 3
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • Unit - Create 1 Infernal Juggernaut for Player 7 (Green) at spawn_pt facing 90.00 degrees
          • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
          • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than or equal to 5
        • Then - Actions
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Fel Beast for Player 19 (Mint) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 7
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Fel Stalker for Player 22 (Snow) at spawn_pt facing 90.00 degrees
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 8
        • Then - Actions
          • For each (Integer A) from 1 to 2, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Fel Ravager for Player 7 (Green) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 8
          • spawn_counter Less than 16
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Eredar Diabolist for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • spawn_counter Equal to 9
            • Then - Actions
              • Trigger - Turn on diabolist dies <gen>
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 9
        • Then - Actions
          • For each (Integer A) from 1 to (spawn_counter - 9), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Felguard for Player 22 (Snow) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 10
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Succubus for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Equal to 10
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Queen of Suffering for Player 21 (Coal) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 11
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Maiden of Pain for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 12
          • spawn_counter Less than 18
        • Then - Actions
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Vile Temptress for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 13
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Overlord for Player 19 (Mint) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 14
          • spawn_counter Less than 25
        • Then - Actions
          • For each (Integer A) from 1 to 1, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Doom Guard (Standard) for Player 21 (Coal) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Equal to 15
        • Then - Actions
          • Environment - Turn weather On
          • Destructible - Open Demonic Gate (Vertical) 0678 <gen>
          • Sound - Play HPitLordYesAttack3 <gen>
          • Quest - Display to (All players) the Quest Discovered message: Optional Quest Acqu...
          • Quest - Create a Optional quest titled Magtheridon with the description Defeat the Pit Lord..., using icon path ReplaceableTextures\CommandButtons\BTNPitLord.blp
          • Set VariableSet quest_array[12] = (Last created quest)
          • Unit Group - Add Magtheridon 0168 <gen> to demon_grp
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 18
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to (spawn_counter - 18), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Doom Guard (Standard) for Player 22 (Snow) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
          • For each (Integer A) from 1 to (spawn_counter - 21), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Overlord for Player 21 (Coal) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Equal to 20
        • Then - Actions
          • Environment - Turn weather Off
          • Trigger - Turn off diabolist dies <gen>
          • Unit - Create 1 Nether Dragon for Player 11 (Dark Green) at spawn_pt facing 90.00 degrees
          • Unit Group - Add (Last created unit) to demon_grp
          • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
          • For each (Integer A) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 Nether Dragon Hatchling for Player 21 (Coal) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Greater than 21
          • difficulty_setting Greater than or equal to 1
        • Then - Actions
          • For each (Integer A) from 1 to (spawn_counter - 21), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Overlord for Player 22 (Snow) at spawn_pt facing 90.00 degrees
              • Unit Group - Add (Last created unit) to demon_grp
              • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Equal to 25
          • difficulty_setting Not equal to 5
        • Then - Actions
          • Quest - Display to (All players) the Quest Discovered message: Optional Quest Acqu...
          • Quest - Create a Optional quest titled Archimonde with the description Slay the warlock be..., using icon path ReplaceableTextures\CommandButtons\BTNArchimonde.blp
          • Set VariableSet quest_array[9] = (Last created quest)
          • Unit - Move Archimonde 0069 <gen> instantly to spawn_pt
          • Unit Group - Add Archimonde 0069 <gen> to demon_grp
          • Special Effect - Create a special effect attached to the origin of Archimonde 0069 <gen> using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • -------- re-order as fail safe for triggering --------
      • Unit Group - Pick every unit in demon_grp and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To ran_tar_pt_two
      • -------- Timers / Timer Window Refresh --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Less than 30
        • Then - Actions
          • Countdown Timer - Pause nextwave_timer
          • Countdown Timer - Start nextwave_timer as a One-shot timer that will expire in 60.00 seconds
          • Countdown Timer - Destroy nextwave_timer_window
          • Countdown Timer - Create a timer window for nextwave_timer with title (Wave + ((String((spawn_counter + 1))) + arrives in: ))
          • Set VariableSet nextwave_timer_window = (Last created timer window)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • spawn_counter Equal to 30
        • Then - Actions
          • Countdown Timer - Pause nextwave_timer
          • Countdown Timer - Start nextwave_timer as a One-shot timer that will expire in 60.00 seconds
          • Countdown Timer - Destroy nextwave_timer_window
          • Countdown Timer - Create a timer window for nextwave_timer with title Victory:
        • Else - Actions
      • -------- Quest Log Update --------
      • Quest - Change the description of quest_array[0] to (Atleast one Ancient must survive 30 waves of demon attacks. A wave spawns every 60 seconds from the portal far south of the Night Elf base. + ((|nCurrent Ancients living: + (String((Abs((defeat_counter - 5)))))) + (/5 + (|nCurrent legion attack: + (String
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
There's like a million optimizations that can be made.

1) Don't use Waits in your Pick Every Unit actions. If you want to kill a unit once every 0.01 seconds then use a Timer.

2) Don't use Conditions like this as they're expensive:
  • ((Picked unit) is in demon_grp.) Equal to True
You should be looping over an existing Unit Group that contains those desired units or you should have an easier way of identifying them.

3) Use variables instead of constantly reusing the same Event Response.

4) Break this up into multiple triggers that do things in steps so you can easily manage things. This is a nightmare to look at.

But what are you even trying to accomplish here? Is this supposed to be a wave system that periodically spawns enemies?

If yes, check this out: Custom Tower TD

The basic idea:

You would have a Setup trigger which initializes a bunch of variables using Arrays and/or Hashtables during Map Initialization. This would track things like:
Unit-types of spawns, # of spawns, position of spawns, spawn interval, spawn start delay, etc.

You would have a Start First Wave trigger which gets things started. This runs only once and begins the spawning process.

You would have a Start Next Wave trigger which runs at the end of each wave. This would increment the Wave Number by 1 which is used as the [index] of your array variables.

You would track spawned units in their respective Unit Group(s) the moment that they're created. Then Remove them when they die. Everything should be Event based and handled in an organized manner. To improve performance and avoid "lag spikes" you can spawn units over time instead of all at once.
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
Yes exactly like a wave system for a defense map.

I implemented all suggestions except getting rid of the excessive use of event responses and using a hashtable and I don't notice the stutter anymore.

I suppose I could get rid of all the
  • Unit - Order (Last created unit) to Attack-Move To ran_tar_pt_two
and just have one single
  • Unit Group - Pick every unit in demon_grp and do (Actions)
    • Loop - Actions
      • Unit - Order (Picked unit) to Attack-Move To ran_tar_pt_two
???
 
Status
Not open for further replies.
Top