Moderator: MacroQuest Developers
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 asAmadeus 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?...or something similar? I always forget the syntax on all this ..heheCode: Select all
/*0x0d80*/ struct _PITEMINFO** Inventory[30];
Code: Select all
PITEMINFO* Inventory[30];
donations for this month's patches.
donations for this month's patches.Code: Select all
typedef struct _ITEMBLOB {
PITEMINFO Item;
PITEMBLOB Contents[10];
} ITEMBLOB, *PITEMBLOB;
yes its there EVERY time...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.
donations for this month's patches.I kind of figured that might be the reason... was hoping my earlier post gave you all some ideas.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:
With _CHARINFO pointing to these _ITEMBLOB's.Code: Select all
typedef struct _ITEMBLOB { PITEMINFO Item; PITEMBLOB Contents[10]; } ITEMBLOB, *PITEMBLOB;
Hope that helps.
Code: Select all
typedef struct _ITEMBLOB {
PITEMINFO *Item;
PITEMBLOB *Contents[10];
} ITEMBLOB, *PITEMBLOB;
Code: Select all
/*0x0d80*/ PITEMINFO Inventory[30];
/*0x0df8*/ PITEMINFO Cursor;
Code: Select all
/*0x0d80*/ PITEMBLOB *Inventory[30];
/*0x0df8*/ PITEMBLOB *Cursor;
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
Code: Select all
0:010> dd 06180fd0
[b]06180fd0[/b] 06295e98 06260de8 06260e40 06235c68
06180fe0 06235cc0 05fd05b8 05fd0610 00000000
06180ff0 00000000 00000000 00000000
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........
Code: Select all
0:010> dd 06260de8
06260de8 [b]062960a0[/b] 00000000 00000000 00000000
06260df8 00000000 00000000 00000000 00000000
06260e08 00000000 00000000 00000000 00000000
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 ................
donations for this month's patches.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;
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)
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;
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)
