Hi there, I have finished the general trigger layout of my map found in the Member Projects section, and I would be much obliged if someone would please look over my triggers and point out any leaks that may exist. These triggers work exactly as they should, I just need help with leaks. Thanks in advance!
Trigger:
- Entering 0036
- Events
- Unit - A unit comes within 710.00 of Haunted Gold Mine 0036 <gen>
- Conditions
- (Unit-type of (Entering unit)) Not equal to Zombie
- Actions
- Set index = 0
- Unit Group - Add (Triggering unit) to regionGroup[index]
- Set regionOwner[index] = (Owner of (Triggering unit))
- Unit Group - Pick every unit in regionGroup[index] and do (Actions)
- Loop - Actions
- If ((Owner of (Picked unit)) Not equal to regionOwner[index]) then do (Set regionOwner[index] = Neutral Passive) else do (Set regionOwner[index] = Neutral Hostile)
- Loop - Actions
- Events
Trigger:
- Leaving 0036
- Events
- Unit - A unit leaves (Region centered at (Position of Haunted Gold Mine 0036 <gen>) with size (1401.00, 1401.00))
- Conditions
- (Unit-type of (Leaving unit)) Not equal to Zombie
- Actions
- Set index = 0
- Unit Group - Remove (Leaving unit) from regionGroup[index]
- Set regionOwner[index] = (Owner of (Random unit from regionGroup[index]))
- Unit Group - Pick every unit in regionGroup[index] and do (Actions)
- Loop - Actions
- If ((Owner of (Picked unit)) Not equal to regionOwner[index]) then do (Set regionOwner[index] = Neutral Passive) else do (Set regionOwner[index] = Neutral Hostile)
- Loop - Actions
- Events
Trigger:
- Mine 0036 Claimed
- Events
- Unit - A unit comes within 700.00 of Haunted Gold Mine 0036 <gen>
- Conditions
- regionOwner[0] Equal to Neutral Hostile
- ((Triggering unit) is A Hero) Equal to True
- (Owner of Haunted Gold Mine 0036 <gen>) Equal to Neutral Hostile
- Actions
- Set player = (Owner of (Triggering unit))
- Set Hero = (Triggering unit)
- Set mine = Haunted Gold Mine 0036 <gen>
- Set zomb1 = Zombie 0056 <gen>
- Set zomb2 = Zombie 0057 <gen>
- Set zomb3 = Zombie 0058 <gen>
- Set zomb4 = Zombie 0059 <gen>
- Set zomb5 = Zombie 0060 <gen>
- Game - Display to (All allies of player) the text: ((Name of player) + is claiming a gold mine!)
- Wait 3.00 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Region centered at (Position of mine) with size (1400.00, 1400.00)) contains Hero) Equal to True
- Then - Actions
- Game - Display to (All allies of player) the text: ((Name of player) + has claimed a gold mine!)
- Game - Display to (All enemies of player) the text: An enemy has claime...
- Unit - Change ownership of mine to player and Change color
- Unit - Change ownership of zomb1 to player and Change color
- Unit - Change ownership of zomb2 to player and Change color
- Unit - Change ownership of zomb3 to player and Change color
- Unit - Change ownership of zomb4 to player and Change color
- Unit - Change ownership of zomb5 to player and Change color
- Player - Add -5 to player Food used
- Unit - Order zomb1 to Harvest mine
- Unit - Order zomb2 to Harvest mine
- Unit - Order zomb3 to Harvest mine
- Unit - Order zomb4 to Harvest mine
- Unit - Order zomb5 to Harvest mine
- Else - Actions
- Game - Display to (All allies of player) the text: ((Name of player) + has failed to claim a gold mine!)
- If - Conditions
- Events
Trigger:
- Mine 0036 Captured
- Events
- Unit - Haunted Gold Mine 0036 <gen> Is attacked
- Conditions
- (Life of (Attacked unit)) Less than or equal to 75.00
- Actions
- Set mine = Haunted Gold Mine 0036 <gen>
- Set zomb1 = Zombie 0056 <gen>
- Set zomb2 = Zombie 0057 <gen>
- Set zomb3 = Zombie 0058 <gen>
- Set zomb4 = Zombie 0059 <gen>
- Set zomb5 = Zombie 0060 <gen>
- Unit - Set life of mine to 100.00%
- Player - Add 5 to (Owner of zomb1) Food used
- Unit - Change ownership of mine to (Owner of (Attacking unit)) and Change color
- Unit - Change ownership of zomb1 to (Owner of (Attacking unit)) and Change color
- Unit - Change ownership of zomb2 to (Owner of (Attacking unit)) and Change color
- Unit - Change ownership of zomb3 to (Owner of (Attacking unit)) and Change color
- Unit - Change ownership of zomb4 to (Owner of (Attacking unit)) and Change color
- Unit - Change ownership of zomb5 to (Owner of (Attacking unit)) and Change color
- Player - Add -5 to (Owner of zomb1) Food used
- Unit - Order zomb1 to Harvest mine
- Unit - Order zomb2 to Harvest mine
- Unit - Order zomb3 to Harvest mine
- Unit - Order zomb4 to Harvest mine
- Unit - Order zomb5 to Harvest mine
- Events