Fixed private store related packets.
This commit is contained in:
@@ -48,11 +48,32 @@ public class PrivateStoreListBuy extends AbstractItemPacket
|
|||||||
|
|
||||||
for (TradeItem item : _items)
|
for (TradeItem item : _items)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
|
||||||
packet.writeD(item.getObjectId());
|
packet.writeD(item.getObjectId());
|
||||||
packet.writeQ(item.getPrice());
|
packet.writeD(item.getItem().getId());
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
packet.writeH(item.getEnchant());
|
||||||
packet.writeQ(item.getStoreCount());
|
packet.writeQ(item.getCount()); // give max possible sell amount
|
||||||
|
|
||||||
|
packet.writeQ(item.getItem().getReferencePrice());
|
||||||
|
packet.writeH(0);
|
||||||
|
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeH(item.getItem().getType2());
|
||||||
|
packet.writeQ(item.getPrice()); // buyers price
|
||||||
|
|
||||||
|
packet.writeQ(item.getStoreCount()); // maximum possible tradecount
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -50,9 +50,29 @@ public class PrivateStoreListSell extends AbstractItemPacket
|
|||||||
packet.writeD(_seller.getSellList().getItems().length);
|
packet.writeD(_seller.getSellList().getItems().length);
|
||||||
for (TradeItem item : _seller.getSellList().getItems())
|
for (TradeItem item : _seller.getSellList().getItems())
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeD(item.getItem().getType2());
|
||||||
packet.writeQ(item.getPrice());
|
packet.writeD(item.getObjectId());
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
packet.writeD(item.getItem().getId());
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeH(0x00);
|
||||||
|
packet.writeH(item.getEnchant());
|
||||||
|
packet.writeH(item.getCustomType2());
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeQ(item.getPrice()); // your price
|
||||||
|
packet.writeQ(item.getItem().getReferencePrice()); // store price
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -49,18 +49,54 @@ public class PrivateStoreManageListBuy extends AbstractItemPacket
|
|||||||
packet.writeD(_itemList.length); // inventory items for potential buy
|
packet.writeD(_itemList.length); // inventory items for potential buy
|
||||||
for (ItemInstance item : _itemList)
|
for (ItemInstance item : _itemList)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeD(item.getId());
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
packet.writeH(0); // show enchant lvl as 0, as you can't buy enchanted weapons
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeQ(item.getReferencePrice());
|
||||||
|
packet.writeH(0x00);
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeH(item.getItem().getType2());
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// section 3
|
// section 3
|
||||||
packet.writeD(_buyList.length); // count for all items already added for buy
|
packet.writeD(_buyList.length); // count for all items already added for buy
|
||||||
for (TradeItem item : _buyList)
|
for (TradeItem item : _buyList)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeD(item.getItem().getId());
|
||||||
packet.writeQ(item.getPrice());
|
packet.writeH(0);
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
|
||||||
packet.writeQ(item.getCount());
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeQ(item.getItem().getReferencePrice());
|
||||||
|
packet.writeH(0x00);
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeH(item.getItem().getType2());
|
||||||
|
packet.writeQ(item.getPrice());// your price
|
||||||
|
packet.writeQ(item.getItem().getReferencePrice());// fixed store price
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -52,16 +52,56 @@ public class PrivateStoreManageListSell extends AbstractItemPacket
|
|||||||
packet.writeD(_itemList.length); // for potential sells
|
packet.writeD(_itemList.length); // for potential sells
|
||||||
for (TradeItem item : _itemList)
|
for (TradeItem item : _itemList)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeD(item.getItem().getType2());
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
packet.writeD(item.getObjectId());
|
||||||
|
packet.writeD(item.getItem().getId());
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeH(0);
|
||||||
|
packet.writeH(item.getEnchant());// enchant lvl
|
||||||
|
packet.writeH(item.getCustomType2());
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeQ(item.getPrice()); // store price
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// section 3
|
// section 3
|
||||||
packet.writeD(_sellList.length); // count for any items already added for sell
|
packet.writeD(_sellList.length); // count for any items already added for sell
|
||||||
for (TradeItem item : _sellList)
|
for (TradeItem item : _sellList)
|
||||||
{
|
{
|
||||||
writeItem(packet, item);
|
packet.writeD(item.getItem().getType2());
|
||||||
packet.writeQ(item.getPrice());
|
packet.writeD(item.getObjectId());
|
||||||
packet.writeQ(item.getItem().getReferencePrice() * 2);
|
packet.writeD(item.getItem().getId());
|
||||||
|
packet.writeQ(item.getCount());
|
||||||
|
packet.writeH(0);
|
||||||
|
packet.writeH(item.getEnchant());// enchant lvl
|
||||||
|
packet.writeH(0x00);
|
||||||
|
packet.writeD(item.getItem().getBodyPart());
|
||||||
|
packet.writeQ(item.getPrice());// your price
|
||||||
|
packet.writeQ(item.getItem().getReferencePrice()); // store price
|
||||||
|
|
||||||
|
// T1
|
||||||
|
packet.writeH(item.getAttackElementType());
|
||||||
|
packet.writeH(item.getAttackElementPower());
|
||||||
|
for (byte i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
packet.writeH(item.getElementDefAttr(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int op : item.getEnchantOptions())
|
||||||
|
{
|
||||||
|
packet.writeH(op);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user