- Joined
- Jul 9, 2008
- Messages
- 253
Hello everybody, I'm having some problems with my spell. For now it's just firing a rocket and that's it, but the problem is that it won't stop.
Trigger 1:
Help would be appreciated, thanks in advance, Quetzalcotl
Trigger 1:
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Aimed Shot
-
-
Actions
-
-------- 0 = Distance --------
-
-------- 1 = Angle --------
-
-------- 2 = Damage --------
-
-------- 3 = Projectile --------
-
-------- 4 = End Location --------
-
-------- ---------------------- --------
-
Set Unit = (Casting unit)
-
-------- ---------------------- --------
-
Set Integer[1] = (Level of Disengage for Unit)
-
-------- ---------------------- --------
-
Set Location[1] = (Position of Unit)
-
-------- ---------------------- --------
-
Set Location[2] = (Target point of ability being cast)
-
-------- ---------------------- --------
-
Set AimedShotAngle = (Angle from Location[1] to Location[2])
-
-------- ---------------------- --------
-
Set AimedShotDamage = ((Real(Integer[1])) x 40.00)
-
-------- ---------------------- --------
-
Set AimedShotDistance = (1250.00 x 0.03)
-
-------- ---------------------- --------
-
Set AimedShotEnd = (Location[1] offset by 1250.00 towards AimedShotAngle degrees)
-
-------- ---------------------- --------
-
-------- Store the values --------
-
Unit - Create 1 Aimed Shot Dummy for (Owner of Unit) at Location[1] facing AimedShotAngle degrees
-
Set AimedShotDummy = (Last created unit)
-
Hashtable - Save AimedShotDistance as 0 of (Key (Last created unit)) in AimedShotTable
-
Hashtable - Save AimedShotAngle as 1 of (Key (Last created unit)) in AimedShotTable
-
Hashtable - Save AimedShotDamage as 2 of (Key (Last created unit)) in AimedShotTable
-
Hashtable - Save Handle OfAimedShotDummy as 3 of (Key (Last created unit)) in AimedShotTable
-
Hashtable - Save Handle OfAimedShotEnd as 4 of (Key (Last created unit)) in AimedShotTable
-
-------- ---------------------- --------
-
Unit Group - Add AimedShotDummy to AimedShotUnits
-
-------- ---------------------- --------
-
Custom script: call RemoveLocation(udg_Location[1])
-
Custom script: call RemoveLocation(udg_Location[2])
-
Custom script: call RemoveLocation(udg_AimedShotEnd)
-
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
-------- 0 = Distance --------
-
-------- 1 = Angle --------
-
-------- 2 = Damage --------
-
-------- 3 = Projectile --------
-
-------- 4 = End Location --------
-
-------- ---------------------- --------
-
Unit Group - Pick every unit in AimedShotUnits and do (Actions)
-
Loop - Actions
-
Set AimedShotDistance = (Load 0 of (Key (Picked unit)) from AimedShotTable)
-
Set AimedShotAngle = (Load 1 of (Key (Picked unit)) from AimedShotTable)
-
Set AimedShotDamage = (Load 2 of (Key (Picked unit)) from AimedShotTable)
-
Set AimedShotDummy = (Load 3 of (Key (Picked unit)) in AimedShotTable)
-
Set AimedShotEnd = (Load 4 of (Key (Picked unit)) in AimedShotTable)
-
Set Location[1] = (Position of AimedShotDummy)
-
Set Location[2] = AimedShotEnd
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Location[1] and Location[2]) Less than 38.00
-
-
Then - Actions
-
Set Location[4] = (Position of AimedShotDummy)
-
Special Effect - Create a special effect at Location[4] using Abilities\Weapons\Mortar\MortarMissile.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit Group - Remove (Picked unit) from AimedShotUnits
-
Unit - Remove AimedShotDummy from the game
-
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in DisengageTable
-
Custom script: call RemoveLocation( udg_Location[4] )
-
-
Else - Actions
-
Set Location[3] = (Location[1] offset by 38.00 towards AimedShotAngle degrees)
-
Unit - Move AimedShotDummy instantly to Location[3]
-
Custom script: call RemoveLocation( udg_Location[3] )
-
-
-
Custom script: call RemoveLocation( udg_Location[1] )
-
Custom script: call RemoveLocation( udg_Location[2] )
-
-
-
Help would be appreciated, thanks in advance, Quetzalcotl