Here's a tip:
Once you've acquired a certain piece of data in a variable, always use that variable for the rest of the trigger because that'll be more efficient.
For example:
-
Set SB_Caster[SB_TempInt] = (Triggering unit)
-
Set SB_CasterPt[SB_TempInt] = (Position of (Triggering unit))
-
Set SB_TargetPoint[SB_TempInt] = (Target point of ability being cast)
-
Set SB_MaxDistance[SB_TempInt] = (Distance between SB_CasterPt[SB_TempInt] and SB_TargetPoint[SB_TempInt])
-
Set SB_MinDistance[SB_TempInt] = 0.00
-
Set SB_AngleDummy[SB_TempInt] = (Angle from SB_CasterPt[SB_TempInt] to SB_TargetPoint[SB_TempInt])
-
Set SB_Angle[SB_TempInt] = 0.00
-
Set SB_Boolean[SB_TempInt] = True
-
Set SB_Level[SB_TempInt] = (Level of (Ability being cast) for (Triggering unit))
-
Unit - Create 1 Dummy for (Triggering player) at SB_CasterPt[SB_TempInt] facing (Facing of SB_Caster[SB_TempInt]) degrees
-
Set SB_Dummy[SB_TempInt] = (Last created unit)
-
Unit - Turn collision for SB_Dummy[SB_TempInt] Off
-
Set SB_DummyPoint = (Position of SB_Dummy[SB_TempInt])
-
Set SB_AreaPoint = (SB_DummyPoint offset by 400.00 towards SB_Angle[SB_TempInt] degrees)
-
Lightning - Create a Finger of Death lightning effect from source SB_DummyPoint to target SB_AreaPoint
-
Set SB_LightningEffect[SB_TempInt] = (Last created lightning effect)
-
Unit Group - Add SB_Caster[SB_TempInt] to SB_CasterGroup
-
Custom script: call RemoveLocation(udg_SB_DummyPoint)
-
Custom script: call RemoveLocation(udg_SB_AreaPoint)
After setting that variable to (Triggering Unit), why are you still using "(Triggering Unit)" in the rest of
the trigger? You should be using the variable.
Also, don't use (Ability being Cast) because you already know what that ability is
Just use the ability here instead because that's much more efficient.
Also, you should be using custom scripts to add the lightning because you can give the lightning a bit of "Z" with it
native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
The codeName is a four letter code for the lightning type
In this case, Finger of Death refers to "AFOD"
so:
-
Custom script: set udg_SB_LightningEffect[SB_TempInt] = AddLightningEx("AFOD",false,GetLocationX(source location),GetLocationY(source location),32,GetLocationX(target location),GetLocationY(target location),32)
Yeah it's long, but it's better ^^
Also, throughout the triggers, whenever you create a unit, since you're reffering to Last Created Unit multiple times, why don't you create a temp unit variable and set that to (Last Created Unit) and use it
instead
That would be more efficient