找回密码
 点一下
查看: 1200|回复: 7

背包问题

[复制链接]
发表于 2008-8-5 17:24:54 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2008-8-5 17:35:00 | 显示全部楼层
单位做..
这个的话无法保留物品效果

一下是一个我写的双重背包..在1.22下可以保留效果也保留CD的双背包

[jass]//=====================双重背包初始化===========================
function doublebag_start takes unit U returns nothing
local integer I=-1
local item array Item
loop
exitwhen(I==5)
set I=I+1
set Item[I]=UnitItemInSlot(U,I)
call SetItemPosition(UnitItemInSlot(U,I),0,0)
endloop
call UnitRemoveAbility(U,'A00A')
call UnitAddAbility(U,'A009')
set I=-1
loop
exitwhen(I==5)
set I=I+1
call UnitAddItemByIdSwapped('I001',U)
endloop
call UnitAddAbility(U,'A00A')
set I=-1
loop
exitwhen(I==5)
set I=I+1
call UnitAddItem(U,Item[I])
call UnitDropItemSlot(U,Item[I],I)
endloop
set I=-1
loop
exitwhen(I==5)
set I=I+1
set Item[I]=null
endloop
set U=null
endfunction
//=========================================
//===============切换背包技能==============
function doublebag_del takes nothing returns nothing
call RemoveItem( GetManipulatedItem() )
endfunction

function doublebag_tab takes unit U returns nothing
local integer I=-1
local item array Item
local trigger T=CreateTrigger()
loop
exitwhen(I==5)
set I=I+1
set Item[I]=I2ITEM(GetStoredInteger(udg_GC,I2S(H2I(U)),I2S(I)))
call StoreInteger(udg_GC,I2S(H2I(U)),I2S(I+6),H2I(Item[I]))
endloop
set I=-1
loop
exitwhen(I==5)
set I=I+1
set Item[I]=UnitItemInSlot(U,I)
call StoreInteger(udg_GC,I2S(H2I(U)),I2S(I),H2I(Item[I]))
call SetItemPosition(UnitItemInSlot(U,I),0,0)
endloop
call TriggerRegisterUnitEvent( T, U, EVENT_UNIT_DROP_ITEM )
call TriggerAddAction(T, function doublebag_del )
call UnitRemoveAbility(U,'A00A')
call UnitRemoveAbility(U,'A009')
call DestroyTrigger( T )
set T=null
call UnitAddAbility(U,'A009')
set I=-1
loop
exitwhen(I==5)
set I=I+1
set Item[I]=I2ITEM(GetStoredInteger(udg_GC,I2S(H2I(U)),I2S(I)))
if (Item[I]!=null)then
call UnitAddItemByIdSwapped( GetItemTypeId(Item[I]), U )
else
call UnitAddItemByIdSwapped('I001',U)
endif
endloop
call UnitAddAbility(U,'A00A')
set I=-1
loop
exitwhen(I==5)
set I=I+1
set Item[I]=I2ITEM(GetStoredInteger(udg_GC,I2S(H2I(U)),I2S(I+6)))
call UnitAddItem(U,Item[I])
call UnitDropItemSlot(U,Item[I],I)
endloop
set I=-1
loop
exitwhen(I==5)
set I=I+1
set Item[I]=null
endloop
endfunction[/jass]

给你个参考
回复

使用道具 举报

发表于 2008-8-5 17:41:04 | 显示全部楼层
英雄和单位有什么区别?不明白………………
回复

使用道具 举报

发表于 2008-8-5 23:34:47 | 显示全部楼层
http://www.islga.org/bbs/read.php?tid=11388

这里有几个背包演示你看看吧。。。。。
回复

使用道具 举报

 楼主| 发表于 2008-8-6 10:12:04 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-8-6 12:12:41 | 显示全部楼层
引用第2楼zhuzeitou于2008-08-05 17:41发表的  :
英雄和单位有什么区别?不明白………………
單位的背包不能使用物品
回复

使用道具 举报

发表于 2008-8-6 14:32:58 | 显示全部楼层
单位给个英雄物品栏技能不就好了嘛~~
回复

使用道具 举报

发表于 2008-8-6 15:21:49 | 显示全部楼层
要把能使用物品的選項勾掉
不然他加了屬性會當機
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-7-21 02:28 , Processed in 0.030744 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表