Exemple #1
0
        private void SendEquipmentPackets(List <ushort> slotsToUpdate)
        {
            int currentIndex = 0;

            while (true)
            {
                if (slotsToUpdate.Count - currentIndex >= 64)
                {
                    owner.queuePacket(EquipmentListX64Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
                }
                else if (slotsToUpdate.Count - currentIndex >= 32)
                {
                    owner.queuePacket(EquipmentListX32Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
                }
                else if (slotsToUpdate.Count - currentIndex >= 16)
                {
                    owner.queuePacket(EquipmentListX16Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
                }
                else if (slotsToUpdate.Count - currentIndex > 1)
                {
                    owner.queuePacket(EquipmentListX08Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex));
                }
                else if (slotsToUpdate.Count - currentIndex == 1)
                {
                    owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot));
                    currentIndex++;
                }
                else
                {
                    break;
                }
            }
        }
Exemple #2
0
 private void SendEquipmentPackets(ushort equipSlot, InventoryItem item)
 {
     if (item == null)
     {
         owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, equipSlot));
     }
     else
     {
         owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, equipSlot, item.slot));
     }
 }