Exemplo n.º 1
0
        private void SendInventoryPackets(List <InventoryItem> items)
        {
            int currentIndex = 0;

            while (true)
            {
                if (items.Count - currentIndex >= 64)
                {
                    owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex >= 32)
                {
                    owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex >= 16)
                {
                    owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex > 1)
                {
                    owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex == 1)
                {
                    owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex]));
                    currentIndex++;
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void SendInventoryPackets(int startOffset)
        {
            int currentIndex = startOffset;

            while (true)
            {
                if (list.Count - currentIndex >= 64)
                {
                    owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, list, ref currentIndex));
                }
                else if (list.Count - currentIndex >= 32)
                {
                    owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, list, ref currentIndex));
                }
                else if (list.Count - currentIndex >= 16)
                {
                    owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, list, ref currentIndex));
                }
                else if (list.Count - currentIndex > 1)
                {
                    owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, list, ref currentIndex));
                }
                else if (list.Count - currentIndex == 1)
                {
                    owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex]));
                    currentIndex++;
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 3
0
        public void SendCheckEquipmentToPlayer(Player toPlayer)
        {
            List <InventoryItem> items = new List <InventoryItem>();

            for (ushort i = 0; i < list.Length; i++)
            {
                if (list[i] != null)
                {
                    InventoryItem equipItem = new InventoryItem(list[i], i);
                    items.Add(equipItem);
                }
            }

            toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER));
            int currentIndex = 0;

            while (true)
            {
                if (items.Count - currentIndex >= 16)
                {
                    toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex > 1)
                {
                    toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex));
                }
                else if (items.Count - currentIndex == 1)
                {
                    toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex]));
                    currentIndex++;
                }
                else
                {
                    break;
                }
            }
            toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
        }