The spell will be more flexible if you use
-
(Triggering unit)
Instead of
-
(Casting unit)
Because the triggering unit is the same as the casting unit. (The triggering unit is the one that triggers off the whole trigger (casting unit)).
So for mor flexibility of you'r spell, change all casting unit to triggering unit because then the World Editor picks the triggering unit right away instead of "searching" for the casting unit and if there's no triggering unit the function will return NULL.
You leak this one below because you dont destroy the Special effect.
-
Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Items\AIma\AImaTarget.mdl
The most special effects should be destroyed right after it has been created (the effect will still occur). Put this following right after the action above
-
Special Effect - Destroy (Last created special effect)
Also in the
-
Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Items\AIma\AImaTarget.mdl
you leak a location.
Create a Variable called like "Loc" with array 1 and have it as a point variable and do this below
-
Set Loc[1] = (Position of (Triggering unit))
-
Special Effect - Create a special effect at Loc[1] using Abilities\Spells\Items\AIma\AImaTarget.mdl
-
Custom script: call RemoveLocation (udg_Loc[1])
Also you should remove all the actions
-
Do nothing
because if you remove it, the trigger will not do anything in all cases. The action Do nothing just makes the trigger bigger and that makes the spell a little slower.
Here in the condition below
-
((Target unit of ability being cast) is in (Units in (Playable map area) matching (((Target unit of ability being cast) belongs to an ally of (Owner of (Casting unit))) Equal to True))) Equal to True
You must change Target unit of ability being cast to Matching Unit and also the Casting unit to Triggering unit as i said. Makes also the spell more flexible.
You leak a unit group and a location here below
-
Unit Group - Pick every unit in (Units within 800.00 of (Position of (Target unit of ability being cast)) matching (((Matching unit) Not equal to (Target unit of ability being cast)) and (((Owner of (Matching unit)) is an ally of (Owner of (Casting unit))) Equal to True))) and do (Actions)
You should do this below (Create a variable called like "Group" and set it to Unit Group)
-
Set Loc[2] = (Position of (Target unit of ability being cast))
-
Set Group = (Units within 800.00 of Loc[2] matching ((Matching unit) Not equal to (Target unit of ability being cast))) /// and load in with more of the conditions you want
-
Unit Group - Pick every unit in Group and do (Actions)
-

Loop - Actions
-


Load in with Actions here
-
Custom script: call DestroyGroup (udg_Group) /// Do this after the Unit group action.
-
Custom script: call RemoveLocation (udg_Loc[2]) /// Destroys the leak.
Also you do the same misstake TWICE a bit below that Unit Group Leak
Well that was all. This spell is not going to be approven because of all the leaks and stuffs. Well good calculating. You must learn some more about how to avoid leaks. Well here is the best place. Go to Tutorials and search there for a way to learn how to avoid this.