Deleted member 219079
D
Deleted member 219079
Lightning.create:
You can see from the pic that the lightning has a good distance to the caster, why does this happen / how can I fix this?
JASS:
static method create takes real x1, real y1, real z1, real x2, real y2, real z2 returns thistype
local thistype this = thistype.allocate()
local timer t = NewTimer()
local unit dummy = CreateUnit(P_EFFECT, U_DUMMY, x2, y2, 9)
if UnitAddAbility(dummy, A_FLY) then
call UnitRemoveAbility(dummy, A_FLY)
endif
call SetUnitFlyHeight(dummy, LIGHT_HEIGHT+z2, 0)
call DestroyEffect(AddSpecialEffectTarget(EF_NODE, dummy, "origin"))
call UnitApplyTimedLife(dummy, 'BTLF', 2)
set me = AddLightningEx(LIGHT_CODE, true, x1, y1, LIGHT_HEIGHT+z1, x2, y2, LIGHT_HEIGHT+z2)
call BJDebugMsg("z1+height: "+R2S(LIGHT_HEIGHT+z1))
call BJDebugMsg("z2+height: "+R2S(LIGHT_HEIGHT+z2))
call SetTimerData(t,this)
call TimerStart(t, LIGHT_TIME, false, function thistype.onExpire)
set dummy = null
set t = null
return this
endmethod