C
Cepheids
Guest
when the following code is executed, the caster warps about the target till he is beside it. however, my dummy unit refuses to cast the spell. can anyone tell me why my dummy unit doesnt cast?
i made the dummy unit have a model, and i managed to cast it manually before the expiration timer runs out. how come i can cast it but the trigger cant order it to cast?
i made the dummy unit have a model, and i managed to cast it manually before the expiration timer runs out. how come i can cast it but the trigger cant order it to cast?
Code:
Crossslash
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Crossslash
Actions
Custom script: local unit XCaster = GetSpellAbilityUnit()
Custom script: local unit XTarget = GetSpellTargetUnit()
Custom script: local integer udg_LoopCounter = 1
Unit - Add Invulnerable (Neutral) to Caster
For each (Integer LoopCounter) from 1 to 10, do (Actions)
Loop - Actions
Custom script: set udg_Caster = XCaster
Custom script: set udg_Target = XTarget
Set Point[0] = (Position of Caster)
Set Point[1] = (Position of Target)
Set Point[2] = (Point[0] offset by ((Distance between Point[0] and Point[1]) x 1.60) towards (Angle from Point[0] to Point[1]) degrees)
Unit - Move Caster instantly to Point[2]
Unit - Create 1 Dummy for (Owner of Caster) at Point[0] facing Point[2]
Unit - Add Crossslash to (Last created unit)
Unit - Set level of Crossslash for (Last created unit) to (Integer(((Distance between Point[0] and Point[2]) / 200.00)))
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit(), "crossslash", udg_Target )
Custom script: call RemoveLocation(udg_Point[0])
Custom script: call RemoveLocation(udg_Point[1])
Custom script: call RemoveLocation(udg_Point[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Crossslash for (Last created unit)) Less than or equal to 1
Then - Actions
Unit - Remove Invulnerable (Neutral) from Caster
Skip remaining actions
Else - Actions
Wait ((Real((Level of Crossslash for (Last created unit)))) / 10.00) game-time seconds