Prevents going back to visitor, or else they could multiclass.
- bool CWorldServer::pakGMClass( CPlayer* thisclient, char* classid )
- {
- int classid_new = thisclient->CharInfo->Job;
- if ( strcmp ( classid , "Visitor" ) == 0 || strcmp ( classid , "visitor" ) == 0)
- {
- // classid_new = 0;
- }
- else if ( strcmp ( classid , "Soldier" ) == 0 || strcmp ( classid , "soldier" ) == 0)
- {
- if ((thisclient->Stats->Level >= 10) && (classid_new == 0 )) // visitor
- classid_new = 111;
- }
- else if ( strcmp ( classid , "Knight" ) == 0 || strcmp ( classid , "knight" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 111)) // solder
- classid_new = 121;
- }
- else if ( strcmp ( classid , "Champion" ) == 0 || strcmp ( classid , "champion" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 111)) // solder
- classid_new = 122;
- }
- else if ( strcmp ( classid , "Muse" ) == 0 || strcmp ( classid , "muse" ) == 0)
- {
- if ((thisclient->Stats->Level >= 10) && (classid_new == 0 )) // visitor
- classid_new = 211;
- }
- else if ( strcmp ( classid , "Mage" ) == 0 || strcmp ( classid , "mage" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 211)) // muse
- classid_new = 221;
- }
- else if ( strcmp ( classid , "Cleric" ) == 0 || strcmp ( classid , "cleric" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 211)) // muse
- classid_new = 222;
- }
- else if ( strcmp ( classid , "Hawker" ) == 0 || strcmp ( classid , "hawker" ) == 0)
- {
- if ((thisclient->Stats->Level >= 10) && (classid_new == 0 )) // visitor
- classid_new = 311;
- }
- else if ( strcmp ( classid , "Raider" ) == 0 || strcmp ( classid , "raider" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 311)) // hawker
- classid_new = 321;
- }
- else if ( strcmp ( classid , "Scout" ) == 0 || strcmp ( classid , "scout" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 311)) // hawker
- classid_new = 322;
- }
- else if ( strcmp ( classid , "Dealer" ) == 0 || strcmp ( classid , "dealer" ) == 0)
- {
- if ((thisclient->Stats->Level >= 10) && (classid_new == 0 )) // visitor
- classid_new = 411;
- }
- else if ( strcmp ( classid , "Bourgeois" ) == 0 || strcmp ( classid , "bourgeois" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 411)) // dealer
- classid_new = 421;
- }
- else if ( strcmp ( classid , "Artisan" ) == 0 || strcmp ( classid , "artisan" ) == 0)
- {
- if ((thisclient->Stats->Level >= 100) && (classid_new == 411)) // dealer
- classid_new = 422;
- }
- else
- {
- return true;
- }
- bool changed = true;
- if ( thisclient->CharInfo->Job == classid_new )
- changed = false;
- thisclient->CharInfo->Job = classid_new;
- BEGINPACKET(pak, 0x0721);
- ADDWORD(pak,4);
- ADDWORD(pak, thisclient->CharInfo->Job);
- ADDWORD(pak,0);
- thisclient->client->SendPacket(&pak);
- RESETPACKET(pak, 0x0730);
- ADDWORD(pak, 5);
- ADDWORD(pak, 0xa24d);
- ADDWORD(pak, 0x40b3);
- thisclient->client->SendPacket(&pak);
- if ( changed )
- {
- SendPM(thisclient, "Class changed!" );
- }
- else
- {
- if ( thisclient->Stats->Level < 10 )
- SendPM(thisclient, "Class change failed! You must be at least lvl 10 to change your job." );
- else if (classid_new == 0) // visitor
- SendPM(thisclient, "Class change failed! Pick a first job, muse, dealer, hawker, or solder" );
- else
- SendPM(thisclient, "Class change failed!" );
- }
- return true;
- }