• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Can someone tell me what's wrong?

Status
Not open for further replies.
Level 4
Joined
May 18, 2004
Messages
60
So, in the Arena on my map I have a dueling section and it's not working right and it's driving me crazy... It's works only some times and it makes no sense. Can someone look over these and tell me if you can see something I'm doing wrong?

This is the setup trigger:
  • Arena Setup
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Set Arena_Duel_On = False
      • Unit - Move Arena Misc. Items Vendor 0182 <gen> instantly to (Center of Arena Item Vendor Move 2 <gen>)
      • Unit - Move Arena Magic Items Vendor 0184 <gen> instantly to (Center of Arena Item Vendor Move <gen>)
      • Unit - Move Dueling Referee 0097 <gen> instantly to (Center of Arena Duel Referee <gen>)
      • Dialog - Create a dialog button for Arena_Duel_Accept labelled |c00008000Yes
      • Set Arena_Duel_Yes = (Last created dialog Button)
      • Dialog - Create a dialog button for Arena_Duel_Accept labelled |c00ea0000No
      • Set Arena_Duel_No = (Last created dialog Button)
      • Wait 5.00 seconds
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Players[(Integer A)] slot status) Equal to Is playing
              • (Players[(Integer A)] controller) Equal to User
            • Then - Actions
              • Dialog - Create a dialog button for Arena_Duel labelled ((|c00FF0303 + (Name of Players[(Integer A)])) + (( |c00f9f900( + |c00f9f900Lv ) + (|c00FF0303 + ((String((Hero level of Players_Current_Hero[(Integer A)]))) + ( |c00afafd8 + ((Name of Players_Current_Hero[(Integer A)]) + |c00f9f900)))))))
              • Set Arena_Duel_Players[(Integer A)] = (Last created dialog Button)
              • Dialog - Change the title of Arena_Duel_Accept to ((Duel + (|c00FF0303 + (Name of Arena_Duel_PlayerDeclaringDuel))) + ( |c00f9f900: + ((|c00afafd8 + (Name of Arena_Duel_HeroDeclaringDuel)) + (( |c00f9f900( + (|c00f9f900 + Lv )) + ((|c00ff2020 + (String((Hero level of Arena_Duel_HeroDeclaringDuel)))) + (|c0
            • Else - Actions
      • Trigger - Destroy (This trigger)
This is the trigger of the person initiating the duel:

  • Use Duel Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Arena_Duel_On Equal to False
      • (Item-type of (Item being manipulated)) Equal to Duel
    • Actions
      • Set Arena_Duel_On = True
      • Set Arena_Duel_PlayerClickedButton = False
      • Set Arena_Duel_PlayerDeclaringDuel = (Owner of (Hero manipulating item))
      • Set Arena_Duel_HeroDeclaringDuel = (Hero manipulating item)
      • Dialog - Clear Arena_Duel
      • Dialog - Clear Arena_Duel_Accept
      • Dialog - Change the title of Arena_Duel to Duel Which Player?
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Players[(Integer A)] slot status) Equal to Is playing
              • (Players[(Integer A)] controller) Equal to User
            • Then - Actions
              • Dialog - Create a dialog button for Arena_Duel labelled ((|c00FF0303 + (Name of Players[(Integer A)])) + (( |c00f9f900( + |c00f9f900Lv ) + (|c00FF0303 + ((String((Hero level of Players_Current_Hero[(Integer A)]))) + ( |c00afafd8 + ((Name of Players_Current_Hero[(Integer A)]) + |c00f9f900)))))))
              • Set Arena_Duel_Players[(Integer A)] = (Last created dialog Button)
              • Dialog - Change the title of Arena_Duel_Accept to ((Duel + (|c00FF0303 + (Name of Arena_Duel_PlayerDeclaringDuel))) + ( |c00f9f900: + ((|c00afafd8 + (Name of Arena_Duel_HeroDeclaringDuel)) + (( |c00f9f900( + (|c00f9f900 + Lv )) + ((|c00ff2020 + (String((Hero level of Arena_Duel_HeroDeclaringDuel)))) + (|c0
            • Else - Actions
      • Dialog - Create a dialog button for Arena_Duel_Accept labelled |c00008000Yes
      • Set Arena_Duel_Yes = (Last created dialog Button)
      • Dialog - Create a dialog button for Arena_Duel_Accept labelled |c00ea0000No
      • Set Arena_Duel_No = (Last created dialog Button)
      • Dialog - Show Arena_Duel for (Owner of (Hero manipulating item))
This is the trigger for player that got the request:

  • Duel Players
    • Events
      • Dialog - A dialog button is clicked for Arena_Duel
    • Conditions
      • Arena_Duel_On Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 1 (Red)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[1] Equal to False
                  • Quests_Druid_Active[1] Equal to False
                  • Quests_Ranger_Active[1] Equal to False
                  • Quests_Sorcerer_Active[1] Equal to False
                  • Quests_Thief_Active[1] Equal to False
                  • Quests_Warrior_Active[1] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 1 (Red)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 2 (Blue)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[2] Equal to False
                  • Quests_Druid_Active[2] Equal to False
                  • Quests_Ranger_Active[2] Equal to False
                  • Quests_Sorcerer_Active[2] Equal to False
                  • Quests_Thief_Active[2] Equal to False
                  • Quests_Warrior_Active[2] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 2 (Blue)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player3
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 3 (Teal)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[3] Equal to False
                  • Quests_Druid_Active[3] Equal to False
                  • Quests_Ranger_Active[3] Equal to False
                  • Quests_Sorcerer_Active[3] Equal to False
                  • Quests_Thief_Active[3] Equal to False
                  • Quests_Warrior_Active[3] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 3 (Teal)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player4
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 4 (Purple)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[4] Equal to False
                  • Quests_Druid_Active[4] Equal to False
                  • Quests_Ranger_Active[4] Equal to False
                  • Quests_Sorcerer_Active[4] Equal to False
                  • Quests_Thief_Active[4] Equal to False
                  • Quests_Warrior_Active[4] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 4 (Purple)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player5
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 5 (Yellow)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[5] Equal to False
                  • Quests_Druid_Active[5] Equal to False
                  • Quests_Ranger_Active[5] Equal to False
                  • Quests_Sorcerer_Active[5] Equal to False
                  • Quests_Thief_Active[5] Equal to False
                  • Quests_Warrior_Active[5] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 5 (Yellow)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Arena_Duel_Player6
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Player 6 (Orange)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[6] Equal to False
                  • Quests_Druid_Active[6] Equal to False
                  • Quests_Ranger_Active[6] Equal to False
                  • Quests_Sorcerer_Active[6] Equal to False
                  • Quests_Thief_Active[6] Equal to False
                  • Quests_Warrior_Active[6] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Player 6 (Orange)
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Unit - Make (Picked unit) Invulnerable
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
        • Else - Actions
To see if someone is idle:

  • Is Player Idle
    • Events
    • Conditions
      • Arena_Duel_On Equal to True
    • Actions
      • Wait 10.00 seconds
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of Arena_Duel_HeroAcceptingDuel) Equal to Players[(Integer A)]
              • Arena_Duel_PlayerClickedButton Equal to False
            • Then - Actions
              • Set Arena_Duel_On = False
              • Set Arena_Duel_PlayersIdle[(Player number of Arena_Duel_PlayerAcceptingDuel)] = True
              • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Player di...
            • Else - Actions
 
Last edited:
Level 4
Joined
May 18, 2004
Messages
60
This is the trigger for what button accepting player clicks

  • Players Answer
    • Events
      • Dialog - A dialog button is clicked for Arena_Duel_Accept
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena_Duel_On Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Arena_Duel_Yes
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Arena_Duel_PlayersIdle[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Set Arena_Duel_PlayerClickedButton = True
                  • Set Arena_Duel_PlayerAcceptingDuel = (Triggering player)
                  • Set Disable_Teleport_Spell[(Player number of (Triggering player))] = True
                  • Unit Group - Pick every unit in (Units in Arena Duel Area <gen>) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Not equal to Player 11 (Dark Green)
                          • (Owner of (Picked unit)) Not equal to Neutral Passive
                          • (Owner of (Picked unit)) Not equal to Arena_Duel_PlayerDeclaringDuel
                        • Then - Actions
                          • Unit - Move (Picked unit) instantly to (Center of Arena Duel Move Players Here <gen>)
                        • Else - Actions
                          • Set Disable_Teleport_Spell[(Player number of (Owner of (Picked unit)))] = True
                  • Camera - Lock camera target for (Triggering player) to Shade 0120 <gen>, offset by (0.00, 0.00) using Default rotation
                  • Camera - Lock camera target for Arena_Duel_PlayerDeclaringDuel to Shade 0120 <gen>, offset by (0.00, 0.00) using Default rotation
                  • Item - Remove (Item carried by Arena_Duel_HeroAcceptingDuel of type Boots of Speed (Testing Only))
                  • Item - Remove (Item carried by Arena_Duel_HeroDeclaringDuel of type Boots of Speed (Testing Only))
                  • Unit - Move Arena_Duel_HeroDeclaringDuel instantly to (Center of Arena Duel Area Left Side <gen>), facing (Center of Arena Duel Area Right Side <gen>)
                  • Unit - Move Arena_Duel_HeroAcceptingDuel instantly to (Center of Arena Duel Area Right Side <gen>), facing (Center of Arena Duel Area Left Side <gen>)
                  • Unit - Set life of Arena_Duel_HeroDeclaringDuel to 100.00%
                  • Unit - Set mana of Arena_Duel_HeroDeclaringDuel to 100.00%
                  • Unit - Set life of Arena_Duel_HeroAcceptingDuel to 100.00%
                  • Unit - Set mana of Arena_Duel_HeroAcceptingDuel to 100.00%
                  • Game - Display to Arena_Duel_PlayerAcceptingDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Wait 1.00 seconds
                  • Game - Display to Arena_Duel_PlayerAcceptingDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Wait 1.00 seconds
                  • Game - Display to Arena_Duel_PlayerAcceptingDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 1.00 seconds the text: ...
                  • Player - Make Arena_Duel_PlayerAcceptingDuel treat Arena_Duel_PlayerDeclaringDuel as an Enemy
                  • Player - Make Arena_Duel_PlayerDeclaringDuel treat Arena_Duel_PlayerAcceptingDuel as an Enemy
                  • Unit - Make Arena_Duel_HeroAcceptingDuel Vulnerable
                  • Unit - Make Arena_Duel_HeroDeclaringDuel Vulnerable
                  • Unit - Remove classification of An Ancient from Arena_Duel_HeroDeclaringDuel
                  • Unit - Remove classification of An Ancient from Arena_Duel_HeroAcceptingDuel
                  • Unit - Order Arena_Duel_HeroAcceptingDuel to Attack Arena_Duel_HeroDeclaringDuel
                  • Unit - Order Arena_Duel_HeroDeclaringDuel to Attack Arena_Duel_HeroAcceptingDuel
                • Else - Actions
                  • Set Arena_Duel_PlayersIdle[(Player number of (Triggering player))] = False
                  • Unit - Make Arena_Duel_HeroAcceptingDuel Vulnerable
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to Arena_Duel_No
                • Then - Actions
                  • Set Arena_Duel_PlayerClickedButton = True
                  • Set Arena_Duel_On = False
                  • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5This play...
                  • Unit - Make Arena_Duel_HeroAcceptingDuel Vulnerable
                  • Unit - Make Arena_Duel_HeroDeclaringDuel Vulnerable
                • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Arena_Duel_Yes
              • Arena_Duel_PlayersIdle[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Set Arena_Duel_PlayersIdle[(Player number of (Triggering player))] = False
              • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                      • (Owner of (Picked unit)) Equal to (Triggering player)
                    • Then - Actions
                      • Unit - Make (Picked unit) Vulnerable
                    • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to Arena_Duel_No
              • Arena_Duel_PlayersIdle[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Set Arena_Duel_PlayersIdle[(Player number of (Triggering player))] = False
              • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A Hero) Equal to True
                      • (Owner of (Picked unit)) Equal to (Triggering player)
                    • Then - Actions
                      • Unit - Make (Picked unit) Vulnerable
                    • Else - Actions
            • Else - Actions
And finally this is the trigger if one player wins:

  • Players Dies While Dueling
    • Events
      • Unit - A unit Dies
    • Conditions
      • Arena_Duel_On Equal to True
    • Actions
      • Set Arena_Duel_On = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to Arena_Duel_HeroAcceptingDuel
        • Then - Actions
          • Unit - Move Arena_Duel_HeroDeclaringDuel instantly to (Center of Arena Duel Area Enter Return <gen>)
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Arena_Duel_PlayerAcceptingDuel
                • Then - Actions
                  • Set Disable_Teleport_Spell[(Player number of (Owner of (Picked unit)))] = True
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Arena_Duel_PlayerDeclaringDuel
                • Then - Actions
                  • Set Disable_Teleport_Spell[(Player number of (Owner of (Picked unit)))] = True
                • Else - Actions
          • Unit - Set life of Arena_Duel_HeroDeclaringDuel to 100.00%
          • Unit - Set mana of Arena_Duel_HeroDeclaringDuel to 100.00%
          • Camera - Reset camera for Arena_Duel_PlayerDeclaringDuel to standard game-view over 0.00 seconds
          • Camera - Pan camera for Arena_Duel_PlayerDeclaringDuel to (Center of Arena Duel Area Enter Return <gen>) over 0.00 seconds
          • Unit - Add classification of An Ancient to Arena_Duel_HeroAcceptingDuel
          • Unit - Add classification of An Ancient to Arena_Duel_HeroDeclaringDuel
          • Player - Make Arena_Duel_PlayerAcceptingDuel treat Arena_Duel_PlayerDeclaringDuel as an Ally with shared vision
          • Player - Make Arena_Duel_PlayerDeclaringDuel treat Arena_Duel_PlayerAcceptingDuel as an Ally with shared vision
          • Unit Group - Pick every unit in (Units in Arena Duel Area Duel Zone <gen>) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Not equal to Neutral Passive
                  • (Owner of (Picked unit)) Not equal to Player 11 (Dark Green)
                  • (Unit-type of (Picked unit)) Not equal to Faerie Dragon
                  • ((Picked unit) is A Hero) Equal to False
                • Then - Actions
                  • Unit - Kill (Picked unit)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00FF0303 + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c000042FF + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 3 (Teal)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c001CE6B9 + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00540081 + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 5 (Yellow)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00FFFC01 + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00fEBA0E + (Name of Arena_Duel_PlayerDeclaringDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to Arena_Duel_HeroDeclaringDuel
        • Then - Actions
          • Unit - Move Arena_Duel_HeroAcceptingDuel instantly to (Center of Arena Duel Area Enter Return <gen>)
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Arena_Duel_PlayerAcceptingDuel
                • Then - Actions
                  • Set Disable_Teleport_Spell[(Player number of (Owner of (Picked unit)))] = True
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Arena_Duel_PlayerDeclaringDuel
                • Then - Actions
                  • Set Disable_Teleport_Spell[(Player number of (Owner of (Picked unit)))] = True
                • Else - Actions
          • Unit - Set life of Arena_Duel_HeroAcceptingDuel to 100.00%
          • Unit - Set mana of Arena_Duel_HeroAcceptingDuel to 100.00%
          • Camera - Reset camera for Arena_Duel_PlayerAcceptingDuel to standard game-view over 0.00 seconds
          • Camera - Pan camera for Arena_Duel_PlayerAcceptingDuel to (Center of Arena Duel Area Enter Return <gen>) over 0.00 seconds
          • Unit - Add classification of An Ancient to Arena_Duel_HeroAcceptingDuel
          • Unit - Add classification of An Ancient to Arena_Duel_HeroDeclaringDuel
          • Player - Make Arena_Duel_PlayerAcceptingDuel treat Arena_Duel_PlayerDeclaringDuel as an Ally with shared vision
          • Player - Make Arena_Duel_PlayerDeclaringDuel treat Arena_Duel_PlayerAcceptingDuel as an Ally with shared vision
          • Unit Group - Pick every unit in (Units in Arena Duel Area Duel Zone <gen>) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Not equal to Neutral Passive
                  • (Owner of (Picked unit)) Not equal to Player 11 (Dark Green)
                  • (Unit-type of (Picked unit)) Not equal to Faerie Dragon
                  • ((Picked unit) is A Hero) Equal to False
                • Then - Actions
                  • Unit - Kill (Picked unit)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 1 (Red)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00FF0303 + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c000042FF + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 3 (Teal)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c001CE6B9 + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 4 (Purple)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00540081 + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 5 (Yellow)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00FFFC01 + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player 6 (Orange)
            • Then - Actions
              • Game - Display to (All players) for 5.00 seconds the text: (|c00f9f900Dueling Referee:|r + ((|c00fEBA0E + (Name of Arena_Duel_PlayerAcceptingDuel)) + |c0096ecf5Has won the duel!!))
            • Else - Actions
        • Else - Actions
Ok... SO:
  • Sometimes what happens is when you click a button it pauses you and does nothing @ all when your the one declaring the duel. Which doesn't make any sense @ all.
  • Also, sometimes it will freeze both units and pause them and do nothing else. Sometimes after it get's both players into the duel, after 1 player wins the winner trigger doesn't fire and the player is stuck in the dueling pit. Also, if player gets out by other player killing him players remain enemies and don't have Ancient classification anymore.
  • Sometimes also after being frozen (you can use teleport to unfreeze yourself) and the hero's armor will be invulnerable.

Can anyone see where I went wrong cause it's driving me crazy!!
 
Last edited:
Level 8
Joined
Jul 22, 2008
Messages
331
cheee
try not to pause units, or try to move triggers pause/unpause
EDIT:why were you used array variables when you did this like you could without them?
simplify your triggers a little. my advice

EDIT2: and you have action for every integer numer from 1 to 12
 
Level 4
Joined
May 18, 2004
Messages
60
cheee
try not to pause units, or try to move triggers pause/unpause
EDIT:why were you used array variables when you did this like you could without them?
simplify your triggers a little. my advice

EDIT2: and you have action for every integer numer from 1 to 12

Well I pause and make unit invulnerable because if the person that get's the request is out fighting mobs he will most likely die. The array for Cleric_Active, Druid_Active ETC. state if that player currently has an active quest. The players_current_hero array if for their active hero and I guess I could simply this.

Where do you see "you have action for every integer numer from 1 to 12?" I just went threw the whole thing and didn't see any...

I'll try to go threw the whole thing today and try to simply it some more.

And to by the hell, I can't use loops for this trigger >.>
 
Level 4
Joined
May 18, 2004
Messages
60
Well, I would do for 1 to 6 cause there is only 6 players, but @ the same time, I don't think it would work.

How can I do a loop to check if player X has NO active quest and player (initializing duel) doesn't either?

-Update-
I posted the simplified triggers as much as I could get them. The only one that could use more is the "Duel Players" one but HOW do you run loops with different dialog buttons being clicked as wells as the quest active issue stated above?
 
Level 2
Joined
Aug 31, 2008
Messages
22
An example for your first trigger :

  • For each (Integer A) 1 to 6 do actions :
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Player (Integer A) slot status) Equal to Is playing
        • (Player (Integer A) controller) Equal to User
      • Then - Actions
        • Dialog - Create a dialog button for Arena_Duel labelled ((|c00FF0303 + (Name of Player (Integer A))) + (( |c00f9f900( + |c00f9f900Lv ) + (|c00FF0303 + ((String((Hero level of Players_Current_Hero[1]))) + ( |c00afafd8 + ((Name of Players_Current_Hero[1]) + |c00f9f900)))))))
        • Set Arena_Duel_Player1 = (Last created dialog Button)
        • Dialog - Change the title of Arena_Duel_Accept to ((Duel + (|c00FF0303 + (Name of Arena_Duel_PlayerDeclaringDuel))) + ( |c00f9f900: + ((|c00afafd8 + (Name of Arena_Duel_HeroDeclaringDuel)) + (( |c00f9f900( + (|c00f9f900 + Lv )) + ((|c00ff2020 + (String((Hero level of Arena_Duel_HeroDeclaringDuel)))) + (|c0
      • Else - Actions
Pretty hard huh ?
 
Level 4
Joined
May 18, 2004
Messages
60
Haha. No that is easy to do. The hard one was the one I posted about specifically...

I think this might work:

  • Duel Players
    • Events
      • Dialog - A dialog button is clicked for Arena_Duel
    • Conditions
      • Arena_Duel_On Equal to True
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Not equal to Arena_Duel_PlayerDeclaringDuel
              • (Clicked dialog button) Equal to Arena_Duel_Players[(Integer A)]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Quests_Cleric_Active[(Integer A)] Equal to False
                  • Quests_Druid_Active[(Integer A)] Equal to False
                  • Quests_Ranger_Active[(Integer A)] Equal to False
                  • Quests_Sorcerer_Active[(Integer A)] Equal to False
                  • Quests_Thief_Active[(Integer A)] Equal to False
                  • Quests_Warrior_Active[(Integer A)] Equal to False
                  • Quests_Cleric_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Druid_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Ranger_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Sorcerer_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Thief_Active[(Player number of (Triggering player))] Equal to False
                  • Quests_Warrior_Active[(Player number of (Triggering player))] Equal to False
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Picked unit)) Equal to Players[(Integer A)]
                          • ((Picked unit) is A Hero) Equal to True
                        • Then - Actions
                          • Set Arena_Duel_HeroAcceptingDuel = Players_Current_Hero[(Player number of (Owner of (Picked unit)))]
                          • Unit - Make (Picked unit) Invulnerable
                          • Dialog - Show Arena_Duel_Accept for (Owner of (Picked unit))
                          • Game - Display to Arena_Duel_PlayerDeclaringDuel, at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Sending r...
                          • Trigger - Run Is Player Idle <gen> (checking conditions)
                        • Else - Actions
                • Else - Actions
                  • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5Either yo...
                  • Set Arena_Duel_On = False
            • Else - Actions
              • Game - Display to (Triggering player), at offset (0.00, 0.00) for 5.00 seconds the text: |c0096ecf5You can't...
              • Set Arena_Duel_On = False
 
Status
Not open for further replies.
Top