Better is a single trigger. Except when you create a local trigger for a specific unit for a certain period of time.
It's also best to never use Conditions and instead check conditions in Actions using if/then/else.
Every Conditions check like "Used skill is Blizzard" creates an extra function, but if you do everything in Actions, that won't happen.
If you're thinking about it, why not just switch to Jass? Thoughts about how to make things "better" or "more optimized" indicate that you may be ready for this step.
But okay, let's think about GUI a little.
Yes, when a single GUI trigger has many actions, it can lag and become less visually appealing, but you can still split actions into multiple triggers.
With YDWE PK, you can use "call" and "ExecuteFucntion" to create and use your own functions.
With the default GUI, you can run another trigger.
It might look like this: If (condition) then (run trigger)
This way, you can have one trigger for each event, which will, if necessary, trigger other triggers that don't have events.
This is a kind of sorting.
Is this better than multiple triggers with the same event? Yes, this way you know exactly the order in which actions will be executed.
Is it more optimized? A little, because the event will only proc once.
The problem is that every GUI trigger, even if empty, the following happens:
Always created:
- A function that runs when the map is initialized. (Btw, if you have a lot of triggers, this can lead to an "operation limit" which will break most of your triggers)
- A function for "Actions"
- Global trigger variable
- New trigger
If events is used:
If conditions used:
- A function for conditions
If you understood everything listed above, then you've already guessed that GUI triggers suck in terms of optimization anyway.
I could fix this in YDWE PK, but I don't want to mess around with C++ for the sake of a couple of smart people.
To summarize: Don't use Conditions and try separating triggers using "Run Trigger" - it will definitely be better.
But when it comes to triggers for custom abilities, the best optimization option is to store the functions in a hashtable and then call them in the "unit uses ability" event.
We save the function by the parent key, which is the Id of a specific ability, and then when casting, we check if the Id of the applied ability is written to the hashtable, we run the function of this ability.
How do you do this with the default GUI? Idk, you don't even have all the functions for working with a hashtable.