``` unit Q2; interface uses Classes, SysUtils; procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); procedure Save(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); procedure Take(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); implementation procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); const S = [[ <存/@Save>\ <取/@Take>\ <离 开/@exit> ]]; begin Npc.Say(Player, S); end; procedure Save(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); var AItem: TUserItem; begin //存储的前提是该物品位于玩家背包 AItem := Player.GiveItem('裁决之杖'); //发放一个物品给玩家 if AItem <> nil then Player.AddItemToStorage(AItem); //将该物品存到普通仓库(可在仓库管理员处查看) AItem := Player.GiveItem('屠龙'); //发放一个物品给玩家 if AItem <> nil then Player.AddItemToBigStorage(AItem); //将该物品存到无限仓库 end; procedure Take(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); var I: Integer; begin //取回全部普通仓库的物品 for I := Player.StorageItemsCount - 1 downto 0 do begin if Player.MaxBagSize > Player.ItemSize then Player.TakebackStorageItem(I); //取回普通仓库某个存放位置的物品 end; //取回全部无限仓库的物品 for I := Player.BigStorageItemsCount - 1 downto 0 do begin if Player.MaxBagSize > Player.ItemSize then Player.TakebackBigStorageItem(I); //取回无限仓库某个存放位置的物品 end; end; end. ```