Template Duel

Exide

I am amazingly focused right now!
Reaction score
448
Hi.

I didn't have anything better to do, so I made a template for a Duel (triggers mainly).
I haven't had the chance to test it much (only 1v1), but I think it will work.

This template is meant to help new mappers with their maps.
However, some triggers require a bit of triggering knowledge. (Not for first-time mappers.)

All triggers are made in GUI.

Here are the Duel-related triggers (there are more triggers in the map):
Setup:
Code:
Forces
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Add Player 1 (Red) to Forces[1]
        Player Group - Add Player 2 (Blue) to Forces[1]
        Player Group - Add Player 3 (Teal) to Forces[1]
        -------- Force 1   /    Force 2 --------
        Player Group - Add Player 4 (Purple) to Forces[2]
        Player Group - Add Player 5 (Yellow) to Forces[2]
        Player Group - Add Player 6 (Orange) to Forces[2]

Code:
Visibility
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Hero Pick Area <gen>
                Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Battle Area <gen>
                Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Duel Area <gen>

Code:
Variables
    Events
        Map initialization
    Conditions
    Actions
        Set DuelSpawn[1] = (Center of Duel Spawn 1 <gen>)
        Set DuelSpawn[2] = (Center of Duel Spawn 2 <gen>)
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Set RepickInteger[(Integer A)] = 1
                Set RandomInteger[(Integer A)] = 1
        -------- ------------------- --------
        Set RandomHero[1] = Paladin 0008 <gen>
        Set RandomHero[2] = Archmage 0009 <gen>
        Set RandomHero[3] = Mountain King 0010 <gen>
        Set RandomHero[4] = Blood Mage 0011 <gen>
        Set RandomHero[5] = Blademaster 0012 <gen>
        Set RandomHero[6] = Far Seer 0013 <gen>
        Set RandomHero[7] = Tauren Chieftain 0014 <gen>
        Set RandomHero[8] = Shadow Hunter 0015 <gen>
        Set RandomHero[9] = Death Knight 0016 <gen>
        Set RandomHero[10] = Lich 0017 <gen>
        Set RandomHero[11] = Dreadlord 0018 <gen>
        Set RandomHero[12] = Crypt Lord 0019 <gen>
        Set RandomHero[13] = Demon Hunter 0022 <gen>
        Set RandomHero[14] = Warden 0023 <gen>
        Set RandomHero[15] = Priestess of the Moon 0021 <gen>
        Set RandomHero[16] = Keeper of the Grove 0020 <gen>

Duel:
Code:
First Duel
    Events
        Time - Elapsed game time is 120.00 seconds
    Conditions
    Actions
        Quest - Display to (All players) the Quest Update message: The first Duel will...
        Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 60.00 seconds
        Countdown Timer - Create a timer window for DuelTimer with title Duel Starts In:
        Set DuelTWindow = (Last created timer window)

Code:
Duel Begins
    Events
        Time - DuelTimer expires
    Conditions
    Actions
        Quest - Display to (All players) the Quest Update message: It's Duel Time!
        Countdown Timer - Destroy DuelTWindow
        Set DuelTime = True
        For each (Integer A) from 1 to 2, do (Actions)
            Loop - Actions
                Player Group - Pick every player in Forces[(Integer A)] and do (Actions)
                    Loop - Actions
                        Set DuelGroup[(Integer A)] = (Units owned by (Picked player) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True)))
                        Unit Group - Pick every unit in DuelGroup[(Integer A)] and do (Actions)
                            Loop - Actions
                                Unit - Pause (Picked unit)
                                Unit - Make (Picked unit) Invulnerable
                                Set DuelPoint[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Owner of (Picked unit)) is in Forces[1]) Equal to True
                                    Then - Actions
                                        Set DuelViewPoint[(Player number of (Owner of (Picked unit)))] = (Random point in Duel Viewer 1 <gen>)
                                    Else - Actions
                                        Set DuelViewPoint[(Player number of (Owner of (Picked unit)))] = (Random point in Duel Viewer 2 <gen>)
                                Unit - Move (Picked unit) instantly to DuelViewPoint[(Player number of (Owner of (Picked unit)))]
                                Camera - Pan camera for (Owner of (Picked unit)) to DuelViewPoint[(Player number of (Owner of (Picked unit)))] over 0.00 seconds
                                Custom script:   call RemoveLocation(udg_DuelViewPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
                                Selection - Clear selection for (Owner of (Picked unit))
        Wait 2.00 game-time seconds
        Trigger - Run Prepare Heroes <gen> (ignoring conditions)

Code:
Prepare Heroes
    Events
    Conditions
    Actions
        For each (Integer B) from 1 to 2, do (Actions)
            Loop - Actions
                Set DuelUnit[(Integer B)] = (Random unit from DuelGroup[(Integer B)])
                Hero - Instantly revive DuelUnit[(Integer B)] at TempPoint, Hide revival graphics
                Selection - Select DuelUnit[(Integer B)] for (Owner of DuelUnit[(Integer B)])
                Set TempPoint = (Position of DuelUnit[(Integer B)])
                Camera - Pan camera for (Triggering player) to TempPoint over 0.00 seconds
                Custom script:   call RemoveLocation(udg_TempPoint)
                Unit - Move DuelUnit[(Integer B)] instantly to DuelSpawn[(Integer B)]
                Unit - Reset ability cooldowns for DuelUnit[(Integer B)]
                Unit - Set mana of DuelUnit[(Integer B)] to 100.00%
                Unit - Set life of DuelUnit[(Integer B)] to 100.00%
                Unit - Make DuelUnit[(Integer B)] Vulnerable
                Unit - Unpause DuelUnit[(Integer B)]
        Trigger - Turn on Enter View Stand <gen>

Code:
Duel Ends
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) Equal to DuelUnit[1]) or ((Triggering unit) Equal to DuelUnit[2])
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering unit) Equal to DuelUnit[1]
            Then - Actions
                Set WinInteger = 2
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Triggering unit) Equal to DuelUnit[2]
            Then - Actions
                Set WinInteger = 1
            Else - Actions
        Quest - Display to (All players) the Quest Update message: ((Name of (Owner of DuelUnit[WinInteger])) +  is victorious!)
        Player - Add 200 to (Owner of DuelUnit[WinInteger]) Current gold
        Wait 2.00 game-time seconds
        Unit - Reset ability cooldowns for DuelUnit[WinInteger]
        Unit - Set mana of DuelUnit[WinInteger] to 100.00%
        Unit - Set life of DuelUnit[WinInteger] to 100.00%
        Set DuelUnit[1] = No unit
        Set DuelUnit[2] = No unit
        For each (Integer A) from 1 to 2, do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in DuelGroup[(Integer A)] and do (Actions)
                    Loop - Actions
                        Unit - Move (Picked unit) instantly to DuelPoint[(Player number of (Owner of (Picked unit)))]
                        Custom script:   call RemoveLocation(udg_DuelPoint[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
                        Unit - Unpause (Picked unit)
        Custom script:   call DestroyGroup(udg_DuelGroup[1])
        Custom script:   call DestroyGroup(udg_DuelGroup[2])
        Set DuelTime = False
        Set TempGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
        Unit Group - Pick every unit in TempGroup and do (Unit - Unpause (Picked unit))
        Custom script:   call DestroyGroup(udg_TempGroup)
        Wait 10.00 game-time seconds
        Quest - Display to (All players) the Quest Update message: The next Duel will ...
        Countdown Timer - Start DuelTimer as a One-shot timer that will expire in 60.00 seconds
        Countdown Timer - Create a timer window for DuelTimer with title Duel Starts In:
        Set DuelTWindow = (Last created timer window)
        Trigger - Turn off Enter View Stand <gen>

This template also features:
*'Double click on a hero to pick him - system'
*'Random Hero - system'
*'Repick Hero - system'


Map attached.
Any questions/suggestions can be posted in this thread.
 

Attachments

  • [Template] Duel v1.1.w3x
    41.3 KB · Views: 584

UndeadDragon

Super Moderator
Reaction score
447
Everyone asks for these. I am sure that newbies will be able to learn from it. I haven't checked the triggers yet, but I will once I have finished my history essay :p
 

Exide

I am amazingly focused right now!
Reaction score
448
All in GUI.
Sorry should've mentioned.

@UndeadDragon: yea, I was thinking of the new users when I made this. :)
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Can post some examples of the coding here?
 

UndeadDragon

Super Moderator
Reaction score
447
I had a quick look through your code and I noticed that you had

Code:
Wait (10.00 + (5.00 x (Real((Hero level of (Triggering unit)))))) game-time seconds

in your Respawn Hero trigger, which would make it non-MUI (also you did game-time seconds which is a lot shorter than real seconds).

For people who want to know what it has:

Picking a Hero (double click selection).
Respawning a Hero
Player Triggers (Player Leaves)
Duel Triggers (Start Duel, Prepare Heroes, End Duel)
 

Samael88

Evil always finds a way
Reaction score
181
in your Respawn Hero trigger, which would make it non-MUI

This can be worked aroung with just converting it to jass and changing the variables into locals:) Then it will be mui if it was I think it is, don't have time to look at it.
I am just guessing that UndeadDragon is reffering to the location/point leaks. That will be dealt with in that way:thup:
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
If the Respawn Hero trigger uses (Triggering Unit) and nothing more that's fundamental it's still MUI since (Triggering Unit) works just fine with waits.
 

Exide

I am amazingly focused right now!
Reaction score
448
Edited the first post, adding the Duel triggers within Spoiler tags.

Now what's this I hear about my Respawn trigger not being MUI? :p
Here's the trigger, for the people who are too lazy to download the map:
Code:
Respawn Hero
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Quest - Display to (All players) the Quest Update message: ((Name of (Owner of (Triggering unit))) +  has been killed!)
        Quest - Display to (All players) the Quest Update message: ((Name of (Owner of (Triggering unit))) + ( will respawn in  + ((String((10 + (5 x (Level of (Triggering unit)))))) +  seconds.)))
        Wait (10.00 + (5.00 x (Real((Hero level of (Triggering unit)))))) game-time seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Triggering unit)) slot status) Not equal to Is playing
            Then - Actions
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Owner of (Triggering unit)) is in Forces[1]) Equal to True
            Then - Actions
                Set RespawnPoint[(Player number of (Owner of (Triggering unit)))] = (Random point in Force1 Base <gen>)
            Else - Actions
                Set RespawnPoint[(Player number of (Owner of (Triggering unit)))] = (Random point in Force2 Base <gen>)
        Hero - Instantly revive (Triggering unit) at RespawnPoint[(Player number of (Owner of (Triggering unit)))], Hide revival graphics
        Camera - Pan camera for (Owner of (Triggering unit)) to RespawnPoint[(Player number of (Owner of (Triggering unit)))] over 0.00 seconds
        Selection - Clear selection for (Owner of (Triggering unit))
        Selection - Select (Triggering unit) for (Owner of (Triggering unit))
        Custom script:   call RemoveLocation(udg_RespawnPoint[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                DuelTime Equal to True
            Then - Actions
                Unit - Pause (Triggering unit)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Owner of (Triggering unit)) is in Forces[1]) Equal to True
                    Then - Actions
                        Set TempPoint = (Center of Duel Viewer 1 <gen>)
                    Else - Actions
                        Set TempPoint = (Center of Duel Viewer 2 <gen>)
                Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 0.00 seconds
                Selection - Clear selection for (Owner of (Triggering unit))
                Custom script:   call RemoveLocation(udg_TempPoint)
            Else - Actions

This Template is about the Duel triggers, though. So if the others are somewhat faulty, I don't mind. :p

EDIT: @Anman64: It's a template for a 'Duel'. I believe these types of maps are called 'Arenas', if that makes more sense. I also believe 'Angel Arena' is a famous such map.
 

duyen

New Member
Reaction score
214
If you make the setup trigger this:

Code:
Variables
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Set DuelSpawn[1] = (Center of Duel Spawn 1 <gen>)
        Set DuelSpawn[2] = (Center of Duel Spawn 2 <gen>)
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Set RepickInteger[(Integer A)] = 1
                Set RandomInteger[(Integer A)] = 1
        -------- ------------------- --------
        Set RandomHero[1] = Battlemage 0008 <gen>
        Set RandomHero[2] = Value
        Set RandomHero[3] = Value
        Set RandomHero[4] = Value
        Set RandomHero[5] = Value
        Set RandomHero[6] = Value
        Set RandomHero[7] = Value
        Set RandomHero[8] = Value
        Set RandomHero[9] = Value
        Set RandomHero[10] = Value
        Set RandomHero[11] = Value
        Set RandomHero[12] = Value
        Set RandomHero[13] = Value
        Set RandomHero[14] = Value
        Set RandomHero[15] = Value
        Set RandomHero[16] = Value
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Player - Make Neutral Passive treat (Player((Integer A))) as an Ally with shared vision and shared units
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Unit - Create 1 dummy for Player 12 (Brown) at (Center of Hero Pick Area <gen>) facing Default building facing degrees
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt RandomHero[(Integer A)]

(look at bottom)

Then the players can look at the abilities.

Note: You have to create a dummy with storm bolt, it has to have a long cast range, no projectile, no damage, and perma stun.
 

Exide

I am amazingly focused right now!
Reaction score
448
If you make the setup trigger this:

Code:
Variables
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Set DuelSpawn[1] = (Center of Duel Spawn 1 <gen>)
        Set DuelSpawn[2] = (Center of Duel Spawn 2 <gen>)
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Set RepickInteger[(Integer A)] = 1
                Set RandomInteger[(Integer A)] = 1
        -------- ------------------- --------
        Set RandomHero[1] = Battlemage 0008 <gen>
        Set RandomHero[2] = Value
        Set RandomHero[3] = Value
        Set RandomHero[4] = Value
        Set RandomHero[5] = Value
        Set RandomHero[6] = Value
        Set RandomHero[7] = Value
        Set RandomHero[8] = Value
        Set RandomHero[9] = Value
        Set RandomHero[10] = Value
        Set RandomHero[11] = Value
        Set RandomHero[12] = Value
        Set RandomHero[13] = Value
        Set RandomHero[14] = Value
        Set RandomHero[15] = Value
        Set RandomHero[16] = Value
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Player - Make Neutral Passive treat (Player((Integer A))) as an Ally with shared vision and shared units
        For each (Integer A) from 1 to 16, do (Actions)
            Loop - Actions
                Unit - Create 1 dummy for Player 12 (Brown) at (Center of Hero Pick Area <gen>) facing Default building facing degrees
                Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt RandomHero[(Integer A)]

(look at bottom)

Then the players can look at the abilities.

Note: You have to create a dummy with storm bolt, it has to have a long cast range, no projectile, no damage, and perma stun.

Good thinking. But this is not a map meant to be played. -Flaws are accepted. :p

>coo coo +rep
Thanks. :)
 

Exide

I am amazingly focused right now!
Reaction score
448
I'm just saying it would be a nice feature since it's a template you say,

Right.
I might add it if I get around to update to v1.1 :thup:
 

emjlr3

Change can be a good thing
Reaction score
395
i should get working and release the one Acehart made in Hulks Heroes, it was really good
 

Exide

I am amazingly focused right now!
Reaction score
448
Updated to version 1.1 :thup:

I haven't tested this version much on multiplayer, but hopefully it will fix a bug that occured when all Heroes on one force was dead.
The Hero Pick system has also been slightly updated, as well as the respawn system.
 

Exide

I am amazingly focused right now!
Reaction score
448
In the trigger named 'Duel Ends' there's a wait action at the bottom. -Increase it's value.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top