コード例 #1
0
ファイル: Inventory.cs プロジェクト: keltins/mooege
 public void OnInventorySplitStackMessage(InventorySplitStackMessage msg)
 {
     // TODO need to create and introduce a new item that is of the same type as the source
 }
コード例 #2
0
ファイル: Inventory.cs プロジェクト: kiwi0530/mooege
        /// <summary>
        /// Transfers an amount from one stack to a free space
        /// </summary>
        public void OnInventorySplitStackMessage(InventorySplitStackMessage msg)
        {
            Item itemFrom = GetItem((uint)msg.FromID);
            itemFrom.Attributes[GameAttribute.ItemStackQuantityLo] -= (int)msg.Amount;
            itemFrom.Attributes.SendChangedMessage(_owner.InGameClient);

            Item item = ItemGenerator.CreateItem(_owner, itemFrom.ItemDefinition);
            item.Attributes[GameAttribute.ItemStackQuantityLo] = (int)msg.Amount;

            InventoryGrid targetGrid = (msg.InvLoc.EquipmentSlot == (int)EquipmentSlotId.Stash) ? _stashGrid : _inventoryGrid;
            targetGrid.AddItem(item, msg.InvLoc.Row, msg.InvLoc.Column);
        }