Support for MultiSellList custom item display ids.

This commit is contained in:
MobiusDevelopment
2020-11-13 22:13:58 +00:00
parent 1c6372c9bd
commit bd0ee06ab5
19 changed files with 210 additions and 55 deletions

View File

@ -86,14 +86,15 @@ public class MultiSellList extends AbstractItemPacket
{
final Item template = ItemTable.getInstance().getTemplate(product.getId());
final ItemInfo displayItemEnchantment = (_list.isMaintainEnchantment() && (itemEnchantment != null) && (template != null) && template.getClass().equals(itemEnchantment.getItem().getClass())) ? itemEnchantment : null;
packet.writeD(product.getId());
if (template != null)
{
packet.writeD(template.getDisplayId());
packet.writeQ(template.getBodyPart());
packet.writeH(template.getType2());
}
else
{
packet.writeD(product.getId());
packet.writeQ(0);
packet.writeH(65535);
}
@ -110,8 +111,16 @@ public class MultiSellList extends AbstractItemPacket
{
final Item template = ItemTable.getInstance().getTemplate(ingredient.getId());
final ItemInfo displayItemEnchantment = ((itemEnchantment != null) && (itemEnchantment.getItem().getId() == ingredient.getId())) ? itemEnchantment : null;
packet.writeD(ingredient.getId());
packet.writeH(template != null ? template.getType2() : 65535);
if (template != null)
{
packet.writeD(template.getDisplayId());
packet.writeH(template.getType2());
}
else
{
packet.writeD(ingredient.getId());
packet.writeH(65535);
}
packet.writeQ(_list.getIngredientCount(ingredient));
packet.writeH(ingredient.getEnchantmentLevel() > 0 ? ingredient.getEnchantmentLevel() : displayItemEnchantment != null ? displayItemEnchantment.getEnchantLevel() : 0); // enchant level
writeItemAugment(packet, displayItemEnchantment);