Ejemplo n.º 1
0
        /// <summary>
        /// Transfers an amount from one stack to another
        /// </summary>
        public void OnInventoryStackTransferMessage(InventoryStackTransferMessage msg)
        {
            Item itemFrom = GetItem(msg.FromID);
            Item itemTo   = GetItem(msg.ToID);

            itemFrom.Attributes[GameAttribute.ItemStackQuantityLo] -= (int)msg.Amount;
            itemTo.Attributes[GameAttribute.ItemStackQuantityLo]   += (int)msg.Amount;

            itemFrom.Attributes.SendChangedMessage(_owner.InGameClient);
            itemTo.Attributes.SendChangedMessage(_owner.InGameClient);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Transfers an amount from one stack to another
        /// </summary>
        public void OnInventoryStackTransferMessage(InventoryStackTransferMessage msg)
        {
            Item itemFrom = _owner.World.GetItem(msg.FromID);
            Item itemTo   = _owner.World.GetItem(msg.ToID);

            itemFrom.Attributes[GameAttribute.ItemStackQuantityLo] -= (int)msg.Amount;
            itemTo.Attributes[GameAttribute.ItemStackQuantityLo]   -= (int)msg.Amount;


            // TODO: This needs to change the attribute on the item itself. /komiga
            // Update source
            itemFrom.Attributes.SendChangedMessage(_owner.InGameClient);

            // TODO: This needs to change the attribute on the item itself. /komiga
            // Update target
            itemTo.Attributes.SendChangedMessage(_owner.InGameClient);
        }