- Joined
- Jan 12, 2010
- Messages
- 132
Two hours ago i found a tutorial here on hive about hashtable and i decided try to create a spell MUI.The first trigger of spell work fine but second no.So the second trigger obviously should move unit to a specific point facing a specific angle .Here are the trigger:
-
Twist
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to LB
-
Actions
- Set Twist_point = (Target point of ability being cast)
- Set Twist_caster = (Triggering unit)
- Set Twist_timer = 6.00
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
- Set Twist_angle = ((Real((Integer A))) x 30.00)
- Unit - Create 1 Dummy (sword) for (Owner of Twist_caster) at Twist_point facing Twist_angle degrees
- Unit - Turn collision for (Last created unit) Off
- Unit - Add a 6.10 second Generic expiration timer to (Last created unit)
- Unit - Make (Last created unit) Explode on death
- Unit Group - Add (Last created unit) to Twist_group[1]
- Hashtable - Save Handle OfTwist_point as 1 of (Key (Last created unit)) in MY_hashtable
- Hashtable - Save Twist_angle as 2 of (Key (Last created unit)) in MY_hashtable
- Hashtable - Save Twist_timer as 3 of (Key (Last created unit)) in MY_hashtable
-
Loop - Actions
- Custom script: call RemoveLocation(udg_Twist_point)
-
Events
-
Twist event
-
Events
- Time - Every 0.04 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Twist_group[1] and do (Actions)
-
Loop - Actions
- Set Twist_timer = (Load 3 of (Key (Picked unit)) from MY_hashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Twist_timer Greater than 0.04
-
Then - Actions
- Set Twist_angle = (Load 2 of (Key (Picked unit)) from MY_hashtable)
- Set Twist_angle = (Twist_angle + 5.00)
- If (Twist_angle Equal to 365.00) then do (Set Twist_angle = 5.00) else do (Do nothing)
- Unit - Move (Picked unit) instantly to (Load 1 of (Key (Picked unit)) in MY_hashtable), facing Twist_angle degrees
- Hashtable - Save Twist_angle as 2 of (Key (Picked unit)) in MY_hashtable
- Hashtable - Save (Twist_timer - 0.04) as 3 of (Key (Picked unit)) in MY_hashtable
-
Else - Actions
- Unit Group - Remove (Picked unit) from Twist_group[1]
- Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MY_hashtable
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in Twist_group[1] and do (Actions)
-
Events