• 🏆 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] Trigger Abomination Slim Down

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey Guys,

Me again with obnoxiously ridiculous triggers and a cry for help.

Can somebody take a look at this monstrosity and give me an idea on how to slim it down?

Those triggers handle the Buffs/ Debuffs and the unit counts that happen through placing buildings besides each other.
Because of the fact that every building has to account for the different buildings that could go besides it and the appropriate upgrade levels, this trigger is damn huge....
Example: If i place a farm besides a Barracks i get +1 Soldier out of the Barracks, if i place a Barracks besides another one i get +1 Damage on all Units.

  • Building Stats 1
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Issued order)
    • Actions
      • Set temp_before = (Unit-type of (Triggering unit))
      • Set temp_after = (Unit-type((String((Issued order)))))
      • -------- ----------Gold Mine---------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • temp_before Equal to Build Slot (Gold)
              • temp_after Equal to Mine (gold)
        • Then - Actions
          • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Castle
                      • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                      • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                • Then - Actions
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                • Then - Actions
                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Custom script: call DestroyGroup (udg_temp_group)
          • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • temp_after Equal to Build Slot (Gold)
                  • temp_before Equal to Mine (gold)
            • Then - Actions
              • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Castle
                          • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                    • Then - Actions
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                    • Then - Actions
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_temp_group)
              • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • temp_after Equal to Mine lvl2 (gold)
                      • temp_after Equal to Mine lvl3 (gold)
                • Then - Actions
                  • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • temp_after Equal to Build Slot (Gold)
                          • temp_before Equal to Mine lvl2 (gold)
                    • Then - Actions
                      • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle
                                  • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                            • Then - Actions
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                            • Then - Actions
                              • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Custom script: call DestroyGroup (udg_temp_group)
                      • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] - 2)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • temp_after Equal to Build Slot (Gold)
                              • temp_before Equal to Mine lvl3 (gold)
                        • Then - Actions
                          • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle
                                      • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                                • Then - Actions
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                                • Then - Actions
                                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Custom script: call DestroyGroup (udg_temp_group)
                          • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] - 3)
                        • Else - Actions
      • -------- ----------Farm---------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • temp_before Equal to Build Slot (Gold)
              • temp_before Equal to Build Slot (Lumber)
              • temp_before Equal to Build Slot (large)
          • Or - Any (Conditions) are true
            • Conditions
              • temp_after Equal to Farm
              • temp_after Equal to Farm (Gold)
              • temp_after Equal to Farm (Lumber)
        • Then - Actions
          • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Farm
                      • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                • Then - Actions
                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] + 2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Barracks
                          • (Unit-type of (Picked unit)) Equal to Barracks (Gold)
                          • (Unit-type of (Picked unit)) Equal to Barracks (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Lumber)
                    • Then - Actions
                      • Set Footman_count[(Player number of (Owner of (Triggering unit)))] = (Footman_count[(Player number of (Owner of (Triggering unit)))] + 1)
                    • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Castle
                      • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2
                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3
                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                • Then - Actions
                  • Set Paladin_count[(Player number of (Owner of (Triggering unit)))] = (Paladin_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Archery
                      • (Unit-type of (Picked unit)) Equal to Archery (Gold)
                      • (Unit-type of (Picked unit)) Equal to Archery (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Archery lvl2
                      • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Archery lvl3
                      • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Lumber)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Picked unit)) Greater than or equal to 1
                    • Then - Actions
                      • Set Crossbow_count[(Player number of (Owner of (Triggering unit)))] = (Crossbow_count[(Player number of (Owner of (Triggering unit)))] + 1)
                    • Else - Actions
                      • Set Archer_count[(Player number of (Owner of (Triggering unit)))] = (Archer_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                • Then - Actions
                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Balista_count[(Player number of (Owner of (Triggering unit)))] = (Balista_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                • Then - Actions
                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Tank_count[(Player number of (Owner of (Triggering unit)))] = (Tank_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                • Then - Actions
                  • Set Missile_count[(Player number of (Owner of (Triggering unit)))] = (Missile_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Lumber)
                • Then - Actions
                  • Set Marine_count[(Player number of (Owner of (Triggering unit)))] = (Marine_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Medical Barracks
                      • (Unit-type of (Picked unit)) Equal to Medical Barracks (Gold)
                      • (Unit-type of (Picked unit)) Equal to Medical Barracks (Lumber)
                • Then - Actions
                  • Set Medic_count[(Player number of (Owner of (Triggering unit)))] = (Medic_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Lumber)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Custom value of (Picked unit)) Greater than or equal to 1
                    • Then - Actions
                      • Set BTR_count[(Player number of (Owner of (Triggering unit)))] = (BTR_count[(Player number of (Owner of (Triggering unit)))] + 1)
                    • Else - Actions
                      • Set Sniper_count[(Player number of (Owner of (Triggering unit)))] = (Sniper_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                • Then - Actions
                  • Set ROfficer_count[(Player number of (Owner of (Triggering unit)))] = (ROfficer_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                • Then - Actions
                  • Set MOfficer_count[(Player number of (Owner of (Triggering unit)))] = (MOfficer_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Factory
                      • (Unit-type of (Picked unit)) Equal to Factory (Gold)
                      • (Unit-type of (Picked unit)) Equal to Factory (Lumber)
                • Then - Actions
                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Lumber)
                • Then - Actions
                  • Set Hydra_count[(Player number of (Owner of (Triggering unit)))] = (Hydra_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                • Then - Actions
                  • Set Vampire_count[(Player number of (Owner of (Triggering unit)))] = (Vampire_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                • Then - Actions
                  • Set Kraken_count[(Player number of (Owner of (Triggering unit)))] = (Kraken_count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                • Else - Actions
          • Custom script: call DestroyGroup (udg_temp_group)
          • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] + 1)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • temp_after Equal to Build Slot (Gold)
                  • temp_after Equal to Build Slot (Lumber)
                  • temp_after Equal to Build Slot (large)
              • Or - Any (Conditions) are true
                • Conditions
                  • temp_before Equal to Farm
                  • temp_before Equal to Farm (Gold)
                  • temp_before Equal to Farm (Lumber)
            • Then - Actions
              • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm
                          • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                    • Then - Actions
                      • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 2)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Picked unit) Not equal to (Triggering unit)
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Unit-type of (Picked unit)) Equal to Barracks (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks
                              • (Unit-type of (Picked unit)) Equal to Barracks (Gold)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Gold)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Gold)
                        • Then - Actions
                          • Set Footman_count[(Player number of (Owner of (Triggering unit)))] = (Footman_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle
                          • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                    • Then - Actions
                      • Set Paladin_count[(Player number of (Owner of (Triggering unit)))] = (Paladin_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Archery
                          • (Unit-type of (Picked unit)) Equal to Archery (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Lumber)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Custom value of (Picked unit)) Greater than or equal to 1
                        • Then - Actions
                          • Set Crossbow_count[(Player number of (Owner of (Triggering unit)))] = (Crossbow_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
                          • Set Archer_count[(Player number of (Owner of (Triggering unit)))] = (Archer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                    • Then - Actions
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Balista_count[(Player number of (Owner of (Triggering unit)))] = (Balista_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                    • Then - Actions
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Tank_count[(Player number of (Owner of (Triggering unit)))] = (Tank_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                    • Then - Actions
                      • Set Missile_count[(Player number of (Owner of (Triggering unit)))] = (Missile_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Lumber)
                    • Then - Actions
                      • Set Marine_count[(Player number of (Owner of (Triggering unit)))] = (Marine_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks (Gold)
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks (Lumber)
                    • Then - Actions
                      • Set Medic_count[(Player number of (Owner of (Triggering unit)))] = (Medic_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Lumber)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Custom value of (Picked unit)) Greater than or equal to 1
                        • Then - Actions
                          • Set BTR_count[(Player number of (Owner of (Triggering unit)))] = (BTR_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
                          • Set Sniper_count[(Player number of (Owner of (Triggering unit)))] = (Sniper_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                    • Then - Actions
                      • Set ROfficer_count[(Player number of (Owner of (Triggering unit)))] = (ROfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                    • Then - Actions
                      • Set MOfficer_count[(Player number of (Owner of (Triggering unit)))] = (MOfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Factory
                          • (Unit-type of (Picked unit)) Equal to Factory (Gold)
                          • (Unit-type of (Picked unit)) Equal to Factory (Lumber)
                    • Then - Actions
                      • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Lumber)
                    • Then - Actions
                      • Set Hydra_count[(Player number of (Owner of (Triggering unit)))] = (Hydra_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                    • Then - Actions
                      • Set Vampire_count[(Player number of (Owner of (Triggering unit)))] = (Vampire_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                    • Then - Actions
                      • Set Kraken_count[(Player number of (Owner of (Triggering unit)))] = (Kraken_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_temp_group)
              • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • temp_after Equal to Farm lvl2
                      • temp_after Equal to Farm lvl2 (Gold)
                      • temp_after Equal to Farm lvl2 (Lumber)
                      • temp_after Equal to Farm lvl3
                      • temp_after Equal to Farm lvl3 (Gold)
                      • temp_after Equal to Farm lvl3 (Lumber)
                • Then - Actions
                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] + 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • temp_after Equal to Build Slot (Gold)
                          • temp_after Equal to Build Slot (Lumber)
                          • temp_after Equal to Build Slot (large)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • temp_before Equal to Farm lvl2
                          • temp_before Equal to Farm lvl2 (Gold)
                          • temp_before Equal to Farm lvl2 (Lumber)
                    • Then - Actions
                      • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Farm
                                  • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl2
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl3
                                  • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                            • Then - Actions
                              • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 2)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Barracks (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Barracks
                                      • (Unit-type of (Picked unit)) Equal to Barracks (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl2
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl3
                                      • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Gold)
                                • Then - Actions
                                  • Set Footman_count[(Player number of (Owner of (Triggering unit)))] = (Footman_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Castle
                                  • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3
                                  • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                            • Then - Actions
                              • Set Paladin_count[(Player number of (Owner of (Triggering unit)))] = (Paladin_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Archery
                                  • (Unit-type of (Picked unit)) Equal to Archery (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Archery (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl2
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl3
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Lumber)
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Custom value of (Picked unit)) Greater than or equal to 1
                                • Then - Actions
                                  • Set Crossbow_count[(Player number of (Owner of (Triggering unit)))] = (Crossbow_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                                  • Set Archer_count[(Player number of (Owner of (Triggering unit)))] = (Archer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                            • Then - Actions
                              • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Balista_count[(Player number of (Owner of (Triggering unit)))] = (Balista_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                            • Then - Actions
                              • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Tank_count[(Player number of (Owner of (Triggering unit)))] = (Tank_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                            • Then - Actions
                              • Set Missile_count[(Player number of (Owner of (Triggering unit)))] = (Missile_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Lumber)
                            • Then - Actions
                              • Set Marine_count[(Player number of (Owner of (Triggering unit)))] = (Marine_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Medical Barracks
                                  • (Unit-type of (Picked unit)) Equal to Medical Barracks (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Medical Barracks (Lumber)
                            • Then - Actions
                              • Set Medic_count[(Player number of (Owner of (Triggering unit)))] = (Medic_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl1
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl2
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl3
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Lumber)
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Custom value of (Picked unit)) Greater than or equal to 1
                                • Then - Actions
                                  • Set BTR_count[(Player number of (Owner of (Triggering unit)))] = (BTR_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                                  • Set Sniper_count[(Player number of (Owner of (Triggering unit)))] = (Sniper_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                            • Then - Actions
                              • Set ROfficer_count[(Player number of (Owner of (Triggering unit)))] = (ROfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                            • Then - Actions
                              • Set MOfficer_count[(Player number of (Owner of (Triggering unit)))] = (MOfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Factory
                                  • (Unit-type of (Picked unit)) Equal to Factory (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Factory (Lumber)
                            • Then - Actions
                              • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Lumber)
                            • Then - Actions
                              • Set Hydra_count[(Player number of (Owner of (Triggering unit)))] = (Hydra_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                            • Then - Actions
                              • Set Vampire_count[(Player number of (Owner of (Triggering unit)))] = (Vampire_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Unit Group - Pick every unit in temp_group and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Picked unit) Not equal to (Triggering unit)
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                                  • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                            • Then - Actions
                              • Set Kraken_count[(Player number of (Owner of (Triggering unit)))] = (Kraken_count[(Player number of (Owner of (Triggering unit)))] - 1)
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • Custom script: call DestroyGroup (udg_temp_group)
                      • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 2)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • temp_after Equal to Build Slot (Gold)
                              • temp_after Equal to Build Slot (Lumber)
                              • temp_after Equal to Build Slot (large)
                          • Or - Any (Conditions) are true
                            • Conditions
                              • temp_before Equal to Farm lvl3
                              • temp_before Equal to Farm lvl3 (Gold)
                              • temp_before Equal to Farm lvl3 (Lumber)
                        • Then - Actions
                          • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Farm
                                      • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl2
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl3
                                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                                • Then - Actions
                                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 2)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Picked unit) Not equal to (Triggering unit)
                                      • Or - Any (Conditions) are true
                                        • Conditions
                                          • (Unit-type of (Picked unit)) Equal to Barracks (Lumber)
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Lumber)
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Lumber)
                                          • (Unit-type of (Picked unit)) Equal to Barracks
                                          • (Unit-type of (Picked unit)) Equal to Barracks (Gold)
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Gold)
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3
                                          • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Gold)
                                    • Then - Actions
                                      • Set Footman_count[(Player number of (Owner of (Triggering unit)))] = (Footman_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                    • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Castle
                                      • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3
                                      • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                                • Then - Actions
                                  • Set Paladin_count[(Player number of (Owner of (Triggering unit)))] = (Paladin_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Archery
                                      • (Unit-type of (Picked unit)) Equal to Archery (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Archery (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl2
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl3
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Lumber)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Custom value of (Picked unit)) Greater than or equal to 1
                                    • Then - Actions
                                      • Set Crossbow_count[(Player number of (Owner of (Triggering unit)))] = (Crossbow_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                    • Else - Actions
                                      • Set Archer_count[(Player number of (Owner of (Triggering unit)))] = (Archer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                                • Then - Actions
                                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Balista_count[(Player number of (Owner of (Triggering unit)))] = (Balista_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                                • Then - Actions
                                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Tank_count[(Player number of (Owner of (Triggering unit)))] = (Tank_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                                • Then - Actions
                                  • Set Missile_count[(Player number of (Owner of (Triggering unit)))] = (Missile_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Lumber)
                                • Then - Actions
                                  • Set Marine_count[(Player number of (Owner of (Triggering unit)))] = (Marine_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Medical Barracks
                                      • (Unit-type of (Picked unit)) Equal to Medical Barracks (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Medical Barracks (Lumber)
                                • Then - Actions
                                  • Set Medic_count[(Player number of (Owner of (Triggering unit)))] = (Medic_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Lumber)
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Custom value of (Picked unit)) Greater than or equal to 1
                                    • Then - Actions
                                      • Set BTR_count[(Player number of (Owner of (Triggering unit)))] = (BTR_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                    • Else - Actions
                                      • Set Sniper_count[(Player number of (Owner of (Triggering unit)))] = (Sniper_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                                • Then - Actions
                                  • Set ROfficer_count[(Player number of (Owner of (Triggering unit)))] = (ROfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                                • Then - Actions
                                  • Set MOfficer_count[(Player number of (Owner of (Triggering unit)))] = (MOfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Factory
                                      • (Unit-type of (Picked unit)) Equal to Factory (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Factory (Lumber)
                                • Then - Actions
                                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Lumber)
                                • Then - Actions
                                  • Set Hydra_count[(Player number of (Owner of (Triggering unit)))] = (Hydra_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                                • Then - Actions
                                  • Set Vampire_count[(Player number of (Owner of (Triggering unit)))] = (Vampire_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Unit Group - Pick every unit in temp_group and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Picked unit) Not equal to (Triggering unit)
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                                      • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                                • Then - Actions
                                  • Set Kraken_count[(Player number of (Owner of (Triggering unit)))] = (Kraken_count[(Player number of (Owner of (Triggering unit)))] - 1)
                                  • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                                • Else - Actions
                          • Custom script: call DestroyGroup (udg_temp_group)
                          • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 3)
                        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • temp_before Equal to Farm lvl3
              • temp_before Equal to Farm lvl3 (Gold)
              • temp_before Equal to Farm lvl3 (Lumber)
          • Or - Any (Conditions) are true
            • Conditions
              • temp_after Equal to Factory
              • temp_after Equal to Factory (Gold)
              • temp_after Equal to Factory (Lumber)
        • Then - Actions
          • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
          • Unit Group - Pick every unit in temp_group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of (Picked unit)) Equal to Farm
                      • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                      • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                      • (Unit-type of (Picked unit)) Equal to Factory
                      • (Unit-type of (Picked unit)) Equal to Factory (Gold)
                      • (Unit-type of (Picked unit)) Equal to Factory (Lumber)
                • Then - Actions
                  • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
                • Else - Actions
          • Custom script: call DestroyGroup (udg_temp_group)
          • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 3)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • temp_after Equal to Build Slot (Gold)
                  • temp_after Equal to Build Slot (Lumber)
                  • temp_after Equal to Build Slot (large)
              • Or - Any (Conditions) are true
                • Conditions
                  • temp_before Equal to Factory
                  • temp_before Equal to Factory (Gold)
                  • temp_before Equal to Factory (Lumber)
            • Then - Actions
              • Set temp_group = (Units within 500.00 of (Position of (Triggering unit)))
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Farm (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Farm
                          • (Unit-type of (Picked unit)) Equal to Farm (Gold)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2
                          • (Unit-type of (Picked unit)) Equal to Farm lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3
                          • (Unit-type of (Picked unit)) Equal to Farm lvl3 (Gold)
                    • Then - Actions
                      • Set Militia_count[(Player number of (Owner of (Triggering unit)))] = (Militia_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Picked unit) Not equal to (Triggering unit)
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Unit-type of (Picked unit)) Equal to Barracks (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Lumber)
                              • (Unit-type of (Picked unit)) Equal to Barracks
                              • (Unit-type of (Picked unit)) Equal to Barracks (Gold)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl2 (Gold)
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3
                              • (Unit-type of (Picked unit)) Equal to Barracks lvl3 (Gold)
                        • Then - Actions
                          • Set Footman_count[(Player number of (Owner of (Triggering unit)))] = (Footman_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Castle (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Castle
                          • (Unit-type of (Picked unit)) Equal to Castle (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2
                          • (Unit-type of (Picked unit)) Equal to Castle lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3
                          • (Unit-type of (Picked unit)) Equal to Castle lvl3 (Gold)
                    • Then - Actions
                      • Set Paladin_count[(Player number of (Owner of (Triggering unit)))] = (Paladin_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Archery
                          • (Unit-type of (Picked unit)) Equal to Archery (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Archery lvl3 (Lumber)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Custom value of (Picked unit)) Greater than or equal to 1
                        • Then - Actions
                          • Set Crossbow_count[(Player number of (Owner of (Triggering unit)))] = (Crossbow_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
                          • Set Archer_count[(Player number of (Owner of (Triggering unit)))] = (Archer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Siege Workshop lvl3 (Lumber)
                    • Then - Actions
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Balista_count[(Player number of (Owner of (Triggering unit)))] = (Balista_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Tank Factory lvl 3 (Lumber)
                    • Then - Actions
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Tank_count[(Player number of (Owner of (Triggering unit)))] = (Tank_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Missile Factory lvl3 (Lumber)
                    • Then - Actions
                      • Set Missile_count[(Player number of (Owner of (Triggering unit)))] = (Missile_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Navy Barracks lvl3 (Lumber)
                    • Then - Actions
                      • Set Marine_count[(Player number of (Owner of (Triggering unit)))] = (Marine_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks (Gold)
                          • (Unit-type of (Picked unit)) Equal to Medical Barracks (Lumber)
                    • Then - Actions
                      • Set Medic_count[(Player number of (Owner of (Triggering unit)))] = (Medic_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Recon Center lvl3 (Lumber)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Custom value of (Picked unit)) Greater than or equal to 1
                        • Then - Actions
                          • Set BTR_count[(Player number of (Owner of (Triggering unit)))] = (BTR_count[(Player number of (Owner of (Triggering unit)))] - 1)
                        • Else - Actions
                          • Set Sniper_count[(Player number of (Owner of (Triggering unit)))] = (Sniper_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Ranged Officers Quarters lvl3 (Lumber)
                    • Then - Actions
                      • Set ROfficer_count[(Player number of (Owner of (Triggering unit)))] = (ROfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Melee Officers Quarters lvl3 (Lumber)
                    • Then - Actions
                      • Set MOfficer_count[(Player number of (Owner of (Triggering unit)))] = (MOfficer_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Hydra Broodpool lvl3 (Lumber)
                    • Then - Actions
                      • Set Hydra_count[(Player number of (Owner of (Triggering unit)))] = (Hydra_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] = (Archery_DeBuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Blood Shrine lvl3 (Lumber)
                    • Then - Actions
                      • Set Vampire_count[(Player number of (Owner of (Triggering unit)))] = (Vampire_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Unit Group - Pick every unit in temp_group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl1 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl2 (Lumber)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Gold)
                          • (Unit-type of (Picked unit)) Equal to Void Shrine lvl3 (Lumber)
                    • Then - Actions
                      • Set Kraken_count[(Player number of (Owner of (Triggering unit)))] = (Kraken_count[(Player number of (Owner of (Triggering unit)))] - 1)
                      • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_temp_group)
            • Else - Actions
 
Level 7
Joined
Apr 17, 2017
Messages
316
Instead of checking unit type every time, you can set them at map init with an array, then use loops inside unit groups. Also I noticed that you leak a point there in unit group variable. Actually unit group variable is not needed at all, just add set bj_wantDestroyGroup = true before picking units, and it should be fine. Also in the condition block why did you check if issued order is equal to issued order ? You can also save Owner of triggering unit to variable if you use it more than once, which you obviously do :D . Here's what it should look like:
  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Group1_Count = 1
      • Set Group1[Group1_Count] = Town Hall
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Keep
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Castle
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Farm
      • Set Group1_Count = (Group1_Count + 1)
  • Building Stats 1
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Issued order)
    • Actions
      • Set temp_before = (Unit-type of (Triggering unit))
      • Set temp_after = (Unit-type((String((Issued order)))))
      • -------- -------- ----------Gold Mine---------- -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • temp_before Equal to Build Slot (Gold)
              • temp_after Equal to Mine (gold)
        • Then - Actions
          • Set temploc = (Position of (Triggering unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 500.00 of temploc) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • For each (Integer A) from 1 to Group1_Count, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Group1[(Integer A)]
                        • Then - Actions
                          • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                        • Else - Actions
                  • For each (Integer A) from 1 to Group2_Count, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Group2[(Integer A)]
                        • Then - Actions
                          • Set Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                        • Else - Actions
                • Else - Actions
          • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
          • Custom script: call RemoveLocation(udg_temploc)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • temp_after Equal to Build Slot (Gold)
                  • temp_before Equal to Mine (gold)
            • Then - Actions
              • Set temploc = (Position of (Triggering unit))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 500.00 of temploc) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                    • Then - Actions
                      • For each (Integer A) from 1 to Group3_Count, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Group3[(Integer A)]
                            • Then - Actions
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • For each (Integer A) from 1 to Group4_Count, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Group4[(Integer A)]
                            • Then - Actions
                              • Set Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                    • Else - Actions
              • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] - 1)
              • Custom script: call RemoveLocation(udg_temploc)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • temp_after Equal to Mine lvl2 (gold)
                      • temp_after Equal to Mine lvl3 (gold)
                • Then - Actions
                  • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • -------- so on. --------
                • Else - Actions
 
Level 7
Joined
Sep 19, 2012
Messages
204
Instead of checking unit type every time, you can set them at map init with an array, then use loops inside unit groups. Also I noticed that you leak a point there in unit group variable. Actually unit group variable is not needed at all, just add set bj_wantDestroyGroup = true before picking units, and it should be fine. Also in the condition block why did you check if issued order is equal to issued order ? You can also save Owner of triggering unit to variable if you use it more than once, which you obviously do :D . Here's what it should look like:
  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Group1_Count = 1
      • Set Group1[Group1_Count] = Town Hall
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Keep
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Castle
      • Set Group1_Count = (Group1_Count + 1)
      • Set Group1[Group1_Count] = Farm
      • Set Group1_Count = (Group1_Count + 1)
  • Building Stats 1
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Issued order)
    • Actions
      • Set temp_before = (Unit-type of (Triggering unit))
      • Set temp_after = (Unit-type((String((Issued order)))))
      • -------- -------- ----------Gold Mine---------- -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • temp_before Equal to Build Slot (Gold)
              • temp_after Equal to Mine (gold)
        • Then - Actions
          • Set temploc = (Position of (Triggering unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 500.00 of temploc) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked unit) Not equal to (Triggering unit)
                • Then - Actions
                  • For each (Integer A) from 1 to Group1_Count, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Group1[(Integer A)]
                        • Then - Actions
                          • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] - 2)
                        • Else - Actions
                  • For each (Integer A) from 1 to Group2_Count, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Group2[(Integer A)]
                        • Then - Actions
                          • Set Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] + 1)
                        • Else - Actions
                • Else - Actions
          • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
          • Custom script: call RemoveLocation(udg_temploc)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • temp_after Equal to Build Slot (Gold)
                  • temp_before Equal to Mine (gold)
            • Then - Actions
              • Set temploc = (Position of (Triggering unit))
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 500.00 of temploc) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Not equal to (Triggering unit)
                    • Then - Actions
                      • For each (Integer A) from 1 to Group3_Count, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Group3[(Integer A)]
                            • Then - Actions
                              • Set Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] = (Castle_Buff_count[(Player number of (Owner of (Triggering unit)))] + 2)
                            • Else - Actions
                      • For each (Integer A) from 1 to Group4_Count, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Group4[(Integer A)]
                            • Then - Actions
                              • Set Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] = (Balista_Debuff_count[(Player number of (Owner of (Triggering unit)))] - 1)
                            • Else - Actions
                    • Else - Actions
              • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] - 1)
              • Custom script: call RemoveLocation(udg_temploc)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • temp_after Equal to Mine lvl2 (gold)
                      • temp_after Equal to Mine lvl3 (gold)
                • Then - Actions
                  • Set Mine_Count[(Player number of (Owner of (Triggering unit)))] = (Mine_Count[(Player number of (Owner of (Triggering unit)))] + 1)
                  • -------- so on. --------
                • Else - Actions

not sure if i understood everything going on here due to complete and utter sleep deprivation, but you mean to create a Group array for every of those dependency groups and then check through the array...did i get that right?
if so...ill check if this is an option for the whole system tomorrow.

the issued order equals issued order thingy was needed for it to work...forgot why though lol (I started this map a while ago and am trying to fix and continue it now)

Might be the solution, but if somebody has another idea while im getting some well deserved sleep...hit me with it.

P.s: +rep
 
Level 7
Joined
Apr 17, 2017
Messages
316
not sure if i understood everything going on here due to complete and utter sleep deprivation, but you mean to create a Group array for every of those dependency groups and then check through the array...did i get that right?
if so...ill check if this is an option for the whole system tomorrow.

the issued order equals issued order thingy was needed for it to work...forgot why though lol (I started this map a while ago and am trying to fix and continue it now)

Might be the solution, but if somebody has another idea while im getting some well deserved sleep...hit me with it.

P.s: +rep

Basically yes. Creating unit-type arrays will result in less code, and it's more readable.
 
Status
Not open for further replies.
Top