View Single Post
  #22  
Old 12-16-2008, 09:05 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Here is a link to the post from right before when SoF was released stating that he was able to get the spawn struct from the eqgame.exe and that it should be fully accurate:

http://www.showeq.net/forums/showpos...4&postcount=21

Since that struct didn't change in the update following the SoF release and they said everything in SEQ was still functional, I am wondering if it is safe to assume that it is correct. Ultimately, I wish I knew exactly what he did to pull all of that info from the .exe and if I knew that, this would be simple.

Here is the Spawn_Struct according to SEQ at the time of SoF (and a few patches later as well):

Code:
/* 
** Generic Spawn Struct 
** Length: 897 Octets 
** Used in: 
**   dbSpawnStruct
**   petStruct
**   spawnShroudOther
**   spawnShroudSelf
*/ 

struct spawnStruct
{
/*0000*/ uint8_t  unknown0000[9];
/*0009*/ int16_t  deity;          // Player's Deity
/*0011*/ uint8_t  unknown0011[11];
/*0022*/ uint8_t  gender;         // Gender (0=male, 1=female)
/*0023*/ uint8_t  unknown0023[4];
/*0027*/ union 
	 {
		struct
		{
		/*0027*/ EquipStruct equip_helmet; // Equiptment: Helmet visual
		/*0039*/ EquipStruct equip_chest; // Equiptment: Chest visual
		/*0051*/ EquipStruct equip_arms; // Equiptment: Arms visual
		/*0063*/ EquipStruct equip_bracers; // Equiptment: Wrist visual
		/*0075*/ EquipStruct equip_hands; // Equiptment: Hands visual
		/*0087*/ EquipStruct equip_legs; // Equiptment: Legs visual
		/*0099*/ EquipStruct equip_feet; // Equiptment: Boots visual
		/*0111*/ EquipStruct equip_primary; // Equiptment: Main visual
		/*0123*/ EquipStruct equip_secondary; // Equiptment: Off visual
		} equip;
		/*0027*/ EquipStruct equipment[9];
	 };
/*0135*/ uint8_t  state;          // stand state
/*0136*/ uint8_t  unknown0136;
/*0137*/ uint32_t guildID;        // Current guild
/*0141*/ uint8_t  unknown0141[24];
/*0165*/ uint8_t  class_;         // Player's class
/*0166*/ uint8_t  unknown0166[201];
/*%%% gm right this time? */
/*0367*/ uint8_t  gm;
/*0368*/ uint8_t  unknown0368[134];
/*0502*/ float    runspeed;       // Speed when walking
/*0506*/ uint8_t  light;          // Spawn's lightsource
/*0507*/ uint8_t  unknown0507[4];
/*0511*/ uint8_t  level;          // Spawn Level
/*0512*/ uint8_t  unknown0512[23];
/*0535*/ uint32_t race;           // Spawn race
/*0539*/ uint8_t  unknown0539[41];
/*0580*/ char     suffix[32];     // Player's suffix (of Veeshan, etc.)
/*0612*/ uint8_t  unknown0612;
/*0613*/ uint8_t  bodytype;       // Bodytype
/*0614*/ uint8_t  unknown0614[41];
/*0655*/ uint8_t  curHp;          // Current hp
/*0656*/ uint8_t  unknown0656[2];
/*0658*/ char     lastName[32];   // Player's Lastname
/*0690*/ uint8_t  unknown0690[2];
/*0692*/ char     title[32];      // Title
/*0724*/ uint8_t  unknown0724[6];
/*0730*/ uint8_t  NPC;            // 0=player,1=npc,2=pc corpse,3=npc corpse
/*0731*/ uint8_t  unknown0731[12];
/*0743*/ signed   padding0000:12; // ***Placeholder
	 signed   x:19;           // x coord
	 signed   padding0002:1; // ***Placeholder
/*0747*/ signed   deltaX:13;      // change in x
	 signed   deltaY:13;      // change in y
	 signed   padding0006:6;  // ***Placeholder
/*0751*/ signed   z:19;           // z coord
	 signed   deltaHeading:10;// change in heading
	 signed   padding0014:3;  // ***Placeholder
/*0755*/ signed   y:19;           // y coord
	 signed   deltaZ:13;      // change in z
/*0759*/ signed   animation:10;   // animation
	 unsigned heading:12;     // heading
	 signed   padding0018:10;  // ***Placeholder
/*0763*/ uint32_t spawnId;        // Spawn Id
/*0767*/ uint8_t  unknown0767[8];
/*0775*/ char     name[64];       // Player's Name
/*0839*/ uint32_t petOwnerId;     // If this is a pet, the spawn id of owner
/*0843*/ uint8_t  unknown0843;
/*0844*/ union 
	 {
		struct 
		{
		/*0844*/ Color_Struct color_helmet;    // Color of helmet item
		/*0848*/ Color_Struct color_chest;     // Color of chest item
		/*0852*/ Color_Struct color_arms;      // Color of arms item
		/*0856*/ Color_Struct color_bracers;   // Color of bracers item
		/*0860*/ Color_Struct color_hands;     // Color of hands item
		/*0864*/ Color_Struct color_legs;      // Color of legs item
		/*0868*/ Color_Struct color_feet;      // Color of feet item
		/*0872*/ Color_Struct color_primary;   // Color of primary item
		/*0876*/ Color_Struct color_secondary; // Color of secondary item
		} equipment_colors;
		/*0844*/ Color_Struct colors[9]; // Array elements correspond to struct equipment_colors above
	 };
/*0880*/ uint8_t  anon;           // 0=normal, 1=anon, 2=roleplay
/*0881*/ uint8_t  unknown0881[10];
/*0891*/ float    walkspeed;      // Speed when running
/*0895*/ uint8_t  unknown896[2];
/*0897*/
};
Part of the problem may be that I had to change this considerably to fit in all of the stuff that EQEmu currently uses for settings on spawns within the same number of bytes. Also, I don't know how to count the signed and padding stuff, so my structure size may be off.

It is still possible that something else could be the cause of my crashes, but at least by fixing everything as much as possible now, it will mean less work later. I am glad that the itemlist stuff is all done now, so it should hopefully work as soon as it is ready to get to that point
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote