A global variable can only have one value at a time. So everytime you do this:
-
Set VariableSet UnitTargetBashGhast = (Damage Target)
You're changing the value of the variable which affects ALL triggers and instances of triggers that use this variable.
So when this happens:
-
Wait 5.00 seconds
-
Animation - Change UnitTargetBashGhast's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Nothing is guaranteeing that the value of UnitTargetBashGhast is equal to the same Unit that it was Set to 5.00 seconds ago. This is what happens when you incorporate Waits into your triggers, you create opportunities for things to change which can affect multiple triggers at a time.
What you want is a local variable, which basically creates a new variable each time the trigger runs which will retains it's value throughout the trigger:
-
GhastBash
-

Events
-


Unit - A unit Takes damage
-

Conditions
-


((Unit-type of (Damage source)) Equal to Ghast) or ((Unit-type of (Damage source)) Equal to Ghast Female)
-

Actions
-


Custom script: local unit udg_UnitTargetBashGhast
-


Set VariableSet UnitTargetBashGhast = (Damage Target)
-


Unit - Create 1 BashGhastDummy for Neutral Passive at (Position of UnitTargetBashGhast) facing Default building facing degrees
-


Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
-


Unit - Order (Last created unit) to Human Mountain King - Storm Bolt UnitTargetBashGhast
-


Animation - Change UnitTargetBashGhast's vertex coloring to (50.00%, 75.00%, 75.00%) with 0.00% transparency
-


Wait 5.00 seconds
-


Animation - Change UnitTargetBashGhast's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
-


Custom script: set udg_UnitTargetBashGhast = null
Note that this method uses a special hybrid Global/Local variable. It's actually a trick you can do to easily make Local variables in GUI. We're turning the Global variable (UnitTargetBashGhast) into a Local variable by using that "local unit" Custom Script at the start of the Actions. The "= null" stuff at the end is simply to avoid a memory leak (local variables can leak). Read more about the technique here:
local udg_
Another note, this trigger still has problems if the same unit takes damage again while it's already tinted blue. This is because you'll have multiple instances of the trigger running at the same time for the same unit. For this you can use something like a Timer instead of a Wait, with the goal being that each Unit gets a
single Timer that will
restart whenever the trigger runs instead of creating a new one. This ensures that there will never be multiple Timers running at the same time for a unit.
Speaking of
memory leaks, you're leaking a Point here:
-
Unit - Create 1 BashGhastDummy for Neutral Passive at (Position of UnitTargetBashGhast) facing Default building facing degrees
(Position of UnitTargetBashGhast) leaks a Point.
Regarding the orb, you can remove the Art from any ability by editing it's Art fields. Buffs use Art as well which can be edited the same way: