Beispiel #1
0
        /// <summary>
        /// Removes an item from the equipment slot it uses
        /// returns the used equipmentSlot
        /// </summary>
        public EquipmentSlotId UnequipItem(InventoryItem item)
        {
            ItemsEquiped.Remove(item.DynamicID);
            itemsEquipedBySlot[item.EquipmentSlot] = null;

            item.EquipmentSlot = EquipmentSlotId.Inventory;

            return(item.EquipmentSlot);
        }
Beispiel #2
0
        /// <summary>
        /// Equips an item in an equipment slot
        /// </summary>
        public void EquipItem(InventoryItem item, EquipmentSlotId slot)
        {
            ItemsEquiped.Add(item.DynamicID, item);
            item.Owner = _owner;
            //item.Attributes[GameAttributeStaticList.Item_Equipped] = true; // Probaly should be handled by Equipable class
            //item.Attributes.SendChangedMessage(_owner.GameClient);

            item.EquipmentSlot = slot;

            if (!itemsEquipedBySlot.ContainsKey(slot))
            {
                itemsEquipedBySlot.Add(slot, item);
            }
            else
            {
                itemsEquipedBySlot[slot] = item;
            }
        }