Reborn is removing items

Welcome in the osRose emulator Project.

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

Re: Reborn is removing items

Postby Bless on Sat Jun 15, 2013 12:06 pm

I'm trying to play with the code but it never works :S :(
Bless
Pomic
Pomic
 
Posts: 83
Joined: Wed Oct 13, 2010 9:44 pm

Re: Reborn is removing items

Postby Bless on Mon Jun 17, 2013 9:50 am

I got it working, thanks to hoegarden31!!

  1.    if(thisclient->Party->party!=NULL)
  2.         {
  3.             Log(MSG_INFO,"Player %s tried to use reborn but he was in a party.");
  4.             return true;
  5.         }
  6.      
  7.          if(thisclient->Stats->Level < GServer->Config.MaxLevel) //Level 260 can be changed to any level you want
  8.          {
  9.             GServer->SendPM(thisclient, "You have to be lvl %i to reborn !", GServer->Config.MaxLevel);
  10.          }
  11.          else
  12.          {
  13.      
  14.             thisclient = GServer->GetClientByCharName( thisclient->CharInfo->charname ); // adding this allows the server to retrieve the players client info for item removal
  15.             //starting the item removal process from slots 1 through 11
  16.             /*
  17.                 slot 1, Face
  18.                 slot 2, Head
  19.                 slot 3, Body
  20.                 slot 4, Back
  21.                 slot 5, Hand
  22.                 slot 6, Foot
  23.                 slot 7, Weapon
  24.                 slot 8, Offhand
  25.                 slot 9, Necklace
  26.                 slot 10, Ring
  27.                 slot 11, Earring
  28.             */
  29.             /*for(int j=1; j<11; j++){
  30.                 if(thisclient->items[j].itemnum == 0){ //prevents unknown itemtype error
  31.                     continue;
  32.                 }
  33.      
  34.                 UINT newslot = thisclient->GetNewItemSlot(thisclient->items[j]); // finds the first free slot in inventory
  35.                 if(newslot==0xffff)
  36.                 {
  37.                     Log(MSG_INFO,"Unable to find empty slot");
  38.                     SendPM(thisclient,"Your inventory is full");
  39.                     return false;
  40.                 }
  41.      
  42.                 thisclient->items[newslot] = thisclient->items[j];
  43.                 ClearItem( thisclient->items[j] );
  44.                 thisclient->UpdateInventory( newslot, j );
  45.                 BEGINPACKET( pak, 0x7a5 );
  46.                 ADDWORD    ( pak, thisclient->clientid );
  47.                 ADDWORD    ( pak, j );
  48.                 ADDWORD    ( pak, thisclient->items[j].itemnum );
  49.                 ADDWORD    ( pak, GServer->BuildItemRefine( thisclient->items[j] ) );
  50.                 ADDWORD    ( pak, thisclient->Stats->Move_Speed );
  51.                 GServer->SendToVisible( &pak, (CCharacter*)this);
  52.                 thisclient->SetStats( );
  53.             }
  54.             (CPlayer *)thisclient;*/
  55.      
  56.             //LMA: We remove all but basic skills.
  57.             /*for(int i=0;i<320;i++)  //For keeping the skills, remove this line
  58.             {  //For keeping the skills, remove this line
  59.                   //For keeping the skills, remove this line
  60.                 //For keeping the skills, remove this line
  61.                         }  //For keeping the skills, remove this line
  62.      
  63.             for(int i=0;i<MAX_QUICKBAR;i++)
  64.                 thisclient->quickbar[i] = 0;
  65.     */
  66.              thisclient->p_skills = 0;  //For keeping the skills, remove
  67.              thisclient->CharInfo->SkillPoints = 0;
  68.              thisclient->CharInfo->StatPoints = 0;
  69.              thisclient->CharInfo->Job = 1;
  70.      
  71.              thisclient->Stats->Level = 1;
  72.              thisclient->CharInfo->Exp = 0;
  73.      
  74.              thisclient->ActiveQuest = 0;
  75.      
  76.             /*Update Reborn Command {By CrAshInSiDe*/
  77.             int x = 5098;
  78.             int y = 5322;
  79.             int map = 22;
  80.             if( (x != 0) && (y != 0) && (map != 0) )
  81.             {
  82.                 fPoint coord;
  83.                 coord.x = x;
  84.                 coord.y = y;
  85.                 MapList.Index[map]->TeleportPlayer( thisclient, coord, false );
  86.             }
  87.      
  88.      
  89.              // Uncomment below if you want to use the Nobles part
  90.              /*
  91.                      char newcharname[65];
  92.                      strcpy (newcharname,"[Nobles]");
  93.                      strcat (newcharname, thisclient->CharInfo->charname);
  94.                      GServer->DB->QExecute(" UPDATE characters SET char_name = '%s' WHERE id = '%i' ",newcharname, thisclient->CharInfo->charid);
  95.             */
  96.      
  97.              BEGINPACKET( pak, 0x702 );
  98.              ADDSTRING( pak, "You were disconnected from the server !" );
  99.              ADDBYTE( pak, 0 );
  100.              thisclient->client->SendPacket( &pak );
  101.      
  102.              RESETPACKET( pak, 0x707 );
  103.              ADDWORD( pak, 0 );
  104.              thisclient->client->SendPacket( &pak );
  105.      
  106.              //saving skills.
  107.              thisclient->saveskills();
  108.              thisclient->ResetSkillOffset();
  109.              thisclient->client->isActive = false;
  110.              thisclient->clearquest(thisclient);
  111.           }


If you want the reborn to keep the job/class, comment this out:
  1. thisclient->CharInfo->Job = 1;
Bless
Pomic
Pomic
 
Posts: 83
Joined: Wed Oct 13, 2010 9:44 pm

Previous

Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 11 guests

cron