07-05-2015, 15:14 PM
Pages: 1 2
07-06-2015, 13:40 PM
07-06-2015, 13:56 PM
JAVA Programming
@Override
protected void readImpl()
{
_listId = readD();
int size = readD();
if ((size <= 0) || (size > Config.MAX_ITEM_IN_PACKET) || ((size * BATCH_LENGTH) != _buf.remaining()))
{
return;
}
_items = new ArrayList<>(size);
for (int i = 0; i < size; i++)
{
int objectId = readD();
int itemId = readD();
long count = readQ();
if ((objectId < 1) || (itemId < 1) || (count < 1))
{
_items = null;
return;
}
_items.add(new UniqueItemHolder(itemId, objectId, count));
}
}
so as you can see format is like:
D - items list ID (server sends it when you open that window with items to buy)
D - count of iteems to buy
repeat X times :
D - item id from list
D - object id
Q - count
:end
07-06-2015, 14:00 PM
ok, i will help you a bit, but i will not post any code, sorry.
1. this impossible to do by script, and only possible with plugin, because there is a 'list id' parameter in the packet that you send for selling item, and this value comes from server after you talked to npc but BEFORE you are trying to sell items.
2. value that you called D[1] is that 'list id'.
3. actual packet structure is:
37 - id
XX XX XX XX - list id
XX XX XX XX - list size (how many different items we are selling)
block start (
XX XX XX XX - object id of item
XX XX XX XX - display id of item
XX XX XX XX XX XX XX XX - numbers of items
) block end
this block repeats as many times as you specified in "list size".
haha Sakaszli was first.
requesting forum add-on, that notifies about new answers while i'm writing my answer
1. this impossible to do by script, and only possible with plugin, because there is a 'list id' parameter in the packet that you send for selling item, and this value comes from server after you talked to npc but BEFORE you are trying to sell items.
2. value that you called D[1] is that 'list id'.
3. actual packet structure is:
37 - id
XX XX XX XX - list id
XX XX XX XX - list size (how many different items we are selling)
block start (
XX XX XX XX - object id of item
XX XX XX XX - display id of item
XX XX XX XX XX XX XX XX - numbers of items
) block end
this block repeats as many times as you specified in "list size".
haha Sakaszli was first.
requesting forum add-on, that notifies about new answers while i'm writing my answer
07-07-2015, 05:29 AM
Thanks Sakaszli and Kerberos, that was extremely helpful!
07-07-2015, 09:11 AM
(07-07-2015 05:29 AM)mandymua Wrote: [ -> ]Thanks Sakaszli and Kerberos, that was extremely helpful!
id you make a working plugin code?
07-08-2015, 00:51 AM
Kerberos' post actually already contains almost all of the information you need to make it work. I will give you the last piece that Kerberos didn't mention. That is the packet with the listID is:
packet:GetID() == 0xFE and packet:GetSubID() == 184
packet:SetOffset(12)
listID = packet:ReadInt(4)
packet:GetID() == 0xFE and packet:GetSubID() == 184
packet:SetOffset(12)
listID = packet:ReadInt(4)
07-08-2015, 23:33 PM
Make the plugin, get hte info, build the packet with commands through script, easy peasy.
Pages: 1 2