Recently, I've been working on a spell which works by making a river which travels back to the point it was cast from. My idea was to record the path the first unit in the river takes with hashtables and that way have an actual flowing river. This is not working. What i have tried to do is have 2 sets of indexing going, so that when the spell is cast an index is created, which will manage each individual piece of the river in a seperate index, with the lead unit recording it's path as it goes. I know its not exactly a small piece of code, and it is'nt documented at all, but i would appreciate your help a lot. Anywho, i've got the trigger documentation and tooltip set up below. Obviously the spell isn't close to finished, incase you're wondering if you're reading the tooltip. Thanks for your help.
Releases his rage into a stream of water that travels from the target point to where the caster was standing at the time. Units hit by the stream will be sent down the stream to where the caster was standing when he cast the ability. Damages and stuns when units hit the end, and automatically curves to hit heroes. Damage is pure. |n|n|cffffcc00Level 1|r - 600 cast range, 1 second stun, 100 damage.|n|cffffcc00Level 2|r - 800 cast range, 1.15 second stun, 130 damage.|n|cffffcc00Level 3|r - 1000 cast range, 1.3 second stun, 160 damage.|n|cffffcc00Level 4|r - 1200 cast range, 1.4 second stun, 190 damage.
-
TF Init
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Tidal Fury
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFBOOLEANHASHTABLECHECK Equal to False
-
-
Then - Actions
-
Hashtable - Create a hashtable
-
Set TF_Hashtable = (Last created hashtable)
-
Set TFBOOLEANHASHTABLECHECK = True
-
-
Else - Actions
-
-
Set TFAL1_Integers[1] = (TFAL1_Integers[1] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL1_Integers[1] Equal to 1
-
-
Then - Actions
-
Trigger - Turn on TF Loop 1 <gen>
-
-
Else - Actions
-
-
Set TFAL1_Integers[2] = (TFAL1_Integers[2] + 1)
-
Set TFAL1_Caster[TFAL1_Integers[2]] = (Casting unit)
-
Set TFAL1_TargetPoint[TFAL1_Integers[2]] = (Target point of ability being cast)
-
Set TFAL1_OriginalPoint[TFAL1_Integers[2]] = (Position of TFAL1_Caster[TFAL1_Integers[2]])
-
Set TFAL1_FirstUnit[TFAL1_Integers[2]] = True
-
Set TFAL1_CurrentCount[TFAL1_Integers[2]] = 0
-
Unit - Create 1 DummyCaster for (Owner of TFAL1_Caster[TFAL1_Integers[2]]) at TFAL1_OriginalPoint[TFAL1_Integers[2]] facing Default building facing degrees
-
Set TFAL1_DummyCaster[TFAL1_Integers[2]] = (Last created unit)
-
Unit Group - Add TFAL1_DummyCaster[TFAL1_Integers[2]] to TF_ConstantGroup
-
-
-
TF Loop 1
-
Events
-
Time - Every 0.06 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer TFAL1_Integers[3]) from 1 to TFAL1_Integers[2], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL1_FirstUnit[TFAL1_Integers[3]] Equal to True
-
-
Then - Actions
-
Set TFAL1_FirstUnit[TFAL1_Integers[3]] = False
-
Set TFAL2_Integers[1] = (TFAL2_Integers[1] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_Integers[1] Equal to 1
-
-
Then - Actions
-
Trigger - Turn on TF Loop 2 <gen>
-
-
Else - Actions
-
-
Set TFAL2_Integers[2] = (TFAL2_Integers[2] + 1)
-
Unit - Create 1 SFX_TidalFury River Particle for (Owner of TFAL1_Caster[TFAL1_Integers[3]]) at TFAL1_TargetPoint[TFAL1_Integers[3]] facing (Angle from TFAL1_OriginalPoint[TFAL1_Integers[3]] to TFAL1_TargetPoint[TFAL1_Integers[3]]) degrees
-
Set TFAL2_Dummy[TFAL2_Integers[2]] = (Last created unit)
-
Set TFAL2_LeadDummy[TFAL2_Integers[2]] = True
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Real(TFAL1_CurrentCount[TFAL1_Integers[3]])) / 4.00) Equal to (Real((TFAL1_CurrentCount[TFAL1_Integers[3]] / 4)))
-
-
Then - Actions
-
Set TFAL2_MovesunitsBoo[TFAL2_Integers[2]] = True
-
-
Else - Actions
-
-
Set TFAL2_Caster[TFAL2_Integers[2]] = TFAL1_Caster[TFAL1_Integers[3]]
-
Set TFAL2_PointCounter[TFAL2_Integers[2]] = 0
-
Set TFAL2_OriginalPoint[TFAL2_Integers[2]] = TFAL1_OriginalPoint[TFAL1_Integers[3]]
-
Set TFAL2_Targetunit[TFAL2_Integers[2]] = No unit
-
Set TFAL2_DummyCaster[TFAL2_Integers[2]] = TFAL1_DummyCaster[TFAL1_Integers[3]]
-
-
Else - Actions
-
Set TFAL2_Integers[1] = (TFAL2_Integers[1] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_Integers[1] Equal to 1
-
-
Then - Actions
-
Trigger - Turn on TF Loop 2 <gen>
-
-
Else - Actions
-
-
Set TFAL2_Integers[2] = (TFAL2_Integers[2] + 1)
-
Unit - Create 1 SFX_TidalFury River Particle for (Owner of TFAL1_Caster[TFAL1_Integers[3]]) at TFAL1_TargetPoint[TFAL1_Integers[3]] facing (Angle from TFAL1_OriginalPoint[TFAL1_Integers[3]] to TFAL1_TargetPoint[TFAL1_Integers[3]]) degrees
-
Set TFAL2_Dummy[TFAL2_Integers[2]] = (Last created unit)
-
Set TFAL1_CurrentCount[TFAL1_Integers[3]] = (TFAL1_CurrentCount[TFAL1_Integers[3]] + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Real(TFAL1_CurrentCount[TFAL1_Integers[3]])) / 4.00) Equal to (Real((TFAL1_CurrentCount[TFAL1_Integers[3]] / 4)))
-
-
Then - Actions
-
Set TFAL2_MovesunitsBoo[TFAL2_Integers[2]] = True
-
-
Else - Actions
-
-
Set TFAL2_Caster[TFAL2_Integers[2]] = TFAL1_Caster[TFAL1_Integers[3]]
-
Set TFAL2_PointCounter[TFAL2_Integers[2]] = 0
-
Set TFAL2_DummyCaster[TFAL2_Integers[2]] = TFAL1_DummyCaster[TFAL1_Integers[3]]
-
-
-
-
-
-
-
TF Loop 2
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer TFAL2_Integers[3]) from 1 to TFAL2_Integers[2], do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_LeadDummy[TFAL2_Integers[3]] Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_Targetunit[TFAL2_Integers[3]] Equal to No unit
-
-
Then - Actions
-
Set TFA_Point1[TFAL2_Integers[3]] = TFAL2_OriginalPoint[TFAL2_Integers[3]]
-
Set TFA_Point2[TFAL2_Integers[3]] = (Position of TFAL2_Dummy[TFAL2_Integers[3]])
-
Set TFAL2_Distance[TFAL2_Integers[3]] = ((Distance between TFA_Point1[TFAL1_Integers[3]] and TFA_Point2[TFAL2_Integers[3]]) / 2.00)
-
Set TFA_Point3[TFAL2_Integers[3]] = (TFA_Point1[TFAL2_Integers[3]] offset by (TFAL2_Distance[TFAL2_Integers[3]] / 1.00) towards (Angle from TFA_Point1[TFAL2_Integers[3]] to TFA_Point2[TFAL2_Integers[3]]) degrees)
-
Set TFAL2_TempBoolean[TFAL2_Integers[3]] = False
-
For each (Integer TFAL2_Integers[4]) from 1 to 20, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_TempBoolean[TFAL2_Integers[3]] Equal to False
-
-
Then - Actions
-
Set TFAL2_TempUnitGroup[TFAL2_Integers[3]] = (Units within ((TFAL2_Distance[TFAL2_Integers[3]] / 20.00) x (Real(TFAL2_Integers[4]))) of TFA_Point3[TFAL2_Integers[3]] matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Me
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TFAL2_TempUnitGroup[TFAL2_Integers[3]]) Greater than or equal to 1
-
-
Then - Actions
-
Set TFAL2_TempBoolean[TFAL2_Integers[3]] = True
-
Set TFAL2_Targetunit[TFAL2_Integers[3]] = (Random unit from TFAL2_TempUnitGroup[TFAL2_Integers[3]])
-
Custom script: call DestroyGroup (udg_TFAL2_TempUnitGroup[udg_TFAL2_Integers[3]])
-
-
Else - Actions
-
Set TFAL2_Targetunit[TFAL2_Integers[3]] = No unit
-
Custom script: call DestroyGroup (udg_TFAL2_TempUnitGroup[udg_TFAL2_Integers[3]])
-
-
-
-
Else - Actions
-
-
-
-
Custom script: call RemoveLocation (udg_TFA_Point1[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point2[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point3[udg_TFAL2_Integers[3]])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TFAL2_Targetunit[TFAL2_Integers[3]] Equal to No unit
-
-
Then - Actions
-
Set TFA_Point1[TFAL2_Integers[3]] = TFAL2_OriginalPoint[TFAL2_Integers[3]]
-
Set TFA_Point2[TFAL2_Integers[3]] = (Position of TFAL2_Dummy[TFAL2_Integers[3]])
-
Set TFA_Point3[TFAL2_Integers[3]] = (TFA_Point2[TFAL2_Integers[3]] offset by 40.00 towards (Angle from TFA_Point1[TFAL2_Integers[3]] to TFA_Point2[TFAL2_Integers[3]]) degrees)
-
Unit - Make TFAL2_Dummy[TFAL2_Integers[3]] face TFA_Point3[TFAL2_Integers[3]] over 0.00 seconds
-
Unit - Move TFAL2_Dummy[TFAL2_Integers[3]] instantly to TFA_Point3[TFAL2_Integers[3]]
-
Unit Group - Pick every unit in TF_ConstantGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Picked unit) Equal to TFAL2_DummyCaster[TFAL2_Integers[3]]
-
-
Then - Actions
-
Hashtable - Save Handle OfTFA_Point3[TFAL2_Integers[3]] as TFAL2_PointCounter[TFAL2_Integers[3]] of (Key (Picked unit)) in TF_Hashtable
-
-
Else - Actions
-
-
-
-
Set TFAL2_PointCounter[TFAL2_Integers[3]] = (TFAL2_PointCounter[TFAL2_Integers[3]] + 1)
-
Custom script: call RemoveLocation (udg_TFA_Point1[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point2[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point3[udg_TFAL2_Integers[3]])
-
-
Else - Actions
-
Set TFA_Point1[TFAL2_Integers[3]] = (Position of TFAL2_Targetunit[TFAL2_Integers[3]])
-
Set TFA_Point2[TFAL2_Integers[3]] = (Position of TFAL2_Dummy[TFAL2_Integers[3]])
-
Set TFA_Point3[TFAL2_Integers[3]] = (TFA_Point1[TFAL2_Integers[3]] offset by 40.00 towards (Angle from TFA_Point1[TFAL2_Integers[3]] to TFA_Point2[TFAL2_Integers[3]]) degrees)
-
Unit - Make TFAL2_Dummy[TFAL2_Integers[3]] face TFA_Point3[TFAL2_Integers[3]] over 0.00 seconds
-
Unit - Move TFAL2_Dummy[TFAL2_Integers[3]] instantly to TFA_Point3[TFAL2_Integers[3]]
-
Unit Group - Pick every unit in TF_ConstantGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Picked unit) Equal to TFAL2_DummyCaster[TFAL2_Integers[3]]
-
-
Then - Actions
-
Hashtable - Save Handle OfTFA_Point3[TFAL2_Integers[3]] as TFAL2_PointCounter[TFAL2_Integers[3]] of (Key (Picked unit)) in TF_Hashtable
-
-
Else - Actions
-
-
-
-
Set TFAL2_PointCounter[TFAL2_Integers[3]] = (TFAL2_PointCounter[TFAL2_Integers[3]] + 1)
-
Custom script: call RemoveLocation (udg_TFA_Point1[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point2[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point3[udg_TFAL2_Integers[3]])
-
-
-
-
Else - Actions
-
Set TFA_Point1[TFAL2_Integers[3]] = (Position of TFAL2_Targetunit[TFAL2_Integers[3]])
-
Set TFA_Point2[TFAL2_Integers[3]] = (Position of TFAL2_Dummy[TFAL2_Integers[3]])
-
Set TFA_Point3[TFAL2_Integers[3]] = (TFA_Point1[TFAL2_Integers[3]] offset by 40.00 towards (Angle from TFA_Point1[TFAL2_Integers[3]] to TFA_Point2[TFAL2_Integers[3]]) degrees)
-
Unit - Make TFAL2_Dummy[TFAL2_Integers[3]] face TFA_Point3[TFAL2_Integers[3]] over 0.00 seconds
-
Unit - Move TFAL2_Dummy[TFAL2_Integers[3]] instantly to TFA_Point3[TFAL2_Integers[3]]
-
Unit Group - Pick every unit in TF_ConstantGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Picked unit) Equal to TFAL2_DummyCaster[TFAL2_Integers[3]]
-
-
Then - Actions
-
Hashtable - Save Handle OfTFA_Point3[TFAL2_Integers[3]] as TFAL2_PointCounter[TFAL2_Integers[3]] of (Key (Picked unit)) in TF_Hashtable
-
-
Else - Actions
-
-
-
-
Set TFAL2_PointCounter[TFAL2_Integers[3]] = (TFAL2_PointCounter[TFAL2_Integers[3]] + 1)
-
Custom script: call RemoveLocation (udg_TFA_Point1[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point2[udg_TFAL2_Integers[3]])
-
Custom script: call RemoveLocation (udg_TFA_Point3[udg_TFAL2_Integers[3]])
-
-
-
-
Else - Actions
-
Unit Group - Pick every unit in TF_ConstantGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Picked unit) Equal to TFAL2_DummyCaster[TFAL2_Integers[3]]
-
-
Then - Actions
-
Set TFA_Point1[TFAL2_Integers[3]] = (Load TFAL2_PointCounter[TFAL2_Integers[3]] of (Key (Picked unit)) in TF_Hashtable)
-
Set TFAL2_PointCounter[TFAL2_Integers[3]] = (TFAL2_PointCounter[TFAL2_Integers[3]] + 1)
-
Unit - Make TFAL2_Dummy[TFAL2_Integers[3]] face TFA_Point1[TFAL2_Integers[3]] over 0.00 seconds
-
Unit - Move TFAL2_Dummy[TFAL2_Integers[3]] instantly to TFA_Point1[TFAL2_Integers[3]]
-
Custom script: call RemoveLocation (udg_TFA_Point1[udg_TFAL2_Integers[3]])
-
-
Else - Actions
-
-
-
-
-
-
-
-
-