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; } } }
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; } } }
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, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER)); int currentIndex = 0; while (true) { if (items.Count - currentIndex >= 16) { toPlayer.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex > 1) { toPlayer.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex == 1) { toPlayer.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, toPlayer.actorId, items[currentIndex])); currentIndex++; } else { break; } } toPlayer.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId, toPlayer.actorId)); }
private void SendInventoryPackets(InventoryItem item) { owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item)); }