Hey, to be a commonly uploaded DotA spell this isn't very bad, after all it's MUI.
I'm not saying it's good, but it isn't crap.
Anyway here are things I found:
- temp_loc is never nulled
- temp is only sometimes nulled
- blinkEffect and targetEffect are never nulled
Coding:
-
set blinkEffect = AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", GetUnitLoc (caster))
call DestroyEffect (blinkEffect)
can be replaced with:
call DestroyEffect( AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", GetUnitLoc (caster)))
Thus avoiding the two variables that wern't nulled.
- In first If statment (in the loop) there's an empty "else", just remove it
- Uses alot of short TriggerSleepAction() which might cause obscure bugs. If you can, replace it with a Timer.
- Replace the IsUnitDeadBJ( GetFilterUnit() ) with GetWidgetLife( GetFilterUnit() ) < 0.405. It's faster and more reliable.
- This is a minor issue, but I suggest you use exitwhen count <= 0 instead of == 0, cause if the CPU calculates alot of stuff and happens to "miss" the exitwhen count == 0, you're garantueed that it will still exit (just giving you an additional target)
Improvements:
- Setup section? Currently you have to change 3 params if you get another rawcode for the spell. It would be alot more userfriendly
I hope it helps. If you're confused just ask, I'm here to help not judge.