make an array variable, unit type. for example: UnitType
set UnitType[1] = Ents
set UnitType[2] = Wisps
when you spawn, create <number of units> of type UnitType[Hero Level]
easiest way to do it without triggering the fireball itself is probably:
you will need a unit indexing system, like AIDS [EDIT: nevermind, forgot about hashtables]
-Make firebolt a dummy spell (spell that does nothing)
-Detect unit casting firebolt
-Create a dummy to cast the real firebolt at...
local real DNewX = DX + OFFSET * Cos(s.angle)
local real DNewY = DY + OFFSET * Sin(s.angle)
s.angle should be in radians, however,
call SetUnitFacing(s.Dummy, s.angle)
should be in degrees
what i was trying to say was, what part of your game would need such a system? you must take into consideration that these systems take a long time to write and/or implement and bring down performance if there are too many projectiles (combined with leaking)
you must decide whether your game...
if possible, could you upload the map? (you can pm too). sometimes, it just takes a little tinkering and experimenting. from your code itself, it looks perfectly fine