• 🏆 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!

Custom Duel System v1.9b

  • Like
Reactions: Mumbis
Hello! The system is very simple and easy to use. All you have to do is to type -duel 1,2,3...
To accept or reject type -accept or -reject
When duel starts two heroes will be moved to Duel Region and other units in play map area are paused to prevent help from other units. To win the duel you must defeat the enemy and then duel will be finished.
If you find any bugs or have something to suggest tell it.
Updates

v1.0 - created;
v1.1 - fixed crashes;
v1.2 - some minor changes;
v1.3 - fixed some bugs;
added -accept and -reject commands to test the duel by your self;
v1.4 - cleared some leaks;
removed Food Cost and Point Value from dummy;
v1.5 - unit that lost the duel will be ressurected;
v1.6 - fixed two more leaks;
v1.7 - some few changes and more documentation;
- added option where you can change if duel heroes are allies you still can fight;
v1.8 - fixed the point locations of reviving;
- fixed the text;
v1.9 - added possibilty to invite friends for duels;
- all positive and negative buffs will be removed from units in CDS region.
Give credits if you use it!

  • CDS Settings
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ------------------------------------- --------
      • -------- SETTINGS FOR THE SYSTEM, FEEL FREE TO MODIFY AS YOU WANT --------
      • -------- ------------------------------------- --------
      • Set CDS_On = False
      • -------- ------------------------------------- --------
      • -------- Dummy is used as camera target, so later we lock camera to dummy. --------
      • -------- ------------------------------------- --------
      • Set CDS_Dummy = Dummy 1
      • -------- ------------------------------------- --------
      • -------- Region is the place where duel will be performed --------
      • -------- Don't forget to create region bigger in radius then 300 because in trigger CDS Create Duel i set the points in region offset by 300! --------
      • -------- ------------------------------------- --------
      • Set CDS_Region = Duel Region <gen>
      • Set CDS_Point[3] = (Center of CDS_Region)
      • -------- ------------------------------------- --------
      • -------- Now we set the point where units will be moved during duel --------
      • -------- ------------------------------------- --------
      • Set CDS_Point[1] = (CDS_Point[3] offset by 300.00 towards 300.00 degrees)
      • Set CDS_Point[2] = (CDS_Point[3] offset by 300.00 towards 150.00 degrees)
      • -------- ------------------------------------- --------
      • -------- DS_Seconds is the time in which oponent has to answer if he'll go to duel or not. --------
      • -------- ------------------------------------- --------
      • Set CDS_Seconds = 15.00
      • -------- ------------------------------------- --------
      • -------- Now we create dummy at center of region, where camera will be locked. --------
      • -------- ------------------------------------- --------
      • Unit - Create 1 CDS_Dummy for Neutral Passive at CDS_Point[3] facing Default building facing degrees
      • Set CDS_LockPoint = (Last created unit)
      • -------- ------------------------------------- --------
      • -------- If you want to call allied units to duel set next variable to true --------
      • -------- ------------------------------------- --------
      • Set CDS_AliiesCanFight = True
      • -------- ------------------------------------- --------
      • -------- Create some effects --------
      • -------- ------------------------------------- --------
      • Set CDS_Point2[1] = (Point((Max X of CDS_Region), (Max Y of CDS_Region)))
      • Set CDS_Point2[2] = (Point((Max X of CDS_Region), (Min Y of CDS_Region)))
      • Set CDS_Point2[3] = (Point((Min X of CDS_Region), (Min Y of CDS_Region)))
      • Set CDS_Point2[4] = (Point((Min X of CDS_Region), (Max Y of CDS_Region)))
      • Lightning - Create a Chain Lightning - Primary lightning effect from source CDS_Point2[1] to target CDS_Point2[2]
      • Lightning - Create a Chain Lightning - Primary lightning effect from source CDS_Point2[2] to target CDS_Point2[3]
      • Lightning - Create a Chain Lightning - Primary lightning effect from source CDS_Point2[3] to target CDS_Point2[4]
      • Lightning - Create a Chain Lightning - Primary lightning effect from source CDS_Point2[4] to target CDS_Point2[1]
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_CDS_Point2[GetForLoopIndexA()])
  • CDS Ask for Duel
    • Events
      • Player - Player 1 (Red) types a chat message containing -duel as A substring
      • Player - Player 2 (Blue) types a chat message containing -duel as A substring
      • Player - Player 3 (Teal) types a chat message containing -duel as A substring
      • Player - Player 4 (Purple) types a chat message containing -duel as A substring
      • Player - Player 5 (Yellow) types a chat message containing -duel as A substring
      • Player - Player 6 (Orange) types a chat message containing -duel as A substring
      • Player - Player 7 (Green) types a chat message containing -duel as A substring
      • Player - Player 8 (Pink) types a chat message containing -duel as A substring
      • Player - Player 9 (Gray) types a chat message containing -duel as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -duel as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -duel as A substring
      • Player - Player 12 (Brown) types a chat message containing -duel as A substring
    • Conditions
    • Actions
      • -------- If duel is in progress inform the player --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CDS_On Equal to True
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312Duel is i...
        • Else - Actions
      • -------- Setting variables --------
      • -------- Turn on triggers where we can accept or reject the duel. --------
      • Trigger - Turn on CDS Vote Yes <gen>
      • Trigger - Turn on CDS Vote No <gen>
      • -------- Now we set the player that was entered in massage --------
      • Set CDS_Player_Number = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • -------- Check if that player is the right one --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • CDS_Player_Number Greater than or equal to 1
              • CDS_Player_Number Less than or equal to 12
              • CDS_Player_Number Equal to (Integer((Substring((Entered chat string), 7, (Integer((Entered chat string)))))))
        • Then - Actions
          • -------- First player is the player that has been asked for duel or entered in massage --------
          • Set CDS_Player[1] = CDS_Player_Number
          • -------- Second player is the one who asked for duel --------
          • Set CDS_Player[2] = (Player number of (Triggering player))
          • -------- Check if asking player didn't type duel with himself --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player(CDS_Player[2])) Equal to (Player(CDS_Player[1]))
            • Then - Actions
              • Game - Display to (Player group((Triggering player))) the text: |cfffed312You canno...
              • Skip remaining actions
            • Else - Actions
          • -------- Chek if duel isn't already in progress --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDS_On Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CDS_AliiesCanFight Equal to True
                • Then - Actions
                  • -------- Start the timer --------
                  • Countdown Timer - Start CDS_Timer as a One-shot timer that will expire in CDS_Seconds seconds
                  • Set CDS_On = True
                  • Game - Display to (Player group((Player(CDS_Player[1])))) the text: (|cfffed312 + ((Name of (Player(CDS_Player[2]))) + wants to fight with you in duel. If you want to fight type "-accept" or "-reject' to give up.))
                  • Game - Display to (Player group((Player(CDS_Player[2])))) the text: (|cfffed312You asked for duel with player + (Name of (Player(CDS_Player[1]))))
                  • -------- Now we must wait until second player accepts the duel offer or rejects --------
                • Else - Actions
                  • -------- If they are enemies we turn on the duel --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(CDS_Player[1])) is an enemy of (Player(CDS_Player[2]))) Equal to True
                    • Then - Actions
                      • -------- Start the timer --------
                      • Countdown Timer - Start CDS_Timer as a One-shot timer that will expire in CDS_Seconds seconds
                      • Set CDS_On = True
                      • Game - Display to (Player group((Player(CDS_Player[1])))) the text: (|cfffed312 + ((String(CDS_Player[1])) + wants to fight with you in duel. If you want to fight type "-accept" or "-reject' to give up.))
                      • Game - Display to (Player group((Player(CDS_Player[2])))) the text: (|cfffed312You asked for duel with player + (Name of (Player(CDS_Player[1]))))
                      • -------- Now we must wait until second player accepts the duel offer or rejects --------
                    • Else - Actions
                      • -------- If the player picked fight with ally he won't be able to fight with him. --------
                      • Game - Display to (Player group((Player(CDS_Player[2])))) the text: |cfffed312You can o...
            • Else - Actions
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312You can o...
  • CDS Invite
    • Events
      • Player - Player 1 (Red) types a chat message containing -invite as A substring
      • Player - Player 2 (Blue) types a chat message containing -invite as A substring
      • Player - Player 3 (Teal) types a chat message containing -invite as A substring
      • Player - Player 4 (Purple) types a chat message containing -invite as A substring
      • Player - Player 5 (Yellow) types a chat message containing -invite as A substring
      • Player - Player 6 (Orange) types a chat message containing -invite as A substring
      • Player - Player 7 (Green) types a chat message containing -invite as A substring
      • Player - Player 8 (Pink) types a chat message containing -invite as A substring
      • Player - Player 9 (Gray) types a chat message containing -invite as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -invite as A substring
      • Player - Player 12 (Brown) types a chat message containing -invite as A substring
    • Conditions
    • Actions
      • -------- Checking if right player invites --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to (Player(CDS_Player[2]))
        • Then - Actions
          • -------- Settings index +1 to detect if the player wont invite anymore --------
          • Set CDS_Index[1] = (CDS_Index[1] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDS_Index[1] Equal to 1
            • Then - Actions
              • -------- Setting invited player --------
              • Set CDS_Player[3] = (Integer((Substring((Entered chat string), 9, (Length of (Entered chat string))))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CDS_Player[3] Greater than or equal to 1
                  • CDS_Player[3] Less than or equal to 12
                  • CDS_Player[3] Equal to (Integer((Substring((Entered chat string), 9, (Integer((Entered chat string)))))))
                  • CDS_Player[3] Not equal to CDS_Player[1]
                  • CDS_Player[3] Not equal to CDS_Player[2]
                • Then - Actions
                  • Game - Display to (All players) the text: (|cfffed312 + ((Name of (Triggering player)) + ( has invited + ((Name of (Player(CDS_Player[3]))) + for a duel.))))
                  • -------- Cheking if invited unit is an ally to inviting player --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(CDS_Player[3])) is an ally of (Triggering player)) Equal to True
                    • Then - Actions
                      • -------- Settings old mana, hit points, point e.t.c --------
                      • Set CDS_UnitGroup[3] = (Units owned by (Player(CDS_Player[3])) matching (((Matching unit) is A Hero) Equal to True))
                      • Unit Group - Pick every unit in CDS_UnitGroup[3] and do (Actions)
                        • Loop - Actions
                          • Set CDS_Unit[3] = (Picked unit)
                          • Set CDS_Unit_Life[3] = (Life of CDS_Unit[3])
                          • Set CDS_Unit_Mana[3] = (Mana of CDS_Unit[3])
                          • Set CDS_Positions[3] = (Position of (Picked unit))
                          • Unit - Move CDS_Unit[3] instantly to CDS_Point[2]
                    • Else - Actions
                • Else - Actions
                  • Game - Display to (Player group((Triggering player))) the text: |cfffed312You can o...
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: |cfffed312You alrea...
        • Else - Actions
      • -------- Checking if right player invites --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to (Player(CDS_Player[1]))
        • Then - Actions
          • -------- Settings index +1 to detect if the player wont invite anymore --------
          • Set CDS_Index[2] = (CDS_Index[2] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDS_Index[2] Equal to 1
            • Then - Actions
              • -------- Setting invited player --------
              • Set CDS_Player[4] = (Integer((Substring((Entered chat string), 9, (Length of (Entered chat string))))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CDS_Player[4] Greater than or equal to 1
                  • CDS_Player[4] Less than or equal to 12
                  • CDS_Player[4] Equal to (Integer((Substring((Entered chat string), 9, (Integer((Entered chat string)))))))
                  • CDS_Player[4] Not equal to CDS_Player[1]
                  • CDS_Player[4] Not equal to CDS_Player[2]
                • Then - Actions
                  • Game - Display to (All players) the text: (|cfffed312 + ((Name of (Triggering player)) + ( has invited + ((Name of (Player(CDS_Player[4]))) + for a duel.))))
                  • -------- Cheking if invited unit is an ally to inviting player --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(CDS_Player[4])) is an ally of (Triggering player)) Equal to True
                    • Then - Actions
                      • -------- Settings old mana, hit points, point e.t.c --------
                      • Set CDS_UnitGroup[4] = (Units owned by (Player(CDS_Player[3])) matching (((Matching unit) is A Hero) Equal to True))
                      • Unit Group - Pick every unit in CDS_UnitGroup[4] and do (Actions)
                        • Loop - Actions
                          • Set CDS_Unit[4] = (Picked unit)
                          • Set CDS_Unit_Life[4] = (Life of CDS_Unit[4])
                          • Set CDS_Unit_Mana[4] = (Mana of CDS_Unit[4])
                          • Set CDS_Positions[4] = (Position of (Picked unit))
                          • Unit - Move CDS_Unit[4] instantly to CDS_Point[1]
                    • Else - Actions
                • Else - Actions
                  • Game - Display to (Player group((Triggering player))) the text: |cfffed312You can o...
            • Else - Actions
              • Game - Display to (Player group((Triggering player))) the text: |cfffed312You alrea...
        • Else - Actions
      • -------- If players have invited their teammates, we start the battle --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • CDS_Index[1] Equal to 1
              • CDS_Index[2] Equal to 1
        • Then - Actions
          • Set CDS_Invited = True
          • Trigger - Run CDS Run Duel <gen> (checking conditions)
          • Trigger - Turn off CDS Start <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • CDS Start
    • Events
      • Player - Player 1 (Red) types a chat message containing -start as An exact match
      • Player - Player 2 (Blue) types a chat message containing -start as An exact match
      • Player - Player 3 (Teal) types a chat message containing -start as An exact match
      • Player - Player 4 (Purple) types a chat message containing -start as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -start as An exact match
      • Player - Player 6 (Orange) types a chat message containing -start as An exact match
      • Player - Player 7 (Green) types a chat message containing -start as An exact match
      • Player - Player 8 (Pink) types a chat message containing -start as An exact match
      • Player - Player 9 (Gray) types a chat message containing -start as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -start as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -start as An exact match
      • Player - Player 12 (Brown) types a chat message containing -start as An exact match
    • Conditions
    • Actions
      • -------- If someone doesn't want to invite we run the duel --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Triggering player) Equal to (Player(CDS_Player[1]))
              • (Triggering player) Equal to (Player(CDS_Player[2]))
        • Then - Actions
          • Game - Display to (Player group((Player(CDS_Player[1])))) the text: |cfffed312No teamma...
          • Game - Display to (Player group((Player(CDS_Player[2])))) the text: |cfffed312No teamma...
          • Trigger - Run CDS Run Duel <gen> (checking conditions)
          • Trigger - Turn off CDS Invite <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • CDS Create Duel
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on CDS Invite <gen>
      • Trigger - Turn on CDS Start <gen>
      • Game - Display to (Player group((Player(CDS_Player[1])))) the text: |cfffed312If you wi...
      • Game - Display to (Player group((Player(CDS_Player[2])))) the text: |cfffed312If you wi...
      • -------- If he accepted we set both units and move them to the Duel region. --------
      • -------- We also set the life and mana before duel, so the winner will come out with previous life and mana. --------
      • Set CDS_UnitGroup[1] = (Units owned by (Player(CDS_Player[1])) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in CDS_UnitGroup[1] and do (Actions)
        • Loop - Actions
          • Set CDS_Unit[1] = (Picked unit)
          • Set CDS_Unit_Life[1] = (Life of CDS_Unit[1])
          • Set CDS_Unit_Mana[1] = (Mana of CDS_Unit[1])
          • Set CDS_Positions[1] = (Position of (Picked unit))
          • Unit - Move CDS_Unit[1] instantly to CDS_Point[1]
      • Set CDS_UnitGroup[2] = (Units owned by (Player(CDS_Player[2])) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in CDS_UnitGroup[2] and do (Actions)
        • Loop - Actions
          • Set CDS_Unit[2] = (Picked unit)
          • Set CDS_Unit_Life[2] = (Life of CDS_Unit[2])
          • Set CDS_Unit_Mana[2] = (Mana of CDS_Unit[2])
          • Set CDS_Positions[2] = (Position of (Picked unit))
          • Unit - Move CDS_Unit[2] instantly to CDS_Point[2]
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • -------- Now we make other players to watch the duel so no one will cheat. --------
          • Camera - Pan camera for (Picked player) to CDS_Point[3] over 0.00 seconds
          • Camera - Lock camera target for (Picked player) to CDS_LockPoint, offset by (0.00, 0.00) using Default rotation
          • Custom script: call RemoveLocation(udg_CDS_Point[3])
          • Unit - Pause all units
      • -------- If allied units can fight then we make those players enemies --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player(CDS_Player[1])) is an ally of (Player(CDS_Player[2]))) Equal to True
        • Then - Actions
          • Set CDS_AllyCheck = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDS_AliiesCanFight Equal to True
            • Then - Actions
              • Player - Make (Owner of CDS_Unit[1]) treat (Owner of CDS_Unit[2]) as an Enemy
              • Player - Make (Owner of CDS_Unit[2]) treat (Owner of CDS_Unit[1]) as an Enemy
            • Else - Actions
        • Else - Actions
  • CDS Run Duel
    • Events
    • Conditions
    • Actions
      • Set CDS_UnitGroup[5] = (Units in CDS_Region)
      • Unit Group - Pick every unit in CDS_UnitGroup[5] and do (Actions)
        • Loop - Actions
          • Unit - Remove Positive buffs from (Picked unit)
          • Unit - Remove Negative buffs from (Picked unit)
      • Custom script: call DestroyGroup(udg_CDS_UnitGroup[5])
      • Unit - Unpause CDS_Unit[1]
      • Unit - Unpause CDS_Unit[2]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CDS_Invited Equal to True
        • Then - Actions
          • Unit - Unpause CDS_Unit[3]
          • Unit - Unpause CDS_Unit[4]
        • Else - Actions
      • Game - Display to (All players) the text: (|cfffed312The duel between + ((Name of (Owner of CDS_Unit[1])) + ( and + ((Name of (Owner of CDS_Unit[2])) + has started.))))
  • CDS Vote Yes
    • Events
      • Player - Player 1 (Red) types a chat message containing -accept as An exact match
      • Player - Player 2 (Blue) types a chat message containing -accept as An exact match
      • Player - Player 3 (Teal) types a chat message containing -accept as An exact match
      • Player - Player 4 (Purple) types a chat message containing -accept as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -accept as An exact match
      • Player - Player 6 (Orange) types a chat message containing -accept as An exact match
      • Player - Player 7 (Green) types a chat message containing -accept as An exact match
      • Player - Player 8 (Pink) types a chat message containing -accept as An exact match
      • Player - Player 9 (Gray) types a chat message containing -accept as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -accept as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -accept as An exact match
      • Player - Player 12 (Brown) types a chat message containing -accept as An exact match
    • Conditions
    • Actions
      • -------- Chek if the right player will answer --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player(CDS_Player[1])) Equal to (Triggering player)
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312You accep...
          • Game - Display to (Player group((Player(CDS_Player[2])))) the text: (|cfffed312 + ((Name of (Triggering player)) + has accepted duel offer.))
          • Set CDS_Accept = True
          • Set CDS_On = True
          • Trigger - Run CDS Create Duel <gen> (checking conditions)
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312You canno...
      • Trigger - Turn off (This trigger)
  • CDS Vote No
    • Events
      • Player - Player 1 (Red) types a chat message containing -reject as An exact match
      • Player - Player 2 (Blue) types a chat message containing -reject as An exact match
      • Player - Player 3 (Teal) types a chat message containing -reject as An exact match
      • Player - Player 4 (Purple) types a chat message containing -reject as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -reject as An exact match
      • Player - Player 6 (Orange) types a chat message containing -reject as An exact match
      • Player - Player 7 (Green) types a chat message containing -reject as An exact match
      • Player - Player 8 (Pink) types a chat message containing -reject as An exact match
      • Player - Player 9 (Gray) types a chat message containing -reject as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -reject as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -reject as An exact match
      • Player - Player 12 (Brown) types a chat message containing -reject as An exact match
    • Conditions
    • Actions
      • -------- Chek if the right player will answer --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player(CDS_Player[1])) Equal to (Triggering player)
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312You rejec...
          • Game - Display to (Player group((Player(CDS_Player[2])))) the text: (|cfffed312 + ((Name of (Triggering player)) + has rejected duel offer.))
          • Set CDS_Accept = False
          • Set CDS_On = False
          • Set CDS_AllyCheck = False
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |cfffed312You canno...
      • Trigger - Turn off (This trigger)
  • CDS Turn Off
    • Events
      • Time - CDS_Timer expires
    • Conditions
    • Actions
      • -------- Check if duel is in progress --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CDS_On Equal to True
        • Then - Actions
          • -------- Check if duel region contains both heroes --------
          • -------- If yes we do nothing, because duel is in progress --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (CDS_Region contains CDS_Unit[1]) Equal to True
                  • (CDS_Region contains CDS_Unit[2]) Equal to True
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
              • -------- If the ask timer expires we reject the duel. --------
              • Game - Display to (Player group((Player(CDS_Player[1])))) the text: |cfffed312Duel time...
              • Game - Display to (Player group((Player(CDS_Player[2])))) the text: |cfffed312Duel time...
              • -------- Remove leaks --------
              • Custom script: call DestroyGroup(udg_CDS_UnitGroup[1])
              • Custom script: call DestroyGroup(udg_CDS_UnitGroup[2])
              • Custom script: call RemoveLocation(udg_CDS_Positions[1])
              • Custom script: call RemoveLocation(udg_CDS_Positions[2])
              • Set CDS_Accept = False
              • Set CDS_On = False
              • Set CDS_AllyCheck = False
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CDS_Invited Equal to True
                • Then - Actions
                  • Set CDS_Index[1] = 0
                  • Set CDS_Index[2] = 0
                  • Custom script: call DestroyGroup(udg_CDS_UnitGroup[3])
                  • Custom script: call DestroyGroup(udg_CDS_UnitGroup[4])
                  • Custom script: call RemoveLocation(udg_CDS_Positions[3])
                  • Custom script: call RemoveLocation(udg_CDS_Positions[4])
                  • Set CDS_Invited = False
                • Else - Actions
        • Else - Actions
  • CDS Duel Is Over
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CDS_Invited Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Dying unit) is in CDS_UnitGroup[3]) Equal to True
            • Then - Actions
              • Hero - Instantly revive CDS_Unit[3] at CDS_Positions[3], Hide revival graphics
              • Unit - Move CDS_Unit[3] instantly to CDS_Positions[3]
              • Unit - Set life of CDS_Unit[3] to CDS_Unit_Life[3]
              • Unit - Set mana of CDS_Unit[3] to CDS_Unit_Mana[3]
              • Camera - Pan camera for (Owner of CDS_Unit[3]) to CDS_Positions[3] over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Dying unit) is in CDS_UnitGroup[4]) Equal to True
            • Then - Actions
              • Hero - Instantly revive CDS_Unit[4] at CDS_Positions[4], Hide revival graphics
              • Unit - Set life of CDS_Unit[4] to CDS_Unit_Life[4]
              • Unit - Set mana of CDS_Unit[4] to CDS_Unit_Mana[4]
              • Camera - Pan camera for (Owner of CDS_Unit[4]) to CDS_Positions[4] over 0.00 seconds
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Dying unit) is in CDS_UnitGroup[1]) Equal to True
              • ((Dying unit) is in CDS_UnitGroup[2]) Equal to True
        • Then - Actions
          • -------- If they where enemies in duel but before aliied, we make them allied again --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDS_AllyCheck Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CDS_AliiesCanFight Equal to True
                • Then - Actions
                  • Player - Make (Owner of CDS_Unit[1]) treat (Owner of CDS_Unit[2]) as an Ally with shared vision
                  • Player - Make (Owner of CDS_Unit[2]) treat (Owner of CDS_Unit[1]) as an Ally with shared vision
                • Else - Actions
            • Else - Actions
          • -------- If one of the duel heroes dies. Duel will be over and winner will be moved to hist old position with old hp and mp. --------
          • -------- Reward the winner. (not needed) --------
          • Player - Add 250 to (Owner of (Killing unit)) Current gold
          • Unit - Unpause all units
          • Game - Display to (All players) the text: (|cfffed312 + ((Name of (Owner of (Killing unit))) + has won the duel.))
          • -------- Reset all cameras to normal. --------
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Camera - Reset camera for (Picked player) to standard game-view over 0.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to CDS_Unit[1]
            • Then - Actions
              • Unit - Move CDS_Unit[2] instantly to CDS_Positions[2]
              • Unit - Set life of CDS_Unit[2] to CDS_Unit_Life[2]
              • Unit - Set mana of CDS_Unit[2] to CDS_Unit_Mana[2]
              • Camera - Pan camera for (Owner of CDS_Unit[2]) to CDS_Positions[2] over 0.00 seconds
              • Hero - Instantly revive CDS_Unit[1] at CDS_Positions[1], Hide revival graphics
              • Unit - Set life of CDS_Unit[1] to CDS_Unit_Life[1]
              • Unit - Set mana of CDS_Unit[1] to CDS_Unit_Mana[1]
              • Camera - Pan camera for (Owner of CDS_Unit[1]) to CDS_Positions[1] over 0.00 seconds
            • Else - Actions
              • Unit - Move CDS_Unit[1] instantly to CDS_Positions[1]
              • Unit - Set life of CDS_Unit[1] to CDS_Unit_Life[1]
              • Unit - Set mana of CDS_Unit[1] to CDS_Unit_Mana[1]
              • Camera - Pan camera for (Owner of CDS_Unit[1]) to CDS_Positions[1] over 0.00 seconds
              • Hero - Instantly revive CDS_Unit[2] at CDS_Positions[2], Hide revival graphics
              • Unit - Set life of CDS_Unit[2] to CDS_Unit_Life[2]
              • Unit - Set mana of CDS_Unit[2] to CDS_Unit_Mana[2]
              • Camera - Pan camera for (Owner of CDS_Unit[2]) to CDS_Positions[2] over 0.00 seconds
          • -------- Remove leaks --------
          • Custom script: call DestroyGroup(udg_CDS_UnitGroup[1])
          • Custom script: call DestroyGroup(udg_CDS_UnitGroup[2])
          • Custom script: call RemoveLocation(udg_CDS_Positions[1])
          • Custom script: call RemoveLocation(udg_CDS_Positions[2])
          • Set CDS_Accept = False
          • Set CDS_On = False
          • Set CDS_AllyCheck = False
        • Else - Actions
      • -------- If units where invited to the duel we set everything back to normal fot them and remove additional leaks --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CDS_Invited Equal to True
        • Then - Actions
          • Unit - Move CDS_Unit[3] instantly to CDS_Positions[3]
          • Unit - Set life of CDS_Unit[3] to CDS_Unit_Life[3]
          • Unit - Set mana of CDS_Unit[3] to CDS_Unit_Mana[3]
          • Camera - Pan camera for (Owner of CDS_Unit[3]) to CDS_Positions[3] over 0.00 seconds
          • Unit - Move CDS_Unit[4] instantly to CDS_Positions[4]
          • Unit - Set life of CDS_Unit[4] to CDS_Unit_Life[4]
          • Unit - Set mana of CDS_Unit[4] to CDS_Unit_Mana[4]
          • Camera - Pan camera for (Owner of CDS_Unit[4]) to CDS_Positions[4] over 0.00 seconds
          • Set CDS_Index[1] = 0
          • Set CDS_Index[2] = 0
          • Custom script: call DestroyGroup(udg_CDS_UnitGroup[3])
          • Custom script: call DestroyGroup(udg_CDS_UnitGroup[4])
          • Custom script: call RemoveLocation(udg_CDS_Positions[3])
          • Custom script: call RemoveLocation(udg_CDS_Positions[4])
          • Set CDS_Invited = False
        • Else - Actions
Keywords:
System, duel, hero, fight, battle
Contents

Custom Duel System (Map)

Reviews
17:08, 21st Dec 2010 The_Reborn_Devil: My review. Status: Approved Rating: Useful
Level 12
Joined
Apr 16, 2010
Messages
584
Did i spelt it wrong??? Seriously?
Make player answer your duel offer by creating a triggers with this action:
  • Accept
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Set CDS_Accept = True
      • Set CDS_On = True
The_Witcher also has made a better system than this but it is in JASS.
Yes i know but i don't know nothing about JASS so i needed GUI version for my map, i created and uploaded it.

Oh and how to spell accept?? Sorry don't know... omg In google is says Accept as i typed.
 
Last edited:
Level 12
Joined
Apr 16, 2010
Messages
584
when i write -duel # it says i cant fight with myself or smth and if i write -duel blue i got crash lolz

Maybe you get crash you suppose to type number not a word (like blue). I said -duel and number of player, like 1,2,3,4,5,6,7,8,9,10,11,12.
U can only fight with enemies in the test map there are 2 clans lol if you type number above 6 of course you cannot fight cuz he's your friend. So players 1,2,3,4,5,6 are clan 1 and players 7,8,9,10,11,12 are clan 2. Didn't see that??
If you want to fight with ally units then just remove this action
  • ((Player(CDS_Player[1])) is an enemy of (Player(CDS_Player[2]))) Equal to True
I really would like if you do the yes/no thingie with an dialog buttons..
I honestly hate typing for everything, it's kinda frustating..
Here you example why dialogs are bad at this point. If you are fighting or running away and suddenly dialog appears on your screen, you cannot control and you're dead... As for me typing is better.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
Moderator review:

You got some leaks in there. Stuff like "Center of <region>" and "<some location> offset by <distance> towards <direction> degrees" create locations that must be stored in variables and then removed with this:
  • Custom script: call RemoveLocation(udg_variableName)
This "(Units owned by (Player(CDS_Player[1])) matching (((Matching unit) is A Hero) Equal to true))" creates a unit group and it must be stored in a variable and destroyed with this:
  • Custom script: call DestroyGroup(udg_variableName)
Other than that the triggers look ok.



You still got two leaks left in the trigger "CDS Create Duel".
This:
  • Set CDS_Point[1] = ((Center of CDS_Region) offset by 300.00 towards 300.00 degrees)
And
  • Set CDS_Point[2] = ((Center of CDS_Region) offset by 300.00 towards 150.00 degrees)
"(Center of CDS_Region)" must be stored in a variable and then you use that variable in the polar projection.

I couldn't find any other leaks.


The triggering looks good now.
 
Last edited:
Level 4
Joined
Dec 4, 2010
Messages
63
I Have a question, If one of the players enter the arena it can back to its player start loc, or its main location?,, because it units have blink, they can enter and destruct duelers,, Got it???.. or it can use duel by 2v2 by inviting a team member, and when it full, 2 teams duel,,, it can be possible???... lol i think..
anyway,, this system was great,, 5/5 :)
 
Level 4
Joined
Dec 4, 2010
Messages
63
oh,,,,,, you got a point,, so you can answer my other question??
It can duel 2 teams? just like i said, me i will invite he when he accept, we are team, and others do what i do they also invite members, when teams are ready 2 of that teams are manage to duel, and also it can kick a member, lol so auetistic. it can be possible??...

"ONLY A SUGGESTION" :)

---------------------------------------------------------
 
Level 12
Joined
Apr 16, 2010
Messages
584
Oh i didn't notice the other question... sry...
Well you've got a great point there, it would be cool if someone could invite teammates to the duel, so i guess I'll make it...
Edit:
Except if they didn't buff the dueler right before entering :)
  • Actions
    • Set CDS_UnitGroup[5] = (Units in CDS_Region)
    • Unit Group - Pick every unit in CDS_UnitGroup[5] and do (Actions)
      • Loop - Actions
        • Unit - Remove Positive buffs from (Picked unit)
        • Unit - Remove Negative buffs from (Picked unit)
    • Custom script: call DestroyGroup(udg_CDS_UnitGroup[5])
Also i started making the new version few minutes ago, and i'm in great progress, but the only thing is that when i'll update i have no opportunity totest it in LAN so if any of you could do this, i'd be very thankful and gave rep and credits into system.
 
Last edited:
Level 4
Joined
Dec 4, 2010
Messages
63
oh,,, im glad to test your new version,. if you will,,, i will find bugs and some leaks as fast as i can,, and i will test it on Lan that sures the quality of the version,, lol....

I hope it works Properly.... another lol for me,,, :)
 
Level 4
Joined
Dec 4, 2010
Messages
63
Aside from Bugfree, i found a 2 bugs in my first test,
1, When im already invite a member, my teamate don't move otherwise paused,.
2, When the duel finished, my teamate don't back to its original position,,,

maybe in bug1, you forgot to unpause the CDS_Unit(3) and CDS_Unit(4).
In bug2 you may also forgot to back to its original position, instead back to its position on the duel zone,,, lol

i have a another suggestion,,,,, can do a yes/no system for inviting duel members?,,
to ensure if they accept or not to duel,,,,..... lol

next testing i will test it in Lan,,,
--------------------------------------------------------------------------
 
Level 4
Joined
Dec 4, 2010
Messages
63
i already test it in lan, many times already, from 1.9a-1.9b there was no bugs i've found last bugs i found was already fixed,..... and i have a new suggestion,,,,,

Actually, This was a Mod ,
If has 1v1 and 2v2 by inviting members,,, now it can be, 4vsAll.
Just like a random duel, haved no teams, no allies and all Nuetrals.

And Who has the last stading, has a winner,.. lol
I think its really cool, :)

-----------------------------------------------------------------
 
Level 7
Joined
Sep 8, 2011
Messages
211
This is awesome I have been using it for a long time :D

I just need to know how you would be able to have two heroes vs one or if player 1 has two heroes and he enters a duel, how to keep one of them out of the dueling arena (or stop them from becoming the actual dueling unit itself)

eg. I have a hunter hero that has a pet (also a hero) and I want to duel player 2 but when the duel starts i can't move the hunter only the pet. Either can you help me make it so both of the heroes can move/attack and only if the hunter dies they both port out. Or if you have the hunter hero your unable to type -duel or -accept.
 
Top