|
function it2i takes item it returns integer
return it
return 0
endfunction
function i2u takes integer i returns unit
return i
return null
endfunction
function Trig_diuqiwupin_Conditions takes nothing returns boolean
local unit uu=GetTriggerUnit()
local item it = UnitItemInSlotBJ(uu, 2)
local unit u=i2u(it2i(it))
if GetItemTypeId(GetManipulatedItem())=='I083' then
if GetItemTypeId(it) =='I088' then
if IsUnitInGroup(u,xqsx[0])==false then
call GroupAddUnit(xqsx[0],u)
endif
if IsUnitInGroup(u,xqsx[0])==true then
call GroupAddUnit(xqsx[1],u)
endif
endif
if GetItemTypeId(it)=='I086' then
if IsUnitInGroup(u,xqsx[2])==false then
call GroupAddUnit(xqsx[2],u)
endif
if IsUnitInGroup(u,xqsx[2])==true then
call GroupAddUnit(xqsx[3],u)
endif
endif
if GetItemTypeId(it)=='I087' then
if IsUnitInGroup(u,xqsx[4])==false then
call GroupAddUnit(xqsx[4],u)
endif
if IsUnitInGroup(u,xqsx[4])==true then
call GroupAddUnit(xqsx[5],u)
endif
endif
if GetItemTypeId(it)=='I085' then
if IsUnitInGroup(u,xqsx[6])==false then
call GroupAddUnit(xqsx[6],u)
endif
if IsUnitInGroup(u,xqsx[6])==true then
call GroupAddUnit(xqsx[7],u)
endif
endif
call RemoveItem(UnitItemInSlotBJ(uu,2))
endif
set u=null
set uu=null
endfunction
这段J是否成功把物品转的单位成功添加进单位组里了?
如果没有,要怎么做才可以实现? |
|