This code suppose to teleport a target unit infront of the caster, but it doesnt, so please tell me what's wrong with it.
JASS:
function Trig_Void_Tunnel_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A03T'
endfunction
function Trig_Void_Tunnel_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call TriggerSleepAction(0.1)
call SetUnitX(t, x + Cos(bj_RADTODEG * GetUnitFacing(u)) * 130)
call SetUnitY(t, y + Sin(bj_RADTODEG * GetUnitFacing(u)) * 130)
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_Void_Tunnel takes nothing returns nothing
set gg_trg_Void_Tunnel = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Void_Tunnel, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Void_Tunnel, Condition(function Trig_Void_Tunnel_Conditions))
call TriggerAddAction(gg_trg_Void_Tunnel, function Trig_Void_Tunnel_Actions)
endfunction
Last edited by a moderator: