Team Duel

garion992

TH.net Regular
Reaction score
17
Hello everyone!
I have a map like footman frenzy, its pretty good and fun.
But i tried to make a Duel Arena in the map, so every 180 secs all heroes must duel there.
I tried a lot and searched much and i only founded triggers for 2 teams. It would be nice if this became a tutorial.

Wat i want: (but it doesnt works)
  • Every 180 seconds move all heroes to the arena at full health, revive when dead.
  • Must be suitable for 4 teams with 2 players in each team.
  • If team mate has left or is defeated, the arena must still work for other players, so my team mate left and other players kill me that they dont need to kill the teammate who has left so who is impossible to kill.
  • Give the 2 or 1 winning player(s) a reward and move them back to the base.
  • You can have more then 1 Hero in this map, but only the first must be possible to enter the Arena.

My old Triggers: (it will be better to not look at those)
Code:
Timer
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Countdown Timer - Start ArenaTimer as a One-shot timer that will expire in 180.00 seconds
        Countdown Timer - Create a timer window for ArenaTimer with title Duel Time: 
        Countdown Timer - Show AreanTimerWindow
Code:
Go to Arena
    Events
        Time - ArenaTimer expires
    Conditions
    Actions
        Game - Display to (All players) the text: It's time to Duel! ...
        Set DuelBoolean = True
        Set ArenaLives[1] = (2 - Left[1])
        Set ArenaLives[2] = (2 - Left[2])
        Set ArenaLives[3] = (2 - Left[3])
        Set ArenaLives[4] = (2 - Left[4])
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Hero - Instantly revive Heroes[(Integer A)] at (Center of ArenaAreas[(Integer A)]), Show revival graphics
                Unit - Move Heroes[(Integer A)] instantly to (Center of ArenaAreas[(Integer A)])
                Camera - Pan camera for (Player((Integer A))) to (Position of Heroes[(Integer A)]) over 1.00 seconds
Code:
// This one is really bad i know, but it sets the variables lower if a unit dies and checks if the team has won
Winning Players
    Events
        Unit - A unit Dies
    Conditions
        And - All (Conditions) are true
            Conditions
                DuelBoolean Equal to True
                ((Triggering unit) is A Hero) Equal to True
                (Hero Arena <gen> contains (Triggering unit)) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Triggering unit)) Equal to Player 1 (Red)) or ((Owner of (Triggering unit)) Equal to Player 2 (Blue))
            Then - Actions
                Set ArenaLives[1] = (ArenaLives[1] - 1)
                Game - Display to (All players) the text: (A Hero of Team 1 has fallen! Lives:  + (String(ArenaLives[1])))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                ArenaLives[1] Equal to 0
                                ArenaLives[3] Equal to 0
                                ArenaLives[4] Equal to 0
                    Then - Actions
                        Set IntWinner = 2
                        Trigger - Run Reward <gen> (ignoring conditions)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        ArenaLives[1] Equal to 0
                                        ArenaLives[2] Equal to 0
                                        ArenaLives[4] Equal to 0
                            Then - Actions
                                Set IntWinner = 3
                                Trigger - Run Reward <gen> (ignoring conditions)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        And - All (Conditions) are true
                                            Conditions
                                                ArenaLives[1] Equal to 0
                                                ArenaLives[2] Equal to 0
                                                ArenaLives[3] Equal to 0
                                    Then - Actions
                                        Set IntWinner = 4
                                        Trigger - Run Reward <gen> (ignoring conditions)
                                    Else - Actions
                                        Do nothing
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Owner of (Triggering unit)) Equal to Player 3 (Teal)) or ((Owner of (Triggering unit)) Equal to Player 4 (Purple))
                    Then - Actions
                        Set ArenaLives[2] = (ArenaLives[2] - 1)
                        Game - Display to (All players) the text: A Hero of Team 2 ha...
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        ArenaLives[2] Equal to 0
                                        ArenaLives[3] Equal to 0
                                        ArenaLives[4] Equal to 0
                            Then - Actions
                                Set IntWinner = 1
                                Trigger - Run Reward <gen> (ignoring conditions)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        And - All (Conditions) are true
                                            Conditions
                                                ArenaLives[1] Equal to 0
                                                ArenaLives[2] Equal to 0
                                                ArenaLives[4] Equal to 0
                                    Then - Actions
                                        Set IntWinner = 3
                                        Trigger - Run Reward <gen> (ignoring conditions)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                And - All (Conditions) are true
                                                    Conditions
                                                        ArenaLives[1] Equal to 0
                                                        ArenaLives[2] Equal to 0
                                                        ArenaLives[3] Equal to 0
                                            Then - Actions
                                                Set IntWinner = 4
                                                Trigger - Run Reward <gen> (ignoring conditions)
                                            Else - Actions
                                                Do nothing
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Owner of (Triggering unit)) Equal to Player 5 (Yellow)) or ((Owner of (Triggering unit)) Equal to Player 6 (Orange))
                            Then - Actions
                                Set ArenaLives[3] = (ArenaLives[3] - 1)
                                Game - Display to (All players) the text: A Hero of Team 3 ha...
                                -------- XXXXXXXXXXXXXXX --------
                                -------- XXXXXXXXXXXXXXX --------
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        And - All (Conditions) are true
                                            Conditions
                                                ArenaLives[2] Equal to 0
                                                ArenaLives[3] Equal to 0
                                                ArenaLives[4] Equal to 0
                                    Then - Actions
                                        Set IntWinner = 1
                                        Trigger - Run Reward <gen> (ignoring conditions)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                And - All (Conditions) are true
                                                    Conditions
                                                        ArenaLives[1] Equal to 0
                                                        ArenaLives[3] Equal to 0
                                                        ArenaLives[4] Equal to 0
                                            Then - Actions
                                                Set IntWinner = 2
                                                Trigger - Run Reward <gen> (ignoring conditions)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        And - All (Conditions) are true
                                                            Conditions
                                                                ArenaLives[1] Equal to 0
                                                                ArenaLives[2] Equal to 0
                                                                ArenaLives[3] Equal to 0
                                                    Then - Actions
                                                        Set IntWinner = 4
                                                        Trigger - Run Reward <gen> (ignoring conditions)
                                                    Else - Actions
                                                        Do nothing
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Owner of (Triggering unit)) Equal to Player 7 (Green)) or ((Owner of (Triggering unit)) Equal to Player 8 (Pink))
                                    Then - Actions
                                        Set ArenaLives[4] = (ArenaLives[4] - 1)
                                        Game - Display to (All players) the text: A Hero of Team 4 ha...
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                And - All (Conditions) are true
                                                    Conditions
                                                        ArenaLives[2] Equal to 0
                                                        ArenaLives[3] Equal to 0
                                                        ArenaLives[4] Equal to 0
                                            Then - Actions
                                                Set IntWinner = 1
                                                Trigger - Run Reward <gen> (ignoring conditions)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        And - All (Conditions) are true
                                                            Conditions
                                                                ArenaLives[1] Equal to 0
                                                                ArenaLives[3] Equal to 0
                                                                ArenaLives[4] Equal to 0
                                                    Then - Actions
                                                        Set IntWinner = 2
                                                        Trigger - Run Reward <gen> (ignoring conditions)
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                And - All (Conditions) are true
                                                                    Conditions
                                                                        ArenaLives[1] Equal to 0
                                                                        ArenaLives[2] Equal to 0
                                                                        ArenaLives[4] Equal to 0
                                                            Then - Actions
                                                                Set IntWinner = 3
                                                                Trigger - Run Reward <gen> (ignoring conditions)
                                                            Else - Actions
                                                                Do nothing
                                    Else - Actions
                                        Game - Display to (All players) the text: - test: Unit isn't ...
Code:
Reward
    Events
    Conditions
    Actions
        Game - Display to (All players) the text: (|cffff8c00Team  + ((String(IntWinner)) + |r wins the Duel! Pick up your rewards in the middle!))
        Hero - Create ArenaDuelSets[(Random integer number between 1 and 5)] and give it to Heroes[((IntWinner + IntWinner) - 1)]
        Hero - Create ArenaDuelSets[(Random integer number between 1 and 5)] and give it to Heroes[(IntWinner + IntWinner)]
        Game - Display to (All players) the text: Arena will end in 1...
        Set DuelBoolean = False
        Wait 15.00 seconds
        Countdown Timer - Start ArenaTimer as a One-shot timer that will expire in 300.00 seconds
        Unit - Move Heroes[((IntWinner + IntWinner) - 1)] instantly to ((Player(((IntWinner + IntWinner) - 1))) start location)
        Camera - Pan camera for (Player(((IntWinner + IntWinner) - 1))) to (Position of Heroes[((IntWinner + IntWinner) - 1)]) over 1.00 seconds
        Unit - Move Heroes[(IntWinner + IntWinner)] instantly to ((Player((IntWinner + IntWinner))) start location)
        Camera - Pan camera for (Player((IntWinner + IntWinner))) to (Position of Heroes[(IntWinner + IntWinner)]) over 1.00 seconds
        Game - Display to (All players) the text: Arena mode is over!
Edit 16-07-07 20:35 - set to code tags
 

Darkchaoself

What is this i dont even
Reaction score
106
I refuse to help, thats barley readable, the third one, for *insert word here* sake, use code tags!
 

NapaHero

Back from the dead...
Reaction score
43
Agreed with Dark, use code tags so we can understand your trigger and try to help you.
 

Sevion

The DIY Ninja
Reaction score
413
Hey, don't feel bad. A lot of us forget Code Tags sometime in our forum life :p. I'll get back to you when I get this stupid driver. Right now scrolling is killing me. It looks terrible without my driver :p. I just reformatted.
 

garion992

TH.net Regular
Reaction score
17
A driver? Does it makes text better readable? Cool!
But take your time, im already building a month on this map.

But dont get off the subject! :p
 

NapaHero

Back from the dead...
Reaction score
43
First thing:

Code:
Set ArenaLives[1] = (2 - Left[1])
Set ArenaLives[2] = (2 - Left[2])
Set ArenaLives[3] = (2 - Left[3])
Set ArenaLives[4] = (2 - Left[4])

could be shortened to:

Code:
For Each (Integer A) from 1 to 4, do (Actions):
   Loop - Actions
      Set Arena Lives[Integer A] = (2 - Left[IntegerA])
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top