Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
JASS:
struct knockDat
unit uni
real speed
real direc
timer time
endstruct
function tideTimeCall takes nothing returns nothing
local knockDat knockD
local location offset = PolarProjectionBJ(GetUnitLoc(knockD.uni),knockD.speed,knockD.direc)
call SetUnitPositionLoc(knockD.uni,offset)
set knockD.direc = knockD.direc - 1
if knockD.direc < 30 then
call DestroyTimer(knockD.time)
endif
endfunction
function tideKnock takes nothing returns nothing
local knockDat knockD = knockDat.create()
local knockDat knockCastD
local unit kdunit = CreateUnitAtLoc(GetOwningPlayer(knockCastD.uni),'hfoo',GetUnitLoc(knockCastD.uni),knockCastD.direc)
call BJDebugMsg(GetUnitName(kdunit))
//-->
set knockD.uni = kdunit
call BJDebugMsg(GetUnitName(knockD.uni))
set knockD.speed = 15
set knockD.direc = GetUnitFacing(GetSpellAbilityUnit())
call TimerStart(knockD.time,.03,true,function tideTimeCall)
endfunction
function tideActions takes nothing returns nothing
local knockDat knockCastD = knockDat.create()
if GetSpellAbilityId()=='A001' then
set knockCastD.uni = GetSpellAbilityUnit()
set knockCastD.direc = GetUnitFacing(GetSpellAbilityUnit())
call tideKnock()
else
call knockCastD.destroy()
endif
endfunction
function InitTrig_tide takes nothing returns nothing
set gg_trg_tide = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_tide,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_tide,function tideActions)
endfunction
what am i doing wrong? everything seems to work until it gets to by debug messages (look for the comment)