- Joined
- Jul 31, 2012
- Messages
- 2,217
I created this thread for the spell i uploaded here and i'm making it GUI
I made what i could following a hashtable tutorial here and i got stuck here:
The first is perfectly MUI but the second doesn't do anything, someone help?
If it is hard to understand all the hashtable:
I made what i could following a hashtable tutorial here and i got stuck here:
-
Lightning Field Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Lightning Field
-
Actions
- Set Hashtable_Value = (Key (Triggering unit))
- Hashtable - Save Handle Of(Triggering unit) as 1 of Hashtable_Value in Hashtable
- Hashtable - Save Handle Of(Target point of ability being cast) as 20 of Hashtable_Value in Hashtable
- Hashtable - Save 0.02 as 21 of Hashtable_Value in Hashtable
- Hashtable - Save 600 as 22 of Hashtable_Value in Hashtable
-
For each (Integer x) from 1 to 6, do (Actions)
-
Loop - Actions
- Unit - Create 1 Lightning Field dummy for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
- Hashtable - Save Handle Of(Last created unit) as (x + 1) of Hashtable_Value in Hashtable
-
Loop - Actions
- Unit - Create 1 Lightning Field dummy high for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
- Hashtable - Save Handle Of(Last created unit) as 8 of Hashtable_Value in Hashtable
- Wait 1.00 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 1 to 5, do (Actions)
-
Loop - Actions
- Set Lightning_Field_dummy[(x + 1)] = (Load (x + 2) of Hashtable_Value in Hashtable)
- Set Lightning_Field_Target = (Load 20 of Hashtable_Value in Hashtable)
- Set temp_location = (Lightning_Field_Target offset by 500.00 towards ((360.00 / 5.00) x (Real(x))) degrees)
- Unit - Order Lightning_Field_dummy[(x + 1)] to Move To temp_location
- Set Lightning_Field_Angle[x] = ((360.00 / 5.00) x (Real(x)))
- Hashtable - Save Lightning_Field_Angle[x] as (x + 21) of Hashtable_Value in Hashtable
-
Loop - Actions
- Animation - Change (Load 8 of Hashtable_Value in Hashtable) flying height to 600.00 at 600.00
- Wait 1.00 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 2 to 2, do (Actions)
-
Loop - Actions
- Set Lightning_Field_dummy[x] = (Load (x + 1) of Hashtable_Value in Hashtable)
- Set Lightning_Field_dummy[(x + 1)] = (Load (x + 2) of Hashtable_Value in Hashtable)
- Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[x]) to target (Position of Lightning_Field_dummy[(x + 1)])
- Hashtable - Save Handle Of(Last created lightning effect) as (x + 7) of Hashtable_Value in Hashtable
-
Loop - Actions
- Wait 0.01 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 3 to 3, do (Actions)
-
Loop - Actions
- Set Lightning_Field_dummy[x] = (Load (x + 1) of Hashtable_Value in Hashtable)
- Set Lightning_Field_dummy[(x + 1)] = (Load (x + 2) of Hashtable_Value in Hashtable)
- Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[x]) to target (Position of Lightning_Field_dummy[(x + 1)])
- Hashtable - Save Handle Of(Last created lightning effect) as (x + 7) of Hashtable_Value in Hashtable
-
Loop - Actions
- Wait 0.01 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 4 to 4, do (Actions)
-
Loop - Actions
- Set Lightning_Field_dummy[x] = (Load (x + 1) of Hashtable_Value in Hashtable)
- Set Lightning_Field_dummy[(x + 1)] = (Load (x + 2) of Hashtable_Value in Hashtable)
- Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[x]) to target (Position of Lightning_Field_dummy[(x + 1)])
- Hashtable - Save Handle Of(Last created lightning effect) as (x + 7) of Hashtable_Value in Hashtable
-
Loop - Actions
- Wait 0.01 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 5 to 5, do (Actions)
-
Loop - Actions
- Set Lightning_Field_dummy[x] = (Load (x + 1) of Hashtable_Value in Hashtable)
- Set Lightning_Field_dummy[(x + 1)] = (Load (x + 2) of Hashtable_Value in Hashtable)
- Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[x]) to target (Position of Lightning_Field_dummy[(x + 1)])
- Hashtable - Save Handle Of(Last created lightning effect) as (x + 7) of Hashtable_Value in Hashtable
-
Loop - Actions
- Wait 0.01 seconds
- Set Hashtable_Value = (Key (Triggering unit))
- Lightning - Create a Forked Lightning lightning effect from source (Position of (Load 7 of Hashtable_Value in Hashtable)) to target (Position of (Load 3 of Hashtable_Value in Hashtable))
- Hashtable - Save Handle Of(Last created lightning effect) as 13 of Hashtable_Value in Hashtable
- Wait 0.01 seconds
- Set Hashtable_Value = (Key (Triggering unit))
-
For each (Integer x) from 1 to 6, do (Actions)
-
Loop - Actions
- Set p = (Position of (Load 2 of Hashtable_Value in Hashtable))
- Set p1 = (Position of (Load (x + 1) of Hashtable_Value in Hashtable))
- Custom script: set udg_Lightning_Field_lightning[udg_x+5] = AddLightningEx("FORK", true , GetLocationX(udg_p), GetLocationY(udg_p), GetLocationZ(udg_p) + 600, GetLocationX(udg_p1), GetLocationY(udg_p1), GetLocationZ(udg_p1) + 0)
- Hashtable - Save Handle OfLightning_Field_lightning[(x + 5)] as (x + 13) of Hashtable_Value in Hashtable
-
Loop - Actions
- Wait 0.50 seconds
- Set Hashtable_Value = (Key (Triggering unit))
- Animation - Change (Load 8 of Hashtable_Value in Hashtable) flying height to 100.00 at 100.00
- Unit Group - Add (Triggering unit) to Lightning_Field_UG
- Custom script: call RemoveLocation(udg_temp_location)
- Custom script: call RemoveLocation(udg_p)
- Custom script: call RemoveLocation(udg_p1)
-
Events
-
Lightning Field move
-
Events
- Time - Every 0.01 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Lightning_Field_UG and do (Actions)
-
Loop - Actions
- Hashtable - Save ((Load 23 of (Key (Picked unit)) from (Last created hashtable)) - 1) as 23 of (Key (Picked unit)) in Hashtable
-
For each (Integer x) from 1 to 5, do (Actions)
-
Loop - Actions
- Hashtable - Save (Load (x + 21) of (Key (Picked unit)) from Hashtable) as (x + 21) of (Key (Picked unit)) in Hashtable
- Set temp_location = ((Position of Lightning_Field_dummy[1]) offset by 500.00 towards Lightning_Field_Angle[x] degrees)
- Unit - Move (Load (x + 2) of (Key (Picked unit)) in Hashtable) instantly to ((Position of (Load 2 of (Key (Picked unit)) in Hashtable)) offset by 500.00 towards (Load (x + 21) of (Key (Picked unit)) from Hashtable) degrees)
- Lightning - Move (Load (x + 8) of (Key (Picked unit)) in Hashtable) to source (Position of (Load (x + 2) of (Key (Picked unit)) in Hashtable)) and target (Position of (Load (x + 3) of (Key (Picked unit)) in Hashtable))
-
Loop - Actions
-
Loop - Actions
-
For each (Integer x) from 1 to 6, do (Actions)
-
Loop - Actions
- Set p = (Position of (Load 2 of (Key (Picked unit)) in Hashtable))
- Set p1 = (Position of (Load (x + 1) of (Key (Picked unit)) in Hashtable))
- Custom script: call MoveLightningEx(LoadLightningHandleBJ(( udg_x + 13 ), GetHandleIdBJ(GetEnumUnit()), udg_Hashtable), true , GetLocationX(udg_p), GetLocationY(udg_p), GetLocationZ(udg_p) + udg_i, GetLocationX(udg_p1), GetLocationY(udg_p1), GetLocationZ(udg_p1) + 0)
-
Loop - Actions
- Lightning - Move (Load 13 of (Key (Picked unit)) in Hashtable) to source (Position of (Load 3 of (Key (Picked unit)) in Hashtable)) and target (Position of (Load 7 of (Key (Picked unit)) in Hashtable))
- Hashtable - Save (Load 21 of (Key (Picked unit)) from Hashtable) as 21 of (Key (Picked unit)) in Hashtable
- Unit - Order (Load 8 of (Key (Picked unit)) in Hashtable) to Orc Tauren Chieftain - War Stomp
- Custom script: call RemoveLocation(udg_temp_location)
- Custom script: call RemoveLocation(udg_p)
- Custom script: call RemoveLocation(udg_p1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load 21 of (Key (Picked unit)) from Hashtable) Greater than or equal to 10.00
-
Then - Actions
- Unit Group - Remove (Load 1 of (Key (Picked unit)) in Hashtable) from Lightning_Field_UG
- Unit - Create 1 Lightning Field effect for (Owner of (Load 1 of (Key (Picked unit)) in Hashtable)) at (Position of (Load 2 of (Key (Picked unit)) in Hashtable)) facing Default building facing degrees
- Unit - Add Lightning_Field_Ability[(Level of Lightning Field for Lightning_Field_Caster)] to (Last created unit)
- Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
- Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
- Unit - Create 1 Lightning Field effect for (Owner of (Load 1 of (Key (Picked unit)) in Hashtable)) at (Position of (Load 2 of (Key (Picked unit)) in Hashtable)) facing Default building facing degrees
- Animation - Change (Last created unit)'s animation speed to 20.00% of its original speed
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
- Unit - Create 1 Lightning Field effect for (Owner of (Load 1 of (Key (Picked unit)) in Hashtable)) at (Position of (Load 2 of (Key (Picked unit)) in Hashtable)) facing Default building facing degrees
- Animation - Change (Last created unit)'s animation speed to 10.00% of its original speed
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
-
For each (Integer x) from 1 to 7, do (Actions)
-
Loop - Actions
- Unit - Remove (Load (x + 1) of (Key (Picked unit)) in Hashtable) from the game
-
Loop - Actions
-
For each (Integer x) from 1 to 11, do (Actions)
-
Loop - Actions
- Lightning - Destroy (Load (x + 8) of (Key (Picked unit)) in Hashtable)
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
Unit Group - Pick every unit in Lightning_Field_UG and do (Actions)
-
Events
If it is hard to understand all the hashtable:
1 x: caster
--------------------
2 x: dumies 1
3 x: dumies 2
4 x: dumies 3
5 x: dumies 4
6 x: dumies 5
7 x: dumies 6
8 x: dumies 7
---------------------
9 x: lightning 1
10 x: lightning 2
11 x: lightning 3
12 x: lightning 4
13 x: lightning 5
14 x: lightning 6
15 x: lightning 7
16 x: lightning 8
17 x: lightning 9
18 x: lightning 10
19 x: lightning 11
---------------------------
20 x: target point
---------------------------
21 x: angle speed
---------------------------
22 x: i (dummy height)
---------------------------
22 x: angle 1
23 x: angle 2
24 x: angle 3
25 x: angle 4
26 x: angle 5
--------------------
2 x: dumies 1
3 x: dumies 2
4 x: dumies 3
5 x: dumies 4
6 x: dumies 5
7 x: dumies 6
8 x: dumies 7
---------------------
9 x: lightning 1
10 x: lightning 2
11 x: lightning 3
12 x: lightning 4
13 x: lightning 5
14 x: lightning 6
15 x: lightning 7
16 x: lightning 8
17 x: lightning 9
18 x: lightning 10
19 x: lightning 11
---------------------------
20 x: target point
---------------------------
21 x: angle speed
---------------------------
22 x: i (dummy height)
---------------------------
22 x: angle 1
23 x: angle 2
24 x: angle 3
25 x: angle 4
26 x: angle 5