- // Reborn command credits Core
- bool CWorldServer::pakGMReborn(CPlayer* thisclient)
- {
- if(thisclient->Party->party!=NULL)
- {
- Log(MSG_INFO,"Player %s tried to use reborn but he was in a party.");
- return true;
- }
- if(thisclient->Stats->Level < 250) //Level 250 can be changed to any level you want
- {
- GServer->SendPM(thisclient, "You have to be lvl 250 to reborn !");
- }
- else
- {
- //LMA: We remove all but basic skills.
- for(int i=0;i<320;i++) //For keeping the skills, remove this line
- { //For keeping the skills, remove this line
- thisclient->cskills[i].id = 0; //For keeping the skills, remove this line
- thisclient->cskills[i].level = 1; //For keeping the skills, remove this line
- thisclient->cskills[i].thisskill=NULL;
- } //For keeping the skills, remove this line
- for(int i=0;i<MAX_QUICKBAR;i++)
- thisclient->quickbar[i] = 0;
- thisclient->p_skills = 0; //For keeping the skills, remove*/
- thisclient->CharInfo->SkillPoints = 0;
- thisclient->CharInfo->StatPoints = 0;
- thisclient->Stats->Level = 1;
- thisclient->CharInfo->Exp = 0;
- thisclient->ActiveQuest = 0;
- /*Update Reborn Command {By CrAshInSiDe*/
- int x = 5098;
- int y = 5322;
- int map = 22;
- if( (x != 0) && (y != 0) && (map != 0) )
- {
- fPoint coord;
- coord.x = x;
- coord.y = y;
- MapList.Index[map]->TeleportPlayer( thisclient, coord, false );
- }
- // Uncomment below if you want to use the Nobles part
- /*char newcharname[65];
- strcpy (newcharname,"[NOBLES]");
- strcat (newcharname, thisclient->CharInfo->charname);
- GServer->DB->QExecute(" UPDATE characters SET char_name = '%s' WHERE id = '%i' ",newcharname, thisclient->CharInfo->charid);
- */
- BEGINPACKET( pak, 0x702 );
- ADDSTRING( pak, "You were disconnected from the server !" );
- ADDBYTE( pak, 0 );
- thisclient->client->SendPacket( &pak );
- RESETPACKET( pak, 0x707 );
- ADDWORD( pak, 0 );
- thisclient->client->SendPacket( &pak );
- //saving skills.
- thisclient->saveskills();
- thisclient->ResetSkillOffset();
- thisclient->client->isActive = false;
- }
- return true;
- }
Just a quick Question:
What is the Function name for keeping Unique Skills and milease skills after reborning? Currently I have it so that when you reborn, you lose all your normal class skills and your level becomes 1 again, but you stay as the class you were i.e 250 knight /reborns become lvl 1 knight with normal skills again, I like it this way, but I want to be able to keep the Unique Skills like Drive Cart and Castle Gear.
Here's how I have it so far:
I'm guessing that I would have to use something like: thisclient->U_skills = 0; ?? I dunno though, cant find where the Unique / Mileage skills are called.
Any And all help is much appreciated ty ^^