PDA

View Full Version : help me with spawnStruct



codepig666
07-01-2005, 08:51 PM
Did something wierd happen to the X/deltaX Y/deltaY section of the spawnStruct? I got the rest of my spawnStruct all lined up, but for some reason I can't get the math to work out right on the loc info.

If anyone has the new spawnStruct or at least the correct loc section, can you post it for me pls?

-piggy

BlueAdept
07-01-2005, 08:54 PM
I think Purple is having the same problem.

codepig666
07-02-2005, 01:13 AM
This is as close as I have come so far:


starting at offset 54:

signed deltaHeading:10;
signed x:19;
signed unknown1:3;
signed y:19;
signed animation:10;
signed unknown2:3;
signed z:10;
signed deltaY:13;
signed deltaX:13;
signed heading:12;
signed deltaZ:7;

I know that x,y,z,deltaX,deltaY,and the heading are correct. I am at a loss as to what to do with the last 7 bits or the 2 sets of 3 "unknown" bits. Maybe animation is 13 bits now? or maybe what I have labled animation/unk2 is deltaZ and animation is the 7 bit field? If so, it precludes it from being 66 which means that a comparison will fail based on field size. I have no idea what it is looking for at that point tho.

If ya know the answer, let me know. This is good enough to make it work, but it would be nice to have it accurate instead.

--piggy

purple
07-02-2005, 05:11 AM
struct spawnStruct
{
/*0000*/ uint8_t NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse,a
/*0001*/ uint8_t unknown0001[8]; // ***Placeholder (all ff)
/*0009*/ uint8_t curHp; // Current hp
/*0010*/ char lastName[32]; // Player's Lastname
/*0042*/ uint8_t bodytype; // Bodytype
/*0043*/ uint8_t unknown0042[7];
/*0050*/ uint32_t petOwnerId; // If this is a pet, the spawn id of owner
/*0054*/ signed deltaZ:10; // change in z
signed x:19; // x coord
signed padding0054:3; // *** Placeholder
/*0058*/ signed y:19; // y coord
signed deltaX:13; // change in x
/*0062*/ signed z:19; // z coord
signed deltaY:13; // change in y
/*0066*/ signed deltaHeading:10;// change in heading
signed animation:10; // animation id
signed heading:12; // spawn heading
/*0070*/ uint8_t unknown0070[4];
/*0074*/ int16_t deity; // Player's Deity
/*0076*/ uint8_t unknown[2];
/*0078*/ union
{
struct
{
/*0078*/ uint32_t equip_helmet; // Equipment: Helmet Visual
/*0082*/ uint32_t equip_chest; // Equipment: Chest Visual
/*0086*/ uint32_t equip_arms; // Equipment: Arms Visual
/*0090*/ uint32_t equip_bracers; // Equipment: Bracers Visual
/*0094*/ uint32_t equip_hands; // Equipment: Hands Visual
/*0098*/ uint32_t equip_legs; // Equipment: Legs Visual
/*0102*/ uint32_t equip_feet; // Equipment: Feet Visual
/*0106*/ uint32_t equip_primary; // Equipment: Primary Visual
/*0110*/ uint32_t equip_secondary; // Equipment: Secondary Visual
} equip;
/*0078*/ uint32_t equipment[9]; // Array elements correspond to struct equipment above
};
/*0114*/ uint8_t unknown0114[5];
/*0119*/ uint8_t afk; // 0=no, 1=afk
/*0120*/ uint32_t spawnId; // Spawn Id
/*0124*/ uint8_t unknown0124;
/*0125*/ uint8_t gm; // 0=no, 1=gm
/*0126*/ uint8_t unknown0126[4];
/*0130*/ int8_t aa_title; // 0=none, 1=general, 2=archtype, 3=class
/*0131*/ uint8_t unknown0132[24];
/*0155*/ uint8_t anon; // 0=normal, 1=anon, 2=roleplay
/*0156*/ uint8_t unknown0156;
/*0157*/ uint8_t face; // Face id for players
/*0158*/ uint8_t unknown0158[2];
/*0160*/ float runspeed; // Speed when running
/*0164*/ uint8_t eyecolor1; // Player's left eye color
/*0165*/ uint8_t unknown0165;
/*0166*/ uint8_t is_npc; // 0=no, 1=yes
/*0167*/ uint8_t unknown0167;
/*0168*/ uint32_t guildID; // Current guild
/*0172*/ union
{
struct
{
/*0172*/ Color_Struct color_helmet; // Color of helmet item
/*0176*/ Color_Struct color_chest; // Color of chest item
/*0180*/ Color_Struct color_arms; // Color of arms item
/*0184*/ Color_Struct color_bracers; // Color of bracers item
/*0188*/ Color_Struct color_hands; // Color of hands item
/*0192*/ Color_Struct color_legs; // Color of legs item
/*0196*/ Color_Struct color_feet; // Color of feet item
/*0200*/ Color_Struct color_primary; // Color of primary item
/*0204*/ Color_Struct color_secondary; // Color of secondary item
} equipment_colors;
/*0172*/ Color_Struct colors[9]; // Array elements correspond to struct equipment_colors above
};
/*0208*/ uint8_t unknown0208;
/*0209*/ float walkspeed; // Speed when walking
/*0213*/ uint8_t unknown0213[3];
/*0216*/ uint8_t class_; // Player's class
/*0217*/ uint8_t beardcolor; // Beard color
/*0218*/ float size; // Model size
/*0222*/ uint8_t findable; // 0=can't be found, 1=can be found
/*0223*/ uint8_t unknown0222[4];
/*0227*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
/*0259*/ uint8_t unknown0259[4];
/*0263*/ int8_t guildrank; // 0=normal, 1=officer, 2=leader
/*0264*/ uint8_t unknown0264[3];
/*0267*/ uint8_t is_pet; // 0=no, 1=yes
/*0268*/ uint32_t race; // Spawn race
/*0272*/ uint8_t invis; // Invis (0=not, 1=invis)
/*0273*/ uint8_t unknown0276[6];
/*0279*/ uint8_t level; // Spawn Level
/*0280*/ uint8_t haircolor; // Hair color
/*0281*/ uint8_t unknown0282[2];
/*0283*/ uint8_t gender; // Gender (0=male, 1=female)
/*0284*/ char name[64]; // Player's Name
/*0348*/ uint8_t eyecolor2; // Left eye color
/*0349*/ char title[32]; // Title
/*0381*/ uint8_t unknown0381;

// Wrong but compile please. Was light removed 6/29/2005? %%%
/*0009*/ uint8_t light; // Spawn's lightsource
}; /*0383*/

#if 0
/*0010*/ uint8_t hairstyle; // Hair style
union
{
/*0174*/ int8_t equip_chest2; // Second place in packet for chest texture (usually 0xFF in live packets)
// Not sure why there are 2 of them, but it effects chest texture!
/*0174*/ int8_t mount_color; // drogmor: 0=white, 1=black, 2=green, 3=red
// horse: 0=brown, 1=white, 2=black, 3=tan
};
/*0321*/ uint8_t helm; // Helm texture
/*0368*/ uint8_t lfg; // 0=off, 1=lfg on

/*121*/ int8_t maxHp; // max hp
/*122*/ uint8_t pvp; // 0=Not pvp,1=pvp

#endif


That's where I'm at with spawn struct. Haven't bothered to do deltas for it yet though. Deltas for client update are more important since spawn struct is just NewSpawn and ZoneSpawns.

BlueAdept
07-02-2005, 08:11 AM
// Wrong but compile please. Was light removed 6/29/2005? %%%
/*0009*/ uint8_t light; // Spawn's lightsource
}; /*0383*/


OH NO they messed with my lightsource!

Heh. After a new version is posted, I can fix the light source. Im pretty good at figuring that out.

codepig666
07-02-2005, 10:23 AM
If it helps, I know for a fact that my deltaX, deltaY, and Heading are correct. My skittles move smoothly with good velocity lines.

purple
07-02-2005, 10:31 AM
Mine too. I just didn't have time to finish positioning until this morning.