Squeekems
TH.net Regular
- Reaction score
- 11
Here is what I want it to do: When a player's Great Hall falls below 50% hit-points and is attacked, it is forced to join the team of attacking player.
Here is the problem: I had it working and I can not figure out why it stopped working.
I suspect that the problem may lie in another trigger. I had tried to add messages that would be sent to all players involved in the take-over to inform them of what occurred, but the messages were causing crashes.
Here is the problem: I had it working and I can not figure out why it stopped working.
I suspect that the problem may lie in another trigger. I had tried to add messages that would be sent to all players involved in the take-over to inform them of what occurred, but the messages were causing crashes.
Trigger:
- Conquer Great Hall
- Events
- Unit - A unit Is attacked
- Conditions
- And - All (Conditions) are true
- Conditions
- ((Owner of (Triggering unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
- ((Triggering unit) is A structure) Equal to True
- (Life of (Triggering unit)) Less than or equal to ((Max life of (Triggering unit)) / 2.00)
- ((Triggering unit) is A town-hall-type unit) Equal to True
- (Triggering unit) Not equal to Great Hall 0065 <gen>
- (Triggering unit) Not equal to Great Hall 0066 <gen>
- (Triggering unit) Not equal to Great Hall 0067 <gen>
- (Triggering unit) Not equal to Great Hall 0068 <gen>
- Conditions
- And - All (Conditions) are true
- Actions
- Unit - Set life of (Triggering unit) to 100.00%
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player number of (Owner of (Triggering unit))) Equal to iTeam[(Player number of (Owner of (Triggering unit)))]
- Then - Actions
- Player Group - Make pgTeam[(Player number of (Owner of (Triggering unit)))] treat (All players) as an Enemy
- Player Group - Make (All players) treat pgTeam[(Player number of (Owner of (Triggering unit)))] as an Enemy
- Player Group - Pick every player in pgTeam[(Player number of (Owner of (Triggering unit)))] and do (Actions)
- Loop - Actions
- Set iTeam[(Player number of (Picked player))] = (Player number of (Picked player))
- Player Group - Add (Picked player) to pgTeam[(Player number of (Picked player))]
- Player - Change color of (Picked player) to pcColor[(Player number of (Picked player))], Changing color of existing units
- Player Group - Remove (Picked player) from pgTeam[(Player number of (Owner of (Triggering unit)))]
- Loop - Actions
- Set pgForce = (Player group((Owner of (Triggering unit))))
- Player Group - Make pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]] treat pgForce as an Ally with shared vision
- Player Group - Make pgForce treat pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]] as an Ally with shared vision
- Set iTeam[(Player number of (Owner of (Triggering unit)))] = iTeam[(Player number of (Owner of (Attacking unit)))]
- Player Group - Add (Owner of (Triggering unit)) to pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]]
- Player - Change color of (Owner of (Triggering unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
- Else - Actions
- Set pgForce = (Player group((Owner of (Triggering unit))))
- Player Group - Make pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]] treat pgForce as an Ally with shared vision
- Player Group - Make pgForce treat pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]] as an Ally with shared vision
- Set iTeam[(Player number of (Owner of (Triggering unit)))] = iTeam[(Player number of (Owner of (Attacking unit)))]
- Player Group - Add (Owner of (Triggering unit)) to pgTeam[iTeam[(Player number of (Owner of (Attacking unit)))]]
- Player - Change color of (Owner of (Triggering unit)) to (Color of (Owner of (Attacking unit))), Changing color of existing units
- If - Conditions
- Custom script: call DestroyForce(udg_pgForce)
- Events
Last edited: