- Joined
- Mar 18, 2009
- Messages
- 788
So, I'm creating a trigger for a spell that I am currently making and the visual effect is multiply Lightning effects from the casting units position to his enemies position. The problem is that I cant manage to get the function MUI.
Here are the triggers I have done so far:
[trigger=Lightning]Lightning
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to EXSPELL
Actions
Set TempUnit = (Triggering unit)
Hashtable - Save 80 as (Key Handl) of 4 in Hash
Hashtable - Save Handle Of(Units within 500.00 of (Position of TempUnit) matching ((((Triggering player) is an enemy of (Owner of (Matching unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) is Mechanical) Not equal to True))) as (Key (Triggering unit)) of 1 in Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group) Equal to 0
Then - Actions
Trigger - Turn on Lightning loop <gen>
Unit Group - Add TempUnit to Group
Else - Actions
Unit Group - Add TempUnit to Group[/trigger]
[trigger=Lightning Loop]Lightning loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Group and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
Set Handle = (Picked unit)
Hashtable - Save Handle Of(Position of (Picked unit)) as (Key Handle) of 2 in Hash
Hashtable - Save ((Load (Key Handle) of 4 from Hash) - 1) as (Key Handle) of 4 in Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key Handle) of 4 from Hash) Not equal to 0
Then - Actions
Unit Group - Pick every unit in (Load (Key Handle) of 1 in Hash) and do (Actions)
Loop - Actions
Hashtable - Save Handle Of(Position of (Picked unit)) as (Key (Picked unit)) of (Key Handle) in Hash
Set Lightning = (Load (Key (Picked unit)) of 3 in Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Load (Key (Picked unit)) of (Key Handle) in Hash) and (Load (Key Handle) of 2 in Hash)) Less than or equal to 500.00
((Picked unit) is alive) Equal to True
Then - Actions
Lightning - Destroy Lightning
Lightning - Create a Drain Life lightning effect from source (Load (Key (Picked unit)) of (Key Handle) in Hash) to target (Load (Key Handle) of 2 in Hash)
Hashtable - Save Handle Of(Last created lightning effect) as (Key (Picked unit)) of 3 in Hash
Else - Actions
Lightning - Destroy Lightning
Unit Group - Remove (Picked unit) from (Load (Key Handle) of 1 in Hash)
Else - Actions
Unit Group - Pick every unit in (Load (Key Handle) of 1 in Hash) and do (Actions)
Loop - Actions
Set Lightning = (Load (Key (Picked unit)) of 3 in Hash)
Lightning - Destroy Lightning
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Unit Group - Remove (Picked unit) from (Load (Key Handle) of 1 in Hash)
Unit Group - Remove TempUnit from Group
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions[/trigger]
I removed all other function within these two triggers since they already work.
REP to those who help me out with this, some will be added to the credit list to. =)
Here are the triggers I have done so far:
[trigger=Lightning]Lightning
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to EXSPELL
Actions
Set TempUnit = (Triggering unit)
Hashtable - Save 80 as (Key Handl) of 4 in Hash
Hashtable - Save Handle Of(Units within 500.00 of (Position of TempUnit) matching ((((Triggering player) is an enemy of (Owner of (Matching unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) is Mechanical) Not equal to True))) as (Key (Triggering unit)) of 1 in Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group) Equal to 0
Then - Actions
Trigger - Turn on Lightning loop <gen>
Unit Group - Add TempUnit to Group
Else - Actions
Unit Group - Add TempUnit to Group[/trigger]
[trigger=Lightning Loop]Lightning loop
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Group and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
Set Handle = (Picked unit)
Hashtable - Save Handle Of(Position of (Picked unit)) as (Key Handle) of 2 in Hash
Hashtable - Save ((Load (Key Handle) of 4 from Hash) - 1) as (Key Handle) of 4 in Hash
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key Handle) of 4 from Hash) Not equal to 0
Then - Actions
Unit Group - Pick every unit in (Load (Key Handle) of 1 in Hash) and do (Actions)
Loop - Actions
Hashtable - Save Handle Of(Position of (Picked unit)) as (Key (Picked unit)) of (Key Handle) in Hash
Set Lightning = (Load (Key (Picked unit)) of 3 in Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Load (Key (Picked unit)) of (Key Handle) in Hash) and (Load (Key Handle) of 2 in Hash)) Less than or equal to 500.00
((Picked unit) is alive) Equal to True
Then - Actions
Lightning - Destroy Lightning
Lightning - Create a Drain Life lightning effect from source (Load (Key (Picked unit)) of (Key Handle) in Hash) to target (Load (Key Handle) of 2 in Hash)
Hashtable - Save Handle Of(Last created lightning effect) as (Key (Picked unit)) of 3 in Hash
Else - Actions
Lightning - Destroy Lightning
Unit Group - Remove (Picked unit) from (Load (Key Handle) of 1 in Hash)
Else - Actions
Unit Group - Pick every unit in (Load (Key Handle) of 1 in Hash) and do (Actions)
Loop - Actions
Set Lightning = (Load (Key (Picked unit)) of 3 in Hash)
Lightning - Destroy Lightning
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Special Effect - Destroy (Last created special effect)
Unit Group - Remove (Picked unit) from (Load (Key Handle) of 1 in Hash)
Unit Group - Remove TempUnit from Group
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Group) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions[/trigger]
I removed all other function within these two triggers since they already work.
REP to those who help me out with this, some will be added to the credit list to. =)