- Joined
- Feb 15, 2013
- Messages
- 372
Guys i have problem with this trigger, My map Ancient's Keep have a circle of power's spell which is when the circle of power cast the ability, the hero that owned by the player will teleport to base over 5 seconds.
But if multiple player cast, it will bug...
[trigger=Teleport]
Teleport
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Teleport
Actions
Set TeleportCount = (TeleportCount + 1)
Set TeleportCaster[TeleportCount] = (Triggering unit)
Set TeleportRealCount[TeleportCount] = 4
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of TeleportCaster[TeleportCount])) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Set TeleportCasterUnit[TeleportCount] = (Picked unit)
Unit - Pause TeleportCasterUnit[TeleportCount]
Else - Actions
Special Effect - Create a special effect attached to the origin of TeleportCaster[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[1] = (Last created special effect)
Special Effect - Create a special effect attached to the origin of TeleportCasterUnit[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[2] = (Last created special effect)
Trigger - Turn on Teleport Count <gen>
[/trigger]
[trigger=Teleport Count]
Teleport Count
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer TeleportCounts) from 1 to TeleportCount, do (Actions)
Loop - Actions
Wait 0.75 seconds
Set TeleportRealCounts[TeleportCounts] = (TeleportRealCounts[TeleportCounts] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportRealCounts[TeleportCounts] Equal to TeleportRealCount[TeleportCounts]
Then - Actions
Set TeleportRealCounts[TeleportCounts] = 0
Set TeleportCount = (TeleportCount - 1)
Special Effect - Destroy TeleportEffect[1]
Special Effect - Destroy TeleportEffect[2]
Unit - Move TeleportCasterUnit[TeleportCounts] instantly to (Position of TeleportCaster[TeleportCounts])
Unit - Unpause TeleportCasterUnit[TeleportCounts]
Else - Actions
[/trigger]
+REP thanks
But if multiple player cast, it will bug...
[trigger=Teleport]
Teleport
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Teleport
Actions
Set TeleportCount = (TeleportCount + 1)
Set TeleportCaster[TeleportCount] = (Triggering unit)
Set TeleportRealCount[TeleportCount] = 4
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Owner of TeleportCaster[TeleportCount])) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Set TeleportCasterUnit[TeleportCount] = (Picked unit)
Unit - Pause TeleportCasterUnit[TeleportCount]
Else - Actions
Special Effect - Create a special effect attached to the origin of TeleportCaster[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[1] = (Last created special effect)
Special Effect - Create a special effect attached to the origin of TeleportCasterUnit[TeleportCount] using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set TeleportEffect[2] = (Last created special effect)
Trigger - Turn on Teleport Count <gen>
[/trigger]
[trigger=Teleport Count]
Teleport Count
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer TeleportCounts) from 1 to TeleportCount, do (Actions)
Loop - Actions
Wait 0.75 seconds
Set TeleportRealCounts[TeleportCounts] = (TeleportRealCounts[TeleportCounts] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TeleportRealCounts[TeleportCounts] Equal to TeleportRealCount[TeleportCounts]
Then - Actions
Set TeleportRealCounts[TeleportCounts] = 0
Set TeleportCount = (TeleportCount - 1)
Special Effect - Destroy TeleportEffect[1]
Special Effect - Destroy TeleportEffect[2]
Unit - Move TeleportCasterUnit[TeleportCounts] instantly to (Position of TeleportCaster[TeleportCounts])
Unit - Unpause TeleportCasterUnit[TeleportCounts]
Else - Actions
[/trigger]
+REP thanks