- Don't use ~=nil in conditions. false and nil are only boolean falses. 0 is not.
- Always do ReleaseParticleIndex(particleID) after you are done with a particle. DestroyParticle(particleID) if particle is not being destroyed by itself.
- Instead of using :GetTeam() use :GetTeamNumber().
- Avoid using EmitSoundOn and StopSoundOn -> they don't respect Fog of War. Use unit:EmitSound("") instead.
- Use enums wherever you can.
- Avoid using + for bit values (unless they are userdata/uint64). Use bit.bor(v1,v2,v3,...).
- If a spell is dealing physical damage, you need a damage flag: DOTA_DAMAGE_FLAG_BYPASSES_BLOCK
- DeclareFunctions() and CheckState() don't need: 'local funcs = {...}' or 'local state = {...}', just do 'return {...}' if there are no special conditions.
- Don't do 'return nil', doing 'return' is enough.
- OnSpentMana event doesn't work with in WTF mode.