Exemple #1
0
        void HandleCancelTempEnchantment(CancelTempEnchantment packet)
        {
            // apply only to equipped item
            if (!Player.IsEquipmentPos(InventorySlots.Bag0, (byte)packet.Slot))
            {
                return;
            }

            Item item = GetPlayer().GetItemByPos(InventorySlots.Bag0, (byte)packet.Slot);

            if (!item)
            {
                return;
            }

            if (item.GetEnchantmentId(EnchantmentSlot.Temp) == 0)
            {
                return;
            }

            GetPlayer().ApplyEnchantment(item, EnchantmentSlot.Temp, false);
            item.ClearEnchantment(EnchantmentSlot.Temp);
        }