2007-04-08 10:36:36 +00:00
|
|
|
|
/**************************************************************************
|
|
|
|
|
|
* File: act.comm.c Part of tbaMUD *
|
|
|
|
|
|
* Usage: Player-level communication commands. *
|
2006-12-19 22:56:18 +00:00
|
|
|
|
* *
|
2007-04-08 10:36:36 +00:00
|
|
|
|
* All rights reserved. See license for complete information. *
|
2006-12-19 22:56:18 +00:00
|
|
|
|
* *
|
|
|
|
|
|
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
|
|
|
|
|
|
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
|
2007-04-08 10:36:36 +00:00
|
|
|
|
**************************************************************************/
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
|
|
#include "conf.h"
|
|
|
|
|
|
#include "sysdep.h"
|
|
|
|
|
|
#include "structs.h"
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
#include "comm.h"
|
|
|
|
|
|
#include "interpreter.h"
|
|
|
|
|
|
#include "handler.h"
|
|
|
|
|
|
#include "db.h"
|
|
|
|
|
|
#include "screen.h"
|
2025-12-15 20:37:39 -08:00
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
#include "spells.h"
|
2006-12-19 22:56:18 +00:00
|
|
|
|
#include "improved-edit.h"
|
|
|
|
|
|
#include "dg_scripts.h"
|
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line
Minor Bugfix: All game configuration settings now reference the world config
structure, not the individual config variables found in config.c.
------------------------------------------------------------------------
rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line
Added lib/world/qst/ directory, index, index.mini, and 0.qst.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines
Bugfix: the include directory (for .h files) is now referenced correctly in the
depend statement.
Deletion: listrent.c removed as a separate utility.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line
Enhancement: utils/ Makefile will now use a depends file, and looks for dependen
cies in the ../ directory (shrinks the necessary information to make each utilit
y).
------------------------------------------------------------------------
Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line
Made TBA specific changes. do_cheat, removed help level checking, and advance to
level 32.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line
Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a
ttribution for the changes. (Thanks seqwith.)
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines
Changed Makefile.in to use glob expressions when building the objects. This
translates into no longer a need to update Makefile.in whenever a new .c file
is added to the mud code. Other Makefile.* have not yet been changed (and
need review, anyway).
All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using
Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen
does, however the tbaMUD (and legacy circle code) has never been marked-up with
the special CXREF codes required to effectively use the program. Since Doxygen
is easier to use, and provides almost as much functionality as CXREF, CXREF
support has been dropped.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line
Bug Fix: asciiflag_conv* functions now can handle a negative numeric value.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line
Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master)
will no longer attempt to wander off.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines
Based on the compiler warning about mag_materials being an unused function, and
the clone spell being unused.
Bug fix: Clone can now be cast. It is an 'ignore' target spell.
Fix and Modification: Clone, being an effectively unused spell that is only used
by mortal Magic Users at level 30, is now implemented as very simple example of
how to use mag_materials(). The item required by mag_materials is vnum 161,
which in stock tbaMUD is some sacrificial entrails.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix for "Did you mean:" including DG commands.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a
door.
Documentation: do_simple_move documented.
------------------------------------------------------------------------
Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line
Trial run of columnizer function on commands list to see how people like it.
------------------------------------------------------------------------
jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line
asciimap, an in game automap, along with a couple of minor bug fixes to do with
the automap, patched in (Thanks Jamdog).
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line
Minor update: Relocate local variable declaration to the top of ACMD(do_help)
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines
Checked in the following placeholders for do_gen_tog:
#define SCMD_AUTOLOOT 24
#define SCMD_AUTOGOLD 25
#define SCMD_AUTOSPLIT 26
#define SCMD_AUTOSAC 27
#define SCMD_AUTOASSIST 28
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line
The Autoquest patch, along with a couple of minor bug fixes, has been integrated
into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.)
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines
Minor Fix:
Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int
index types.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines
Added a new atoidx() conversion function for dealing with string to IDXTYPE
conversions (in utils.c, prototype exported through utils.h).
Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h).
Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c).
------------------------------------------------------------------------
Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line
Fixed direction mapping to give readable directions instead of sub commands.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines
Since general olc editing are automatically saved to disk, 'shutdown reboot' has
been changed to not-autosave by default. (Small change made to do_shutdown in
act.wizard.c).
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines
Changed:
struct attack_hit_type moved to fight.h
attack_hit_text exported through fight.h
------------------------------------------------------------------------
jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines
- do_file heads or tails files correctly and has also been enhanced to return
file info (act.wizard.c)
- defines made for common log files created by autorun, and those used by
do_file (db.h)
- utility functions added: file_head(), file_tail(), file_sizeof(), and
file_numlines() (defined utils.c and exported through utils.h)
------------------------------------------------------------------------
Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line
Fixed export command. (thanks Kyle)
------------------------------------------------------------------------
jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line
Files are now tagged as executable. Should be able to be checked out from subver
sion and executed without running chmod.
------------------------------------------------------------------------
Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line
Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc()
strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back.
------------------------------------------------------------------------
jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line
Event queue function definitions, global variables and defines doxygenated.
------------------------------------------------------------------------
Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line
Updated levels command to use an arg/range and added color parsing to greetings.
(thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line
Doxygen comments completed for weather.c
------------------------------------------------------------------------
Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line
Corrected several 64-bit warnings. (thanks Buggo)
------------------------------------------------------------------------
Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line
Added get_flag_by_name allowing for new trigedit variable checks like
%actor.pref(FLAG)% checks. (thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines
COMPLETE: tbaMUD code re-org of global and local scope function and variable
declarations. There may be a few things that I did not catch (some non extern
keyword declarations of function prototypes within other functions, for
example).
BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines
Continued clean-up of 'extern' references to functions and variables.
BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of
the char * returned from title_female and title_male.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines
More work on mud clean-up.
New file: spec_procs.h
Created this file to house the legacy special procedures (spec_procs.c and
castle.c) and special feature assignment in general.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines
- Minor Bugfix: Fixed parse error in mobact.c
- Minor Bugfix: act.h is now included in all of the act functions. Forgot to do
that the first time :(
- Additions: ban.h has been added as the external entry point into the ban.c
globals and functions. Files needing ban.h have been updated.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line
All act*.c functions, defines and globals have been prototyped/declared in
act.h. The file act.h does not contain every ACMD, only those ACMDs and
utility functions available within the act*.c files.
------------------------------------------------------------------------
Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed the last few flags missed for the 128 bit conversion.
------------------------------------------------------------------------
Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines
Adding a column formatter for lists. Accepts printf-like arguments.
Only used by medit right now.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines
- Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts.
- Ongoing cleanup to mud project.
------------------------------------------------------------------------
Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed run_autowiz which ran twice on advancement.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line
act.h created and added. This header will be the external entry point for the
functions, function subcommands and variables within the act*.c files. It is
not designed to be the entry point for all ACMD functions.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line
Merge of another part of the code cleanup, the dg script stuff.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line
Modularizing and organizing files continues. Committing comm.c and comm.h
because they are hairy, and I don't want to do them over if my hard drive
crashes.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines
- Marking all file scope functions as 'static'
- Reorganization of the global variables and functions.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line
* Protected the conf.h.* system config files from multiple calls.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line
* Removed extraneous references to TRUE / FALSE and YES / NO defines.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines
* BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before)
* Migrated NUM_* settings from oasis.h to more appropriate locations near where
they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the
POSITION_* defines.)
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line
Added Appendix A - Coder Support. Right now, it simply speaks to the fact that
we have included doxygen config files, are working to document the source code,
and provides a rudimentary "do this" guide to create the doxygen cross
references.
------------------------------------------------------------------------
jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines
- All .h files now have doxygen recognized headers, and the format is slightly
altered to ease editing of headers.
- Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE
R_H_ #define _HEADER_H_ .... #endif)
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line
constants.h, structs.h and utils.h now protected from multiple includes. This is
sometimes overkill, but good practice overall.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line
Updated documentation for constants.c and constants.h.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines
The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is
to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if
Graphviz is not available.
Now just need a short document describing the usage of doxygen.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line
Minor document correction in struct dex_app_tpe.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line
*bugfix* do_drink command: When a container is empty, the correct, "It is
empty." message is now displayed.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines
Merging changes to trunk for:
* utils.h, utils.c and structs.h doxygen comments
* adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
|
|
|
|
#include "act.h"
|
|
|
|
|
|
#include "modify.h"
|
2025-08-30 19:26:06 -07:00
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
#include <strings.h> /* for strncasecmp on POSIX */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2012-06-10 19:44:44 +00:00
|
|
|
|
static bool legal_communication(char * arg);
|
|
|
|
|
|
|
|
|
|
|
|
static bool legal_communication(char * arg)
|
|
|
|
|
|
{
|
2012-06-19 21:11:14 +00:00
|
|
|
|
while (*arg) {
|
|
|
|
|
|
if (*arg == '@') {
|
|
|
|
|
|
arg++;
|
|
|
|
|
|
if (*arg == '(' || *arg == ')' || *arg == '<' || *arg == '>')
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
arg++;
|
|
|
|
|
|
}
|
|
|
|
|
|
return TRUE;
|
2012-06-10 19:44:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 19:26:06 -07:00
|
|
|
|
static int is_boundary_char(char c) {
|
|
|
|
|
|
return c == '\0' || isspace((unsigned char)c) || ispunct((unsigned char)c);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Convert first-person phrases to second-person for self-facing messages. */
|
|
|
|
|
|
static void to_second_person_self(const char *in, char *out, size_t outlen) {
|
|
|
|
|
|
struct { const char *from; const char *to; } map[] = {
|
|
|
|
|
|
/* Longer patterns first to avoid partial matches */
|
|
|
|
|
|
{"i'm", "you're"},
|
|
|
|
|
|
{"i’ve", "you’ve"},
|
|
|
|
|
|
{"i've", "you've"},
|
|
|
|
|
|
{"i’d", "you’d"},
|
|
|
|
|
|
{"i'd", "you'd"},
|
|
|
|
|
|
{"i’ll", "you’ll"},
|
|
|
|
|
|
{"i'll", "you'll"},
|
|
|
|
|
|
{"myself","yourself"},
|
|
|
|
|
|
{"mine", "yours"},
|
|
|
|
|
|
{"my", "your"},
|
|
|
|
|
|
{"me", "you"},
|
|
|
|
|
|
{"i", "you"}
|
|
|
|
|
|
};
|
|
|
|
|
|
const size_t nmap = sizeof(map)/sizeof(map[0]);
|
|
|
|
|
|
|
|
|
|
|
|
size_t i = 0, o = 0;
|
|
|
|
|
|
out[0] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
while (in[i] && o + 1 < outlen) {
|
|
|
|
|
|
int replaced = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (i == 0 || is_boundary_char(in[i - 1])) {
|
|
|
|
|
|
for (size_t k = 0; k < nmap; k++) {
|
|
|
|
|
|
size_t lf = strlen(map[k].from);
|
|
|
|
|
|
if (strncasecmp(in + i, map[k].from, lf) == 0 && is_boundary_char(in[i + lf])) {
|
|
|
|
|
|
/* write replacement */
|
|
|
|
|
|
size_t lt = strlen(map[k].to);
|
|
|
|
|
|
if (o + lt < outlen) {
|
|
|
|
|
|
memcpy(out + o, map[k].to, lt);
|
|
|
|
|
|
o += lt;
|
|
|
|
|
|
i += lf;
|
|
|
|
|
|
replaced = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!replaced) {
|
|
|
|
|
|
out[o++] = in[i++];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* NUL-terminate */
|
|
|
|
|
|
if (o >= outlen) o = outlen - 1;
|
|
|
|
|
|
out[o] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
/* Trim trailing spaces */
|
|
|
|
|
|
while (o && isspace((unsigned char)out[o - 1])) out[--o] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
/* Ensure trailing sentence punctuation */
|
|
|
|
|
|
if (o) {
|
|
|
|
|
|
char last = out[o - 1];
|
|
|
|
|
|
if (!(last == '.' || last == '!' || last == '?')) {
|
|
|
|
|
|
if (o + 1 < outlen) {
|
|
|
|
|
|
out[o++] = '.';
|
|
|
|
|
|
out[o] = '\0';
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
static void trim_whitespace(char *s) {
|
|
|
|
|
|
char *start = s;
|
|
|
|
|
|
while (*start && isspace((unsigned char)*start))
|
|
|
|
|
|
start++;
|
|
|
|
|
|
|
|
|
|
|
|
if (start != s)
|
|
|
|
|
|
memmove(s, start, strlen(start) + 1);
|
|
|
|
|
|
|
|
|
|
|
|
size_t len = strlen(s);
|
|
|
|
|
|
while (len > 0 && isspace((unsigned char)s[len - 1]))
|
|
|
|
|
|
s[--len] = '\0';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
static bool parse_speech_adornments(struct char_data *ch, char **text,
|
|
|
|
|
|
char *bracket_raw, size_t bracket_sz, bool *has_bracket,
|
|
|
|
|
|
char *paren_raw, size_t paren_sz, bool *has_paren)
|
|
|
|
|
|
{
|
|
|
|
|
|
char *p = *text;
|
|
|
|
|
|
|
|
|
|
|
|
if (bracket_raw && bracket_sz > 0)
|
|
|
|
|
|
bracket_raw[0] = '\0';
|
|
|
|
|
|
if (paren_raw && paren_sz > 0)
|
|
|
|
|
|
paren_raw[0] = '\0';
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
*has_bracket = FALSE;
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
*has_paren = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
while (TRUE) {
|
|
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
|
|
|
|
|
|
if (*p == '[' && has_bracket && !*has_bracket) {
|
|
|
|
|
|
const char *close = strchr(p, ']');
|
|
|
|
|
|
if (!close) {
|
|
|
|
|
|
send_to_char(ch, "You need a closing ']'.\r\n");
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
size_t len = (size_t)(close - p - 1);
|
|
|
|
|
|
if (len >= bracket_sz)
|
|
|
|
|
|
len = bracket_sz - 1;
|
|
|
|
|
|
if (len > 0 && bracket_raw) {
|
|
|
|
|
|
strncpy(bracket_raw, p + 1, len);
|
|
|
|
|
|
bracket_raw[len] = '\0';
|
|
|
|
|
|
trim_whitespace(bracket_raw);
|
|
|
|
|
|
} else if (bracket_raw && bracket_sz > 0)
|
|
|
|
|
|
bracket_raw[0] = '\0';
|
|
|
|
|
|
*has_bracket = TRUE;
|
|
|
|
|
|
p = (char *)close + 1;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (*p == '(' && has_paren && !*has_paren) {
|
|
|
|
|
|
const char *close = strchr(p, ')');
|
|
|
|
|
|
if (!close) {
|
|
|
|
|
|
send_to_char(ch, "You need a closing ')'.\r\n");
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
}
|
|
|
|
|
|
size_t len = (size_t)(close - p - 1);
|
|
|
|
|
|
if (len >= paren_sz)
|
|
|
|
|
|
len = paren_sz - 1;
|
|
|
|
|
|
if (len > 0 && paren_raw) {
|
|
|
|
|
|
strncpy(paren_raw, p + 1, len);
|
|
|
|
|
|
paren_raw[len] = '\0';
|
|
|
|
|
|
trim_whitespace(paren_raw);
|
|
|
|
|
|
} else if (paren_raw && paren_sz > 0)
|
|
|
|
|
|
paren_raw[0] = '\0';
|
|
|
|
|
|
*has_paren = TRUE;
|
|
|
|
|
|
p = (char *)close + 1;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
*text = p;
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void wrap_line(const char *src, char *dst, size_t dstsz, int width)
|
|
|
|
|
|
{
|
|
|
|
|
|
size_t out = 0;
|
|
|
|
|
|
int col = 0;
|
|
|
|
|
|
const char *p = src;
|
|
|
|
|
|
bool first_word = TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
if (!dst || dstsz == 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
dst[0] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
while (*p && out < dstsz - 1) {
|
|
|
|
|
|
while (*p && isspace((unsigned char)*p) && *p != '\n' && *p != '\r')
|
|
|
|
|
|
p++;
|
|
|
|
|
|
if (!*p)
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
const char *word_start = p;
|
|
|
|
|
|
size_t word_len = 0;
|
|
|
|
|
|
while (*p && !isspace((unsigned char)*p))
|
|
|
|
|
|
word_len++, p++;
|
|
|
|
|
|
|
|
|
|
|
|
if (word_len == 0)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (!first_word && col + 1 + (int)word_len > width) {
|
|
|
|
|
|
if (out < dstsz - 2) {
|
|
|
|
|
|
dst[out++] = '\r';
|
|
|
|
|
|
dst[out++] = '\n';
|
|
|
|
|
|
}
|
|
|
|
|
|
col = 0;
|
|
|
|
|
|
first_word = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!first_word) {
|
|
|
|
|
|
if (out < dstsz - 1) {
|
|
|
|
|
|
dst[out++] = ' ';
|
|
|
|
|
|
col++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t copy = MIN(word_len, dstsz - 1 - out);
|
|
|
|
|
|
memcpy(dst + out, word_start, copy);
|
|
|
|
|
|
out += copy;
|
|
|
|
|
|
col += word_len;
|
|
|
|
|
|
first_word = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
while (*p && (*p == '\n' || *p == '\r')) {
|
|
|
|
|
|
if (out < dstsz - 2) {
|
|
|
|
|
|
dst[out++] = '\r';
|
|
|
|
|
|
dst[out++] = '\n';
|
|
|
|
|
|
}
|
|
|
|
|
|
p++;
|
|
|
|
|
|
col = 0;
|
|
|
|
|
|
first_word = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dst[out] = '\0';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 20:37:39 -08:00
|
|
|
|
static void capitalize_leading_you(char *line)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!line)
|
|
|
|
|
|
return;
|
|
|
|
|
|
if (strn_cmp(line, "you", 3) != 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
char next = line[3];
|
|
|
|
|
|
if (next && !isspace((unsigned char)next) && next != ',' && next != ':' && next != ';')
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
line[0] = UPPER(line[0]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define LISTEN_DC_TABLE 10
|
|
|
|
|
|
#define LISTEN_DC_TABLE_REMOTE 21
|
|
|
|
|
|
#define LISTEN_DC_TABLE_REMOTE_CLOSED 26
|
|
|
|
|
|
#define LISTEN_DC_WHISPER 15
|
|
|
|
|
|
#define LISTEN_DC_ROOM 18
|
|
|
|
|
|
#define LISTEN_DC_CLOSED 23
|
|
|
|
|
|
#define LISTEN_MASTERY_MIN 81
|
|
|
|
|
|
|
|
|
|
|
|
static void compose_history_entry(char *out, size_t outsz,
|
|
|
|
|
|
const char *first_line,
|
|
|
|
|
|
const char *speech)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!out || outsz == 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
out[0] = '\0';
|
|
|
|
|
|
if (first_line && *first_line)
|
|
|
|
|
|
strlcpy(out, first_line, outsz);
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(out, "\r\n \"", outsz);
|
|
|
|
|
|
if (speech && *speech)
|
|
|
|
|
|
strlcat(out, speech, outsz);
|
|
|
|
|
|
strlcat(out, "\"", outsz);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool can_attempt_listen(struct char_data *ch)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!ch)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (!AFF_FLAGGED(ch, AFF_LISTEN))
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (GET_POS(ch) <= POS_SLEEPING)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (!GET_SKILL(ch, SKILL_PERCEPTION))
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int roll_listen_total(struct char_data *ch)
|
|
|
|
|
|
{
|
2025-12-23 07:34:11 -08:00
|
|
|
|
int total = roll_skill_check(ch, SKILL_PERCEPTION, 0, NULL);
|
2025-12-15 20:37:39 -08:00
|
|
|
|
|
|
|
|
|
|
if (FIGHTING(ch))
|
|
|
|
|
|
total -= 4;
|
|
|
|
|
|
|
|
|
|
|
|
return total;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool perform_listen_check(struct char_data *ch, int difficulty, bool require_mastery)
|
|
|
|
|
|
{
|
|
|
|
|
|
bool success;
|
|
|
|
|
|
|
|
|
|
|
|
if (!can_attempt_listen(ch))
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
if (require_mastery && GET_SKILL(ch, SKILL_PERCEPTION) < LISTEN_MASTERY_MIN)
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
success = (roll_listen_total(ch) >= difficulty);
|
|
|
|
|
|
gain_skill(ch, "perception", success);
|
|
|
|
|
|
return success;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void deliver_listen_output(struct char_data *listener, const char *first_line, const char *speech)
|
|
|
|
|
|
{
|
|
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
char hist_buf[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(listener, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
|
|
|
|
|
|
|
|
|
|
|
compose_history_entry(hist_buf, sizeof(hist_buf), wrapped_line, speech);
|
|
|
|
|
|
add_history(listener, hist_buf, HIST_SAY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void send_overheard_table(struct char_data *listener,
|
|
|
|
|
|
struct char_data *speaker,
|
|
|
|
|
|
const char *furn_name,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase)
|
|
|
|
|
|
{
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
const char *label = (furn_name && *furn_name) ? furn_name : "the table";
|
|
|
|
|
|
|
|
|
|
|
|
if (bracket_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, bracket_phrase, FALSE, listener, prefix, sizeof(prefix));
|
|
|
|
|
|
if (paren_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, paren_phrase, FALSE, listener, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
strlcpy(first_line, "You overhear ", sizeof(first_line));
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcat(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, get_char_sdesc(speaker), sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, " at ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, label, sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
|
|
|
|
|
deliver_listen_output(listener, first_line, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void send_overheard_whisper(struct char_data *listener,
|
|
|
|
|
|
struct char_data *speaker,
|
|
|
|
|
|
struct char_data *vict,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase)
|
|
|
|
|
|
{
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (bracket_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, bracket_phrase, FALSE, listener, prefix, sizeof(prefix));
|
|
|
|
|
|
if (paren_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, paren_phrase, FALSE, listener, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
strlcpy(first_line, "You overhear ", sizeof(first_line));
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcat(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, get_char_sdesc(speaker), sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, " whisper to ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, get_char_sdesc(vict), sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
|
|
|
|
|
deliver_listen_output(listener, first_line, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void send_overheard_room(struct char_data *listener,
|
|
|
|
|
|
struct char_data *speaker,
|
|
|
|
|
|
const char *context_label,
|
|
|
|
|
|
const char *dir_name,
|
|
|
|
|
|
bool closed_door,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase)
|
|
|
|
|
|
{
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (bracket_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, bracket_phrase, FALSE, listener, prefix, sizeof(prefix));
|
|
|
|
|
|
if (paren_phrase)
|
|
|
|
|
|
render_targeted_phrase(speaker, paren_phrase, FALSE, listener, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
strlcpy(first_line, "You overhear ", sizeof(first_line));
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcat(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, get_char_sdesc(speaker), sizeof(first_line));
|
|
|
|
|
|
if (context_label && *context_label) {
|
|
|
|
|
|
strlcat(first_line, " at ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, context_label, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
if (closed_door) {
|
|
|
|
|
|
strlcat(first_line, " through a closed door to the ", sizeof(first_line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcat(first_line, " from the ", sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
strlcat(first_line, dir_name ? dir_name : "unknown", sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
|
|
|
|
|
deliver_listen_output(listener, first_line, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void notify_adjacent_listeners_internal(struct char_data *speaker,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase,
|
|
|
|
|
|
int open_dc,
|
|
|
|
|
|
int closed_dc,
|
|
|
|
|
|
bool closed_requires_mastery,
|
|
|
|
|
|
const char *context_label)
|
|
|
|
|
|
{
|
|
|
|
|
|
room_rnum origin;
|
|
|
|
|
|
|
|
|
|
|
|
if (!speaker || !speech || !*speech)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
origin = IN_ROOM(speaker);
|
|
|
|
|
|
if (origin == NOWHERE)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
for (int dir = 0; dir < NUM_OF_DIRS; dir++) {
|
|
|
|
|
|
struct room_direction_data *exit = world[origin].dir_option[dir];
|
|
|
|
|
|
room_rnum other_room;
|
|
|
|
|
|
bool closed_door;
|
|
|
|
|
|
|
|
|
|
|
|
if (!exit || exit->to_room == NOWHERE)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
other_room = exit->to_room;
|
|
|
|
|
|
if (ROOM_FLAGGED(origin, ROOM_SOUNDPROOF) || ROOM_FLAGGED(other_room, ROOM_SOUNDPROOF))
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
closed_door = EXIT_FLAGGED(exit, EX_CLOSED) && EXIT_FLAGGED(exit, EX_ISDOOR);
|
|
|
|
|
|
|
|
|
|
|
|
for (struct char_data *listener = world[other_room].people; listener; listener = listener->next_in_room) {
|
|
|
|
|
|
if (!perform_listen_check(listener,
|
|
|
|
|
|
closed_door ? closed_dc : open_dc,
|
|
|
|
|
|
closed_requires_mastery && closed_door))
|
|
|
|
|
|
continue;
|
|
|
|
|
|
send_overheard_room(listener, speaker, context_label, dirs[dir], closed_door,
|
|
|
|
|
|
speech, bracket_phrase, paren_phrase);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void notify_adjacent_listeners(struct char_data *speaker,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase)
|
|
|
|
|
|
{
|
|
|
|
|
|
notify_adjacent_listeners_internal(speaker, speech,
|
|
|
|
|
|
bracket_phrase, paren_phrase,
|
|
|
|
|
|
LISTEN_DC_ROOM, LISTEN_DC_CLOSED, TRUE, NULL);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void notify_adjacent_table_listeners(struct char_data *speaker,
|
|
|
|
|
|
const char *furn_name,
|
|
|
|
|
|
const char *speech,
|
|
|
|
|
|
const struct targeted_phrase *bracket_phrase,
|
|
|
|
|
|
const struct targeted_phrase *paren_phrase)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!furn_name)
|
|
|
|
|
|
furn_name = "the table";
|
|
|
|
|
|
|
|
|
|
|
|
notify_adjacent_listeners_internal(speaker, speech,
|
|
|
|
|
|
bracket_phrase, paren_phrase,
|
|
|
|
|
|
LISTEN_DC_TABLE_REMOTE,
|
|
|
|
|
|
LISTEN_DC_TABLE_REMOTE_CLOSED,
|
|
|
|
|
|
TRUE,
|
|
|
|
|
|
furn_name);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2006-12-19 22:56:18 +00:00
|
|
|
|
ACMD(do_say)
|
|
|
|
|
|
{
|
2025-12-15 19:53:08 -08:00
|
|
|
|
char *p = argument;
|
|
|
|
|
|
char bracket_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
char paren_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
char speech[MAX_INPUT_LENGTH];
|
|
|
|
|
|
struct targeted_phrase bracket_phrase;
|
|
|
|
|
|
struct targeted_phrase paren_phrase;
|
|
|
|
|
|
bool has_bracket = FALSE;
|
|
|
|
|
|
bool has_paren = FALSE;
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
skip_spaces(&p);
|
2025-12-15 20:06:59 -08:00
|
|
|
|
if (!parse_speech_adornments(ch, &p,
|
|
|
|
|
|
bracket_raw, sizeof(bracket_raw), &has_bracket,
|
|
|
|
|
|
paren_raw, sizeof(paren_raw), &has_paren))
|
|
|
|
|
|
return;
|
2025-12-15 19:53:08 -08:00
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*p) {
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "Yes, but WHAT do you want to say?\r\n");
|
2025-12-15 19:53:08 -08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcpy(speech, p, sizeof(speech));
|
|
|
|
|
|
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(speech))
|
|
|
|
|
|
parse_at(speech);
|
|
|
|
|
|
|
|
|
|
|
|
if (*bracket_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, bracket_raw, FALSE, &bracket_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_bracket = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (*paren_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, paren_raw, FALSE, &paren_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_paren = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool suppress_self = (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT));
|
|
|
|
|
|
bool use_say = (has_bracket || has_paren);
|
|
|
|
|
|
|
|
|
|
|
|
for (struct char_data *vict = world[IN_ROOM(ch)].people; vict; vict = vict->next_in_room) {
|
|
|
|
|
|
bool self = (vict == ch);
|
|
|
|
|
|
|
|
|
|
|
|
if (self && suppress_self)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (!self && GET_POS(vict) <= POS_SLEEPING)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
char speaker[MAX_INPUT_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, vict, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, vict, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
if (self)
|
2025-12-15 20:37:39 -08:00
|
|
|
|
strlcpy(speaker, "you", sizeof(speaker));
|
2025-12-15 19:53:08 -08:00
|
|
|
|
else
|
|
|
|
|
|
strlcpy(speaker, PERS(ch, vict), sizeof(speaker));
|
|
|
|
|
|
|
|
|
|
|
|
first_line[0] = '\0';
|
|
|
|
|
|
strlcpy(first_line, "", sizeof(first_line));
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, speaker, sizeof(first_line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcpy(first_line, speaker, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, (self && use_say) ? " say" : " says", sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
2025-12-15 20:37:39 -08:00
|
|
|
|
if (self)
|
|
|
|
|
|
capitalize_leading_you(first_line);
|
2025-12-15 20:06:59 -08:00
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(vict, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
|
|
|
|
|
|
if (!self || !suppress_self) {
|
|
|
|
|
|
char hist_buf[MAX_STRING_LENGTH];
|
2025-12-15 20:37:39 -08:00
|
|
|
|
compose_history_entry(hist_buf, sizeof(hist_buf), wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
add_history(vict, hist_buf, HIST_SAY);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 20:37:39 -08:00
|
|
|
|
notify_adjacent_listeners(ch, speech,
|
|
|
|
|
|
has_bracket ? &bracket_phrase : NULL,
|
|
|
|
|
|
has_paren ? &paren_phrase : NULL);
|
|
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
if (suppress_self)
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
|
|
|
|
|
|
|
|
|
|
|
speech_mtrigger(ch, speech);
|
|
|
|
|
|
speech_wtrigger(ch, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACMD(do_talk)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct obj_data *furniture = SITTING(ch);
|
|
|
|
|
|
int allowed_positions = 0;
|
|
|
|
|
|
char *p = argument;
|
|
|
|
|
|
char bracket_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
char paren_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
struct targeted_phrase bracket_phrase;
|
|
|
|
|
|
struct targeted_phrase paren_phrase;
|
|
|
|
|
|
bool has_bracket = FALSE, has_paren = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
if (!furniture || GET_OBJ_TYPE(furniture) != ITEM_FURNITURE) {
|
|
|
|
|
|
send_to_char(ch, "You need to be seated at a piece of furniture to talk there.\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (GET_POS(ch) != POS_SITTING) {
|
|
|
|
|
|
send_to_char(ch, "You need to be sitting first.\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
allowed_positions = GET_OBJ_VAL(furniture, VAL_FURN_POSITIONS);
|
|
|
|
|
|
if (allowed_positions > 0 && !(allowed_positions & (1 << 1))) {
|
|
|
|
|
|
send_to_char(ch, "That furniture doesn't have any seats.\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces(&p);
|
2025-12-15 20:06:59 -08:00
|
|
|
|
if (!parse_speech_adornments(ch, &p,
|
|
|
|
|
|
bracket_raw, sizeof(bracket_raw), &has_bracket,
|
|
|
|
|
|
paren_raw, sizeof(paren_raw), &has_paren))
|
|
|
|
|
|
return;
|
2025-12-15 19:53:08 -08:00
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*p) {
|
|
|
|
|
|
send_to_char(ch, "Talk what?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char speech[MAX_INPUT_LENGTH];
|
|
|
|
|
|
strlcpy(speech, p, sizeof(speech));
|
|
|
|
|
|
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(speech))
|
|
|
|
|
|
parse_at(speech);
|
|
|
|
|
|
|
|
|
|
|
|
if (*bracket_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, bracket_raw, FALSE, &bracket_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_bracket = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (*paren_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, paren_raw, FALSE, &paren_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_paren = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *furn_name = (furniture->short_description && *furniture->short_description)
|
|
|
|
|
|
? furniture->short_description : "the furniture";
|
|
|
|
|
|
|
|
|
|
|
|
bool suppress_self = (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT));
|
|
|
|
|
|
|
|
|
|
|
|
for (struct char_data *tch = OBJ_SAT_IN_BY(furniture); tch; tch = NEXT_SITTING(tch)) {
|
|
|
|
|
|
if (tch == ch)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (SITTING(tch) != furniture)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (GET_POS(tch) != POS_SITTING)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (GET_POS(tch) <= POS_SLEEPING)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
const char *speaker = PERS(ch, tch);
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, tch, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, tch, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
first_line[0] = '\0';
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, speaker, sizeof(first_line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcpy(first_line, speaker, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, " says", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
char locbuf[MAX_INPUT_LENGTH];
|
|
|
|
|
|
snprintf(locbuf, sizeof(locbuf), "at %s,", furn_name);
|
|
|
|
|
|
strlcat(first_line, locbuf, sizeof(first_line));
|
|
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(tch, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
|
|
|
|
|
|
char hist_buf[MAX_STRING_LENGTH];
|
2025-12-15 20:37:39 -08:00
|
|
|
|
compose_history_entry(hist_buf, sizeof(hist_buf), wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
add_history(tch, hist_buf, HIST_SAY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (suppress_self)
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
else {
|
2025-12-15 19:53:08 -08:00
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
2007-03-12 23:55:50 +00:00
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, ch, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, ch, suffix, sizeof(suffix));
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", you", sizeof(first_line));
|
2025-12-15 20:37:39 -08:00
|
|
|
|
} else {
|
2025-12-15 19:53:08 -08:00
|
|
|
|
strlcpy(first_line, "you", sizeof(first_line));
|
2025-12-15 20:37:39 -08:00
|
|
|
|
}
|
2025-12-15 19:53:08 -08:00
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, " say", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
2025-12-15 19:53:08 -08:00
|
|
|
|
char locbuf[MAX_INPUT_LENGTH];
|
|
|
|
|
|
snprintf(locbuf, sizeof(locbuf), "at %s,", furn_name);
|
|
|
|
|
|
strlcat(first_line, locbuf, sizeof(first_line));
|
2025-12-15 20:37:39 -08:00
|
|
|
|
capitalize_leading_you(first_line);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(ch, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
char hist_buf[MAX_STRING_LENGTH];
|
2025-12-15 20:37:39 -08:00
|
|
|
|
compose_history_entry(hist_buf, sizeof(hist_buf), wrapped_line, speech);
|
2025-12-15 19:53:08 -08:00
|
|
|
|
add_history(ch, hist_buf, HIST_SAY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Notify others in the room (not seated at this furniture) with an action cue. */
|
|
|
|
|
|
for (struct char_data *onlooker = world[IN_ROOM(ch)].people; onlooker; onlooker = onlooker->next_in_room) {
|
|
|
|
|
|
if (onlooker == ch)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (GET_POS(onlooker) <= POS_SLEEPING)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (SITTING(onlooker) == furniture && GET_POS(onlooker) == POS_SITTING)
|
|
|
|
|
|
continue; /* already heard the speech */
|
|
|
|
|
|
|
2025-12-15 20:37:39 -08:00
|
|
|
|
if (perform_listen_check(onlooker, LISTEN_DC_TABLE, FALSE)) {
|
|
|
|
|
|
send_overheard_table(onlooker, ch, furn_name, speech,
|
|
|
|
|
|
has_bracket ? &bracket_phrase : NULL,
|
|
|
|
|
|
has_paren ? &paren_phrase : NULL);
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char line[MAX_STRING_LENGTH];
|
|
|
|
|
|
const char *speaker = PERS(ch, onlooker);
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, onlooker, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, onlooker, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
line[0] = '\0';
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(line, capped, sizeof(line));
|
|
|
|
|
|
strlcat(line, ", ", sizeof(line));
|
|
|
|
|
|
strlcat(line, speaker, sizeof(line));
|
|
|
|
|
|
} else
|
|
|
|
|
|
strlcpy(line, speaker, sizeof(line));
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(line, " says something at ", sizeof(line));
|
|
|
|
|
|
strlcat(line, furn_name, sizeof(line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(line, ", ", sizeof(line));
|
|
|
|
|
|
strlcat(line, suffix, sizeof(line));
|
|
|
|
|
|
}
|
|
|
|
|
|
strlcat(line, ".", sizeof(line));
|
|
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(onlooker, "%s\r\n", wrapped_line);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
|
2025-12-15 19:53:08 -08:00
|
|
|
|
speech_mtrigger(ch, speech);
|
|
|
|
|
|
speech_wtrigger(ch, speech);
|
2025-12-15 20:37:39 -08:00
|
|
|
|
|
|
|
|
|
|
notify_adjacent_table_listeners(ch, furn_name, speech,
|
|
|
|
|
|
has_bracket ? &bracket_phrase : NULL,
|
|
|
|
|
|
has_paren ? &paren_phrase : NULL);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-17 11:14:58 -07:00
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 19:26:06 -07:00
|
|
|
|
ACMD(do_feel)
|
|
|
|
|
|
{
|
|
|
|
|
|
char raw[MAX_INPUT_LENGTH];
|
|
|
|
|
|
char rendered[MAX_INPUT_LENGTH * 2];
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces(&argument);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*argument) {
|
|
|
|
|
|
send_to_char(ch, "Feel what?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Keep user casing; just copy and convert perspective */
|
|
|
|
|
|
strlcpy(raw, argument, sizeof(raw));
|
|
|
|
|
|
to_second_person_self(raw, rendered, sizeof(rendered));
|
|
|
|
|
|
|
|
|
|
|
|
/* Self-only echo */
|
|
|
|
|
|
send_to_char(ch, "You feel %s\r\n", rendered);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 19:35:52 -07:00
|
|
|
|
ACMD(do_think)
|
|
|
|
|
|
{
|
|
|
|
|
|
char thought[MAX_INPUT_LENGTH];
|
|
|
|
|
|
char feeling[MAX_INPUT_LENGTH];
|
|
|
|
|
|
char *p = argument; /* must be mutable for skip_spaces */
|
|
|
|
|
|
char *close;
|
|
|
|
|
|
|
|
|
|
|
|
thought[0] = '\0';
|
|
|
|
|
|
feeling[0] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*p) {
|
|
|
|
|
|
send_to_char(ch, "Think what?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Optional leading "(...)" becomes the feeling block. */
|
|
|
|
|
|
if (*p == '(') {
|
|
|
|
|
|
close = strchr(p + 1, ')');
|
|
|
|
|
|
if (close) {
|
|
|
|
|
|
size_t len = (size_t)(close - (p + 1));
|
|
|
|
|
|
if (len >= sizeof(feeling)) len = sizeof(feeling) - 1;
|
|
|
|
|
|
strncpy(feeling, p + 1, len);
|
|
|
|
|
|
feeling[len] = '\0';
|
|
|
|
|
|
|
|
|
|
|
|
p = close + 1; /* move past ')' */
|
|
|
|
|
|
while (*p && isspace((unsigned char)*p)) p++; /* skip spaces after ) */
|
|
|
|
|
|
}
|
|
|
|
|
|
/* If there's no closing ')', we ignore and treat entire line as thought. */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!*p) {
|
|
|
|
|
|
send_to_char(ch, "Think what?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* The rest is the thought text */
|
|
|
|
|
|
strlcpy(thought, p, sizeof(thought));
|
|
|
|
|
|
delete_doubledollar(thought);
|
|
|
|
|
|
if (*feeling) delete_doubledollar(feeling);
|
|
|
|
|
|
|
|
|
|
|
|
/* Output (two lines; second indented two spaces) */
|
|
|
|
|
|
if (*feeling) {
|
|
|
|
|
|
send_to_char(ch, "You think, feeling %s,\r\n \"%s\"\r\n", feeling, thought);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
send_to_char(ch, "You think,\r\n \"%s\"\r\n", thought);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line
Minor Bugfix: All game configuration settings now reference the world config
structure, not the individual config variables found in config.c.
------------------------------------------------------------------------
rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line
Added lib/world/qst/ directory, index, index.mini, and 0.qst.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines
Bugfix: the include directory (for .h files) is now referenced correctly in the
depend statement.
Deletion: listrent.c removed as a separate utility.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line
Enhancement: utils/ Makefile will now use a depends file, and looks for dependen
cies in the ../ directory (shrinks the necessary information to make each utilit
y).
------------------------------------------------------------------------
Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line
Made TBA specific changes. do_cheat, removed help level checking, and advance to
level 32.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line
Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a
ttribution for the changes. (Thanks seqwith.)
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines
Changed Makefile.in to use glob expressions when building the objects. This
translates into no longer a need to update Makefile.in whenever a new .c file
is added to the mud code. Other Makefile.* have not yet been changed (and
need review, anyway).
All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using
Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen
does, however the tbaMUD (and legacy circle code) has never been marked-up with
the special CXREF codes required to effectively use the program. Since Doxygen
is easier to use, and provides almost as much functionality as CXREF, CXREF
support has been dropped.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line
Bug Fix: asciiflag_conv* functions now can handle a negative numeric value.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line
Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master)
will no longer attempt to wander off.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines
Based on the compiler warning about mag_materials being an unused function, and
the clone spell being unused.
Bug fix: Clone can now be cast. It is an 'ignore' target spell.
Fix and Modification: Clone, being an effectively unused spell that is only used
by mortal Magic Users at level 30, is now implemented as very simple example of
how to use mag_materials(). The item required by mag_materials is vnum 161,
which in stock tbaMUD is some sacrificial entrails.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix for "Did you mean:" including DG commands.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a
door.
Documentation: do_simple_move documented.
------------------------------------------------------------------------
Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line
Trial run of columnizer function on commands list to see how people like it.
------------------------------------------------------------------------
jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line
asciimap, an in game automap, along with a couple of minor bug fixes to do with
the automap, patched in (Thanks Jamdog).
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line
Minor update: Relocate local variable declaration to the top of ACMD(do_help)
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines
Checked in the following placeholders for do_gen_tog:
#define SCMD_AUTOLOOT 24
#define SCMD_AUTOGOLD 25
#define SCMD_AUTOSPLIT 26
#define SCMD_AUTOSAC 27
#define SCMD_AUTOASSIST 28
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line
The Autoquest patch, along with a couple of minor bug fixes, has been integrated
into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.)
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines
Minor Fix:
Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int
index types.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines
Added a new atoidx() conversion function for dealing with string to IDXTYPE
conversions (in utils.c, prototype exported through utils.h).
Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h).
Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c).
------------------------------------------------------------------------
Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line
Fixed direction mapping to give readable directions instead of sub commands.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines
Since general olc editing are automatically saved to disk, 'shutdown reboot' has
been changed to not-autosave by default. (Small change made to do_shutdown in
act.wizard.c).
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines
Changed:
struct attack_hit_type moved to fight.h
attack_hit_text exported through fight.h
------------------------------------------------------------------------
jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines
- do_file heads or tails files correctly and has also been enhanced to return
file info (act.wizard.c)
- defines made for common log files created by autorun, and those used by
do_file (db.h)
- utility functions added: file_head(), file_tail(), file_sizeof(), and
file_numlines() (defined utils.c and exported through utils.h)
------------------------------------------------------------------------
Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line
Fixed export command. (thanks Kyle)
------------------------------------------------------------------------
jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line
Files are now tagged as executable. Should be able to be checked out from subver
sion and executed without running chmod.
------------------------------------------------------------------------
Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line
Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc()
strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back.
------------------------------------------------------------------------
jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line
Event queue function definitions, global variables and defines doxygenated.
------------------------------------------------------------------------
Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line
Updated levels command to use an arg/range and added color parsing to greetings.
(thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line
Doxygen comments completed for weather.c
------------------------------------------------------------------------
Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line
Corrected several 64-bit warnings. (thanks Buggo)
------------------------------------------------------------------------
Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line
Added get_flag_by_name allowing for new trigedit variable checks like
%actor.pref(FLAG)% checks. (thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines
COMPLETE: tbaMUD code re-org of global and local scope function and variable
declarations. There may be a few things that I did not catch (some non extern
keyword declarations of function prototypes within other functions, for
example).
BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines
Continued clean-up of 'extern' references to functions and variables.
BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of
the char * returned from title_female and title_male.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines
More work on mud clean-up.
New file: spec_procs.h
Created this file to house the legacy special procedures (spec_procs.c and
castle.c) and special feature assignment in general.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines
- Minor Bugfix: Fixed parse error in mobact.c
- Minor Bugfix: act.h is now included in all of the act functions. Forgot to do
that the first time :(
- Additions: ban.h has been added as the external entry point into the ban.c
globals and functions. Files needing ban.h have been updated.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line
All act*.c functions, defines and globals have been prototyped/declared in
act.h. The file act.h does not contain every ACMD, only those ACMDs and
utility functions available within the act*.c files.
------------------------------------------------------------------------
Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed the last few flags missed for the 128 bit conversion.
------------------------------------------------------------------------
Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines
Adding a column formatter for lists. Accepts printf-like arguments.
Only used by medit right now.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines
- Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts.
- Ongoing cleanup to mud project.
------------------------------------------------------------------------
Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed run_autowiz which ran twice on advancement.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line
act.h created and added. This header will be the external entry point for the
functions, function subcommands and variables within the act*.c files. It is
not designed to be the entry point for all ACMD functions.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line
Merge of another part of the code cleanup, the dg script stuff.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line
Modularizing and organizing files continues. Committing comm.c and comm.h
because they are hairy, and I don't want to do them over if my hard drive
crashes.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines
- Marking all file scope functions as 'static'
- Reorganization of the global variables and functions.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line
* Protected the conf.h.* system config files from multiple calls.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line
* Removed extraneous references to TRUE / FALSE and YES / NO defines.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines
* BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before)
* Migrated NUM_* settings from oasis.h to more appropriate locations near where
they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the
POSITION_* defines.)
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line
Added Appendix A - Coder Support. Right now, it simply speaks to the fact that
we have included doxygen config files, are working to document the source code,
and provides a rudimentary "do this" guide to create the doxygen cross
references.
------------------------------------------------------------------------
jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines
- All .h files now have doxygen recognized headers, and the format is slightly
altered to ease editing of headers.
- Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE
R_H_ #define _HEADER_H_ .... #endif)
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line
constants.h, structs.h and utils.h now protected from multiple includes. This is
sometimes overkill, but good practice overall.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line
Updated documentation for constants.c and constants.h.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines
The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is
to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if
Graphviz is not available.
Now just need a short document describing the usage of doxygen.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line
Minor document correction in struct dex_app_tpe.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line
*bugfix* do_drink command: When a container is empty, the correct, "It is
empty." message is now displayed.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines
Merging changes to trunk for:
* utils.h, utils.c and structs.h doxygen comments
* adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
|
|
|
|
static void perform_tell(struct char_data *ch, struct char_data *vict, char *arg)
|
2006-12-19 22:56:18 +00:00
|
|
|
|
{
|
2007-03-12 23:55:50 +00:00
|
|
|
|
char buf[MAX_STRING_LENGTH], *msg;
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2007-03-12 23:55:50 +00:00
|
|
|
|
snprintf(buf, sizeof(buf), "%s$n tells you, '%s'%s", CCRED(vict, C_NRM), arg, CCNRM(vict, C_NRM));
|
|
|
|
|
|
msg = act(buf, FALSE, ch, 0, vict, TO_VICT | TO_SLEEP);
|
|
|
|
|
|
add_history(vict, msg, HIST_TELL);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
|
|
|
|
|
else {
|
2007-03-12 23:55:50 +00:00
|
|
|
|
snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", CCRED(ch, C_NRM), arg, CCNRM(ch, C_NRM));
|
2012-02-06 19:13:03 +00:00
|
|
|
|
msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
2007-03-12 23:55:50 +00:00
|
|
|
|
add_history(ch, msg, HIST_TELL);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!IS_NPC(vict) && !IS_NPC(ch))
|
|
|
|
|
|
GET_LAST_TELL(vict) = GET_IDNUM(ch);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line
Minor Bugfix: All game configuration settings now reference the world config
structure, not the individual config variables found in config.c.
------------------------------------------------------------------------
rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line
Added lib/world/qst/ directory, index, index.mini, and 0.qst.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines
Bugfix: the include directory (for .h files) is now referenced correctly in the
depend statement.
Deletion: listrent.c removed as a separate utility.
------------------------------------------------------------------------
jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line
Enhancement: utils/ Makefile will now use a depends file, and looks for dependen
cies in the ../ directory (shrinks the necessary information to make each utilit
y).
------------------------------------------------------------------------
Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line
Made TBA specific changes. do_cheat, removed help level checking, and advance to
level 32.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line
Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a
ttribution for the changes. (Thanks seqwith.)
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines
Changed Makefile.in to use glob expressions when building the objects. This
translates into no longer a need to update Makefile.in whenever a new .c file
is added to the mud code. Other Makefile.* have not yet been changed (and
need review, anyway).
All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using
Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen
does, however the tbaMUD (and legacy circle code) has never been marked-up with
the special CXREF codes required to effectively use the program. Since Doxygen
is easier to use, and provides almost as much functionality as CXREF, CXREF
support has been dropped.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line
Bug Fix: asciiflag_conv* functions now can handle a negative numeric value.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line
Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master)
will no longer attempt to wander off.
------------------------------------------------------------------------
jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines
Based on the compiler warning about mag_materials being an unused function, and
the clone spell being unused.
Bug fix: Clone can now be cast. It is an 'ignore' target spell.
Fix and Modification: Clone, being an effectively unused spell that is only used
by mortal Magic Users at level 30, is now implemented as very simple example of
how to use mag_materials(). The item required by mag_materials is vnum 161,
which in stock tbaMUD is some sacrificial entrails.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix for "Did you mean:" including DG commands.
------------------------------------------------------------------------
jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines
Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a
door.
Documentation: do_simple_move documented.
------------------------------------------------------------------------
Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line
Trial run of columnizer function on commands list to see how people like it.
------------------------------------------------------------------------
jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line
asciimap, an in game automap, along with a couple of minor bug fixes to do with
the automap, patched in (Thanks Jamdog).
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line
Minor update: Relocate local variable declaration to the top of ACMD(do_help)
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines
Checked in the following placeholders for do_gen_tog:
#define SCMD_AUTOLOOT 24
#define SCMD_AUTOGOLD 25
#define SCMD_AUTOSPLIT 26
#define SCMD_AUTOSAC 27
#define SCMD_AUTOASSIST 28
------------------------------------------------------------------------
jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line
The Autoquest patch, along with a couple of minor bug fixes, has been integrated
into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.)
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines
Minor Fix:
Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int
index types.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines
Added a new atoidx() conversion function for dealing with string to IDXTYPE
conversions (in utils.c, prototype exported through utils.h).
Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h).
Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c).
------------------------------------------------------------------------
Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line
Fixed direction mapping to give readable directions instead of sub commands.
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines
Since general olc editing are automatically saved to disk, 'shutdown reboot' has
been changed to not-autosave by default. (Small change made to do_shutdown in
act.wizard.c).
------------------------------------------------------------------------
jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines
Changed:
struct attack_hit_type moved to fight.h
attack_hit_text exported through fight.h
------------------------------------------------------------------------
jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines
- do_file heads or tails files correctly and has also been enhanced to return
file info (act.wizard.c)
- defines made for common log files created by autorun, and those used by
do_file (db.h)
- utility functions added: file_head(), file_tail(), file_sizeof(), and
file_numlines() (defined utils.c and exported through utils.h)
------------------------------------------------------------------------
Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line
Fixed export command. (thanks Kyle)
------------------------------------------------------------------------
jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line
Files are now tagged as executable. Should be able to be checked out from subver
sion and executed without running chmod.
------------------------------------------------------------------------
Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line
Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc()
strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back.
------------------------------------------------------------------------
jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line
Event queue function definitions, global variables and defines doxygenated.
------------------------------------------------------------------------
Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line
Updated levels command to use an arg/range and added color parsing to greetings.
(thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line
Doxygen comments completed for weather.c
------------------------------------------------------------------------
Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line
Corrected several 64-bit warnings. (thanks Buggo)
------------------------------------------------------------------------
Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line
Added get_flag_by_name allowing for new trigedit variable checks like
%actor.pref(FLAG)% checks. (thanks Jamdog)
------------------------------------------------------------------------
jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines
COMPLETE: tbaMUD code re-org of global and local scope function and variable
declarations. There may be a few things that I did not catch (some non extern
keyword declarations of function prototypes within other functions, for
example).
BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines
Continued clean-up of 'extern' references to functions and variables.
BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of
the char * returned from title_female and title_male.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines
More work on mud clean-up.
New file: spec_procs.h
Created this file to house the legacy special procedures (spec_procs.c and
castle.c) and special feature assignment in general.
------------------------------------------------------------------------
jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines
- Minor Bugfix: Fixed parse error in mobact.c
- Minor Bugfix: act.h is now included in all of the act functions. Forgot to do
that the first time :(
- Additions: ban.h has been added as the external entry point into the ban.c
globals and functions. Files needing ban.h have been updated.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line
All act*.c functions, defines and globals have been prototyped/declared in
act.h. The file act.h does not contain every ACMD, only those ACMDs and
utility functions available within the act*.c files.
------------------------------------------------------------------------
Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed the last few flags missed for the 128 bit conversion.
------------------------------------------------------------------------
Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines
Adding a column formatter for lists. Accepts printf-like arguments.
Only used by medit right now.
------------------------------------------------------------------------
jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines
- Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts.
- Ongoing cleanup to mud project.
------------------------------------------------------------------------
Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line
Fixed run_autowiz which ran twice on advancement.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line
act.h created and added. This header will be the external entry point for the
functions, function subcommands and variables within the act*.c files. It is
not designed to be the entry point for all ACMD functions.
------------------------------------------------------------------------
jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line
Merge of another part of the code cleanup, the dg script stuff.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line
Modularizing and organizing files continues. Committing comm.c and comm.h
because they are hairy, and I don't want to do them over if my hard drive
crashes.
------------------------------------------------------------------------
jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines
- Marking all file scope functions as 'static'
- Reorganization of the global variables and functions.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line
* Protected the conf.h.* system config files from multiple calls.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line
* Removed extraneous references to TRUE / FALSE and YES / NO defines.
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines
* BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before)
* Migrated NUM_* settings from oasis.h to more appropriate locations near where
they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the
POSITION_* defines.)
------------------------------------------------------------------------
jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line
Added Appendix A - Coder Support. Right now, it simply speaks to the fact that
we have included doxygen config files, are working to document the source code,
and provides a rudimentary "do this" guide to create the doxygen cross
references.
------------------------------------------------------------------------
jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines
- All .h files now have doxygen recognized headers, and the format is slightly
altered to ease editing of headers.
- Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE
R_H_ #define _HEADER_H_ .... #endif)
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line
constants.h, structs.h and utils.h now protected from multiple includes. This is
sometimes overkill, but good practice overall.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line
Updated documentation for constants.c and constants.h.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines
The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is
to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if
Graphviz is not available.
Now just need a short document describing the usage of doxygen.
------------------------------------------------------------------------
jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line
Minor document correction in struct dex_app_tpe.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line
*bugfix* do_drink command: When a container is empty, the correct, "It is
empty." message is now displayed.
------------------------------------------------------------------------
jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines
Merging changes to trunk for:
* utils.h, utils.c and structs.h doxygen comments
* adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00
|
|
|
|
static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
2006-12-19 22:56:18 +00:00
|
|
|
|
{
|
2010-11-25 16:24:53 +00:00
|
|
|
|
if (!ch)
|
|
|
|
|
|
log("SYSERR: is_tell_ok called with no characters");
|
|
|
|
|
|
else if (!vict)
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
|
|
|
|
|
else if (ch == vict)
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "You try to tell yourself something.\r\n");
|
2012-02-06 19:13:03 +00:00
|
|
|
|
else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "The walls seem to absorb your words.\r\n");
|
|
|
|
|
|
else if (!IS_NPC(vict) && !vict->desc) /* linkless */
|
|
|
|
|
|
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
|
|
|
|
|
else if (PLR_FLAGGED(vict, PLR_WRITING))
|
|
|
|
|
|
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
2025-08-20 08:04:01 -07:00
|
|
|
|
else if ((!IS_NPC(vict)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
|
|
|
|
|
|
else
|
|
|
|
|
|
return (TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
return (FALSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2007-05-08 15:20:59 +00:00
|
|
|
|
/* Yes, do_tell probably could be combined with whisper and ask, but it is
|
2007-03-12 23:55:50 +00:00
|
|
|
|
* called frequently, and should IMHO be kept as tight as possible. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
ACMD(do_tell)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct char_data *vict = NULL;
|
2020-01-11 01:05:32 +01:00
|
|
|
|
char buf[MAX_INPUT_LENGTH + 25], buf2[MAX_INPUT_LENGTH]; // +25 to make room for constants
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
|
|
half_chop(argument, buf, buf2);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*buf || !*buf2)
|
|
|
|
|
|
send_to_char(ch, "Who do you wish to tell what??\r\n");
|
2025-07-02 22:18:40 +02:00
|
|
|
|
else if (GET_LEVEL(ch) < LVL_IMMORT && !(vict = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
2012-02-06 19:13:03 +00:00
|
|
|
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
|
|
|
|
|
else if (GET_LEVEL(ch) >= LVL_IMMORT && !(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
2012-06-10 19:44:44 +00:00
|
|
|
|
else if (is_tell_ok(ch, vict)) {
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
|
|
|
|
|
parse_at(buf2);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
perform_tell(ch, vict, buf2);
|
2012-06-10 19:44:44 +00:00
|
|
|
|
}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACMD(do_reply)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct char_data *tch = character_list;
|
|
|
|
|
|
|
|
|
|
|
|
if (IS_NPC(ch))
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces(&argument);
|
|
|
|
|
|
|
|
|
|
|
|
if (GET_LAST_TELL(ch) == NOBODY)
|
|
|
|
|
|
send_to_char(ch, "You have nobody to reply to!\r\n");
|
|
|
|
|
|
else if (!*argument)
|
|
|
|
|
|
send_to_char(ch, "What is your reply?\r\n");
|
|
|
|
|
|
else {
|
2007-03-12 23:55:50 +00:00
|
|
|
|
/* Make sure the person you're replying to is still playing by searching
|
2006-12-19 22:56:18 +00:00
|
|
|
|
* for them. Note, now last tell is stored as player IDnum instead of
|
|
|
|
|
|
* a pointer, which is much better because it's safer, plus will still
|
2012-02-06 19:13:03 +00:00
|
|
|
|
* work if someone logs out and back in again. A descriptor list based
|
|
|
|
|
|
* search would be faster although we could not find link dead people.
|
2007-03-12 23:55:50 +00:00
|
|
|
|
* Not that they can hear tells anyway. :) -gg 2/24/98 */
|
2008-05-01 23:32:11 +00:00
|
|
|
|
while (tch && (IS_NPC(tch) || GET_IDNUM(tch) != GET_LAST_TELL(ch)))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
tch = tch->next;
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (!tch)
|
2015-06-19 14:25:08 -04:00
|
|
|
|
send_to_char(ch, "That player is no longer here.\r\n");
|
2012-06-10 19:44:44 +00:00
|
|
|
|
else if (is_tell_ok(ch, tch)) {
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
|
|
|
|
|
parse_at(argument);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
perform_tell(ch, tch, argument);
|
2012-06-10 19:44:44 +00:00
|
|
|
|
}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACMD(do_spec_comm)
|
|
|
|
|
|
{
|
|
|
|
|
|
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
|
|
|
|
|
|
struct char_data *vict;
|
|
|
|
|
|
const char *action_sing, *action_plur, *action_others;
|
|
|
|
|
|
|
|
|
|
|
|
switch (subcmd) {
|
|
|
|
|
|
case SCMD_WHISPER:
|
|
|
|
|
|
action_sing = "whisper to";
|
|
|
|
|
|
action_plur = "whispers to";
|
|
|
|
|
|
action_others = "$n whispers something to $N.";
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case SCMD_ASK:
|
|
|
|
|
|
action_sing = "ask";
|
|
|
|
|
|
action_plur = "asks";
|
|
|
|
|
|
action_others = "$n asks $N a question.";
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
action_sing = "oops";
|
|
|
|
|
|
action_plur = "oopses";
|
|
|
|
|
|
action_others = "$n is tongue-tied trying to speak with $N.";
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
half_chop(argument, buf, buf2);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*buf || !*buf2)
|
|
|
|
|
|
send_to_char(ch, "Whom do you want to %s.. and what??\r\n", action_sing);
|
|
|
|
|
|
else if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_ROOM)))
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
|
|
|
|
|
else if (vict == ch)
|
|
|
|
|
|
send_to_char(ch, "You can't get your mouth close enough to your ear...\r\n");
|
|
|
|
|
|
else {
|
2025-12-15 20:06:59 -08:00
|
|
|
|
if (subcmd == SCMD_WHISPER) {
|
|
|
|
|
|
char bracket_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
char paren_raw[MAX_INPUT_LENGTH] = "";
|
|
|
|
|
|
struct targeted_phrase bracket_phrase;
|
|
|
|
|
|
struct targeted_phrase paren_phrase;
|
|
|
|
|
|
bool has_bracket = FALSE, has_paren = FALSE;
|
|
|
|
|
|
char speech[MAX_INPUT_LENGTH];
|
|
|
|
|
|
char *p = buf2;
|
|
|
|
|
|
|
|
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
if (!parse_speech_adornments(ch, &p,
|
|
|
|
|
|
bracket_raw, sizeof(bracket_raw), &has_bracket,
|
|
|
|
|
|
paren_raw, sizeof(paren_raw), &has_paren))
|
|
|
|
|
|
return;
|
|
|
|
|
|
skip_spaces(&p);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*p) {
|
|
|
|
|
|
send_to_char(ch, "Whisper what?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
strlcpy(speech, p, sizeof(speech));
|
2012-06-10 19:44:44 +00:00
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(speech))
|
|
|
|
|
|
parse_at(speech);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
if (*bracket_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, bracket_raw, FALSE, &bracket_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_bracket = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (*paren_raw) {
|
|
|
|
|
|
if (!build_targeted_phrase(ch, paren_raw, FALSE, &paren_phrase))
|
|
|
|
|
|
return;
|
|
|
|
|
|
has_paren = TRUE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Message to victim */
|
|
|
|
|
|
{
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, vict, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, vict, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
const char *speaker = get_char_sdesc(ch);
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, speaker ? speaker : PERS(ch, vict), sizeof(first_line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcpy(first_line, speaker ? speaker : PERS(ch, vict), sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, " whispers to you", sizeof(first_line));
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(vict, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Message to self */
|
|
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) {
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char first_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, ch, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, ch, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(first_line, capped, sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, ", you", sizeof(first_line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcpy(first_line, "you", sizeof(first_line));
|
|
|
|
|
|
CAP(first_line);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(first_line, " whisper to ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, get_char_sdesc(vict), sizeof(first_line));
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(first_line, ", ", sizeof(first_line));
|
|
|
|
|
|
strlcat(first_line, suffix, sizeof(first_line));
|
|
|
|
|
|
}
|
|
|
|
|
|
strlcat(first_line, ":", sizeof(first_line));
|
|
|
|
|
|
|
|
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(first_line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(ch, "%s\r\n \"%s\"\r\n", wrapped_line, speech);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Onlookers */
|
|
|
|
|
|
for (struct char_data *onlooker = world[IN_ROOM(ch)].people; onlooker; onlooker = onlooker->next_in_room) {
|
|
|
|
|
|
if (onlooker == ch || onlooker == vict)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if (GET_POS(onlooker) <= POS_SLEEPING)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
2025-12-15 20:37:39 -08:00
|
|
|
|
if (perform_listen_check(onlooker, LISTEN_DC_WHISPER, FALSE)) {
|
|
|
|
|
|
send_overheard_whisper(onlooker, ch, vict, speech,
|
|
|
|
|
|
has_bracket ? &bracket_phrase : NULL,
|
|
|
|
|
|
has_paren ? &paren_phrase : NULL);
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-15 20:06:59 -08:00
|
|
|
|
char prefix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char suffix[MAX_STRING_LENGTH] = "";
|
|
|
|
|
|
char line[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (has_bracket)
|
|
|
|
|
|
render_targeted_phrase(ch, &bracket_phrase, FALSE, onlooker, prefix, sizeof(prefix));
|
|
|
|
|
|
if (has_paren)
|
|
|
|
|
|
render_targeted_phrase(ch, &paren_phrase, FALSE, onlooker, suffix, sizeof(suffix));
|
|
|
|
|
|
|
|
|
|
|
|
if (*prefix) {
|
|
|
|
|
|
char capped[MAX_STRING_LENGTH];
|
|
|
|
|
|
strlcpy(capped, prefix, sizeof(capped));
|
|
|
|
|
|
CAP(capped);
|
|
|
|
|
|
strlcpy(line, capped, sizeof(line));
|
|
|
|
|
|
strlcat(line, ", ", sizeof(line));
|
|
|
|
|
|
strlcat(line, PERS(ch, onlooker), sizeof(line));
|
|
|
|
|
|
} else {
|
|
|
|
|
|
strlcpy(line, PERS(ch, onlooker), sizeof(line));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strlcat(line, " whispers something to ", sizeof(line));
|
|
|
|
|
|
strlcat(line, PERS(vict, onlooker), sizeof(line));
|
|
|
|
|
|
|
|
|
|
|
|
if (*suffix) {
|
|
|
|
|
|
strlcat(line, ", ", sizeof(line));
|
|
|
|
|
|
strlcat(line, suffix, sizeof(line));
|
|
|
|
|
|
}
|
|
|
|
|
|
strlcat(line, ".", sizeof(line));
|
|
|
|
|
|
|
|
|
|
|
|
char wrapped_line[MAX_STRING_LENGTH];
|
|
|
|
|
|
wrap_line(line, wrapped_line, sizeof(wrapped_line), 80);
|
|
|
|
|
|
send_to_char(onlooker, "%s\r\n", wrapped_line);
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
char buf1[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
|
|
|
|
|
parse_at(buf2);
|
|
|
|
|
|
|
|
|
|
|
|
snprintf(buf1, sizeof(buf1), "$n %s you, '%s'", action_plur, buf2);
|
|
|
|
|
|
act(buf1, FALSE, ch, 0, vict, TO_VICT);
|
|
|
|
|
|
|
|
|
|
|
|
if ((!IS_NPC(ch)) && (PRF_FLAGGED(ch, PRF_NOREPEAT)))
|
|
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
|
|
|
|
|
else
|
|
|
|
|
|
send_to_char(ch, "You %s %s, '%s'\r\n", action_sing, GET_NAME(vict), buf2);
|
|
|
|
|
|
act(action_others, FALSE, ch, 0, vict, TO_NOTVICT);
|
|
|
|
|
|
}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACMD(do_write)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct obj_data *paper, *pen = NULL;
|
|
|
|
|
|
char *papername, *penname;
|
|
|
|
|
|
char buf1[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
papername = buf1;
|
|
|
|
|
|
penname = buf2;
|
|
|
|
|
|
|
|
|
|
|
|
two_arguments(argument, papername, penname);
|
|
|
|
|
|
|
|
|
|
|
|
if (!ch->desc)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (!*papername) {
|
|
|
|
|
|
/* Nothing was delivered. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "Write? With what? ON what? What are you trying to do?!?\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (*penname) {
|
|
|
|
|
|
/* Nothing was delivered. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
if (!(paper = get_obj_in_list_vis(ch, papername, NULL, ch->carrying))) {
|
|
|
|
|
|
send_to_char(ch, "You have no %s.\r\n", papername);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!(pen = get_obj_in_list_vis(ch, penname, NULL, ch->carrying))) {
|
|
|
|
|
|
send_to_char(ch, "You have no %s.\r\n", penname);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
} else { /* There was one arg.. let's see what we can find. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
if (!(paper = get_obj_in_list_vis(ch, papername, NULL, ch->carrying))) {
|
|
|
|
|
|
send_to_char(ch, "There is no %s in your inventory.\r\n", papername);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (GET_OBJ_TYPE(paper) == ITEM_PEN) { /* Oops, a pen. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
pen = paper;
|
|
|
|
|
|
paper = NULL;
|
|
|
|
|
|
} else if (GET_OBJ_TYPE(paper) != ITEM_NOTE) {
|
|
|
|
|
|
send_to_char(ch, "That thing has nothing to do with writing.\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
|
2006-12-19 22:56:18 +00:00
|
|
|
|
/* One object was found.. now for the other one. */
|
|
|
|
|
|
if (!GET_EQ(ch, WEAR_HOLD)) {
|
|
|
|
|
|
send_to_char(ch, "You can't write with %s %s alone.\r\n", AN(papername), papername);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!CAN_SEE_OBJ(ch, GET_EQ(ch, WEAR_HOLD))) {
|
|
|
|
|
|
send_to_char(ch, "The stuff in your hand is invisible! Yeech!!\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (pen)
|
|
|
|
|
|
paper = GET_EQ(ch, WEAR_HOLD);
|
|
|
|
|
|
else
|
|
|
|
|
|
pen = GET_EQ(ch, WEAR_HOLD);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Now let's see what kind of stuff we've found. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
if (GET_OBJ_TYPE(pen) != ITEM_PEN)
|
|
|
|
|
|
act("$p is no good for writing with.", FALSE, ch, pen, 0, TO_CHAR);
|
|
|
|
|
|
else if (GET_OBJ_TYPE(paper) != ITEM_NOTE)
|
|
|
|
|
|
act("You can't write on $p.", FALSE, ch, paper, 0, TO_CHAR);
|
|
|
|
|
|
else {
|
|
|
|
|
|
char *backstr = NULL;
|
2007-01-23 03:07:23 +00:00
|
|
|
|
|
2006-12-19 22:56:18 +00:00
|
|
|
|
/* Something on it, display it as that's in input buffer. */
|
2025-09-07 16:11:05 -07:00
|
|
|
|
if (paper->main_description) {
|
|
|
|
|
|
backstr = strdup(paper->main_description);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "There's something written on it already:\r\n");
|
2025-09-07 16:11:05 -07:00
|
|
|
|
send_to_char(ch, "%s", paper->main_description);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
2007-01-23 03:07:23 +00:00
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* We can write. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
act("$n begins to jot down a note.", TRUE, ch, 0, 0, TO_ROOM);
|
|
|
|
|
|
send_editor_help(ch->desc);
|
2025-09-07 16:11:05 -07:00
|
|
|
|
string_write(ch->desc, &paper->main_description, MAX_NOTE_LENGTH, 0, backstr);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ACMD(do_page)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct descriptor_data *d;
|
|
|
|
|
|
struct char_data *vict;
|
|
|
|
|
|
char buf2[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
half_chop(argument, arg, buf2);
|
|
|
|
|
|
|
|
|
|
|
|
if (IS_NPC(ch))
|
|
|
|
|
|
send_to_char(ch, "Monsters can't page.. go away.\r\n");
|
|
|
|
|
|
else if (!*arg)
|
|
|
|
|
|
send_to_char(ch, "Whom do you wish to page?\r\n");
|
|
|
|
|
|
else {
|
|
|
|
|
|
char buf[MAX_STRING_LENGTH];
|
|
|
|
|
|
|
|
|
|
|
|
snprintf(buf, sizeof(buf), "\007\007*$n* %s", buf2);
|
|
|
|
|
|
if (!str_cmp(arg, "all")) {
|
2012-02-06 19:13:03 +00:00
|
|
|
|
if (GET_LEVEL(ch) > LVL_GOD) {
|
|
|
|
|
|
for (d = descriptor_list; d; d = d->next)
|
|
|
|
|
|
if (STATE(d) == CON_PLAYING && d->character)
|
|
|
|
|
|
act(buf, FALSE, ch, 0, d->character, TO_VICT);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
} else
|
2012-02-06 19:13:03 +00:00
|
|
|
|
send_to_char(ch, "You will never be godly enough to do that!\r\n");
|
2006-12-19 22:56:18 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-17 15:38:49 +00:00
|
|
|
|
if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
|
2007-03-12 23:55:50 +00:00
|
|
|
|
act(buf, FALSE, ch, 0, vict, TO_VICT);
|
2007-05-11 01:16:30 +00:00
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
2012-02-06 19:13:03 +00:00
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
else
|
2012-02-06 19:13:03 +00:00
|
|
|
|
act(buf, FALSE, ch, 0, vict, TO_CHAR);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
} else
|
|
|
|
|
|
send_to_char(ch, "There is no such person in the game!\r\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Generalized communication function by Fred C. Merkel (Torg). */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
ACMD(do_gen_comm)
|
|
|
|
|
|
{
|
|
|
|
|
|
struct descriptor_data *i;
|
|
|
|
|
|
char color_on[24];
|
2020-01-11 01:05:32 +01:00
|
|
|
|
char buf1[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH + 50], *msg; // + 50 to make room for color codes
|
2007-06-05 19:09:00 +00:00
|
|
|
|
bool emoting = FALSE;
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Array of flags which must _not_ be set in order for comm to be heard. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
int channels[] = {
|
|
|
|
|
|
0,
|
|
|
|
|
|
PRF_NOSHOUT,
|
|
|
|
|
|
0
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2007-03-12 23:55:50 +00:00
|
|
|
|
int hist_type[] = {
|
|
|
|
|
|
HIST_SHOUT,
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* com_msgs: [0] Message if you can't perform the action because of noshout
|
2006-12-19 22:56:18 +00:00
|
|
|
|
* [1] name of the action
|
|
|
|
|
|
* [2] message if you're not on the channel
|
2007-03-12 23:55:50 +00:00
|
|
|
|
* [3] a color string. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
const char *com_msgs[][4] = {
|
|
|
|
|
|
|
|
|
|
|
|
{"You cannot shout!!\r\n",
|
|
|
|
|
|
"shout",
|
|
|
|
|
|
"Turn off your noshout flag first!\r\n",
|
2008-05-01 23:32:11 +00:00
|
|
|
|
KYEL},
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
|
|
|
|
|
{"You cannot gossip your emotions!\r\n",
|
|
|
|
|
|
"gossip",
|
|
|
|
|
|
"You aren't even on the channel!\r\n",
|
2008-05-01 23:32:11 +00:00
|
|
|
|
KYEL}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (PLR_FLAGGED(ch, PLR_NOSHOUT)) {
|
|
|
|
|
|
send_to_char(ch, "%s", com_msgs[subcmd][0]);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2012-02-06 19:13:03 +00:00
|
|
|
|
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)) {
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "The walls seem to absorb your words.\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (subcmd == SCMD_GEMOTE) {
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (!*argument)
|
|
|
|
|
|
send_to_char(ch, "Gemote? Yes? Gemote what?\r\n");
|
2006-12-19 22:56:18 +00:00
|
|
|
|
else
|
|
|
|
|
|
do_gmote(ch, argument, 0, 1);
|
|
|
|
|
|
return;
|
2007-01-23 03:07:23 +00:00
|
|
|
|
}
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Level_can_shout defined in config.c. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
if (GET_LEVEL(ch) < CONFIG_LEVEL_CAN_SHOUT) {
|
|
|
|
|
|
send_to_char(ch, "You must be at least level %d before you can %s.\r\n", CONFIG_LEVEL_CAN_SHOUT, com_msgs[subcmd][1]);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Make sure the char is on the channel. */
|
2008-05-10 19:16:35 +00:00
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, channels[subcmd])) {
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "%s", com_msgs[subcmd][2]);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
|
2006-12-19 22:56:18 +00:00
|
|
|
|
/* skip leading spaces */
|
|
|
|
|
|
skip_spaces(&argument);
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Make sure that there is something there to say! */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
if (!*argument) {
|
|
|
|
|
|
send_to_char(ch, "Yes, %s, fine, %s we must, but WHAT???\r\n", com_msgs[subcmd][1], com_msgs[subcmd][1]);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Set up the color on code. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
strlcpy(color_on, com_msgs[subcmd][3], sizeof(color_on));
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* First, set up strings to be given to the communicator. */
|
2007-05-11 01:16:30 +00:00
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
2007-03-12 23:55:50 +00:00
|
|
|
|
else {
|
2012-06-10 19:44:44 +00:00
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
|
|
|
|
|
parse_at(argument);
|
|
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "",
|
|
|
|
|
|
com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));
|
2012-02-06 19:13:03 +00:00
|
|
|
|
|
2008-08-03 21:42:02 +00:00
|
|
|
|
msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR | TO_SLEEP);
|
2007-03-12 23:55:50 +00:00
|
|
|
|
add_history(ch, msg, hist_type[subcmd]);
|
|
|
|
|
|
}
|
2007-06-05 19:09:00 +00:00
|
|
|
|
if (!emoting)
|
|
|
|
|
|
snprintf(buf1, sizeof(buf1), "$n %ss, '%s'", com_msgs[subcmd][1], argument);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
/* Now send all the strings out. */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
for (i = descriptor_list; i; i = i->next) {
|
|
|
|
|
|
if (STATE(i) != CON_PLAYING || i == ch->desc || !i->character )
|
2007-01-23 03:07:23 +00:00
|
|
|
|
continue;
|
2007-05-11 01:16:30 +00:00
|
|
|
|
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
continue;
|
2007-01-23 03:07:23 +00:00
|
|
|
|
|
2012-02-06 19:13:03 +00:00
|
|
|
|
if (ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
continue;
|
2007-01-23 03:07:23 +00:00
|
|
|
|
|
2008-05-01 23:32:11 +00:00
|
|
|
|
if (subcmd == SCMD_SHOUT && ((world[IN_ROOM(ch)].zone != world[IN_ROOM(i->character)].zone) ||
|
|
|
|
|
|
!AWAKE(i->character)))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
|
2012-02-06 19:13:03 +00:00
|
|
|
|
snprintf(buf2, sizeof(buf2), "%s%s%s", (COLOR_LEV(i->character) >= C_NRM) ? color_on : "", buf1, KNRM);
|
2007-03-12 23:55:50 +00:00
|
|
|
|
msg = act(buf2, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP);
|
|
|
|
|
|
add_history(i->character, msg, hist_type[subcmd]);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-19 09:40:03 -07:00
|
|
|
|
/* Currently used for qecho only */
|
2006-12-19 22:56:18 +00:00
|
|
|
|
ACMD(do_qcomm)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!PRF_FLAGGED(ch, PRF_QUEST)) {
|
|
|
|
|
|
send_to_char(ch, "You aren't even part of the quest!\r\n");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
skip_spaces(&argument);
|
|
|
|
|
|
|
|
|
|
|
|
if (!*argument)
|
|
|
|
|
|
send_to_char(ch, "%c%s? Yes, fine, %s we must, but WHAT??\r\n", UPPER(*CMD_NAME), CMD_NAME + 1, CMD_NAME);
|
|
|
|
|
|
else {
|
|
|
|
|
|
char buf[MAX_STRING_LENGTH];
|
|
|
|
|
|
struct descriptor_data *i;
|
2012-06-10 19:44:44 +00:00
|
|
|
|
|
|
|
|
|
|
if (CONFIG_SPECIAL_IN_COMM && legal_communication(argument))
|
|
|
|
|
|
parse_at(argument);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
|
2007-05-11 01:16:30 +00:00
|
|
|
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
|
2006-12-19 22:56:18 +00:00
|
|
|
|
send_to_char(ch, "%s", CONFIG_OK);
|
2025-08-19 09:40:03 -07:00
|
|
|
|
else
|
2006-12-19 22:56:18 +00:00
|
|
|
|
act(argument, FALSE, ch, 0, argument, TO_CHAR);
|
|
|
|
|
|
|
2025-08-19 09:40:03 -07:00
|
|
|
|
strlcpy(buf, argument, sizeof(buf));
|
|
|
|
|
|
mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "(GC) %s qechoed: %s", GET_NAME(ch), argument);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
for (i = descriptor_list; i; i = i->next)
|
|
|
|
|
|
if (STATE(i) == CON_PLAYING && i != ch->desc && PRF_FLAGGED(i->character, PRF_QUEST))
|
2008-05-01 23:32:11 +00:00
|
|
|
|
act(buf, 0, ch, 0, i->character, TO_VICT | TO_SLEEP);
|
2006-12-19 22:56:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|