[ADDED] Fix Name/Quick/Skills
Posted: 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
Replace the entire void CWorldServer::pakPlayer( CPlayer *thisclient ) function in WorldPackets.cpp with
- void CWorldServer::pakPlayer( CPlayer *thisclient )
- {
- unsigned cbyte = 0;
- CRespawnPoint* thisrespawn = GetRespawnByID( thisclient->Position->respawn );
- if(thisclient->Position->saved==20&&thisrespawn->destMap!=20)
- thisclient->Position->saved=22;
- if(thisrespawn!=NULL)
- {
- thisclient->Position->destiny = thisrespawn->dest;
- thisclient->Position->current = thisclient->Position->destiny;
- thisclient->Position->Map = thisrespawn->destMap;
- }
- else
- {
- thisclient->Position->destiny.x = 5300;
- thisclient->Position->destiny.y = 5200;
- thisclient->Position->current = thisclient->Position->destiny;
- thisclient->Position->Map = 1;
- }
- CMap* map = MapList.Index[thisclient->Position->Map];
- map->AddPlayer( thisclient );
- BEGINPACKET(pak, 0x715);
- ADDBYTE( pak, thisclient->CharInfo->Sex ); // Sex
- ADDWORD( pak, thisclient->Position->Map ); // Map
- ADDFLOAT( pak, thisclient->Position->current.x*100 ); // Pos X
- ADDFLOAT( pak, thisclient->Position->current.y*100 ); // Pos Y
- //ADDWORD( pak, thisclient->Position->Map );
- ADDWORD( pak, thisclient->Position->saved );
- ADDDWORD( pak, thisclient->CharInfo->Face ); // Face
- ADDDWORD( pak, thisclient->CharInfo->Hair ); // Hair
- ADDDWORD( pak, BuildItemShow(thisclient->items[2]) ); // Cap
- ADDDWORD( pak, BuildItemShow(thisclient->items[3]) ); // Body
- ADDDWORD( pak, BuildItemShow(thisclient->items[5]) ); // Gloves
- ADDDWORD( pak, BuildItemShow(thisclient->items[6]) ); // Boots
- ADDDWORD( pak, BuildItemShow(thisclient->items[1]) ); // Face
- ADDDWORD( pak, BuildItemShow(thisclient->items[4]) ); // Back
- ADDDWORD( pak, BuildItemShow(thisclient->items[7]) ); // Weapon
- ADDDWORD( pak, BuildItemShow(thisclient->items[8]) ); // SubWeapon
- ADDWORD( pak, 0x0100 );
- ADDBYTE( pak, 0x00 );
- ADDWORD( pak, thisclient->CharInfo->Job ); // Job
- ADDBYTE( pak, 0x00);
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, thisclient->Attr->Str ); // Str
- ADDWORD( pak, thisclient->Attr->Dex ); // Dex
- ADDWORD( pak, thisclient->Attr->Int ); // Int
- ADDWORD( pak, thisclient->Attr->Con ); // Con
- ADDWORD( pak, thisclient->Attr->Cha ); // Cha
- ADDWORD( pak, thisclient->Attr->Sen ); // Sen
- ADDWORD( pak, thisclient->Stats->HP ); // Current HP
- ADDWORD( pak, thisclient->Stats->MP ); // Current MP
- ADDWORD( pak, thisclient->CharInfo->Exp ); // Exp
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, thisclient->Stats->Level ); // Level
- ADDWORD( pak, thisclient->CharInfo->StatPoints ); // Stat Points
- ADDWORD( pak, thisclient->CharInfo->SkillPoints ); // Skill Points
- ADDWORD( pak, 0x6464 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDWORD( pak, 0x0000 );
- ADDBYTE( pak, 0x00 );
- ADDWORD( pak, thisclient->CharInfo->stamina ); // Stamina
- for(short i=0; i<326; i++)
- ADDBYTE( pak, 0x00 );
- for (char i=0; i<30; i++)
- ADDWORD( pak, thisclient->bskills[i] );//Basic skills
- for (char i=0; i<30; i++)
- ADDWORD( pak, thisclient->askill[i]+thisclient->askilllvl[i] );//Active skills
- for (char i=0; i<30; i++)
- ADDWORD( pak, thisclient->pskill[i]+thisclient->pskilllvl[i] );//Passive skills
- for(short i=0; i<60; i++)//unused ????
- ADDBYTE( pak, 0 );
- for (char i=0; i<32; i++)
- ADDWORD( pak, thisclient->quickbar[i] ); // QUICKBAR ROW 1 STARTS
- ADDWORD( pak, thisclient->CharInfo->charid );
- ADDWORD( pak, 0x00 );
- for(unsigned j = 0; j < strlen(thisclient->CharInfo->charname); j++)
- {
- ADDBYTE(pak, thisclient->CharInfo->charname[j] );
- }
- ADDBYTE( pak, 0x00 );
- ADDBYTE( pak, 0x00 );
- thisclient->client->SendPacket( &pak );
- }