Review:
The spell mechanics behind this are quite simple, yet they deliver in appearance and eye-candy. Lofty as the wind, dazzling as lightning, perfect as a cube, such a strange spell catches enemies in awe. Their minds too foolish to understand, they are slowly brought up into the sky, with the fury of the elements tearing the very tethers of their bodies apart.
Code:
Optimization:
Try to avoid Filter functions and For Group callback actions whenever possible. There are a lot of For Group callbacks in the spell. For the callback function
EndCube
, you can use a
FirstOfGroup
loop instead.
Avoid destroying boolexprs if they are only generated once, like this boolexpr:
Condition(function GroupCon)
Use one global dummy unit instead of creating a new dummy unit per target.
If multi-leveled, you can make these variables into arrays: (Add a prefix so that these variables can be easily identified, their names are too generic right now).
-
Set Damage = 350.00
-
Set Radius = 300.00
-
Set Duration = 4
-
Set LType = Chain Lightning - Primary
Try to replace
GetUnitState
with
GetWidgetLife
The filter function
GroupCon
can be made into a customizable function like this:
JASS:
//---Conditions for units when we add them to cube (unit must be alive, not building, not in other cube and an enemy of caster)---
function GroupCon takes unit u returns boolean
return (GetWidgetLife(u) >= 0.405) /*
*/ and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) /*
*/ and (not IsUnitInGroup(u, udg_StunGroup)) /*
*/ and (IsUnitEnemy(u, GetOwningPlayer(udg_Caster[udg_N])))
endfunction
Add more customizable fields, such as the model art of the stun, and model art of the lightning ball.
I can see a lot of room for improvement of the spell, such as added customizability, and optimizable functions.
For now, this shall be
Awaiting Update