_CHARINFO _ITEMINFO structs for 26 Aug 2003 patch

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Thu Aug 28, 2003 11:00 am

Not sure if this matters or not, but I've noticed that looting is different since the last patch. I used to be able to rapidly right-click the loot, and the items would pop into my inventory as the lag allowed. Now, if I right-click too fast, I only loot the last item clicked. Might this have something to do with MQ's inventory issues?

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Thu Aug 28, 2003 1:55 pm

Amadeus wrote:Ahh....

I noticed that when I did Inventory above, but convinced myself that was how it had always been...

Hmmm...I'm pretty good at noticing pointers and still didn't see any inventory bags or bank stuff there. I'm 99% certain that 'server' is the last thing in the struct too.


Wouldn't a pointer to a pointer be notated like this is in the struct?

Code: Select all

/*0x0d80*/   struct  _PITEMINFO**   Inventory[30]; 
...or something similar? I always forget the syntax on all this ..hehe
there is no "right" or "wrong" way of doing it since I addapt the code from what the struct gives me, however right now I have it as

Code: Select all

PITEMINFO* Inventory[30];
which works pretty well...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu Aug 28, 2003 11:11 pm

I just thought that adapting the struct would be more simple than adapting all the MQ code. But, I am not really into EQ anymore...so I'm not really looking any deeper than working on the structs for mental fun :)


However, I hope you do take a look at that struct I posted as there are some differences from yours that I think you should check and see which of us is wrong..hehe ..the skills I'm almost positive is just 125 and I did find languages and put it in there too ...even though I'm not sure if that's necessary for any code or not.

I'll try to find AApoints a little later and look for the bank slots...although I'm a little worried about those....

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

thanks.

Post by EqMule » Thu Aug 28, 2003 11:35 pm

the bank are at the location i posted... we allready have a mosly working copy of mq, and hopefully we can cvs it before the weekend... havent had time to look at click though... and yes we will definately use your additions to charinfo.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Fri Aug 29, 2003 6:12 am

Just wanna say, I am a new user to MQ and you guys do a great job, look for a donation coming from me :)
Blakbelt

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Fri Aug 29, 2003 10:51 am

The bank is at that position EVERY time? That's so utterly strange and unusual that I can't fathom it...I mean, that would make the charinfo packet just monstrous.

I was convinced that the bank was another structure entirely for which an offset needed to be found. It would be so unusual to have the bank so far removed from the rest of the structure with no data whatsoever in the middle ..I mean, we're talking around 31,000 bytes of nothing stuck in the middle of this packet for no apparent reason, I just can't imagine that SOE has gotten that insane.

iluvseq
Clueless Mudslinger
Posts: 269
Joined: Mon Apr 14, 2003 10:05 am

Post by iluvseq » Fri Aug 29, 2003 11:01 pm

Ok, I've figured out containers and the whole doublepointer bit.

The first pointer is really a pointer to a list of pointers, 11 entries long.

The first one is a pointer to an item struct that is the item in that slot.

The next 10 entries are pointers to the contents, each another 11 entry list.

This is because with LDoN, each item can be a 'container' holding "powerup" items.

So it's more like this:

Code: Select all

typedef struct _ITEMBLOB {
PITEMINFO Item;
PITEMBLOB Contents[10];
} ITEMBLOB, *PITEMBLOB;
With _CHARINFO pointing to these _ITEMBLOB's.

Hope that helps.
Last edited by iluvseq on Fri Aug 29, 2003 11:14 pm, edited 2 times in total.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Fri Aug 29, 2003 11:05 pm

Amadeus wrote:The bank is at that position EVERY time? That's so utterly strange and unusual that I can't fathom it...I mean, that would make the charinfo packet just monstrous.

I was convinced that the bank was another structure entirely for which an offset needed to be found. It would be so unusual to have the bank so far removed from the rest of the structure with no data whatsoever in the middle ..I mean, we're talking around 31,000 bytes of nothing stuck in the middle of this packet for no apparent reason, I just can't imagine that SOE has gotten that insane.
yes its there EVERY time...
Last edited by EqMule on Sat Aug 30, 2003 1:14 am, edited 1 time in total.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Fri Aug 29, 2003 11:42 pm

iluvseq wrote:Ok, I've figured out containers and the whole doublepointer bit.

The first pointer is really a pointer to a list of pointers, 11 entries long.

The first one is a pointer to an item struct that is the item in that slot.

The next 10 entries are pointers to the contents, each another 11 entry list.

This is because with LDoN, each item can be a 'container' holding "powerup" items.

So it's more like this:

Code: Select all

typedef struct _ITEMBLOB {
PITEMINFO Item;
PITEMBLOB Contents[10];
} ITEMBLOB, *PITEMBLOB;
With _CHARINFO pointing to these _ITEMBLOB's.

Hope that helps.
I kind of figured that might be the reason... was hoping my earlier post gave you all some ideas.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sat Aug 30, 2003 12:23 am

Iloveseq has it right... ..just beat me to it :)

Therefore, this is my suggestion (I just hope I have all the astericks correct!):

Code: Select all

typedef struct _ITEMBLOB { 
PITEMINFO *Item; 
PITEMBLOB *Contents[10]; 
} ITEMBLOB, *PITEMBLOB; 
(I think that that above is the proper syntax (as far as astericks are concerned) with all the pointers involved in this).

Then.....in the structure, this:

Code: Select all

/*0x0d80*/   PITEMINFO   Inventory[30]; 
/*0x0df8*/   PITEMINFO   Cursor; 
..should read:

Code: Select all

/*0x0d80*/   PITEMBLOB   *Inventory[30]; 
/*0x0df8*/   PITEMBLOB   *Cursor; 

...someone with HEAVY experience in pointers needs to double check my use of the asterick in those. However, this is a prose version of how it works so everyone can understand:

At the charinfo offset+0x0d80 there are 30 pointers that represent the 22 wearable spots and the 8 inventory spots, in that order. If you go to any of the locations of these 30 pointers, you will come across 11 pointers: the first pointer is to the ITEMINFO struct of the container, and the 10 pointers following point to the ITEMINFO structs of the contents. (if the container is empty, then these 10 pointers will be zero.) The IMPORTANT (and new) concept is that now ALL items are considered containers.

Therefore, it is possible to have containers embedded within containers embedded within containers using this scheme ....it's actually smart :)


Here is an example, for those that care:
----------
Step 1: Here is the list of pointers of my inventory...We will use my 2nd "inventory" slot (ie, bag slot) for the example, which is "06180fd0".

Code: Select all

0:010> dd 05f37428+0x0d80 L 31
05f381a8  1d60a4b8 06274f68 05f411f8 060a8340
05f381b8  063acb28 06488f60 0637ff60 063d40b8
05f381c8  063dc438 063dc490 063d9860 063d98b8
05f381d8  06013858 060138b0 060530e0 06053138
05f381e8  05f4c1c8 05f4c220 0612e600 1d412f48
05f381f8  1d412fa0 06491f48 06491fa0 [b]06180fd0[/b]
05f38208  0648e950 0648e9a8 064c09a8 060569e8
05f38218  06056a40 064f7f68 

-------
Step 2: If I do a snap shot of the pointers at 06180fd0, you will see this:

Code: Select all

0:010> dd 06180fd0
[b]06180fd0[/b]  06295e98 06260de8 06260e40 06235c68
06180fe0  06235cc0 05fd05b8 05fd0610 00000000
06180ff0  00000000 00000000 00000000 
As you can see, there are 7 pointers here, so this bag currently has 6 items in it. The first pointer is to the ITEMINFO struct of this inventory spot ...showing here:

Code: Select all

[b]06295e98[/b] 47 72 61 6e 64 6d 61 73 74 65 72 27 73 20 43 61  Grandmaster's Ca
06295ea8 72 72 79 2d 41 6c 6c 00 00 00 00 00 00 00 00 00  rry-All.........
06295eb8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
06295ec8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
06295ed8 2a 47 72 61 6e 64 6d 61 73 74 65 72 27 73 20 43  *Grandmaster's C
06295ee8 61 72 72 79 2d 41 6c 6c 00 00 00 00 00 00 00 00  arry-All........
....then, the other 6 pointers deal with the contents of this grandmaster's carryall....and we have to treat EACH of them as though they were a possible container....soooo...

----------
Step 3: We go to the location pointed to by the 2nd pointer in step 2...

Code: Select all

0:010> dd 06260de8
06260de8  [b]062960a0[/b] 00000000 00000000 00000000
06260df8  00000000 00000000 00000000 00000000
06260e08  00000000 00000000 00000000 00000000
Notice...it only has one pointer...so this item must be considered an "Empty container" (whether it's truly a container or not)

And, if we go to this location...we will see that the first item in the grandmaster's carryall is a Torn Luggald Robe:

Code: Select all

[b]062960a0[/b] 41 20 54 6f 72 6e 20 4c 75 67 67 61 6c 64 20 52  A Torn Luggald R
062960b0 6f 62 65 00 00 00 00 00 00 00 00 00 00 00 00 00  obe.............
062960c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

----------------------

So, hopefully now it makes sense how you could just embed containers within containers within containers within containers forever :)

Also, now that this is figured out, it should make everything else a little easier to decypher I should think.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Sat Aug 30, 2003 1:20 am

now that you understand how it works, can you help by looking up for example .stacksize and .Open for containers? and If you have time maybe you can do the spellinfo struct as well, I havent had time to do that one yet...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sat Aug 30, 2003 2:52 pm

Here is my version of _ITEMINFO & _COMMON ...everything listed here is tested except stackcount at the end (I couldn't log on again to test it!)...but, I think it's right. You'll notice a lot of new data here for ya...

The unions ARE there as indicated here. I'm just insure what the other data is in the union at this point.

Code: Select all

#define ITEM_NAME_LEN         64
#define LORE_NAME_LEN         80
typedef struct _ITEMINFO {
/*0x00*/   CHAR		Name[ITEM_NAME_LEN];
/*0x40*/   CHAR		LoreName[LORE_NAME_LEN];
/*0x90*/   CHAR		IDFile[32];
/*0xb0*/   DWORD	ItemNumber;
/*0xb4*/   DWORD	EquipSlots;
/*0xb8*/   DWORD	Cost;
/*0xbc*/   DWORD	IconNumber;
/*0xc0*/   DWORD	TradeSkills; //unconfirmed
/*0xc4*/   DWORD	Unknown0xc4[3];
/*0xd0*/   BYTE		UnknownData0xd0;
/*0xd1*/   BYTE		Weight;
/*0xd2*/   BYTE		NoRent; 
/*0xd3*/   BYTE		NoDrop;
/*0xd4*/   BYTE		Size;
/*0xd5*/   BYTE		Type; 
         union   {
/*0xd6*/   COMMON    Common;
/*0xd6*/   CONTAINER Container;
/*0xd6*/   BOOK      Book;
               };
} ITEMINFO, *PITEMINFO; 

Code: Select all

typedef struct _COMMON {
/*0x000*/	BYTE	Stackable;
/*0x001*/	BYTE	SvCold;
/*0x002*/	BYTE	SvFire;
/*0x003*/	BYTE	SvMagic;
/*0x004*/	BYTE	SvDisease;
/*0x005*/	BYTE	SvPoison;
/*0x006*/	BYTE	STR;
/*0x007*/	BYTE	STA;
/*0x008*/	BYTE	AGI;
/*0x009*/	BYTE	DEX;
/*0x00a*/	BYTE	CHA;
/*0x00b*/	BYTE	INT;
/*0x00c*/	BYTE	WIS;
/*0x00d*/	BYTE	Unknown0x00d;
/*0x00e*/	BYTE	HP;
/*0x00f*/	BYTE	Unknown0x00f;
/*0x010*/	BYTE	Unknown0x010;
/*0x011*/	BYTE	Unknown0x011;
/*0x012*/	BYTE	Mana;
/*0x013*/	BYTE	Unknown0x013;
/*0x014*/	BYTE	Unknown0x014;
/*0x015*/	BYTE	Unknown0x015;
/*0x016*/	BYTE	AC;
/*0x017*/	BYTE	Unknown0x017[3];
/*0x01a*/	BYTE	SkillModType;
/*0x01b*/	BYTE	Unknown0x01b[11];
/*0x026*/	BYTE	RequiredLevel;
/*0x027*/	BYTE	Unknown0x027[11];
/*0x032*/	DWORD	Classes;
/*0x036*/	DWORD	Races;
/*0x03a*/	DWORD	Diety; 
/*0x03e*/	DWORD	Unknown0x03e;
/*0x042*/	DWORD	SpellID;
/*0x046*/	DWORD	Color;
/*0x04a*/	BYTE	SkillModValue;
/*0x04b*/	BYTE	Unknown0x04b;
/*0x04c*/	BYTE	Unknown0x04c;
/*0x04d*/	BYTE	Magic;  
/*0x04e*/	BYTE	Level;
/*0x04f*/	BYTE	Light;
/*0x050*/	BYTE	Delay;
/*0x051*/	BYTE	RecommendedLevel;
/*0x052*/	BYTE	Unknown0x052[4];
/*0x056*/	BYTE	Damage;
/*0x057*/	BYTE	ItemType;
/*0x058*/	BYTE	Material;
/*0x059*/	BYTE	Unknown0x059[73];
/*0x0a2*/	CHAR	CharmFile[32];
/*0x0c2*/	FLOAT	UnknownData0x0c2;
/*0x0c6*/	BYTE	Unknown0x0c2[12];
/*0x0d2*/	DWORD	FocusId;
/*0x0d6*/	BYTE	Unknown0x0d6[40];
	union {
/*0x0fe*/	DWORD	CastTime;
/*0x0fe*/	DWORD	Unknown0x0fe;   
	};
	union {
/*0x102*/	BYTE	MaxCharges;		
/*0x102*/	BYTE	Unknown0x102;	
	};
/*0x103*/	BYTE	EffectType;	
/*0x104*/	BYTE	Unknown0x104[41];
/*0x12d*/	BYTE	StackCount;  
} COMMON, *PCOMMON;

Example:

Code: Select all

0:010> !c:\games\macroquest-dev\mqext\release\mqext.pitem 0612dde0

Name = Nature Walkers Scimitar (offset 0x0)
LoreName = *Scimitar of the True Druid (offset 0x40)
IDFile = IT150 (offset 0x90)
ItemNumber = 20490 (offset 0xb0)
EquipSlots = 8192 (offset 0xb4)
Cost = 0 (offset 0xb8)
IconNumber = 1169 (offset 0xbc)
TradeSkills = 1 (offset 0xc0)
Weight = 30 (offset 0xd1)
NoRent = 255 (offset 0xd2)
NoDrop = 0 (offset 0xd3)
Size = 2 (offset 0xd4)
Type = 0 (offset 0xd5)
	Note:  The COMMON, CONTAINER, or BOOK union starts at 0xd6

Code: Select all

0:010> !c:\games\macroquest-dev\mqext\release\mqext.pcommon 0612dde0+0xd6

Stackable = 0 (offset 0x0)
SvCold = 10 (offset 0x1)
SvFire = 10 (offset 0x2)
SvMagic = 10 (offset 0x3)
SvDisease = 10 (offset 0x4)
SvPoison = 10 (offset 0x5)
STR = 15 (offset 0x6)
STA = 15 (offset 0x7)
AGI = 0 (offset 0x8)
DEX = 0 (offset 0x9)
CHA = 0 (offset 0xa)
INT = 0 (offset 0xb)
WIS = 20 (offset 0xc)
HP = 10 (offset 0xe)
Mana = 90 (offset 0x12)
AC = 0 (offset 0x16)
SkillModType = 0 (offset 0x1a)
RequiredLevel = 0 (offset 0x26)
Classes = 32 (offset 0x32)
Races = 1097 (offset 0x36)
Diety = 0 (offset 0x3a)
SpellID = 1926 (offset 0x42)
Color = 0 (offset 0x46)
Magic = 1 (offset 0x4d)
Light = 15 (offset 0x4f)
Delay = 30 (offset 0x50)
RecommendedLevel = 0 (offset 0x51)
Damage = 20 (offset 0x56)
ItemType = 0 (offset 0x57)
Material = 0 (offset 0x58)
CharmFile =  (offset 0xa2)
FocusId = 0 (offset 0xd2)
CastTime = 9000 (offset 0xfe)
MaxCharges = 255 (offset 0x102)
EffectType = 4 (offset 0x103)
StackCount = 0 (offset 0x12d)

...unless someone needs all those faction mod things for something, I'm not going to worry about them right now.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sat Aug 30, 2003 3:15 pm

Here is my _CONTAINER struct. I can't log on right now to find 'open' for you..but I'll look into it tonight. But, here is some confirmed values for now.

Code: Select all

typedef struct _CONTAINER { 
/*0x000*/	BYTE	Unknown0x00[292];
/*0x124*/	BYTE	Combine;
/*0x125*/	BYTE	Slots;				// 0 to 10 
/*0x126*/	BYTE	SizeCapacity;		// 0: TINY 1: SMALL 2: MEDIUM 3: LARGE 4: GIANT 
/*0x127*/	BYTE	WeightReduction;
/*0x128*/	BYTE	Unknown0x128[10];
} CONTAINER, *PCONTAINER;

Example:

Code: Select all

0:010> !c:\games\macroquest-dev\mqext\release\mqext.pitem 06295e98

Name = Grandmaster's Carry-All (offset 0x0)
LoreName = *Grandmaster's Carry-All (offset 0x40)
IDFile = 0 (offset 0x90)
ItemNumber = 17138 (offset 0xb0)
EquipSlots = 0 (offset 0xb4)
Cost = 0 (offset 0xb8)
IconNumber = 691 (offset 0xbc)
TradeSkills = -1 (offset 0xc0)
Weight = 12 (offset 0xd1)
NoRent = 255 (offset 0xd2)
NoDrop = 0 (offset 0xd3)
Size = 0 (offset 0xd4)
Type = 1 (offset 0xd5)
	Note:  The COMMON, CONTAINER, or BOOK union starts at 0xd6

Code: Select all

0:010> !c:\games\macroquest-dev\mqext\release\mqext.pcontainer 06295e98+0xd6

Combine = 1 (offset 0x124)
Slots = 10 (offset 0x125)
SizeCapacity = 4 (offset 0x126)
WeightReduction = 100 (offset 0x127)

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Sat Aug 30, 2003 3:21 pm

I decided to start another thread to stick all of my suggestions in for new structs rather than spamming all the time in this thread. I'll just refer to there from now on :)

http://macroquest2.com/phpBB2/viewtopic ... 9772#19772

FrankJScott
naggy
naggy
Posts: 2385
Joined: Sun Feb 19, 2023 7:11 am

High Rated Product Site

Post by FrankJScott » Fri Aug 18, 2023 5:35 pm

Why don't you Google it! before you post