@@ -1046,7 +1046,7 @@ void award_follower_payout(struct char_data *follower, int karma, int nuyen, str
10461046 GET_IDNUM (questor));
10471047}
10481048
1049- void reward (struct char_data *ch, struct char_data *johnson)
1049+ void reward (struct char_data *ch, struct char_data *johnson, bool favour = FALSE )
10501050{
10511051 if (vnum_from_non_approved_zone (quest_table[GET_QUEST (ch)].vnum )) {
10521052#ifdef IS_BUILDPORT
@@ -1194,13 +1194,21 @@ void reward(struct char_data *ch, struct char_data *johnson)
11941194 }
11951195 }
11961196
1197+ if (favour) {
1198+ karma = karma * FAVOURS_KARMA_MULTIPLIER ;
1199+ nuyen = nuyen * FAVOURS_KARMA_MULTIPLIER ;
1200+ }
1201+
11971202 gain_nuyen (ch, nuyen, NUYEN_INCOME_AUTORUNS );
11981203 int gained = gain_karma (ch, karma, TRUE , FALSE , TRUE );
11991204 act (" $n gives some nuyen to $N." , TRUE , johnson, 0 , ch, TO_NOTVICT );
12001205 act (" You give some nuyen to $N." , TRUE , johnson, 0 , ch, TO_CHAR );
12011206 snprintf (buf, sizeof (buf), " $n gives you %d nuyen." , nuyen);
12021207 act (buf, FALSE , johnson, 0 , ch, TO_VICT );
12031208 send_to_char (ch, " You gain %.2f karma.\r\n " , ((float ) gained / 100 ));
1209+ if (favour) {
1210+ send_to_char (ch, " ^L[OOC: Karma and nuyen rewards for this run were suppressed as it was a favor.]^n\r\n " );
1211+ }
12041212
12051213 mudlog_vfprintf (ch, LOG_GRIDLOG , " %s gains %0.2fk and %dn from job %ld. Elapsed time v2 %0.2f seconds." ,
12061214 GET_CHAR_NAME (ch),
@@ -1221,7 +1229,7 @@ bool compareRep(const quest_entry &a, const quest_entry &b)
12211229// done, and outgrown, sorts it by reputation and returns the lowest
12221230// rep one first. It returns 0 if no more quests are available or -1 if
12231231// the johnson is broken.
1224- int new_quest (struct char_data *mob, struct char_data *ch)
1232+ int new_quest (struct char_data *mob, struct char_data *ch, bool favour = FALSE )
12251233{
12261234 int num = 0 ;
12271235 bool allow_disconnected = vnum_from_non_approved_zone (GET_MOB_VNUM (mob));
@@ -1267,7 +1275,7 @@ int new_quest(struct char_data *mob, struct char_data *ch)
12671275#endif
12681276 }
12691277
1270- if (rep_too_high (ch, quest_idx)) {
1278+ if (rep_too_high (ch, quest_idx) && !favour ) {
12711279 if (access_level (ch, LVL_BUILDER )) {
12721280 send_to_char (ch, " [Skipping quest %ld: You exceed rep cap of %d.]\r\n " , quest_table[quest_idx].vnum , quest_table[quest_idx].max_rep );
12731281 }
@@ -1460,7 +1468,7 @@ void handle_info(struct char_data *johnson, int num, struct char_data *target)
14601468SPECIAL (johnson)
14611469{
14621470 struct char_data *johnson = (struct char_data *) me, *temp = NULL ;
1463- int i, obj_complete = 0 , mob_complete = 0 , new_q, cached_new_q = -2 , comm = CMD_JOB_NONE ;
1471+ int i, obj_complete = 0 , mob_complete = 0 , new_q, cached_new_q = -2 , cached_new_f = - 2 , comm = CMD_JOB_NONE ;
14641472
14651473 if (!IS_NPC (johnson))
14661474 return FALSE ;
@@ -1488,6 +1496,7 @@ SPECIAL(johnson)
14881496
14891497 skip_spaces (&argument);
14901498
1499+ bool favour = FALSE ;
14911500 bool need_to_speak = FALSE ;
14921501 bool need_to_act = FALSE ;
14931502 bool is_sayto = CMD_IS (" sayto" ) || CMD_IS (" \" " ) || CMD_IS (" ask" ) || CMD_IS (" whisper" );
@@ -1524,6 +1533,8 @@ SPECIAL(johnson)
15241533 str_str (argument, " run" ) || str_str (argument, " shadowrun" ) ||
15251534 str_str (argument, " job" ) || str_str (argument, " help" ))
15261535 comm = CMD_JOB_START ;
1536+ else if (str_str (argument, " favor" ) || str_str (argument, " favour" ))
1537+ comm = CMD_JOB_FAVOUR ;
15271538 else if (str_str (argument, " yes" ) || str_str (argument, " accept" ) || str_str (argument, " yeah" )
15281539 || str_str (argument, " sure" ) || str_str (argument, " okay" ))
15291540 comm = CMD_JOB_YES ;
@@ -1600,6 +1611,8 @@ SPECIAL(johnson)
16001611 if (need_to_act)
16011612 do_action (ch, argument, cmd, 0 );
16021613
1614+ bool doing_favours = PRF_FLAGGED (ch, PRF_FAVOURS );
1615+
16031616 switch (comm) {
16041617 case CMD_JOB_QUIT :
16051618 return attempt_quit_job (ch, johnson);
@@ -1671,7 +1684,7 @@ SPECIAL(johnson)
16711684 mudlog (buf, ch, LOG_SYSLOG , TRUE );
16721685 do_say (johnson, " Well done." , 0 , 0 );
16731686 }
1674- reward (ch, johnson);
1687+ reward (ch, johnson, quest_table[ GET_QUEST (ch)]. max_rep < GET_REP (ch) );
16751688 forget (johnson, ch);
16761689
16771690 if (GET_QUEST (ch) == QST_MAGE_INTRO && GET_TRADITION (ch) != TRAD_MUNDANE )
@@ -1680,11 +1693,22 @@ SPECIAL(johnson)
16801693 do_say (johnson, " You haven't completed any of your objectives yet." , 0 , 0 );
16811694
16821695 return TRUE ;
1683- case CMD_JOB_START : {
1696+ case CMD_JOB_START :
1697+ case CMD_JOB_FAVOUR : {
1698+ favour = (comm == CMD_JOB_FAVOUR );
1699+
1700+ if (favour) {
1701+ if (PRF_FLAGGED (ch, PRF_FAVOURS )) {
1702+ do_say (johnson, " Yeah, I might need to call in a favor..." , 0 , 0 );
1703+ } else {
1704+ do_say (johnson, " I don't need any favors from you, come back when you want some real work." , 0 , 0 );
1705+ return TRUE ;
1706+ }
1707+ }
16841708
16851709 // Reject high-rep characters.
16861710 unsigned int johnson_max_rep = get_johnson_overall_max_rep (johnson);
1687- if (johnson_max_rep < 10000 && johnson_max_rep < GET_REP (ch)) {
1711+ if (johnson_max_rep < 10000 && johnson_max_rep < GET_REP (ch) && !favour ) {
16881712 do_say (johnson, " My jobs aren't high-profile enough for someone with your rep!" , 0 , 0 );
16891713 send_to_char (ch, " [OOC: This Johnson caps out at %d reputation, so you won't get any further work from them.]\r\n " , johnson_max_rep);
16901714
@@ -1694,11 +1718,14 @@ SPECIAL(johnson)
16941718 return TRUE ;
16951719 }
16961720
1697- new_q = new_quest (johnson, ch);
1721+ new_q = new_quest (johnson, ch, favour );
16981722 // Clever hack to safely save us a call to new_quest() that compiler will be ok with.
16991723 // If we have a cached quest use that and reset the cache integer back to -2 when
17001724 // it is consumed.
1701- cached_new_q = new_q;
1725+ if (!favour)
1726+ cached_new_q = new_q;
1727+ else
1728+ cached_new_f = new_q;
17021729
17031730 // Handle out of quests and broken johnsons.
17041731 // Calls to new_quest() return 0 when there's no quest left available and
@@ -1829,11 +1856,14 @@ SPECIAL(johnson)
18291856 // Clever hack to safely save us a call to new_quest() that compiler will be ok with.
18301857 // If we have a cached quest use that and reset the cache integer back to -2 when
18311858 // it is consumed.
1832- if (cached_new_q != -2 ) {
1859+ if (cached_new_q != -2 && !doing_favours ) {
18331860 new_q = cached_new_q;
18341861 cached_new_q = -2 ;
1862+ } else if (cached_new_f != -2 && doing_favours) {
1863+ new_q = cached_new_f;
1864+ cached_new_f = -2 ;
18351865 } else {
1836- new_q = new_quest (johnson, ch);
1866+ new_q = new_quest (johnson, ch, doing_favours );
18371867 }
18381868
18391869 // Handle out of quests and broken johnsons.
@@ -1899,11 +1929,14 @@ SPECIAL(johnson)
18991929 // Clever hack to safely save us a call to new_quest() that compiler will be ok with.
19001930 // If we have a cached quest use that and reset the cache integer back to -2 when
19011931 // it is consumed.
1902- if (cached_new_q != -2 ) {
1932+ if (cached_new_q != -2 && !doing_favours ) {
19031933 new_q = cached_new_q;
19041934 cached_new_q = -2 ;
1935+ } else if (cached_new_f != -2 && doing_favours) {
1936+ new_q = cached_new_f;
1937+ cached_new_f = -2 ;
19051938 } else {
1906- new_q = new_quest (johnson, ch);
1939+ new_q = new_quest (johnson, ch, doing_favours );
19071940 }
19081941
19091942 // Handle out of quests and broken johnsons.
0 commit comments