• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[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)