Ejemplo n.º 1
0
        void InvMgr_ItemMoved(object sender, ItemMoveEventArgs e)
        {
            // TODO: when attuneable items are in, check for attuneable and set invItem attuned

            // TODO: old emu set the equipment material here but I don't see that ever being used

            if (e.ToSlotID <= (uint)InventorySlot.EquipSlotsEnd)
                TriggerWearChange(InventoryManager.GetEquipableType((InventorySlot)e.ToSlotID));

            if (e.FromSlotID <= (uint)InventorySlot.EquipSlotsEnd)
                TriggerWearChange(InventoryManager.GetEquipableType((InventorySlot)e.FromSlotID));

            if (e.NotifyClient) {
                MoveItem mi = new MoveItem() { FromSlot = e.FromSlotID, NumberInStack = e.Quantity, ToSlot = e.ToSlotID };
                EQApplicationPacket<MoveItem> miPack = null;

                if (e.Quantity > 0) {   // Moving from a stack?
                    mi.NumberInStack = 0xFFFFFFFF;
                    if (e.ToSlotID == 0xFFFFFFFF)
                        miPack = new EQApplicationPacket<MoveItem>(AppOpCode.DeleteItem, mi);
                    else
                        miPack = new EQApplicationPacket<MoveItem>(AppOpCode.MoveItem, mi);     // TODO: this right?

                    for (int i = 0; i < e.Quantity; i++)
                        this.Client.SendApplicationPacket(miPack);
                }
                else {
                    mi.NumberInStack = 0xFFFFFFFF;
                    miPack = new EQApplicationPacket<MoveItem>(AppOpCode.MoveItem, mi);
                    this.Client.SendApplicationPacket(miPack);
                }
            }

            CalcStatModifiers();
        }
Ejemplo n.º 2
0
        void InvMgr_ItemChargeUsed(object sender, ItemChargeUseEventArgs e)
        {
            MoveItem mi = new MoveItem() { FromSlot = e.SlotID, NumberInStack = 0xFFFFFFFF, ToSlot = 0xFFFFFFFF };
            EQApplicationPacket<MoveItem> miPack = new EQApplicationPacket<MoveItem>(AppOpCode.DeleteCharge, mi);

            for (int i = 0; i < e.Charges; i++)
                this.Client.SendApplicationPacket(miPack);
        }