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):
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.
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:
Duel:
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.