- Joined
- May 29, 2013
- Messages
- 1,566
I'm making a point target Hero ability with unlimited casting range that sends out an invisible unselectable flying unit to scout the map.
The unit travels in a straight line, starting from the position of the casting Hero (until it expires or reaches the map boundary), leaving behind a trail of expiring dummy units that provide vision and reveal invisible units.
Does anyone know why the last 25-ish created dummies always appear to have the level 3 duration and sight range?
The unit travels in a straight line, starting from the position of the casting Hero (until it expires or reaches the map boundary), leaving behind a trail of expiring dummy units that provide vision and reveal invisible units.
Does anyone know why the last 25-ish created dummies always appear to have the level 3 duration and sight range?
-
Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Firefly
-
-
Actions
-
Set Firefly_Caster = (Triggering unit)
-
Set Firefly_SpellLevel = (Level of Firefly for Firefly_Caster)
-
-------- Duration of missle (distance covered/speed) --------
-
Set Firefly_A_Duration = (4.00 + ((Real(Firefly_SpellLevel)) x 4.00))
-
-------- Unit type of missle --------
-
Set Firefly_A_UType = Missile (Firefly)
-
Set Firefly_TempPoint = (Position of Firefly_Caster)
-
Set Firefly_TempPoint2 = (Target point of ability being cast)
-
Unit - Create 1 Firefly_A_UType for (Owner of Firefly_Caster) at Firefly_TempPoint facing Firefly_TempPoint2
-
Unit - Add a Firefly_A_Duration second Generic expiration timer to (Last created unit)
-
If (Firefly_SpellLevel Equal to 1) then do (Animation - Change (Last created unit)'s size to (100.00%, 100.00%, 100.00%) of its original size) else do (If (Firefly_SpellLevel Equal to 2) then do (Animation - Change (Last created unit)'s size to (133.00%, 133.00%, 100.00%) of its original size) else do (Animation - Change (Last created unit)'s size to (166.00%, 166.00%, 100.00%) of its original size))
-
Unit - Set life of (Last created unit) to (Real(Firefly_SpellLevel))
-
Unit Group - Add (Last created unit) to Firefly_Dummy
-
Custom script: call RemoveLocation(udg_Firefly_TempPoint)
-
Custom script: call RemoveLocation(udg_Firefly_TempPoint2)
-
Trigger - Turn on Move <gen>
-
-
-
Move
-
Events
-
Time - Every 0.04 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Firefly_Dummy) Greater than 0
-
-
Then - Actions
-
Unit Group - Pick every unit in Firefly_Dummy and do (Actions)
-
Loop - Actions
-
Set Firefly_TempUnit = (Picked unit)
-
Set Firefly_SpellLevel = (Integer((Life of Firefly_TempUnit)))
-
-------- Speed of missle (per second) --------
-
Set Firefly_A_Real = 1000.00
-
Set Firefly_TempPoint = (Position of Firefly_TempUnit)
-
Set Firefly_TempPoint2 = (Firefly_TempPoint offset by (Firefly_A_Real / 25.00) towards (Facing of Firefly_TempUnit) degrees)
-
If (Firefly_SpellLevel Equal to 1) then do (Unit - Add Sight Range Firefly Level 1 to Firefly_TempUnit) else do (If (Firefly_SpellLevel Equal to 2) then do (Unit - Add Sight Range Firefly Level 2 to Firefly_TempUnit) else do (Unit - Add Sight Range Firefly Level 3 to Firefly_TempUnit))
-
If (Firefly_SpellLevel Equal to 1) then do (Unit - Add True Sight Firefly Level 1 to Firefly_TempUnit) else do (If (Firefly_SpellLevel Equal to 2) then do (Unit - Add True Sight Firefly Level 2 to Firefly_TempUnit) else do (Unit - Add True Sight Firefly Level 3 to Firefly_TempUnit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PlayableArea <gen> contains Firefly_TempPoint2) Equal to True
-
-
Then - Actions
-
Unit - Move Firefly_TempUnit instantly to Firefly_TempPoint2
-
Unit - Create 1 Trail (Firefly) for (Owner of Firefly_TempUnit) at Firefly_TempPoint2 facing Default building facing degrees
-
Set Firefly_TempUnit2 = (Last created unit)
-
If (Firefly_SpellLevel Equal to 1) then do (Unit - Add Sight Range Firefly Level 1 to Firefly_TempUnit2) else do (If (Firefly_SpellLevel Equal to 2) then do (Unit - Add Sight Range Firefly Level 2 to Firefly_TempUnit2) else do (Unit - Add Sight Range Firefly Level 3 to Firefly_TempUnit2))
-
If (Firefly_SpellLevel Equal to 1) then do (Unit - Add True Sight Firefly Level 1 to Firefly_TempUnit2) else do (If (Firefly_SpellLevel Equal to 2) then do (Unit - Add True Sight Firefly Level 2 to Firefly_TempUnit2) else do (Unit - Add True Sight Firefly Level 3 to Firefly_TempUnit2))
-
If (Firefly_SpellLevel Equal to 1) then do (Unit - Add a 30.00 second Generic expiration timer to (Last created unit)) else do (If (Firefly_SpellLevel Equal to 2) then do (Unit - Add a 45.00 second Generic expiration timer to (Last created unit)) else do (Unit - Add a 60.00 second Generic expiration timer to (Last created unit)))
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint)
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint2)
-
Set Firefly_TempUnit = No unit
-
Set Firefly_TempUnit2 = No unit
-
-
Else - Actions
-
Unit - Remove Firefly_TempUnit from the game
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint)
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint2)
-
Set Firefly_TempUnit = No unit
-
Set Firefly_TempUnit2 = No unit
-
-
-
-
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint)
-
Custom script: call RemoveLocation (udg_Firefly_TempPoint2)
-
Set Firefly_TempUnit = No unit
-
Set Firefly_TempUnit2 = No unit
-
Trigger - Turn off (This trigger)
-
-
-
-
Last edited: