Updates: _CONTAINER _ITEMINFO and a fix for bankslots

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

Moderator: MacroQuest Developers

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

Updates: _CONTAINER _ITEMINFO and a fix for bankslots

Post by EqMule » Tue May 06, 2003 11:27 am

ok I have taken upon myself to go over the structures and theese are my findings -->
I will post the Common structure as well, but I havent started on that one yet, looks fairly easy though, and its alot of fun, so thanks verant :)

Code: Select all

typedef struct _CONTAINER {
/*0000*/	struct _ITEMINFO *Contents[10];//addresses to whats inside the bag if its a bag
/*0040*/	BYTE		PackType;//  0: Small Bag 1: Large Bag 2: Quiver 3: Belt Pouch and so on... there are 50 types I dont wanna list them all...
/*0041*/	BYTE		Slots; // 0 to 10
/*0042*/	BYTE		Open;//0 closed 1 open
/*0043*/	BYTE		SizeCapacity;// 0: TINY 1: SMALL 2: MEDIUM 3: LARGE 4: GIANT
/*0044*/	BYTE		WeightReduction;
/*0045*/	BYTE		Unknown0045[3];
/*0048*/	BYTE		Combine;// 03 taylor combine 05 no combine NOT SURE ABOUT THIS YET!
/*0049*/	BYTE		Unknown0049[6];
} CONTAINER, *PCONTAINER;

#define LORE_NAME_LEN         82
typedef struct _ITEMINFO {
/*0000*/	BYTE		Unknown0000; //placeholder
/*0001*/	BYTE		Weight;
/*0002*/	BYTE		NoRent;
/*0003*/	BYTE		NoDrop;
/*0004*/	BYTE		Size;
/*0005*/	BYTE		Type;
/*0006*/	BYTE		Unknown0006[10];
/*0016*/	CHAR		IDFile[30];
/*0046*/	CHAR		LoreName[LORE_NAME_LEN];
/*0128*/	DWORD		Unknown0128[3];
/*0140*/	DWORD		Cost;
/*0144*/	CHAR		Name[ITEM_NAME_LEN];
/*0208*/	DWORD		Unknown0208[3];
/*0230*/	DWORD		Unknown0230; //placeholder
/*0234*/	DWORD		Unknown0234[3];
/*0238*/	DWORD		ItemID; //was called itemnumber but ItemID is a better decsription for this value...
			union	{
/*0242*/	COMMON    Common;
/*0242*/	CONTAINER Container;
/*0242*/	BOOK      Book;
					};
} ITEMINFO, *PITEMINFO;
please change

Code: Select all

   BYTE Unknown12D8E[0x09EE];
to

Code: Select all

BYTE Unknown12D8E[0x09EA];
its the second last line of the _CHARINFO structure and its making the 1st bag in the bank come up as the 2d... this is because its 4 bytes wrongly alligned...
Last edited by EqMule on Fri May 09, 2003 7:34 pm, edited 7 times 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.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Tue May 06, 2003 1:06 pm

Please confirm that you are compiling with /Zp1 option -- single byte alignment.

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

Post by EqMule » Tue May 06, 2003 3:41 pm

please change this in the _CHARINFO structure...

Code: Select all

   BYTE Unknown12D8E[0x09EE];
to

Code: Select all

BYTE Unknown12D8E[0x09EA];
Last edited by EqMule on Wed May 07, 2003 9:42 am, edited 2 times 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.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed May 07, 2003 2:43 am

The first bank slot offset is 0x377c, yes?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed May 07, 2003 5:25 am

in any event, I fixed mq.h again.

/charinfo works
/updateitems works

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

Post by EqMule » Wed May 07, 2003 9:18 am

ok when I did the _CHARINFO structure a week or so ago, I was in a hurry, so I didnt pay much attention to actually assign correct bytecounts to it, but I will go over it and do that, which will make it easier for us to debug and make changes when there has been a patch...

note the line you just recently changed in the cvs as an example-->

Code: Select all

BYTE unknown5446q[64];
"5446q" thats not a "real" bytecount, I just named it like that at the time... anyway I will go over it, and I can PM or post it when im done, and seriously the

Code: Select all

   DWORD AAPoints;
   BYTE Unknown12D8E[[i]0x09EE[/i]];
   PITEMINFO      Bank[NUM_BANK_SLOTS];
} CHARINFO, *PCHARINFO;
should be changed to

Code: Select all

   DWORD AAPoints;
   BYTE Unknown12D8E[[b]0x09EA[/b]];
   PITEMINFO      Bank[NUM_BANK_SLOTS];
} CHARINFO, *PCHARINFO;
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.

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

cleaned up _CHARINFO as promised

Post by EqMule » Wed May 07, 2003 11:12 am

ok cleaned it up... now we can refer to the lines easier, and it will help us after next patch as well...

Code: Select all


typedef struct _CHARINFO {
/*00000*/	BYTE        Unknown00000;
/*00001*/	BYTE        Unknown00001;
/*00002*/	CHAR        Name[64];
/*00066*/	CHAR        Lastname[70];
/*00136*/	DWORD       Gender;
/*00140*/	DWORD       Race;
/*00144*/	DWORD       Class;
/*00148*/	DWORD       Unknown00148;
/*00152*/	DWORD       Level;
/*00156*/	DWORD       Exp;
/*00160*/	DWORD       PracticePoints;
/*00164*/	DWORD       Mana;
/*00168*/	DWORD       BaseHP;
/*00172*/	DWORD       Stunned;
/*00176*/	DWORD       BaseSTR;
/*00180*/	DWORD       BaseSTA;
/*00184*/	DWORD       BaseCHA;
/*00188*/	DWORD       BaseDEX;
/*00192*/	DWORD       BaseINT;
/*00196*/	DWORD       BaseAGI;
/*00200*/	DWORD       BaseWIS;
/*00204*/	DWORD       Face;
/*00208*/	BYTE        EquipType[8];
/*00216*/	BYTE        emptyforexpansion[4];
/*00220*/	DWORD       EquipColor[8];
/*00252*/	DWORD       Equipment[22];          // equipment ids
/*00428*/	DWORD       InventoryBagIDs[9];// you can have 1 bag on the cursur thus 9 bags are possible...
/*00464*/	BYTE        languages[48];          // List of languages (MAX_KNOWN_LANGS)
/*00512*/	BYTE        Unknown00512[480];
/*00992*/	struct _SPELLBUFF       Buff[15];      // Buffs currently on the player
/*01052*/   DWORD       InventoryBag1[10];   //IDs of what it contains
/*01092*/   DWORD       InventoryBag2[10];
/*01132*/   DWORD       InventoryBag3[10];
/*01172*/   DWORD       InventoryBag4[10];
/*01212*/   DWORD       InventoryBag5[10];
/*01252*/   DWORD       InventoryBag6[10];
/*01292*/   DWORD       InventoryBag7[10];
/*01332*/   DWORD       InventoryBag8[10];
/*01372*/   DWORD       InventoryBag9[10];
/*01412*/   DWORD       Unknown01412[2];
/*01420*/   BYTE        Unknown01420[1432];
/*02852*/   DWORD       SpellBook[512];        // List of the Spells in spellbook
/*04900*/   DWORD       MemorizedSpells[8];
/*04932*/   BYTE        Unknown04932[36];
/*04968*/   FLOAT       y;
/*04972*/   FLOAT       x;
/*04976*/   FLOAT       z;
/*04980*/   FLOAT       heading;
/*04984*/   DWORD       standstate; 
/*04988*/   DWORD       Plat;
/*04992*/   DWORD       Gold;
/*04996*/   DWORD       Silver;
/*05000*/   DWORD       Copper;
/*05004*/   DWORD       BankPlat;
/*05008*/   DWORD       BankGold;
/*05012*/   DWORD       BankSilver;
/*05016*/   DWORD       BankCopper;
/*05020*/   BYTE        Unknown05020[32];
/*05052*/   DWORD       Skill[125];
/*05552*/   BYTE        Unknown05552[112];
/*05664*/   DWORD       AutoSplit;
/*05668*/   BYTE        Unknown05668[64];
/*05732*/   DWORD       hungerlevel;         // max value < 10000 ; 0 is as hungry as you can get
/*05736*/   DWORD       thirstlevel;
/*05740*/   BYTE        Unknown05740[20];       // ***Placeholder
/*05760*/   DWORD       zoneId;
/*05764*/   struct _SPAWNINFO*	pSpawn;
/*05768*/   PITEMINFO   Inventory[30];
/*05888*/   PITEMINFO   Cursor;
/*05892*/   BYTE        Unknown05892[4];
/*05896*/   DWORD       STR;
/*05900*/   DWORD       STA;
/*05904*/   DWORD       CHA;
/*05908*/   DWORD       DEX;
/*05912*/   DWORD       INT;
/*05916*/   DWORD       AGI;
/*05920*/   DWORD       WIS;
/*05924*/   BYTE        Unknown05924[4];
/*05928*/   DWORD       SaveMagic;
/*05932*/   DWORD       SaveFire;
/*05936*/   DWORD       SaveCold;
/*05940*/   DWORD       SavePosion;
/*05944*/   DWORD       SaveDisease;
/*05948*/   DWORD       CurrWeight;
/*05952*/   BYTE        Unknown05952[72];
/*06024*/   SPELLBUFF   ShortBuff[6];
/*06048*/   BYTE        Unknown06048[912];
/*06960*/   DWORD       ZoneBoundId;
/*06964*/   DWORD       ZoneBirthId;
/*06968*/   DWORD       ZoneOtherId[3];
/*06980*/   FLOAT       ZoneBoundX;
/*06984*/   FLOAT       ZoneBirthX;
/*06988*/   FLOAT       ZoneOtherX[3];
/*07000*/   FLOAT       ZoneBoundY;
/*07004*/   FLOAT       ZoneBirthY;
/*07008*/   FLOAT       ZoneOtherY[3];
/*07020*/   FLOAT       ZoneBoundZ;
/*07024*/   FLOAT       ZoneBirthZ;
/*07028*/   FLOAT       ZoneOtherZ[3];
/*07040*/   BYTE        Unknown07040[3548];
/*10588*/   DWORD       GuildID;
/*10592*/   BYTE        Unknown10592[15];
/*10697*/   BYTE        Anon;
/*10698*/   WORD        GuildStatus;
/*10700*/   BYTE        Unknown10700[452];
/*11152*/   DWORD       AAExp;
/*11156*/   BYTE        Unknown11156[428];
/*11584*/   DWORD       AAPoints;
/*11588*/   BYTE        Unknown11588[2538];
/*14126*/   PITEMINFO   Bank[NUM_BANK_SLOTS];
} CHARINFO, *PCHARINFO;  
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.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed May 07, 2003 5:30 pm

14126 == 0x372E

0:000> dd 00761268 L 1
00761268 0e29ab78
0:000> dd 0e29ab78+372e
0e29e2a6 00000000 00000000 00000000 00000000
0e29e2b6 00000000 657a0000 6f787562 006b7572
0e29e2c6 00000000 00000000 00000000 00000000
0e29e2d6 00000000 00000000 eff80000 bec00448
0e29e2e6 4008044b 00000459 c0040000 4e9007dd
0e29e2f6 fe900e65 cc100e33 f8580e30 4ba80e5b
0e29e306 52b80e3a f7080e3a 00000e45 fe180000
0e29e316 95800e45 aa580e3e 00000e3e ac500000


Those are not bank slots.

0:000> dd 0e29ab78+377c
0e29e2f4 0e654e90 0e33fe90 0e30cc10 0e5bf858
0e29e304 0e3a4ba8 0e3a52b8 0e45f708 00000000
0e29e314 0e45fe18 0e3e9580 0e3eaa58 00000000
0e29e324 0e3eac50 0e3eae48 0e5f7d50 00000000
0e29e334 00000001 00000000 00000000 00000000
0e29e344 00000000 00000000 00000000 00000000
0e29e354 00000000 06fd0033 00080106 73795603
0e29e364 006e6f79 00000000 00000000 00000000
0:000> dc 0e654e90
0e654e90 00ff6400 00000102 00000000 00000000 .d..............
0e654ea0 34365449 00000000 00000000 00000000 IT64............
0e654eb0 00000000 00000000 00000000 532a0000 ..............*S
0e654ec0 77676e6f 65766165 41207372 6d657373 ongweavers Assem
0e654ed0 20796c62 0074694b 00000000 00000000 bly Kit.........
0e654ee0 00000000 00000000 00000000 00000000 ................
0e654ef0 00000000 00000000 00000000 00000000 ................
0e654f00 00000000 00000000 00000000 00000000 ................
0:000> dc 0e33fe90
0e33fe90 ff012300 00000101 00000000 00000000 .#..............
0e33fea0 34365449 00000000 00000000 00000000 IT64............
0e33feb0 00000000 00000000 00000000 65440000 ..............De
0e33fec0 6578756c 6f6f5420 786f626c 00000000 luxe Toolbox....
0e33fed0 00000000 00000000 00000000 00000000 ................
0e33fee0 00000000 00000000 00000000 00000000 ................
0e33fef0 00000000 00000000 00000000 00000000 ................
0e33ff00 00000000 00000000 00000000 00000000 ................

Those are bank slots.

Am I doing something wrong with the calculations?

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

well...

Post by EqMule » Wed May 07, 2003 9:48 pm

0:000> dd 0e29ab78+377c
well I only see 13 addresses to bags and there should be 16... well if you have 16 in bank that is lol, anyway could you try 0:000> dd 0e29ab78+3778 instead and see if there is a bag there?

I think you calculate correctly, I am the one that dont have it right, Im gonna go back and see what I am missing, but the structure holds... just my /*blabla*/ numbers that are wrong... I will get back when I have it all calculated and Im gonna convert from dec to hex as well, since it is easier to see...
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.

Grumpy
a hill giant
a hill giant
Posts: 167
Joined: Sun Nov 10, 2002 4:22 pm

Re: Updates: _CONTAINER _ITEMINFO and a fix for bankslots

Post by Grumpy » Sun May 11, 2003 1:12 am

EqMule00 wrote:

Code: Select all

typedef struct _CONTAINER {
/*0000*/	struct _ITEMINFO *Contents[10];//addresses to whats inside the bag if its a bag
/*0040*/	BYTE		PackType;//  0: Small Bag 1: Large Bag 2: Quiver 3: Belt Pouch and so on... there are 50 types I dont wanna list them all...
/*0041*/	BYTE		Slots; // 0 to 10
/*0042*/	BYTE		Open;//0 closed 1 open
/*0043*/	BYTE		SizeCapacity;// 0: TINY 1: SMALL 2: MEDIUM 3: LARGE 4: GIANT
/*0044*/	BYTE		WeightReduction;
/*0045*/	BYTE		Unknown0045[3];
/*0048*/	BYTE		Combine;// 03 taylor combine 05 no combine NOT SURE ABOUT THIS YET!
/*0049*/	BYTE		Unknown0049[6];
} CONTAINER, *PCONTAINER;

Good bet that:

Code: Select all

/*0045*/	BYTE		Unknown0045[3];
represents LORE/NODROP/NORENT flags, should be easy to check, norent and nodrop containers are common, LORE less so, but still easy to get hold of.