- Joined
- May 25, 2006
- Messages
- 13
Im newish to jass, iv been using for some time now and have a basic grasp of it, but i can't for the life of me get this trigger to work. It's supposed to create a unit at the point of the caster and be moved instantly to his position for 10 seconds. All it's doing at the moment is lagging slightly then creating the unit. Can anyone please point out what im doing wrong
function heal_Actions takes nothing returns nothing
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local unit d
local real x=GetUnitX(u)
local real y=GetUnitY(u)
set d=CreateUnit(GetOwningPlayer(GetTriggerUnit( )),'h00F',x,y,I2R(0))
call TimerStart(t,I2R(10),FALSE,null)
loop
exitwhen R2I(TimerGetRemaining(t))==0
set x=GetUnitX(u)
set y=GetUnitY(u)
call SetUnitPosition(d,x,y)
endloop
endfunction
//==================================================================
function InitTrig_heal takes nothing returns nothing
set gg_trg_heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_heal, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_heal, function heal_Actions )
endfunction
i haven cleaned up leaks or anything yet*
function heal_Actions takes nothing returns nothing
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local unit d
local real x=GetUnitX(u)
local real y=GetUnitY(u)
set d=CreateUnit(GetOwningPlayer(GetTriggerUnit( )),'h00F',x,y,I2R(0))
call TimerStart(t,I2R(10),FALSE,null)
loop
exitwhen R2I(TimerGetRemaining(t))==0
set x=GetUnitX(u)
set y=GetUnitY(u)
call SetUnitPosition(d,x,y)
endloop
endfunction
//==================================================================
function InitTrig_heal takes nothing returns nothing
set gg_trg_heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_heal, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_heal, function heal_Actions )
endfunction
i haven cleaned up leaks or anything yet*