// Put the following comment block and function at the bottom of act_wiz.c /*********************************************************** * The Double Quest Points system is written by Feydrex. * This system provides an imp with the ability to activate * double quest point rewards for the whole mud for a time. ***********************************************************/ void do_doubleqps( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int num_ticks; one_argument(argument,arg); if(arg[0] == '\0') { send_to_char("Syntax: doubleqps <num of ticks>\n\r doubleqps off\n\r", ch); return; } if(!str_cmp(arg, "off")) { if(!double_qps) { send_to_char("Double quest points are already off.\n\r", ch); return; } double_qps = FALSE; dqp_ticks = 0; sprintf(buf, "{GDouble quest points are now OFF.{x"); do_echo(ch, buf); send_to_char( "Double quest points are now off.\n\r", ch); return; } if(double_qps) { send_to_char("Double quest points are already activated.\n\r", ch); return; } num_ticks = atoi(arg); if( num_ticks < 10 || num_ticks > 120 ) { send_to_char("Valid number of ticks is 10 to 120.\n\r", ch); return; } double_qps = TRUE; dqp_ticks = num_ticks; sprintf(buf, "{GDouble quest points are now ON!{x"); do_echo(ch, buf); send_to_char( "Double quest points are now on.\n\r", ch); return; } ///// At the top of act_wiz.c, put the following line before the first function: bool double_qps = FALSE; /* For Feydrex's double quest point code */ //// At the top of update.c, put the following line before the first function: int dqp_ticks = 0; /* For Feydrex's double quest point code */ ///// At the start of the char_update function, declare: char buf[MAX_STRING_LENGTH]; At the end of the char_update function in update.c, put the following: /* The following section is for Feydrex's double qp code */ if(dqp_ticks > 0) { dqp_ticks--; if(dqp_ticks < 1) { double_qps = FALSE; dqp_ticks = 0; sprintf(buf, "{GDouble quest points are now OFF.{x"); do_echo(ch, buf); } } /* end of double qp section */ ////// In the Global Variables section of merc.h (such as somewhere after obj_free): /* For Feydrex's double quest point code */ extern bool double_qps; extern int dqp_ticks; //// In the do_quest function in quest.c, in the quest "complete" section, Inside of the following existing section: reward = number_range(10,500); pointreward = number_range(10,50); --> sprintf(buf, "Congratulations, %s, on completing your quest!", ch->name); do_say(questman,buf); Add this: if(double_qps) pointreward *= 2; And in the object quest reward section, farther down in the same function, Inside of the following existing section: reward = number_range(10,500); pointreward = number_range(10,50); --> act("You hand $p to $N.",ch, obj, questman, TO_CHAR); act("$n hands $p to $N.",ch, obj, questman, TO_ROOM); Add this: if(double_qps) pointreward *=2; //// In interp.h add the do_fun declaration: DECLARE_DO_FUN( do_doubleqps ); //// In interp.c add to the command table: { "doubleqps", do_doubleqps, POS_DEAD, ML, 1, LOG_ALWAYS, 1 ), //// In act_info.c, in the do_who function, put the following near the bottom display: if(double_qps) { sprintf( buf2, "\n\r{GDouble Quest Points is active for %d ticks.{x",dqp_ ticks); add_buf(output,buf2); } //// Add the following help entry to help.are: 0 doubleqps~ The generosity of the imps can grant upon the masses a time of double quest point rewards. For the duration of the double quest point activation, players who complete auto-quests from the quest master will be awarded with double the reward assigned. If the normal reward is 10 - 50 quest points, then the reward during double quest points is 20 - 100 quest points. The duration of double quest points is to be specified by the user of the command. Double quest points can also be turned off before the end of the specified duration. Syntax: doubleqps <number> <number> range: 10 - 120 doubleqps off ~