- Joined
- Jul 3, 2010
- Messages
- 536
Summary | Make it so that a Scroll of Town Portal used by a player will teleport not only that player's units, but its allies as well. |
I already made up my mind about this, so I will update my Sentinel maps to contain this change and any further release will have it as well.
However, I'm also suggesting to The-Spoon that he updates his maps.
This change can actually be done very quickly: For once, Blizzard's events and even position handling are not all over the place, this allows for this quick and simple method:
-
Portal Scroll CAST
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Item Town Portal
-
Actions
- Set TempPoint[1] = (Position of (Casting unit))
- Set TempGroup[1] = (Units within 1100.00 of TempPoint[1])
-
Unit Group - Pick every unit in TempGroup[1] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked unit) is A structure) Equal to False
- ((Picked unit) is alive) Equal to True
- (Owner of (Picked unit)) Not equal to (Owner of (Casting unit))
- ((Picked unit) belongs to an ally of (Owner of (Casting unit))) Equal to True
-
Then - Actions
- Set TempPoint[2] = (Position of (Picked unit))
- Special Effect - Create a special effect at TempPoint[2] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
- Custom script: call RemoveLocation(udg_TempPoint[2])
- Set TempPoint[2] = (Target point of ability being cast)
- Unit - Move (Picked unit) instantly to TempPoint[2]
- Custom script: call RemoveLocation(udg_TempPoint[2])
- Set TempPoint[2] = (Position of (Picked unit))
- Special Effect - Create a special effect at TempPoint[2] using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
- Custom script: call RemoveLocation(udg_TempPoint[2])
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call RemoveLocation(udg_TempPoint[1])
- Custom script: call DestroyGroup(udg_TempGroup[1])
-
Events
- If you target inside a structure, sometimes the place where the caster and his units are teleported slightly differ from the point where the move trigger moves its ally's units. For example, if you target exactly onto a Castle, all of the caster's units are ported to the bottom-right corner of the Castle, while allied units are ported directly in front of it.
- Town Portal will only teleport the caster's workers if they are idle but will teleport allied workers every time.