So I have been working on adding quest points to AfkMud code this is was has worked for me. I am add this to make Afk better and will be working towards getting the questmaster code working with Afk also.
Here is what i have done. If anyone see and glaring mistakes please let me know.
In Character.h
Find int version;
Add int quest_points;
Find bool backtracking; /* Unsafe landing flag */
Under that add
int quest_points; /*adding in quest points ###8-21-12*/
In Character.cpp in the char_data::char_data()
Find this->perm_lck = 13;
Add this->quest_points = 0; right under lck.
Find int char_data::GET_AC( )
Right under that add
int char_data::get_quest_points( )
{
return this->quest_points ;
}
In player.cpp
Find ch->printf( "%sPracs: %s%-15d %sFavor :
And change it to be
ch->printf( "%sPracs: %s%-15d %sFavor : %s%-15d %s Quest Points: %s%-15d\r\n\r\n",
s2, s3, ch->pcdata->practice, s2, s3, ch->pcdata->favor, s2, s3, ch->pcdata->quest_points );
in save.cpp
find fprintf( fp, "Condition %d %d %d\n", ch->pcdata->condition[0], ch->pcdata->condition[1], ch->pcdata->condition[2] );
then add fprintf( fp, "QuestPoints %d\n", ch->pcdata->quest_points); // ### added quest points to characters pfile
then find void fread_char( char_data * ch, FILE * fp, bool preload, bool copyover ) and go down to the case 'Q': right below the Qbit add in
if( !str_cmp( word, "QuestPoints" ) )
{
line = fread_line( fp );
sscanf( line, "%d", &x1 );
ch->pcdata->quest_points = x1;
break;
}
In act_wiz.cpp (this is where I added the command do add and remove quest points)
Under the last CMDF add
CMDF(do_qpset) {
string arg1, arg2, arg3;
char_data *victim;
string origarg = argument;
int value = 0;
ch->set_color(AT_IMMORT);
// adding data to args
argument = one_argument(argument, arg1);
argument = one_argument(argument, arg2);
argument = one_argument(argument, arg3);
// need to change arg3 from string to interger
value = atoi(arg3.c_str());
// checking to make sure the player is online
if (!(victim = ch->get_char_world(arg1))) {
ch->print("They don't seem to be around.\r\n"

;
return;
}
// mobs should not be able to set quest points
if (ch->isnpc()) {
ch->print("Mob's can't qpset\r\n"

;
return;
}
if (arg1.empty() || arg2.empty()) {
ch->print("Syntax: qpset <player> <add|remove>\r\n"

;
ch->print("Example qpset Player1 add, will just add one to quest points\r\n\n"

;
ch->print("Syntax: qpset <player> <add|remove> #\r\n"

;
ch->print("Example qpset Player1 add 5, will add five to quest points\r\n\n"

;
return;
}
if (!str_cmp(arg2, "add"

) {
if (arg3.empty()) {
victim->pcdata->quest_points = victim->pcdata->quest_points + 1;
ch->printf("Setting one quest point on %s.\r\n", victim->name);
victim->save();
return;
}
else if ((value < 1) || (value > 1000)) {
ch->printf("You must enter a number between 1 and 1000"

;
return;
} else {
victim->pcdata->quest_points = value + victim->pcdata->quest_points;
ch->printf("Setting %d quest points on %s.\r\n", value, victim->name);
victim->save();
return;
}
} else if (!str_cmp(arg2, "remove"

) {
if (arg3.empty()) {
victim->pcdata->quest_points = victim->pcdata->quest_points - 1;
ch->printf("Removing one quest point from %s.\r\n", victim->name);
victim->save();
return;
} else if ((value < 1) || (value > 1000)) {
ch->printf("You must enter a number between 1 and 1000"

;
return;
} else {
victim->pcdata->quest_points = victim->pcdata->quest_points - value;
ch->printf("Removing %d quest points from %s.\r\n", value, victim->name);
victim->save();
return;
}
} else {
ch->print("Syntax: qpset <player> <add|remove>\r\n"

;
ch->print("Example qpset Player1 add, will just add one to quest points\r\n\n"

;
ch->print("Syntax: qpset <player> <add|remove> #\r\n"

;
ch->print("Example qpset Player1 add 5, will add five to quest points\r\n\n"

;
return;
}
return;
}
Then go to the system folder and find commands.dat
Then right below pclist add
#COMMAND
Name qpset
Code do_qpset
Position dead
Level 101
Log normal
Flags ghost
End
You can change the level to be whatever you want it to be for your mud