View Full Version : inventory items
Spike
10-11-2012, 12:22 PM
I'm making a program that can read the inventory of your character and sync this with an online database to show your inventory, similar to magelo.
Only problem is, I can't find where the information is stored. I'm reading the process memory and I'm finding things like HP AC and other stats, but cannot find out where an item is located in your inventory. How can I locate this in memory?
Uleat
10-11-2012, 10:36 PM
I thought this info was in the 'peq.inventory' table. Its primary key is linked to the ID of the character. Slots are only assigned if there is an item in it. (Corpses
don't have a separate inventory table..their inventories are blob-encoded.)
If you're testing a character with absolutely no items, then you will not have any entries for that character ID.
The fact that you're finding HP, AC, etc... before the items is fairly surprising since that info is encoded in the BLOB.
If you're going to support Ti in addition to later clients, you will have to account for the extra BLOB length incurred by the addition of the 'power item' slot.
EDIT: I'm not sure if I'm reading this right, but if you're trying to add server code to provide your intended goal by reading in-memory values, you're probably
making it more difficult than it needs to be. You can read directly from the db since all item transactions are immediately saved.
Otherwise, look in 'client.h' for the definitions of m_inv, etc...
trevius
10-11-2012, 10:55 PM
I think he is trying to read the client memory to record profile info locally for players. If that is the case, maybe you could just use the inventory export command built into the client that will export all items to a file. Then you can just parse the file.
Spike
10-12-2012, 10:04 AM
That might be how magelo currently finds items. Does anyone know what the usual item setup looks like in memory? I can find item names and ID's but no slot #s
iluvseq
10-16-2012, 06:55 PM
Take a look at the MQ2 source, specifically the _CHARINFO and _CHARINFO2 structs in EQData.h.
Keep in mind that the structures and offsets are different depending on the version of the client you are targeting.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.