Page 1 of 1

Skills offset fixed

PostPosted: Sun May 11, 2008 4:26 pm
by PurpleYouko
I took Drakia's earlier fix for the character name and general trose error and shifted it back up the function to before the start of the skills.
Now I see all my skills when i log in.

in Worldpackets.cpp pakPlayer

find
  1.  
  2. SETWORD( pak, 0x07e, thisclient->CharInfo->stamina );                        // Stamina
  3.     for(short i=0x080; i<0x1c0; i++)
  4.         SETBYTE( pak, i, 0x00 );
  5.         for (char i=0; i<30; i++)
  6.         SETWORD( pak, 0x1c0+(i*2), thisclient->bskills[i] );//Basic skills
  7.     for (char i=0; i<30; i++)
  8.         SETWORD( pak, 0x1fc+(i*2), thisclient->askill[i]+thisclient->askilllvl[i] );//Active skills
  9.     for (char i=0; i<30; i++)
  10.         SETWORD( pak, 0x238+(i*2), thisclient->pskill[i]+thisclient->pskilllvl[i] );//Passive skills
  11.     for(short i=0x274; i<0x2b0; i++)//unused ????
  12.         SETBYTE( pak, i, 0 );
  13.     for (char i=0; i<32; i++)
  14.         SETWORD( pak, 0x2b0+(i*2), thisclient->quickbar[i] );       // QUICKBAR ROW 1 STARTS
  15.     SETWORD( pak, 0x2f0, thisclient->CharInfo->charid );
  16.     SETWORD( pak, 0x2f2, 0x00 );
  17.     cbyte = 0x2f4;

this code is the way it was prior to applying drakia's patch

replace with
  1.  
  2. SETWORD( pak, 0x07e, 0x00 );
  3.     SETWORD( pak, 0x080, 0x00 );
  4.     SETWORD( pak, 0x082, 0x00 );
  5.     SETWORD( pak, 0x084, thisclient->CharInfo->stamina );                        // Stamina
  6.     for(short i=0x086; i<0x1c0; i++)
  7.         SETBYTE( pak, i, 0x00 );
  8.         for (char i=0; i<30; i++)
  9.         SETWORD( pak, 0x1c6 + (i*2), thisclient->bskills[i] );//Basic skills
  10.     for (char i=0; i<30; i++)
  11.         SETWORD( pak, 0x202 + (i*2), thisclient->askill[i]+thisclient->askilllvl[i] );//Active skills
  12.     for (char i=0; i<30; i++)
  13.         SETWORD( pak, 0x23e + (i*2), thisclient->pskill[i]+thisclient->pskilllvl[i] );//Passive skills
  14.     for(short i=0x274; i<0x2b6; i++)//unused ????
  15.         SETBYTE( pak, i, 0 );
  16.     for (char i=0; i<32; i++)
  17.         SETWORD( pak, 0x2b6+(i*2), thisclient->quickbar[i] );       // QUICKBAR ROW 1 STARTS
  18.     SETWORD( pak, 0x2f6, thisclient->CharInfo->charid );
  19.     SETWORD( pak, 0x2f8, 0x00 );
  20.     cbyte = 0x2fa;


I just shifted the 6 byte offset way back up the code to just before the stamina is sent.
I'm not 1005 sure this is a complete fix yet but it did allow me to get my skills and quickbar data correct.

Code currently running on my server.

Re: Skills offset fixed

PostPosted: Sun May 11, 2008 4:28 pm
by Drakia
I just posted a different fix, that replaced the SET functions with ADD for ease of use, and it fixes all these problems. You moved the offset too high I think, Stamina shows fine,so if you put the offset before it, it's going to stop working.

Re: Skills offset fixed

PostPosted: Sun May 11, 2008 4:35 pm
by PurpleYouko
yeah that is quite possible. I wasn't sure how far to go with it.

Do we actually know that stamina is working?
It still shows up as 5000 after my code change so I'm really not sure.