魔兽地图吧 » □-WE讨论区 » 背包切换与物品叠加演示
中影三年级
人生太失望了
function GetBag takes unit u returns nothing local integer j=1 local integer c loop exitwhen j>6 if UnitItemInSlot(u,j-1)!=null then call RemoveItem(UnitItemInSlot(u,j-1)) endif set c=GetItemId(u,GetBagIndex(u),j) if c!=0 then call UnitAddItemByIdSwapped(c,u) call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j)) else call UnitAddItemByIdSwapped('stel',u) call SetItemUserData(GetLastCreatedItem(),-1) endif set j=j+1 endloop set j=0 loop exitwhen j>5 if GetItemUserData(UnitItemInSlot(u,j))==-1 then call RemoveItem(UnitItemInSlot(u,j)) endif set j=j+1 endloop endfunction
Shingo Jass Highlighter 0.4
查看详细资料
TOP
橙zi 174
区域版主
WE伤透了我的心```
豆腐[NEED爱]
超级版主
邪恶地归来
function GetBag takes unit u returns nothing local integer j=1 local integer c loop exitwhen j>6 if UnitItemInSlot(u,j-1)!=null then call RemoveItem(UnitItemInSlot(u,j-1)) endif set c=GetItemId(u,GetBagIndex(u),j) if c!=0 then call TriggerSleepAction(1) call UnitAddItemToSlotById(u,c,j-1) call BJDebugMsg(I2S(H2I(UnitItemInSlot(u,j-1)))) call BJDebugMsg(I2S(H2I(u))+" "+I2S(c)+" "+I2S(j-1)) call TriggerSleepAction(1) call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j)) endif set j=j+1 endloop set j=0 endfunction
COPY JASSCODEJASS:call TriggerSleepAction(1) call UnitAddItemToSlotById(u,c,j-1) call BJDebugMsg(I2S(H2I(UnitItemInSlot(u,j-1)))) call BJDebugMsg(I2S(H2I(u))+" "+I2S(c)+" "+I2S(j-1)) call TriggerSleepAction(1)Shingo Jass Highlighter 0.4
call TriggerSleepAction(1) call UnitAddItemToSlotById(u,c,j-1) call BJDebugMsg(I2S(H2I(UnitItemInSlot(u,j-1)))) call BJDebugMsg(I2S(H2I(u))+" "+I2S(c)+" "+I2S(j-1)) call TriggerSleepAction(1)
function GetBag takes unit u returns nothing local integer j=1 local integer c loop exitwhen j>6 if UnitItemInSlot(u,j-1)!=null then call RemoveItem(UnitItemInSlot(u,j-1)) endif set c=GetItemId(u,GetBagIndex(u),j) if c!=0 then call TriggerSleepAction(0)//这里加个等待。。就不会出错。具体你再去分析把。。我又要游戏了 call UnitAddItemToSlotById(u,c,j-1) call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j)) endif set j=j+1 endloop set j=0 endfunction
这里加个等待。。就不会出错。具体你再去分析把。。我又要游戏了