Page 2 of 2

Posted: Wed Apr 09, 2003 7:49 am
by lostinspace
Yes, field offsets changed within TspawnInfo. I'm not using MQ, so I listed only some of offsets that I use :

name= 28
type= 102
class= 103
race= 104
level= 109
speed= 120
dir= 124
y= 128
z= 140
x= 144
spawnID= 172
guild= 184
vistype= 224
pNext= 236

Posted: Wed Apr 09, 2003 8:54 am
by Mckorr
I think you lost me Megaton, but then I just got home from working all night... are you saying that this is the NEW correct code for _SPAWNINFO?

OLD code from MQ.h:

Code: Select all

typedef struct _SPAWNINFO {
	BYTE Unknown0000;      // 3?
	CHAR Name[30];
	BYTE Unknown0031[37];
	DWORD Zone;
	FLOAT Y;
	FLOAT X;
	FLOAT Z;
	FLOAT Heading;
	FLOAT Unknown0068;
	FLOAT SpeedRun;
	FLOAT SpeedY;
	FLOAT SpeedX;
	FLOAT SpeedZ;
	FLOAT SpeedHeading;
	FLOAT Unknown0088;
	FLOAT CameraAngle; // 128=up -128=down
	struct _SPAWNINFO *pPrev;
	struct _SPAWNINFO *pNext;
	PVOID pUnknown0108;    // Unknown... pointer? always 0000000
	PACTORINFO pActorInfo;
	PCHARINFO pCharInfo;
	FLOAT CameraHeightOffset;
	FLOAT ModelHeightOffset;
	DWORD SpawnID;
	DWORD MasterID;
	DWORD HPMax;
	DWORD HPCurrent;
	WORD GuildID;
	BYTE Unknown0162[6];
	BYTE Type;
	BYTE Class;
	BYTE Unknown0172[2];
	DWORD Race;
	BYTE Gender;
	BYTE Level;
	BYTE Unknown0174[2];
	BYTE Charmed;
	BYTE StandState;
	BYTE Light;
	BYTE Unknown0179[93];
	BYTE UnkFlag0230;
	BYTE Unknown0231[11];
	BYTE Linkdead;
	BYTE Guide;
	BYTE Unknown0244;
	BYTE GM;
	BYTE VisType;
	BYTE Unknown0247[7];
	DWORD Anon;
	BYTE Unknown0257[4];
	BYTE AFK;
	BYTE Unknown0285[7];
	WORD AARank;
	BYTE Unknown0294[6];
	CHAR Lastname[22];
	BYTE Unknown0298[12];
	WORD Deity;
} SPAWNINFO, *PSPAWNINFO;
Yours is quite a bit shorter... I'm assuming you are saying that just a certain part needs to be changed... or... sheesh, I really need some sleep =)

Posted: Wed Apr 09, 2003 9:54 am
by grimjack
The application he is using does not need all the other stuff that is why it is much shorter. I would guess he is working on leqm or some other similar application.

Posted: Wed Apr 09, 2003 10:05 am
by megaton
Yeah, as I don't have all the offsets yet, the struct is a lot shorter than it really is.

I have no idea which fields MQ actually uses, but you can probably get away with removing all those references temporarily ;).

The reason MQ crashed was because pNext was in the wrong place so it couldn't traverse the link list of spawns.

Posted: Wed Apr 09, 2003 10:47 am
by Lyenu X`Arie
Here is what I have figured out on the new struct so far, a little different than the one posted before.

Code: Select all

typedef struct _SPAWNINFO { 
/*000*/	BYTE Unknown000[28];
/*028*/	CHAR Name[64];
/*092*/	DWORD ZoneID;
/*096*/	BYTE Unknown096[6];
/*102*/	BYTE Type;
/*103*/	BYTE Class;
/*104*/	DWORD Race;
/*108*/	BYTE Unknown106;
/*109*/	BYTE Level;
/*110*/	BYTE Unknown108[14]; 
/*124*/	FLOAT Heading; 
/*128*/	FLOAT Y;
/*132*/	BYTE Unknown132[8];
/*140*/	FLOAT Z;
/*144*/	FLOAT X;
/*148*/	BYTE Unknown148[24];
/*172*/	DWORD SpawnID;
/*176*/	BYTE Unknown176[60];
/*236*/	DWORD pNext;

} SPAWNINFO, *PSPAWNINFO;

Posted: Wed Apr 09, 2003 10:50 am
by Nesu
GUILDS=006BC7C4 is an address I just cannot find in the old EQGAME.EXE to find a comparison in the new.
In the old .exe look for 0x006BC778 rather than 0x006BC7C4. When you find the replacement offset for 0x006BC778, add 0x4C to it and that is the GUILD offset.

Posted: Wed Apr 09, 2003 11:22 am
by Mckorr
The extra code in _SPAWNINFO appears to be for the SuperWho and SuperTarget functions. So yes, errors there would cause a crash, or possibly just be nonresponsive, if the struct is wrong and you do a /who or /target.

The problem is that removing them as you have done would cripple the information our version of /who gives out. You won't see GM, Guide, etc info, last names, etc. I'm guessing here, would have to take apart the /who function to say for sure, and I've got too many other segments I'm working on as it is.

Granted, a few of those functions I don't think ever worked, like "charmed", and I don't think "gender" really matters either, but you run into the potential for causing other functions/variables in eqlib.cpp to screw up. This may or may not be a problem depending on what you are using MQ for.

Posted: Wed Apr 09, 2003 12:41 pm
by ap50
In the old .exe look for 0x006BC778 rather than 0x006BC7C4. When you find the replacement offset for 0x006BC778, add 0x4C to it and that is the GUILD offset.
In that case, it's 006EDE68 + C4

Therefore: GUILDS=006EDEB4

Posted: Wed Apr 09, 2003 2:53 pm
by NealThorpayt
Greetings Constructs,

I have verified that the new offsets for:
[DirectInput8]
Main=00772DDC
Keyboard=00772DE0
Mouse=00772DE4
are correct.

End of line...

Posted: Wed Apr 09, 2003 8:52 pm
by Vaft
I guess we're dealing with struct changes and/or a change in the offset checking. Anyway, these offsets agree with those ap50 posted..

Verified:

Code: Select all

Main=772DDC
Keyboard=772DE0
Mouse=772DE4

Zoning=759B5C
Zones=759B70
SpawnHeader=759B74
Items=759B78
Doors=759B90
SpawnFooter=759B9C
Char=759BB0
CharInfo=759BB8
Target=759BBC

Mouse=772DE8
Attack=72BA6C
Spells=767340

DoAbilityList=73078C
DoAbilityAvailable=72BA08
Group=6A9CF8
GroupCount=6A9BB0
clsItems=759BE0
clsSpawns=759B68

clsMainNewUI=772F78
EncryptPad=5C1A7C

Posted: Thu Apr 10, 2003 2:57 am
by NealThorpayt
Greetings Constructs,

I have confirmed the following:
[Function Locations]
WriteChatColor=004DB0EB
GetRaceByID=004D09EE
GetClassByID=004D0399
GetDeityByID=004D1E90
ScreenItem=0045C8B7
ScreenSpawn=004E4A41
NewUIINI=0044759C
MaxMana=00464CE8
Commands=004E3B79
are correct.

Please note that 'LeftClick' and 'RightClick' should be removed as they are not compatible with the new UI.

End of line...