- Joined
- Jun 23, 2009
- Messages
- 297
I just finished this trigger, but, I have the impression it wouldn't work 100% correctly, or that it could be done in a much better and/or shorter way.
Basically, I have a map with two teams, humans and demons, at the beginning of the map, it detects whether there are two demons playing, or only one, then, it sets a variable depending on this.
EnemiesPlaying = 1 means that only player 11 is playing as a demon
EnemiesPlaying = 2 means that only player 12 is playing as a demon
EnemiesPlaying = 3 means that both players are playing as demons
Humans win when all demons are dead, and demons win when all humans are dead.
Now that you know that, please review my trigger, check if it could be done in a shorter or better way, thanks!
Basically, I have a map with two teams, humans and demons, at the beginning of the map, it detects whether there are two demons playing, or only one, then, it sets a variable depending on this.
EnemiesPlaying = 1 means that only player 11 is playing as a demon
EnemiesPlaying = 2 means that only player 12 is playing as a demon
EnemiesPlaying = 3 means that both players are playing as demons
Humans win when all demons are dead, and demons win when all humans are dead.
Now that you know that, please review my trigger, check if it could be done in a shorter or better way, thanks!
-
Events
-
Unit - A unit owned by Player 11 (Dark Green) Dies
-
Unit - A unit owned by Player 12 (Brown) Dies
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Balnazzar
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EnemiesPlaying Equal to 3
-
-
Then - Actions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(EnemiesPlaying Equal to 1) or (EnemiesPlaying Equal to 2)
-
-
Then - Actions
-
Game - Defeat Player 11 (Dark Green) with the message: Defeat!
-
Game - Defeat Player 12 (Brown) with the message: Defeat!
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EnemiesPlaying Equal to 3
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
-
-
Then - Actions
-
Set EnemiesPlaying = 2
-
-
Else - Actions
-
If ((Owner of (Triggering unit)) Equal to Player 12 (Brown)) then do (Set EnemigosJugando = 1) else do (Game - Display to (All players) the text: |cFFFF0000Error|r: ...)
-
-
-
-
Else - Actions
-
Game - Display to (All players) the text: cFFFF0000Error|r:
-
-
-
-
-
-