Код
function Trig_TP_Actions takes nothing returns nothing
local unit u = GetBuyingUnit()
local integer lID = GetItemTypeId(GetSoldItem())
if lID == 'I000' then
call SetUnitX(u,GetRectCenterX(gg_rct_Dalara))
call SetUnitY(u,GetRectCenterY(gg_rct_Dalara))
elseif lID == 'I001' then
call SetUnitX(u,GetRectCenterX(gg_rct_Kalimdor))
call SetUnitY(u,GetRectCenterY(gg_rct_Kalimdor))
endif
set u = null
endfunction
Добавлено (17 Августа 2015, 13:57:46)
---------------------------------------------
Лучше всего вот так:
Код
function Trig_TP_Actions takes nothing returns nothing
local unit u = GetBuyingUnit()
local integer lID = GetItemTypeId(GetSoldItem())
if lID == 'I000' then
call SetUnitX(u,GetRectCenterX(gg_rct_Dalara))
call SetUnitY(u,GetRectCenterY(gg_rct_Dalara))
elseif lID == 'I001' then
call SetUnitX(u,GetRectCenterX(gg_rct_Kalimdor))
call SetUnitY(u,GetRectCenterY(gg_rct_Kalimdor))
endif
set u = null
return
endfunction