NeuroToxin
New Member
- Reaction score
- 46
Okay, the dummy unit moves, then stops, and I have messages put in here, so that the trigger tells me where it is, but it just doesnt work. The dummy unit isnt being removed either, and it says that the unit reached the target before it even goes anywhere, it doesnt move
Trigger:
- Hashtable
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set HomingTable = (Last created hashtable)
- Events
Trigger:
- Homing Rocket GUI
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to |cffffff00H|r|cffff0080oming Missle|r
- Actions
- Set Caster = (Triggering unit)
- Unit Group - Add Caster to HomingGroup
- Set TargetUnit = (Target Unit of (Ability Being Cast))
- Set CasterLoc = (Position of (Triggering unit))
- Set TargetUnitLoc = (Position of (Target unit of ability being cast))
- Set Angle = (Angle from CasterLoc to TargetUnitLoc)
- Unit - Create 1 Rocket_Unit for (Owner of Caster) at (CasterLoc offset by 100.00 towards Angle degrees) facing Angle degrees
- Hashtable - Save Handle OfDummyUnit as 2 of (Key (Last created unit)) in HomingTable
- Unit - Set level of Dummy_StormBolt for (Last created unit) to (Level of |cffffff00H|r|cffff0080oming Missle|r for (Load 0 of 1 in HomingTable))
- Set DummyUnit = (Last created unit)
- Unit Group - Add (Last created unit) to HomingRocketGroup
- Game - Display to (All players) the text: Homing Rocket Start...
- Hashtable - Save Handle OfCaster as 0 of (Key (Triggering unit)) in (Last created hashtable)
- Hashtable - Save Handle OfTargetUnit as 1 of (Key (Target unit of ability being cast)) in HomingTable
- Trigger - Turn on Homing Rocket Move <gen>
- Events
Trigger:
- Homing Rocket 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 HomingGroup) Greater than 0
- Then - Actions
- Unit Group - Pick every unit in HomingGroup and do (Actions)
- Loop - Actions
- Set TargetUnit = (Load 1 of (Key (Target unit of ability being cast)) in HomingTable)
- Set DummyUnit = (Load 2 of (Key (Last created unit)) in HomingTable)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between DummyLoc and TargetUnitLoc) Less than or equal to 40.00
- Then - Actions
- Game - Display to (All players) the text: Unit Is Reaching Ta...
- Special Effect - Create a special effect at TargetUnitLoc using Abilities\Spells\Other\TinkerRocket\TinkerRocketMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Order DummyUnit to Human Mountain King - Storm Bolt TargetUnit
- Unit Group - Remove DummyUnit from HomingRocketGroup
- Unit - Remove DummyUnit from the game
- Custom script: call RemoveLocation(udg_CasterLoc)
- Custom script: call RemoveLocation(udg_TargetUnitLoc)
- Custom script: call RemoveLocation(udg_DummyLoc)
- Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in HomingTable
- Hashtable - Clear all child hashtables of child (Key (Last created unit)) in HomingTable
- Hashtable - Clear all child hashtables of child (Key (Target unit of ability being cast)) in HomingTable
- Else - Actions
- Custom script: call RemoveLocation(udg_TargetUnitLoc)
- Custom script: call RemoveLocation(udg_DummyLoc)
- Set DummyLoc = (Position of DummyUnit)
- Set TargetUnitLoc = (Position of TargetUnit)
- Set PointsMovedPerSecond = ((Distance between DummyLoc and TargetUnitLoc) x 0.04)
- Set Angle = (Angle from DummyLoc to TargetUnitLoc)
- Unit Group - Pick every unit in HomingRocketGroup and do (Actions)
- Loop - Actions
- Unit - Move DummyUnit instantly to (DummyLoc offset by PointsMovedPerSecond towards Angle degrees), facing Angle degrees
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between TargetUnitLoc and DummyLoc) Less than or equal to 40.00
- Then - Actions
- Unit - Order DummyUnit to Human Mountain King - Storm Bolt TargetUnit
- Special Effect - Create a special effect at TargetUnitLoc using Abilities\Spells\Other\TinkerRocket\TinkerRocketMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Remove DummyUnit from the game
- Custom script: call RemoveLocation(udg_CasterLoc)
- Custom script: call RemoveLocation(udg_TargetUnitLoc)
- Custom script: call RemoveLocation(udg_DummyLoc)
- Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in HomingTable
- Hashtable - Clear all child hashtables of child (Key (Last created unit)) in HomingTable
- Hashtable - Clear all child hashtables of child (Key (Target unit of ability being cast)) in HomingTable
- Else - Actions
- If - Conditions
- Loop - Actions
- If - Conditions
- Loop - Actions
- Unit Group - Pick every unit in HomingGroup and do (Actions)
- Else - Actions
- Trigger - Turn off (This trigger)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events