[ADDED] Fix Name/Quick/Skills

Submit code for osProse project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[ADDED] Fix Name/Quick/Skills

Postby Drakia on Sun May 11, 2008 4:27 pm

This is a big replacement, but it should fix the name crashing (Same fix as my other post, but integrated into these other fixes) as well as the quick bar and skills.

Replace the entire void CWorldServer::pakPlayer( CPlayer *thisclient ) function in WorldPackets.cpp with
  1. void CWorldServer::pakPlayer( CPlayer *thisclient )
  2. {
  3.      unsigned cbyte = 0;
  4.     CRespawnPoint* thisrespawn = GetRespawnByID( thisclient->Position->respawn );
  5.     if(thisclient->Position->saved==20&&thisrespawn->destMap!=20)
  6.         thisclient->Position->saved=22;
  7.     if(thisrespawn!=NULL)
  8.     {
  9.         thisclient->Position->destiny = thisrespawn->dest;
  10.         thisclient->Position->current = thisclient->Position->destiny;
  11.         thisclient->Position->Map = thisrespawn->destMap;
  12.     }
  13.     else
  14.     {
  15.         thisclient->Position->destiny.x = 5300;
  16.         thisclient->Position->destiny.y = 5200;
  17.         thisclient->Position->current = thisclient->Position->destiny;
  18.         thisclient->Position->Map = 1;
  19.     }
  20.     CMap* map = MapList.Index[thisclient->Position->Map];
  21.     map->AddPlayer( thisclient );
  22.     BEGINPACKET(pak, 0x715);
  23.     ADDBYTE( pak, thisclient->CharInfo->Sex );                 // Sex
  24.     ADDWORD( pak, thisclient->Position->Map );                 // Map
  25.     ADDFLOAT( pak, thisclient->Position->current.x*100 );      // Pos X
  26.     ADDFLOAT( pak, thisclient->Position->current.y*100 );      // Pos Y
  27.     //ADDWORD( pak, thisclient->Position->Map );
  28.     ADDWORD( pak, thisclient->Position->saved );
  29.     ADDDWORD( pak, thisclient->CharInfo->Face );               // Face
  30.     ADDDWORD( pak, thisclient->CharInfo->Hair );               // Hair
  31.     ADDDWORD( pak, BuildItemShow(thisclient->items[2]) );      // Cap
  32.     ADDDWORD( pak, BuildItemShow(thisclient->items[3]) );      // Body
  33.     ADDDWORD( pak, BuildItemShow(thisclient->items[5]) );      // Gloves
  34.     ADDDWORD( pak, BuildItemShow(thisclient->items[6]) );      // Boots
  35.     ADDDWORD( pak, BuildItemShow(thisclient->items[1]) );      // Face
  36.     ADDDWORD( pak, BuildItemShow(thisclient->items[4]) );      // Back
  37.     ADDDWORD( pak, BuildItemShow(thisclient->items[7]) );      // Weapon
  38.     ADDDWORD( pak, BuildItemShow(thisclient->items[8]) );      // SubWeapon
  39.     ADDWORD( pak, 0x0100 );
  40.     ADDBYTE( pak, 0x00 );
  41.     ADDWORD( pak, thisclient->CharInfo->Job );                 // Job
  42.     ADDBYTE( pak, 0x00);
  43.     ADDWORD( pak, 0x0000 );
  44.     ADDWORD( pak, thisclient->Attr->Str );                     // Str
  45.     ADDWORD( pak, thisclient->Attr->Dex );                     // Dex
  46.     ADDWORD( pak, thisclient->Attr->Int );                     // Int
  47.     ADDWORD( pak, thisclient->Attr->Con );                     // Con
  48.     ADDWORD( pak, thisclient->Attr->Cha );                     // Cha
  49.     ADDWORD( pak, thisclient->Attr->Sen );                     // Sen
  50.     ADDWORD( pak, thisclient->Stats->HP );                     // Current HP
  51.     ADDWORD( pak, thisclient->Stats->MP );                     // Current MP
  52.     ADDWORD( pak, thisclient->CharInfo->Exp );                 // Exp
  53.     ADDWORD( pak, 0x0000 );
  54.     ADDWORD( pak, thisclient->Stats->Level );                  // Level
  55.     ADDWORD( pak, thisclient->CharInfo->StatPoints );          // Stat Points
  56.     ADDWORD( pak, thisclient->CharInfo->SkillPoints );         // Skill Points
  57.     ADDWORD( pak, 0x6464 );
  58.     ADDWORD( pak, 0x0000 );
  59.     ADDWORD( pak, 0x0000 );
  60.     ADDWORD( pak, 0x0000 );
  61.     ADDWORD( pak, 0x0000 );
  62.     ADDWORD( pak, 0x0000 );
  63.     ADDWORD( pak, 0x0000 );
  64.     ADDWORD( pak, 0x0000 );
  65.     ADDWORD( pak, 0x0000 );
  66.     ADDWORD( pak, 0x0000 );
  67.     ADDWORD( pak, 0x0000 );
  68.     ADDWORD( pak, 0x0000 );
  69.     ADDWORD( pak, 0x0000 );
  70.     ADDWORD( pak, 0x0000 );
  71.     ADDWORD( pak, 0x0000 );
  72.     ADDWORD( pak, 0x0000 );
  73.     ADDWORD( pak, 0x0000 );
  74.     ADDWORD( pak, 0x0000 );
  75.     ADDWORD( pak, 0x0000 );
  76.     ADDBYTE( pak, 0x00 );
  77.     ADDWORD( pak, thisclient->CharInfo->stamina );                       // Stamina
  78.  
  79.     for(short i=0; i<326; i++)
  80.         ADDBYTE( pak, 0x00 );
  81.   for (char i=0; i<30; i++)
  82.         ADDWORD( pak, thisclient->bskills[i] );//Basic skills
  83.     for (char i=0; i<30; i++)
  84.         ADDWORD( pak, thisclient->askill[i]+thisclient->askilllvl[i] );//Active skills
  85.     for (char i=0; i<30; i++)
  86.         ADDWORD( pak, thisclient->pskill[i]+thisclient->pskilllvl[i] );//Passive skills
  87.     for(short i=0; i<60; i++)//unused ????
  88.         ADDBYTE( pak, 0 );
  89.     for (char i=0; i<32; i++)
  90.         ADDWORD( pak, thisclient->quickbar[i] );        // QUICKBAR ROW 1 STARTS
  91.     ADDWORD( pak, thisclient->CharInfo->charid );
  92.     ADDWORD( pak, 0x00 );
  93.     for(unsigned j = 0; j < strlen(thisclient->CharInfo->charname); j++)
  94.     {
  95.         ADDBYTE(pak, thisclient->CharInfo->charname[j] );
  96.     }
  97.  
  98.     ADDBYTE( pak, 0x00 );
  99.     ADDBYTE( pak, 0x00 );
  100.     thisclient->client->SendPacket( &pak );
  101. }
Last edited by Drakia on Wed May 14, 2008 4:07 am, edited 1 time in total.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: Fix Name/Quick/Skills

Postby PurpleYouko on Sun May 11, 2008 4:40 pm

added.
This is a much nicer fix than mine as it doesn't require all the hex adding to put in the 6 byte offset.
compiling now with this and the multiplayer fix.

Server now restarted so we will see if we still get trose errors :D
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 3 guests