• 🏆 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] Need help about Duel System.

Status
Not open for further replies.
Level 11
Joined
Aug 1, 2009
Messages
714
Ok. I think this will work but I am not satisfied about my Duel System.
I made it all. no copy paste on some sites so I don't think it will work very good.
My Duel System works when a player orders his "stash" ability called "Duel a Hero" to an hostile hero. If both of the challenger and the champion are playing, there will be a dialog appear for the challenger to select Yes and No. If either of the challenger or the champion are playing, they are automatically teleport to the arena. So can you tell me if there is something wrong with these triggers.
  • Duel Select
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Duel a Hero - Stashes
      • ((Target unit of ability being cast) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Duel_Boolean Equal to False
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) has an item of type Duel Ticket) Equal to True
              • (Hero_Unit[(Player number of (Owner of (Triggering unit)))] has an item of type Duel Ticket) Equal to True
            • Then - Actions
              • Set Duel_Boolean = True
              • Set Duel_Champion = Hero_Unit[(Player number of (Owner of (Triggering unit)))]
              • Set Duel_Challenger = (Target unit of ability being cast)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of Duel_Challenger) slot status) Equal to Is playing
                  • ((Owner of Duel_Champion) slot status) Equal to Is playing
                • Then - Actions
                  • Dialog - Change the title of Duel_Dialog to Accept Duel?
                  • Dialog - Create a dialog button for Duel_Dialog labelled No
                  • Set Duel_Dialog_Button1 = (Last created dialog Button)
                  • Dialog - Create a dialog button for Duel_Dialog labelled Yes
                  • Set Duel_Dialog_Button2 = (Last created dialog Button)
                  • Dialog - Show Duel_Dialog for (Owner of Duel_Challenger)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Duel_Champion belongs to an ally of Player 6 (Orange)) Equal to True
                    • Then - Actions
                      • Set Cave_Point = (Center of Light Dueler <gen>)
                      • Unit - Move Duel_Champion instantly to Cave_Point
                      • Custom script: call RemoveLocation (udg_Cave_Point)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Duel_Challenger belongs to an ally of Player 6 (Orange)) Equal to True
                    • Then - Actions
                      • Set Cave_Point = (Center of Light Dueler <gen>)
                      • Unit - Move Duel_Challenger instantly to Cave_Point
                      • Custom script: call RemoveLocation (udg_Cave_Point)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Duel_Champion belongs to an ally of Player 12 (Brown)) Equal to True
                    • Then - Actions
                      • Set Cave_Point = (Center of Dark Dueler <gen>)
                      • Unit - Move Duel_Champion instantly to Cave_Point
                      • Custom script: call RemoveLocation (udg_Cave_Point)
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Duel_Challenger belongs to an ally of Player 12 (Brown)) Equal to True
                    • Then - Actions
                      • Set Cave_Point = (Center of Dark Dueler <gen>)
                      • Unit - Move Duel_Challenger instantly to Cave_Point
                      • Custom script: call RemoveLocation (udg_Cave_Point)
                    • Else - Actions
                  • Item - Remove (Item carried by Duel_Challenger of type Duel Ticket)
                  • Item - Remove (Item carried by Duel_Champion of type Duel Ticket)
                  • Game - Display to (All players) for 15.00 seconds the text: (The duel battle between + (String_Player_Color[(Player number of (Owner of Duel_Champion))] + (String_Player_ChangeName[(Player number of (Owner of Duel_Champion))] + (|r and + (String_Player_Color[(Player number of (Owner of Duel_Challenger))] + (String_P
            • Else - Actions
              • Set PGroup = (Player group((Owner of (Triggering unit))))
              • Cinematic - Clear the screen of text messages for PGroup
              • Game - Display to PGroup for 5.00 seconds the text: (String_Player_Color[5] + The targeted hero or your hero doesn't have a Duel Ticket.|r)
              • Custom script: call DestroyForce(udg_PGroup)
        • Else - Actions
          • Set PGroup = (Player group((Owner of (Triggering unit))))
          • Cinematic - Clear the screen of text messages for PGroup
          • Game - Display to PGroup for 5.00 seconds the text: (String_Player_Color[5] + Somebody is in a duel now.|r)
          • Custom script: call DestroyForce(udg_PGroup)
  • Duel Declined
    • Events
      • Dialog - A dialog button is clicked for Duel_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Duel_Dialog_Button1
    • Actions
      • Set Duel_Boolean = False
      • Set Duel_Challenger = No unit
      • Set Duel_Champion = No unit
      • Dialog - Clear Duel_Dialog
      • Dialog - Hide Duel_Dialog for (Owner of Duel_Challenger)
      • Set PGroup = (Player group((Owner of Duel_Champion)))
      • Game - Display to PGroup for 5.00 seconds the text: Your request to due...
      • Custom script: call DestroyForce(udg_PGroup)
  • Duel Accept
    • Events
      • Dialog - A dialog button is clicked for Duel_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Duel_Dialog_Button2
    • Actions
      • Dialog - Clear Duel_Dialog
      • Dialog - Hide Duel_Dialog for (Owner of Duel_Challenger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Champion belongs to an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Light Dueler <gen>)
          • Unit - Move Duel_Champion instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Challenger belongs to an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Light Dueler <gen>)
          • Unit - Move Duel_Challenger instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Champion belongs to an ally of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Dark Dueler <gen>)
          • Unit - Move Duel_Champion instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Challenger belongs to an ally of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Dark Dueler <gen>)
          • Unit - Move Duel_Challenger instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • Item - Remove (Item carried by Duel_Challenger of type Duel Ticket)
      • Item - Remove (Item carried by Duel_Champion of type Duel Ticket)
      • Game - Display to (All players) for 15.00 seconds the text: (The duel battle between + (String_Player_Color[(Player number of (Owner of Duel_Champion))] + (String_Player_ChangeName[(Player number of (Owner of Duel_Champion))] + (|r and + (String_Player_Color[(Player number of (Owner of Duel_Challenger))] + (String_P
  • Declare Winner
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Killing unit)) Equal to Player 1 (Red)
          • (Owner of (Killing unit)) Equal to Player 2 (Blue)
          • (Owner of (Killing unit)) Equal to Player 3 (Teal)
          • (Owner of (Killing unit)) Equal to Player 4 (Purple)
          • (Owner of (Killing unit)) Equal to Player 5 (Yellow)
          • (Owner of (Killing unit)) Equal to Player 7 (Green)
          • (Owner of (Killing unit)) Equal to Player 8 (Pink)
          • (Owner of (Killing unit)) Equal to Player 9 (Gray)
          • (Owner of (Killing unit)) Equal to Player 10 (Light Blue)
          • (Owner of (Killing unit)) Equal to Player 11 (Dark Green)
      • (Duel Zone <gen> contains (Dying unit)) Equal to True
    • Actions
      • Set Duel_Boolean = False
      • Set Duel_Winner = (Killing unit)
      • Set Duel_Challenger = No unit
      • Set Duel_Champion = No unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Winner belongs to an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Market Place Team 1 Exit <gen>)
          • Unit - Move Duel_Winner instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Duel_Winner belongs to an ally of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Set Cave_Point = (Center of Market Place Team 2 Exit <gen>)
          • Unit - Move Duel_Winner instantly to Cave_Point
          • Custom script: call RemoveLocation (udg_Cave_Point)
        • Else - Actions
      • Game - Display to (All players) for 15.00 seconds the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + ((String_Hero_Die[(Random integer number between 1 and 7)] + (String_Player_Color[(Player number of (Owner of (Dyin
      • Player - Add (250 + (5 + (Level of (Dying unit)))) to (Owner of (Killing unit)) Current gold
      • Player - Add (25 x Spree_Number[(Player number of (Owner of (Dying unit)))]) to (Owner of (Killing unit)) Current gold
      • Set Gold_Make_Point = (Position of (Dying unit))
      • Floating Text - Create floating text that reads (String_Player_Color[5] + (+ + ((String((250 + (5 x (Level of (Dying unit)))))) + |r))) at Gold_Make_Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Hide (Last created floating text) for (All players)
      • Set PGroup = (Player group((Owner of (Killing unit))))
      • Floating Text - Show (Last created floating text) for PGroup
      • Custom script: call DestroyForce(udg_PGroup)
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 2.25 seconds
      • Custom script: call RemoveLocation (udg_Gold_Make_Point)
      • Game - Display to (All players) for 15.00 seconds the text: (String_Player_Color[(Player number of (Owner of Duel_Winner))] + (String_Player_ChangeName[(Player number of (Owner of Duel_Winner))] + (|r has beat + (String_Player_Color[(Player number of (Owner of (Dying unit)))] + (String_Player_ChangeName[(Player numbe
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Duel_Champion Equal to (Dying unit)
        • Then - Actions
          • Player - Set (Owner of (Dying unit)) Current gold to (((Owner of (Dying unit)) Current gold) - 750)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Duel_Challenger Equal to (Dying unit)
        • Then - Actions
          • Player - Set (Owner of (Dying unit)) Current gold to (((Owner of (Dying unit)) Current gold) - 500)
        • Else - Actions
      • Player - Add 2500 to (Owner of Duel_Winner) Current gold
      • Set Hero_Unit_Point = (Position of Duel_Winner)
      • Floating Text - Create floating text that reads (String_Player_Color[5] + +2500|r) at Hero_Unit_Point with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Hide (Last created floating text) for (All players)
      • Set PGroup = (Player group((Owner of Duel_Winner)))
      • Floating Text - Show (Last created floating text) for PGroup
      • Custom script: call DestroyForce(udg_PGroup)
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 2.25 seconds
      • -------- Multiboards --------
      • Set Kill_Type_Hero[(Player number of (Owner of (Killing unit)))] = (Kill_Type_Hero[(Player number of (Owner of (Killing unit)))] + 1)
      • Set Kill_Type_Hero_Death[(Player number of (Owner of (Dying unit)))] = (Kill_Type_Hero_Death[(Player number of (Owner of (Dying unit)))] + 1)
      • Multiboard - Set the text for Multiboard item in column 3, row Multi_Number[(Player number of (Owner of (Killing unit)))] to (String_Player_Color[(Player number of (Owner of (Killing unit)))] + ( + ((String(Kill_Type_Hero[(Player number of (Owner of (Killing unit)))])) + (= + ((String(Kill_Type_Hero_Death[(Player number of (Owner of (Killing unit)))])) + |r)))))
      • Multiboard - Set the text for Multiboard item in column 3, row Multi_Number[(Player number of (Owner of (Dying unit)))] to (String_Player_Color[(Player number of (Owner of (Dying unit)))] + ( + ((String(Kill_Type_Hero[(Player number of (Owner of (Dying unit)))])) + (= + ((String(Kill_Type_Hero_Death[(Player number of (Owner of (Dying unit)))])) + |r)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) belongs to an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Kill_Type_Hero_Team[1] = (Kill_Type_Hero_Team[1] + 3)
          • Multiboard - Set the text for Multiboard item in column 3, row 7 to (String_Player_Color[6] + ((<Empty String> + ) + ((String(Kill_Type_Hero_Team[1])) + (= + ((String(Kill_Type_Hero_Death_Team[1])) + |r)))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 6 (Orange)) Equal to True
        • Then - Actions
          • Set Kill_Type_Hero_Death_Team[1] = (Kill_Type_Hero_Death_Team[1] + 1)
          • Multiboard - Set the text for Multiboard item in column 3, row 7 to (String_Player_Color[6] + ((<Empty String> + ) + ((String(Kill_Type_Hero_Team[1])) + (= + ((String(Kill_Type_Hero_Death_Team[1])) + |r)))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) belongs to an ally of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Set Kill_Type_Hero_Team[2] = (Kill_Type_Hero_Team[2] + 3)
          • Multiboard - Set the text for Multiboard item in column 3, row 14 to (String_Player_Color[12] + ((<Empty String> + ) + ((String(Kill_Type_Hero_Team[2])) + (= + ((String(Kill_Type_Hero_Death_Team[2])) + |r)))))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of Player 12 (Brown)) Equal to True
        • Then - Actions
          • Set Kill_Type_Hero_Death_Team[2] = (Kill_Type_Hero_Death_Team[2] + 1)
          • Multiboard - Set the text for Multiboard item in column 3, row 14 to (String_Player_Color[12] + ((<Empty String> + ) + ((String(Kill_Type_Hero_Team[2])) + (= + ((String(Kill_Type_Hero_Death_Team[2])) + |r)))))
        • Else - Actions
      • -------- Sprees --------
      • Set Spree_Number[(Player number of (Owner of (Killing unit)))] = (Spree_Number[(Player number of (Owner of (Killing unit)))] + 1)
      • Set Spree_Number[(Player number of (Owner of (Dying unit)))] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 3
        • Then - Actions
          • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is on a + (String_Player_Color[7] + killing spree|r! Kill him and you get an additional 75 gold!)))
          • Sound - Play Sound_Killing_Spree
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 4
            • Then - Actions
              • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is + (String_Player_Color[4] + dominating|r! Kill him and you get an additional 100 gold!)))
              • Sound - Play Sound_Dominating
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 5
                • Then - Actions
                  • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is on a + (String_Player_Color[8] + megakill|r! Kill him and you get an additional 125 gold!)))
                  • Sound - Play Sound_Mega_Kill
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 6
                    • Then - Actions
                      • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is + (String_Player_Color[6] + unstoppable|r! Kill him and you get an additional 150 gold!)))
                      • Sound - Play Sound_Unstoppable
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 7
                        • Then - Actions
                          • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is + (String_Player_Color[9] + wicked sick|r! Kill him and you get an additional 175 gold!)))
                          • Sound - Play Sound_Wicked_Sick
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 8
                            • Then - Actions
                              • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is on a + (String_Player_Color[10] + monster kill|r! Kill him and you get an additional 200 gold!)))
                              • Sound - Play Sound_Monster_Kill
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Spree_Number[(Player number of (Owner of (Killing unit)))] Equal to 9
                                • Then - Actions
                                  • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is + (String_Player_Color[1] + God Like|r! Kill him and you get an additional 225 gold!)))
                                  • Sound - Play Sound_GodLike
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Spree_Number[(Player number of (Owner of (Killing unit)))] Greater than or equal to 10
                                    • Then - Actions
                                      • Game - Display to (All players) the text: ((String_Player_Color[(Player number of (Owner of (Killing unit)))] + String_Player_ChangeName[(Player number of (Owner of (Killing unit)))]) + (|r is + (String_Player_Color[1] + (Beyond God Like|r! Somebody Kill him and you get an additional + (String_Play
                                      • Sound - Play Sound_Beyond_GodLike
                                    • Else - Actions
  • Duel Area Restriction
    • Events
      • Unit - A unit enters Duel Zone <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Entering unit) Not equal to Duel_Champion
          • (Entering unit) Not equal to Duel_Challenger
    • Actions
      • Item - Remove (Item carried by (Entering unit) of type Duel Ticket)
      • Set Cave_Point = (Center of Black Marketplace <gen>)
      • Unit - Move (Entering unit) instantly to Cave_Point
      • Custom script: call RemoveLocation (udg_Cave_Point)
      • Set PGroup = (Player group((Owner of (Entering unit))))
      • Game - Display to PGroup for 5.00 seconds the text: (You do not have a + |c00ff0000D|r|c00ea1515u|r|c00d52a2ae|r|c00c03f3fl|r|c00ab5454 |r|c00966969T|r|c00817e7ei|r|c006c9393c|r|c0057a8a8k|r|c0042bdbde|r|c002dd2d2t|r|c0018e7e7!|r)
      • Custom script: call DestroyForce(udg_PGroup)
 
Status
Not open for further replies.
Top