Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Packet format for selling item to NPC
Author Message
cuongbeo88 Offline
Expired VIP Member
**

Posts: 62
Joined: Jan 2014
Reputation: 6
Version: 1.4.2.140
Post: #11
RE: Packet format for selling item to NPC

Bump
07-05-2015 15:14 PM
Find all posts by this user Quote this message in a reply
cuongbeo88 Offline
Expired VIP Member
**

Posts: 62
Joined: Jan 2014
Reputation: 6
Version: 1.4.2.140
Post: #12
RE: Packet format for selling item to NPC

@kerberos464, @Clockman, @Sakaszli can you help ?
(This post was last modified: 07-06-2015 13:40 PM by cuongbeo88.)
07-06-2015 13:40 PM
Find all posts by this user Quote this message in a reply
Sakaszli Offline
I'm too pro to be pro.
*******

Posts: 1,189
Joined: Jan 2011
Reputation: 484
Version: 1.4.2.134.5b
Post: #13
RE: Packet format for selling item to NPC

    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 13:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kerberos464 Offline
Bug revealer

Posts: 1,539
Joined: Jun 2012
Reputation: 576
Version: 1.4.2.142
Post: #14
RE: Packet format for selling item to NPC

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 Smile

Everything is possible. The impossible just takes longer.
(This post was last modified: 07-06-2015 14:03 PM by kerberos464.)
07-06-2015 14:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mandymua Offline
Expired VIP Member
**

Posts: 37
Joined: Dec 2013
Reputation: 2
Version: 1.4.2.142
Post: #15
RE: Packet format for selling item to NPC

Thanks Sakaszli and Kerberos, that was extremely helpful! Big Grin
07-07-2015 05:29 AM
Find all posts by this user Quote this message in a reply
goanga1 Offline
VIP Member
***

Posts: 436
Joined: Apr 2012
Reputation: 76
Version: 1.4.2.142
Post: #16
RE: Packet format for selling item to NPC

(07-07-2015 05:29 AM)mandymua Wrote:  Thanks Sakaszli and Kerberos, that was extremely helpful! Big Grin

id you make a working plugin code?

Chonos Shop
(closed atm)

accepting paypal
For more info contact me on Skype : michail.gh

Info here: http://forum.l2tower.eu/thread-wts-lvl-9...aia-chonos
07-07-2015 09:11 AM
Find all posts by this user Quote this message in a reply
mandymua Offline
Expired VIP Member
**

Posts: 37
Joined: Dec 2013
Reputation: 2
Version: 1.4.2.142
Post: #17
RE: Packet format for selling item to NPC

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)
07-08-2015 00:51 AM
Find all posts by this user Quote this message in a reply
Vinter Offline
Expired VIP Member
**

Posts: 299
Joined: Sep 2013
Reputation: 109
Version: 1.4.1.128
Post: #18
RE: Packet format for selling item to NPC

Make the plugin, get hte info, build the packet with commands through script, easy peasy.
07-08-2015 23:33 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Script item using before hitting mob TMBlack 0 262 01-29-2019 12:24 PM
Last Post: TMBlack
  Weird pickup item capucine 1 1,014 11-23-2018 14:38 PM
Last Post: Fadden
  how do get Daily Mission item for script or plugins? king200527 0 1,024 10-26-2015 17:03 PM
Last Post: king200527
  Sell item to shop doesnt work. mandymua 21 4,244 07-03-2015 01:03 AM
Last Post: mandymua
  Item ID steinerff10 5 1,406 06-10-2015 16:42 PM
Last Post: steinerff9
  Item Use Script/plug gm1904 3 1,473 05-26-2015 19:10 PM
Last Post: plixplox
  Item to Ware necrulex 4 1,612 05-03-2015 15:55 PM
Last Post: bistabil
  It recognises chr's item-hp-skills etc but doesn't work d3adlock 0 1,011 09-30-2014 17:11 PM
Last Post: d3adlock
  Weird pickup item capucine 0 1,057 07-24-2014 22:48 PM
Last Post: capucine
  packet reader error elessar 1 1,563 06-29-2014 09:48 AM
Last Post: nektarios007



User(s) browsing this thread: 1 Guest(s)