• Networking: The investigation is still on the way, we've switched to backup telecom carriers since the episode but we're still working in settling everything as it must be. We'll add more updates as we have them available. Incoming and outgoing emails will be restricted, and user registration has been disabled until the issue is resolved.

[DEV] Using /class for job changer script

Status
Not open for further replies.
Newbie Spellweaver
Joined
Aug 8, 2004
Messages
8
Reaction score
0
Location
c(^^,?
i get this script from gmcmds.cpp. modified to be a job changer script. i'm no coder so please help me here. ^^

GM: Change Class (from Crash)
bool CWorldServer::pakGMClass( CWorldClient* thisclient, char* classid )
{
int classid_new, classid_old, playerlevel, 1stclass_req, 2ndclass_req, 3rdclass_req;

1stclass_req = 10;
2ndclass_req = 100;
3rdclass_req = 150;
classid_new = 0;
classid_old = thisclient->PlayerInfo->Job;
playerlevel = thisclient->PlayerInfo->Level;

// from visitor
if (classid_old = 0)
{
if (playerlevel = > 1stclass_req)
{
if ( strcmp ( classid , "Soldier" ) == 0 || strcmp ( classid , "soldier" ) == 0)
{
classid_new = 111;
}
else if ( strcmp ( classid , "Muse" ) == 0 || strcmp ( classid , "muse" ) == 0)
{
classid_new = 211;
}
else if ( strcmp ( classid , "Hawker" ) == 0 || strcmp ( classid , "hawker" ) == 0)
{
classid_new = 311;
}
else if ( strcmp ( classid , "Dealer" ) == 0 || strcmp ( classid , "dealer" ) == 0)
{
classid_new = 411;
}
else
{
char line0[200] = "You can only changed to 1st job!";
char line1[200] = "Use /class [soldier][muse][hawker][dealer] only";
SendPM(thisclient, line0);
SendPM(thisclient, line1);
}
}
else
{
char line0[200] = "1st job change is at level 10!";
char line1[200] = "Use this command: /class [soldier][muse][hawker][dealer] except the [] clauses";
SendPM(thisclient, line0);
SendPM(thisclient, line1);
}
}
// soldier-knight-champion
else if (classid_old = 111) || (classid_old = 121)
{
if ( strcmp ( classid , "Soldier" ) == 0 || strcmp ( classid , "soldier" ) == 0) || ( strcmp ( classid , "Champion" ) == 0 || strcmp ( classid , "champion" ) == 0)
{
if (playerlevel => 3rdclass_req)
{
if ( strcmp ( classid , "Champion" ) == 0 || strcmp ( classid , "champion" ) == 0)
{
classid_new = 122;
}

else if ( strcmp ( classid , "Knight" ) == 0 || strcmp ( classid , "knight" ) == 0)
{
classid_new = 121;
}
}
else if (playerlevel => 2ndclass_req)
{
if ( strcmp ( classid , "Knight" ) == 0 || strcmp ( classid , "knight" ) == 0)
{
classid_new = 121;
}
else if ( strcmp ( classid , "Champion" ) == 0 || strcmp ( classid , "champion" ) == 0)
{
char line0[200] = "You can't change to that job YET.";
char line1[200] = "The champion class is at available at level " + 3rdclass_req;
SendPM(thisclient, line0);
SendPM(thisclient, line1);
}
{
}
else
{
char line0[200] = "You can't change to that job.";
char line1[200] = "Use only /class [knight] or [champion]";
SendPM(thisclient, line0);
SendPM(thisclient, line1);
}

}
// muse-mage-cleric
else if (classid_old = 221) || (classid_old = 222)
{
// ...
}
// hawker-raider-scout
else if (classid_old = 321) || (classid_old = 322)
{
// ..
}
// dealer-borq-artisan
else if (classid_old = 421) || (classid_old = 422)
{
// ..
}
else
{
return true;
}

if (classid_new != 0)
{
thisclient->PlayerInfo->Job = classid_new;
BEGINPACKET( pak, 0x702 );
ADDSTRING( pak, "Class changed. Please re-login now !" );
ADDBYTE( pak, 0 );
thisclient->SendPacket( &pak );
}
return true;
}
 
Status
Not open for further replies.
Back