Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
HeroSelect Init
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Set TempInt = (Integer A)
Set CurrentSelectedUnit[TempInt] = No unit
Set HasSelectedHero[TempInt] = False
Trigger - Add to HeroSelect Click <gen> the event (Player - (Player(TempInt)) Selects a unit)
Trigger - Add to HeroSelect Repick <gen> the event (Player - (Player(TempInt)) types a chat message containing -repick as An exact match)
Wait 60.00 seconds
-------- turn off repick --------
Trigger - Turn off HeroSelect Repick <gen>
HeroSelect Click
Events
Conditions
(Owner of (Triggering unit)) Equal to Neutral Passive
((Triggering unit) is A Hero) Equal to True
Actions
Set TempPlayer = (Triggering player)
Set TempUnit = (Triggering unit)
Set TempInt = (Player number of TempPlayer)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HasSelectedHero[TempInt] Equal to True
Then - Actions
-------- this player has already selected a hero, no need to run the trigger any further --------
Skip remaining actions
Else - Actions
-------- --------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CurrentSelectedUnit[TempInt] Equal to TempUnit
Then - Actions
Set CurrentSelectedUnit[TempInt] = No unit
-------- second click --------
Set HasSelectedHero[TempInt] = True
-------- unit type of TempUnit is the unit that the player has chosen, now create hero for him/her --------
Set TempPoint = (Center of HeroSpawnPlace <gen>)
Unit - Create 1 (Unit-type of TempUnit) for TempPlayer at TempPoint facing Default building facing degrees
Set TempUnit = (Last created unit)
Selection - Select TempUnit for TempPlayer
Camera - Pan camera for TempPlayer to TempPoint over 0.10 seconds
Set TempForce = (Player group(TempPlayer))
Cinematic - Clear the screen of text messages for TempForce
Custom script: call DestroyForce( udg_TempForce )
Game - Display to (All players) the text: ((Name of TempPlayer) + ( has picked + (Name of TempUnit)))
Custom script: call RemoveLocation( udg_TempPoint )
-------- a little special effect won't hurt --------
Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
-------- first click --------
Animation - Play TempUnit's Attack animation
Animation - Queue TempUnit's stand animation
Trigger - Run HeroSelect Description <gen> (ignoring conditions)
Set CurrentSelectedUnit[TempInt] = TempUnit
HeroSelect Repick
Events
Conditions
Actions
Set TempPlayer = (Triggering player)
Set TempInt = (Player number of TempPlayer)
Set HasSelectedHero[TempInt] = False
Set CurrentSelectedUnit[TempInt] = No unit
Set TempGroup = (Units owned by TempPlayer matching (((Matching unit) is A Hero) Equal to True))
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
Unit - Remove (Picked unit) from the game
Game - Display to (All players) the text: ((Name of TempPlayer) + ( has repicked + (Name of TempUnit)))
Set TempPoint = (Center of HeroSelectArea <gen>)
Camera - Pan camera for TempPlayer to TempPoint over 0.10 seconds
Custom script: call RemoveLocation( udg_TempPoint )

cảm ơn bạn mình làm được rồi nhưng ko biết có chống chọn giống nhau ko vậy
HeroSelect Click
Events
Conditions
(Owner of (Triggering unit)) Equal to Neutral Passive
((Triggering unit) is A Hero) Equal to True
Actions
Set TempPlayer = (Triggering player)
Set TempUnit = (Triggering unit)
Set TempInt = (Player number of TempPlayer)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HasSelectedHero[TempInt] Equal to True
Then - Actions
-------- this player has already selected a hero, no need to run the trigger any further --------
Skip remaining actions
Else - Actions
-------- --------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CurrentSelectedUnit[TempInt] Equal to TempUnit
Then - Actions
Set CurrentSelectedUnit[TempInt] = No unit
-------- second click --------
Set HasSelectedHero[TempInt] = True
-------- unit type of TempUnit is the unit that the player has chosen, now create hero for him/her --------
Set TempPoint = (Center of HeroSpawnPlace <gen>)
[B]Unit - Create 1 (Unit-type of TempUnit) for TempPlayer at TempPoint facing Default building facing degrees[/B]
Set TempUnit = (Last created unit)
Selection - Select TempUnit for TempPlayer
Camera - Pan camera for TempPlayer to TempPoint over 0.10 seconds
Set TempForce = (Player group(TempPlayer))
Cinematic - Clear the screen of text messages for TempForce
Custom script: call DestroyForce( udg_TempForce )
Game - Display to (All players) the text: ((Name of TempPlayer) + ( has picked + (Name of TempUnit)))
Custom script: call RemoveLocation( udg_TempPoint )
-------- a little special effect won't hurt --------
Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
-------- first click --------
Animation - Play TempUnit's Attack animation
Animation - Queue TempUnit's stand animation
Trigger - Run HeroSelect Description <gen> (ignoring conditions)
Set CurrentSelectedUnit[TempInt] = TempUnit
YAN[asian];11553328 nói:Cách này là chọn Hero ở 1 team, nếu có 2 team thì làm thế nào hả Tom? Ý mình là nếu có 2 HeroSelectArea và 2 HeroSpawnPlace khác nhau, hoặc 1 HeroSelectArea và 2 HeroSpawnPlace thì làm ntn?
HeroSelect Click
Events
Conditions
(Owner of (Triggering unit)) Equal to Neutral Passive
((Triggering unit) is A Hero) Equal to True
Actions
Set TempPlayer = (Triggering player)
Set TempUnit = (Triggering unit)
Set TempInt = (Player number of TempPlayer)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HasSelectedHero[TempInt] Equal to True
Then - Actions
-------- this player has already selected a hero, no need to run the trigger any further --------
Skip remaining actions
Else - Actions
-------- --------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
CurrentSelectedUnit[TempInt] Equal to TempUnit
Then - Actions
Set CurrentSelectedUnit[TempInt] = No unit
-------- second click --------
Set HasSelectedHero[TempInt] = True
-------- unit type of TempUnit is the unit that the player has chosen, now create hero for him/her --------
[B]Set TempPoint = (Center of HeroSpawnPlace <gen>)[/B]
Unit - Create 1 (Unit-type of TempUnit) for TempPlayer at TempPoint facing Default building facing degrees
Set TempUnit = (Last created unit)
Selection - Select TempUnit for TempPlayer
Camera - Pan camera for TempPlayer to TempPoint over 0.10 seconds
Set TempForce = (Player group(TempPlayer))
Cinematic - Clear the screen of text messages for TempForce
Custom script: call DestroyForce( udg_TempForce )
Game - Display to (All players) the text: ((Name of TempPlayer) + ( has picked + (Name of TempUnit)))
Custom script: call RemoveLocation( udg_TempPoint )
-------- a little special effect won't hurt --------
Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
-------- first click --------
Animation - Play TempUnit's Attack animation
Animation - Queue TempUnit's stand animation
Trigger - Run HeroSelect Description <gen> (ignoring conditions)
Set CurrentSelectedUnit[TempInt] = TempUnit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempPlayer is an ally of <một player nào đó trong team 1>) Equal to True
Then - Actions
Set TempPoint = (Center of HeroSpawnPlace1 <gen>)
Else - Actions
Set TempPoint = (Center of HeroSpawnPlace2 <gen>)
Set TempGroup = (Units in (HeroSelectArea <gen>) matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to Neutral Passive)))
Set TempUnit = (Random unit from TempGroup)
Custom script: call DestroyGroup( udg_TempGroup )
Random All Heroes
Events
Player - Player 1 (Red) types a chat message containing -random as An exact match
Player - Player 2 (Blue) types a chat message containing -random as An exact match
Player - Player 3 (Teal) types a chat message containing -random as An exact match
Player - Player 4 (Purple) types a chat message containing -random as An exact match
Player - Player 5 (Yellow) types a chat message containing -random as An exact match
Player - Player 6 (Orange) types a chat message containing -random as An exact match
Player - Player 7 (Green) types a chat message containing -random as An exact match
Player - Player 8 (Pink) types a chat message containing -random as An exact match
Conditions
Actions
Set TempGroup = (Units in HeroSelectArea <gen> matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to Neutral Passive)))
Set TempUnit = (Random unit from TempGroup)
Custom script: call DestroyGroup( udg_TempGroup )
sau khi TempUnit được "nhặt" random thì cứ tiếp tục xác định vị trí tạo hero, tạo,... như đã "click 2 lần" ở trigger HeroSelect Click.


Random All Heroes
Events
Player - Player 1 (Red) types a chat message containing -random as An exact match
Player - Player 2 (Blue) types a chat message containing -random as An exact match
Player - Player 3 (Teal) types a chat message containing -random as An exact match
Player - Player 4 (Purple) types a chat message containing -random as An exact match
Player - Player 5 (Yellow) types a chat message containing -random as An exact match
Player - Player 6 (Orange) types a chat message containing -random as An exact match
Player - Player 7 (Green) types a chat message containing -random as An exact match
Player - Player 8 (Pink) types a chat message containing -random as An exact match
Conditions
Actions
Set TempPlayer = (Triggering player)
Set TempInt = (Player number of TempPlayer)
Set TempGroup = (Units in HeroSelectArea <gen> matching ((((Matching unit) is A Hero) Equal to True) and ((Owner of (Matching unit)) Equal to Neutral Passive)))
Set TempUnit = (Random unit from TempGroup)
Custom script: call DestroyGroup( udg_TempGroup )
-------- có TempUnit rồi thì cũng làm như đã pick = double click thôi --------
Set HasSelectedHero[TempInt] = True
-------- unit type of TempUnit is the unit that the player has chosen, now create hero for him/her --------
Set TempPoint = (Center of HeroSpawnPlace <gen>)
Unit - Create 1 (Unit-type of TempUnit) for TempPlayer at TempPoint facing Default building facing degrees
Unit - Remove TempUnit from the game
Set TempUnit = (Last created unit)
Selection - Select TempUnit for TempPlayer
Camera - Pan camera for TempPlayer to TempPoint over 0.10 seconds
Set TempForce = (Player group(TempPlayer))
Cinematic - Clear the screen of text messages for TempForce
Custom script: call DestroyForce( udg_TempForce )
Game - Display to (All players) the text: ((Name of TempPlayer) + ( has picked + (Name of TempUnit)))
Custom script: call RemoveLocation( udg_TempPoint )
-------- a little special effect won't hurt --------
Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Special Effect - Destroy (Last created special effect)
có thể làm hệ thống kich người chơi giống cf ko vậy

vậy là cái này của tôi bị bỏ luôn
chắc cái gì tôi cũng phải viết ra mất
[/CODE]