diff --git a/src/act.comm.c b/src/act.comm.c index 637b9df..a6749d0 100644 --- a/src/act.comm.c +++ b/src/act.comm.c @@ -71,6 +71,40 @@ ACMD(do_say) speech_wtrigger(ch, argument); } +ACMD(do_ooc) +{ + skip_spaces(&argument); + + if (!*argument) + send_to_char(ch, "Yes, but WHAT do you want to say OOC?\r\n"); + else { + char buf[MAX_INPUT_LENGTH + 14], *msg; + struct char_data *vict; + + if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument)) + parse_at(argument); + + snprintf(buf, sizeof(buf), "$n\tn says OOC: '%s'", argument); + msg = act(buf, FALSE, ch, 0, 0, TO_ROOM | DG_NO_TRIG); + + for (vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) + if (vict != ch && GET_POS(vict) > POS_SLEEPING) + add_history(vict, msg, HIST_SAY); + + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) + send_to_char(ch, "%s", CONFIG_OK); + else { + sprintf(buf, "You say OOC: '%s'", argument); + msg = act(buf, FALSE, ch, 0, 0, TO_CHAR | DG_NO_TRIG); + add_history(ch, msg, HIST_SAY); + } + } + + /* Trigger check. */ + speech_mtrigger(ch, argument); + speech_wtrigger(ch, argument); +} + ACMD(do_gsay) { skip_spaces(&argument); diff --git a/src/act.h b/src/act.h index 5961e32..8278c62 100644 --- a/src/act.h +++ b/src/act.h @@ -42,6 +42,7 @@ ACMD(do_spec_comm); #define SCMD_ASK 1 /* functions without subcommands */ ACMD(do_say); +ACMD(do_ooc); ACMD(do_gsay); ACMD(do_page); ACMD(do_reply); diff --git a/src/interpreter.c b/src/interpreter.c index 9213b66..7483ad5 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -226,6 +226,7 @@ cpp_extern const struct command_info cmd_info[] = { { "olc" , "olc" , POS_DEAD , do_show_save_list, LVL_BUILDER, 0 }, { "olist" , "olist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_OLIST }, { "oedit" , "oedit" , POS_DEAD , do_oasis_oedit, LVL_BUILDER, 0 }, + { "ooc" , "oo" , POS_RESTING , do_ooc , 0, 0 }, { "oset" , "oset" , POS_DEAD , do_oset, LVL_BUILDER, 0 }, { "ocopy" , "ocopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_OEDIT },