As nedio95 wrote, those triggers are terrible. You should re-think what you want and work on the logic of what you want to achieve. What you have right now seems to be like something you were doing without much thinking and on the run.
Looking at the way you have set the spell, I assume you're pretty new to this, so you may not even know what memory leaks are.
In short, whenever you create anything in game, it takes a tiny bit of your PC's memory. Memory leak occurs when you don't destroy the unneeded stuff - that is because that stuff (even when it serves no purpose and for it may not even be visible to you) still takes that tiny part of your PC's memory. In actual game, this can be seen as gradual FPS decreasing, until the game starts lagging.
Why I wrote about memory leaks is because you have a huge amount of them in the loop trigger you posted.
Let's assume there is only one enemy of Tidalshock_C and that enemy owns 10 units. Your trigger would check each unit. The best-case scenario (leak-wise) here is that this condition:
-
(Distance between (Position of Tidalshock_LC1) and (Position of (Picked unit))) Less than or equal to 20.00
always returns false (as in the distance is greater than 20.00). So assuming that, your trigger would after only 1 second with 1 enemy player owning 10 units produce 4400 leaks. That's really a lot for just 1 second and only 10 units! With 20 units it would get to 8400 leaks per second and that is assuming the best case scenario only!
Some other things:
Unit's maximum movement speed can be only 522, no more. Even if you set higher speed in object editor, in real game it will still be 522 max. You would have to move the unit manually via triggers.
You should take a look at the tutorial section here on hive and check these 3 topics:
- learn about arrays
- learn about loops
- learn about memory leaks
I advise the part about memory leaks first, it's imo the easiest. It is also the most important as you may have a lot of code in your map(s) that leak memory.
With those 3 topics cleared, you could be using a lot simpler and cleaner code as well as prevent mistakes like checking double times the condition
-
(Level of Tidal Shock for Tidalshock_C) Equal to 1
instead of checking that condition against number 1 one time and number 4 the other time.
Also, just for future triggers it is enough for a loop to run at a minimum of 0.03 second. Any less is really unneeded (it runs way too many times for no reason at all).
I may fix those triggers for you, however there's one thing I don't know. Does the spell need to be MUI or not? MUI means Multiple Unit Instanceability and that basically means that multiple units can cast the spell at the same time without any undesired behaviour.
If only one unit can cast it and the previous cast of the spell will always end sooner than the next one can start, it does not need to be MUI.