KAIZEN formatting and linting, header files

This commit is contained in:
welcor
2024-09-17 01:04:36 +02:00
parent e59420363a
commit e6085172d5
45 changed files with 5153 additions and 5238 deletions

View File

@@ -107,7 +107,8 @@ ACMD(do_oasis_aedit)
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing actions.", GET_NAME(ch)); mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
} }
static void aedit_setup_new(struct descriptor_data *d) { static void aedit_setup_new(struct descriptor_data *d)
{
CREATE(OLC_ACTION(d), struct social_messg, 1); CREATE(OLC_ACTION(d), struct social_messg, 1);
OLC_ACTION(d)->command = strdup(OLC_STORAGE(d)); OLC_ACTION(d)->command = strdup(OLC_STORAGE(d));
OLC_ACTION(d)->sort_as = strdup(OLC_STORAGE(d)); OLC_ACTION(d)->sort_as = strdup(OLC_STORAGE(d));
@@ -132,7 +133,8 @@ static void aedit_setup_new(struct descriptor_data *d) {
OLC_VAL(d) = 0; OLC_VAL(d) = 0;
} }
static void aedit_setup_existing(struct descriptor_data *d, int real_num) { static void aedit_setup_existing(struct descriptor_data *d, int real_num)
{
CREATE(OLC_ACTION(d), struct social_messg, 1); CREATE(OLC_ACTION(d), struct social_messg, 1);
OLC_ACTION(d)->command = strdup(soc_mess_list[real_num].command); OLC_ACTION(d)->command = strdup(soc_mess_list[real_num].command);
OLC_ACTION(d)->sort_as = strdup(soc_mess_list[real_num].sort_as); OLC_ACTION(d)->sort_as = strdup(soc_mess_list[real_num].sort_as);
@@ -170,7 +172,8 @@ static void aedit_setup_existing(struct descriptor_data *d, int real_num) {
aedit_disp_menu(d); aedit_disp_menu(d);
} }
static void aedit_save_internally(struct descriptor_data *d) { static void aedit_save_internally(struct descriptor_data *d)
{
struct social_messg *new_soc_mess_list = NULL; struct social_messg *new_soc_mess_list = NULL;
int i; int i;
@@ -200,7 +203,8 @@ static void aedit_save_internally(struct descriptor_data *d) {
aedit_save_to_disk(d); /* autosave by Rumble */ aedit_save_to_disk(d); /* autosave by Rumble */
} }
static void aedit_save_to_disk(struct descriptor_data *d) { static void aedit_save_to_disk(struct descriptor_data *d)
{
FILE *fp; FILE *fp;
int i; int i;
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@@ -252,7 +256,8 @@ static void aedit_save_to_disk(struct descriptor_data *d) {
} }
/* The Main Menu. */ /* The Main Menu. */
static void aedit_disp_menu(struct descriptor_data * d) { static void aedit_disp_menu(struct descriptor_data * d)
{
struct social_messg *action = OLC_ACTION(d); struct social_messg *action = OLC_ACTION(d);
struct char_data *ch = d->character; struct char_data *ch = d->character;
@@ -322,13 +327,15 @@ static void aedit_disp_menu(struct descriptor_data * d) {
} }
/* The main loop. */ /* The main loop. */
void aedit_parse(struct descriptor_data * d, char *arg) { void aedit_parse(struct descriptor_data * d, char *arg)
{
int i; int i;
switch (OLC_MODE(d)) { switch (OLC_MODE(d)) {
case AEDIT_CONFIRM_SAVESTRING: case AEDIT_CONFIRM_SAVESTRING:
switch (*arg) { switch (*arg) {
case 'y': case 'Y': case 'y':
case 'Y':
aedit_save_internally(d); aedit_save_internally(d);
mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s", mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s",
GET_NAME(d->character), OLC_ACTION(d)->command); GET_NAME(d->character), OLC_ACTION(d)->command);
@@ -337,7 +344,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
cleanup_olc(d, CLEANUP_STRUCTS); cleanup_olc(d, CLEANUP_STRUCTS);
write_to_output(d, "Action saved to disk.\r\n"); write_to_output(d, "Action saved to disk.\r\n");
break; break;
case 'n': case 'N': case 'n':
case 'N':
/* free everything up, including strings etc */ /* free everything up, including strings etc */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
break; break;
@@ -350,15 +358,18 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
case AEDIT_CONFIRM_EDIT: case AEDIT_CONFIRM_EDIT:
switch (*arg) { switch (*arg) {
case 'y': case 'Y': case 'y':
case 'Y':
aedit_setup_existing(d, OLC_ZNUM(d)); aedit_setup_existing(d, OLC_ZNUM(d));
break; break;
case 'q': case 'Q': case 'q':
case 'Q':
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
break; break;
case 'n': case 'N': case 'n':
case 'N':
OLC_ZNUM(d)++; OLC_ZNUM(d)++;
for (;(OLC_ZNUM(d) <= top_of_socialt); OLC_ZNUM(d)++) for (; (OLC_ZNUM(d) <= top_of_socialt); OLC_ZNUM(d)++)
if (is_abbrev(OLC_STORAGE(d), soc_mess_list[OLC_ZNUM(d)].command)) if (is_abbrev(OLC_STORAGE(d), soc_mess_list[OLC_ZNUM(d)].command))
break; break;
@@ -386,10 +397,14 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
case AEDIT_CONFIRM_ADD: case AEDIT_CONFIRM_ADD:
switch (*arg) { switch (*arg) {
case 'y': case 'Y': case 'y':
case 'Y':
aedit_setup_new(d); aedit_setup_new(d);
break; break;
case 'n': case 'N': case 'q': case 'Q': case 'n':
case 'N':
case 'q':
case 'Q':
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
break; break;
default: default:
@@ -402,12 +417,12 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
case AEDIT_MAIN_MENU: case AEDIT_MAIN_MENU:
switch (*arg) { switch (*arg) {
case 'q': case 'Q': case 'q':
case 'Q':
if (OLC_VAL(d)) { /* Something was modified */ if (OLC_VAL(d)) { /* Something was modified */
write_to_output(d, "Do you wish to save your changes? : "); write_to_output(d, "Do you wish to save your changes? : ");
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING; OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
} } else cleanup_olc(d, CLEANUP_ALL);
else cleanup_olc(d, CLEANUP_ALL);
break; break;
case 'n': case 'n':
write_to_output(d, "Enter action name: "); write_to_output(d, "Enter action name: ");
@@ -419,7 +434,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
return; return;
case '2': case '2':
write_to_output(d, "Enter the minimum position the Character has to be in to activate social:\r\n"); write_to_output(d, "Enter the minimum position the Character has to be in to activate social:\r\n");
for (i=POS_DEAD;i<=POS_STANDING;i++) for (i=POS_DEAD; i<=POS_STANDING; i++)
write_to_output(d, " %d) %s\r\n", i, position_types[i]); write_to_output(d, " %d) %s\r\n", i, position_types[i]);
write_to_output(d, "Enter choice: "); write_to_output(d, "Enter choice: ");
@@ -427,7 +442,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
return; return;
case '3': case '3':
write_to_output(d, "Enter the minimum position the Victim has to be in to activate social:\r\n"); write_to_output(d, "Enter the minimum position the Victim has to be in to activate social:\r\n");
for (i=POS_DEAD;i<=POS_STANDING;i++) for (i=POS_DEAD; i<=POS_STANDING; i++)
write_to_output(d, " %d) %s\r\n", i, position_types[i]); write_to_output(d, " %d) %s\r\n", i, position_types[i]);
write_to_output(d, "Enter choice: "); write_to_output(d, "Enter choice: ");
@@ -442,21 +457,24 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
aedit_disp_menu(d); aedit_disp_menu(d);
OLC_VAL(d) = 1; OLC_VAL(d) = 1;
break; break;
case 'a': case 'A': case 'a':
case 'A':
write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n" write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->char_no_arg)?OLC_ACTION(d)->char_no_arg:"NULL")); ((OLC_ACTION(d)->char_no_arg)?OLC_ACTION(d)->char_no_arg:"NULL"));
OLC_MODE(d) = AEDIT_NOVICT_CHAR; OLC_MODE(d) = AEDIT_NOVICT_CHAR;
return; return;
case 'b': case 'B': case 'b':
case 'B':
write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n" write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
((OLC_ACTION(d)->others_no_arg)?OLC_ACTION(d)->others_no_arg:"NULL")); ((OLC_ACTION(d)->others_no_arg)?OLC_ACTION(d)->others_no_arg:"NULL"));
OLC_MODE(d) = AEDIT_NOVICT_OTHERS; OLC_MODE(d) = AEDIT_NOVICT_OTHERS;
return; return;
case 'c': case 'C': case 'c':
case 'C':
write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n" write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -464,7 +482,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_NOT_FOUND; OLC_MODE(d) = AEDIT_VICT_NOT_FOUND;
return; return;
case 'd': case 'D': case 'd':
case 'D':
write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n" write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -472,7 +491,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_SELF_CHAR; OLC_MODE(d) = AEDIT_SELF_CHAR;
return; return;
case 'e': case 'E': case 'e':
case 'E':
write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n" write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -480,7 +500,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_SELF_OTHERS; OLC_MODE(d) = AEDIT_SELF_OTHERS;
return; return;
case 'f': case 'F': case 'f':
case 'F':
write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -488,7 +509,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND; OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND;
return; return;
case 'g': case 'G': case 'g':
case 'G':
write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -496,7 +518,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND; OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND;
return; return;
case 'h': case 'H': case 'h':
case 'H':
write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n" write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -504,7 +527,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_VICT_FOUND; OLC_MODE(d) = AEDIT_VICT_VICT_FOUND;
return; return;
case 'i': case 'I': case 'i':
case 'I':
write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -512,7 +536,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND;
return; return;
case 'j': case 'J': case 'j':
case 'J':
write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -520,7 +545,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND;
return; return;
case 'k': case 'K': case 'k':
case 'K':
write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n" write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -528,7 +554,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND; OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND;
return; return;
case 'l': case 'L': case 'l':
case 'L':
write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n" write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",
@@ -536,7 +563,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND; OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND;
return; return;
case 'm': case 'M': case 'm':
case 'M':
write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n" write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n"
"[OLD]: %s\r\n" "[OLD]: %s\r\n"
"[NEW]: ", "[NEW]: ",

View File

@@ -19,18 +19,12 @@
/* comm.c */ /* comm.c */
void close_socket(struct descriptor_data *d); void close_socket(struct descriptor_data *d);
void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2))); void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
size_t send_to_char(struct char_data *ch, const char *messg, ...) __attribute__ size_t send_to_char(struct char_data *ch, const char *messg, ...) __attribute__((format (printf, 2, 3)));
((format (printf, 2, 3))); void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1, void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));
2))); void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format void send_to_group(struct char_data *ch, struct group_data *group, const char * msg, ...) __attribute__ ((format(printf, 3, 4)));
(printf, 2, 3))); void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...) __attribute__ ((format (printf, 3, 4)));
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1,
2)));
void send_to_group(struct char_data *ch, struct group_data *group, const char * msg, ...) __attribute__ ((format
(printf, 3, 4)));
void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...)
__attribute__ ((format (printf, 3, 4)));
/* Act type settings and flags */ /* Act type settings and flags */
#define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */ #define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */

View File

@@ -95,7 +95,7 @@
#define INFO_FILE LIB_TEXT"info" /* for INFO */ #define INFO_FILE LIB_TEXT"info" /* for INFO */
#define WIZLIST_FILE LIB_TEXT"wizlist" /* for WIZLIST */ #define WIZLIST_FILE LIB_TEXT"wizlist" /* for WIZLIST */
#define IMMLIST_FILE LIB_TEXT"immlist" /* for IMMLIST */ #define IMMLIST_FILE LIB_TEXT"immlist" /* for IMMLIST */
#define BACKGROUND_FILE LIB_TEXT"background"/* for the background story */ #define BACKGROUND_FILE LIB_TEXT"background" /* for the background story */
#define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */ #define POLICIES_FILE LIB_TEXT"policies" /* player policies/rules */
#define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */ #define HANDBOOK_FILE LIB_TEXT"handbook" /* handbook for new immorts */
#define HELP_FILE "help.hlp" #define HELP_FILE "help.hlp"
@@ -141,8 +141,8 @@
/* new bitvector data for use in player_index_element */ /* new bitvector data for use in player_index_element */
#define PINDEX_DELETED (1 << 0) /* deleted player */ #define PINDEX_DELETED (1 << 0) /* deleted player */
#define PINDEX_NODELETE (1 << 1) /* protected player */ #define PINDEX_NODELETE (1 << 1) /* protected player */
#define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting*/ #define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting */
#define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist*/ #define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist */
#define REAL 0 #define REAL 0
#define VIRTUAL 1 #define VIRTUAL 1
@@ -174,8 +174,7 @@ struct reset_com {
/* zone definition structure. for the 'zone-table' */ /* zone definition structure. for the 'zone-table' */
struct zone_data { struct zone_data {
char *name; /* name of this zone */ char *name; /* name of this zone */
char *builders; /* namelist of builders allowed to */ char *builders; /* namelist of builders allowed to modify this zone. */
/* modify this zone. */
int lifespan; /* how long between resets (minutes) */ int lifespan; /* how long between resets (minutes) */
int age; /* current age of this zone (minutes) */ int age; /* current age of this zone (minutes) */
room_vnum bot; /* starting room number for this zone */ room_vnum bot; /* starting room number for this zone */
@@ -218,11 +217,11 @@ struct player_index_element {
}; };
struct help_index_element { struct help_index_element {
char *index; /*Future Use */ char *index; /* Future Use */
char *keywords; /*Keyword Place holder and sorter */ char *keywords; /* Keyword Place holder and sorter */
char *entry; /*Entries for help files with Keywords at very top*/ char *entry; /* Entries for help files with Keywords at very top */
int duplicate; /*Duplicate entries for multple keywords*/ int duplicate; /* Duplicate entries for multple keywords */
int min_level; /*Min Level to read help entry*/ int min_level; /* Min Level to read help entry */
}; };
/* The ban defines and structs were moved to ban.h */ /* The ban defines and structs were moved to ban.h */

View File

@@ -125,8 +125,7 @@
* same time. */ * same time. */
#define PULSE_DG_SCRIPT (13 RL_SEC) #define PULSE_DG_SCRIPT (13 RL_SEC)
#define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can #define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can recurse into each other */
recurse into each other */
#define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */ #define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */
@@ -205,8 +204,8 @@ char *one_phrase(char *arg, char *first_arg);
int is_substring(char *sub, char *string); int is_substring(char *sub, char *string);
int word_check(char *str, char *wordlist); int word_check(char *str, char *wordlist);
void act_mtrigger(const char_data *ch, char *str, void act_mtrigger(const char_data *ch, char *str, char_data *actor, char_data *victim, obj_data *object,
char_data *actor, char_data *victim, obj_data *object, obj_data *target, char *arg); obj_data *target, char *arg);
void speech_mtrigger(char_data *actor, char *str); void speech_mtrigger(char_data *actor, char *str);
void speech_wtrigger(char_data *actor, char *str); void speech_wtrigger(char_data *actor, char *str);
void greet_memory_mtrigger(char_data *ch); void greet_memory_mtrigger(char_data *ch);
@@ -218,17 +217,13 @@ int drop_otrigger(obj_data *obj, char_data *actor);
void timer_otrigger(obj_data *obj); void timer_otrigger(obj_data *obj);
int get_otrigger(obj_data *obj, char_data *actor); int get_otrigger(obj_data *obj, char_data *actor);
int drop_wtrigger(obj_data *obj, char_data *actor); int drop_wtrigger(obj_data *obj, char_data *actor);
int give_otrigger(obj_data *obj, char_data *actor, int give_otrigger(obj_data *obj, char_data *actor, char_data *victim);
char_data *victim); int receive_mtrigger(char_data *ch, char_data *actor, obj_data *obj);
int receive_mtrigger(char_data *ch, char_data *actor, void bribe_mtrigger(char_data *ch, char_data *actor, int amount);
obj_data *obj);
void bribe_mtrigger(char_data *ch, char_data *actor,
int amount);
int wear_otrigger(obj_data *obj, char_data *actor, int where); int wear_otrigger(obj_data *obj, char_data *actor, int where);
int remove_otrigger(obj_data *obj, char_data *actor); int remove_otrigger(obj_data *obj, char_data *actor);
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd, int cmd_otrig(obj_data *obj, char_data *actor, char *cmd, char *argument, int type);
char *argument, int type);
int command_mtrigger(char_data *actor, char *cmd, char *argument); int command_mtrigger(char_data *actor, char *cmd, char *argument);
int command_otrigger(char_data *actor, char *cmd, char *argument); int command_otrigger(char_data *actor, char *cmd, char *argument);
int command_wtrigger(char_data *actor, char *cmd, char *argument); int command_wtrigger(char_data *actor, char *cmd, char *argument);
@@ -308,8 +303,7 @@ int trig_is_attached(struct script_data *sc, int trig_num);
/* Thanks to Chris Gilbert for reminding me that there are other options. */ /* Thanks to Chris Gilbert for reminding me that there are other options. */
int script_driver(void *go_adress, trig_data *trig, int type, int mode); int script_driver(void *go_adress, trig_data *trig, int type, int mode);
trig_rnum real_trigger(trig_vnum vnum); trig_rnum real_trigger(trig_vnum vnum);
void process_eval(void *go, struct script_data *sc, trig_data *trig, void process_eval(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
int type, char *cmd);
void read_saved_vars(struct char_data *ch); void read_saved_vars(struct char_data *ch);
void save_char_vars(struct char_data *ch); void save_char_vars(struct char_data *ch);
void init_lookup_table(void); void init_lookup_table(void);
@@ -329,12 +323,10 @@ void add_var(struct trig_var_data **var_list, const char *name, const char *valu
int item_in_list(char *item, obj_data *list); int item_in_list(char *item, obj_data *list);
char *skill_percent(struct char_data *ch, char *skill); char *skill_percent(struct char_data *ch, char *skill);
int char_has_item(char *item, struct char_data *ch); int char_has_item(char *item, struct char_data *ch);
void var_subst(void *go, struct script_data *sc, trig_data *trig, void var_subst(void *go, struct script_data *sc, trig_data *trig, int type, char *line, char *buf);
int type, char *line, char *buf); int text_processed(char *field, char *subfield, struct trig_var_data *vd, char *str, size_t slen);
int text_processed(char *field, char *subfield, struct trig_var_data *vd, void find_replacement(void *go, struct script_data *sc, trig_data *trig, int type, char *var, char *field,
char *str, size_t slen); char *subfield, char *str, size_t slen);
void find_replacement(void *go, struct script_data *sc, trig_data *trig,
int type, char *var, char *field, char *subfield, char *str, size_t slen);
/* From dg_handler.c */ /* From dg_handler.c */
void free_var_el(struct trig_var_data *var); void free_var_el(struct trig_var_data *var);
@@ -355,10 +347,8 @@ void sub_write(char *arg, char_data *ch, byte find_invis, int targets);
void send_to_zone(char *messg, zone_rnum zone); void send_to_zone(char *messg, zone_rnum zone);
/* from dg_misc.c */ /* from dg_misc.c */
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
int type, char *cmd); void do_dg_affect(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
int type, char *cmd);
void send_char_pos(struct char_data *ch, int dam); void send_char_pos(struct char_data *ch, int dam);
int valid_dg_target(char_data *ch, int bitvector); int valid_dg_target(char_data *ch, int bitvector);
void script_damage(char_data *vict, int dam); void script_damage(char_data *vict, int dam);
@@ -433,10 +423,8 @@ void wld_command_interpreter(room_data *room, char *argument);
#define GET_SHORT(ch) ((ch)->player.short_descr) #define GET_SHORT(ch) ((ch)->player.short_descr)
#define SCRIPT_CHECK(go, type) (SCRIPT(go) && \ #define SCRIPT_CHECK(go, type) (SCRIPT(go) && IS_SET(SCRIPT_TYPES(SCRIPT(go)), type))
IS_SET(SCRIPT_TYPES(SCRIPT(go)), type)) #define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && !GET_TRIG_DEPTH(t))
#define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && \
!GET_TRIG_DEPTH(t))
/* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is /* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is

View File

@@ -31,8 +31,7 @@ void hit(struct char_data *ch, struct char_data *victim, int type);
void perform_violence(void); void perform_violence(void);
void raw_kill(struct char_data * ch, struct char_data * killer); void raw_kill(struct char_data * ch, struct char_data * killer);
void set_fighting(struct char_data *ch, struct char_data *victim); void set_fighting(struct char_data *ch, struct char_data *victim);
int skill_message(int dam, struct char_data *ch, struct char_data *vict, int skill_message(int dam, struct char_data *ch, struct char_data *vict, int attacktype);
int attacktype);
void stop_fighting(struct char_data *ch); void stop_fighting(struct char_data *ch);

View File

@@ -18,8 +18,7 @@ void affect_to_char(struct char_data *ch, struct affected_type *af);
void affect_remove(struct char_data *ch, struct affected_type *af); void affect_remove(struct char_data *ch, struct affected_type *af);
void affect_from_char(struct char_data *ch, int type); void affect_from_char(struct char_data *ch, int type);
bool affected_by_spell(struct char_data *ch, int type); bool affected_by_spell(struct char_data *ch, int type);
void affect_join(struct char_data *ch, struct affected_type *af, void affect_join(struct char_data *ch, struct affected_type *af, bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
/* utility */ /* utility */
const char *money_desc(int amount); const char *money_desc(int amount);
@@ -84,8 +83,7 @@ void leave_group(struct char_data *ch);
void join_group(struct char_data *ch, struct group_data *group); void join_group(struct char_data *ch, struct group_data *group);
/* Generic Find */ /* Generic Find */
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch, int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch, struct char_data **tar_ch, struct obj_data **tar_obj);
struct char_data **tar_ch, struct obj_data **tar_obj);
#define FIND_CHAR_ROOM (1 << 0) #define FIND_CHAR_ROOM (1 << 0)
#define FIND_CHAR_WORLD (1 << 1) #define FIND_CHAR_WORLD (1 << 1)

View File

@@ -37,8 +37,7 @@ struct house_control_rec {
long spare7; long spare7;
}; };
#define TOROOM(room, dir) (world[room].dir_option[dir] ? \ #define TOROOM(room, dir) (world[room].dir_option[dir] ? world[room].dir_option[dir]->to_room : NOWHERE)
world[room].dir_option[dir]->to_room : NOWHERE)
/* Functions in house.c made externally available */ /* Functions in house.c made externally available */
/* Utility Functions */ /* Utility Functions */

3
src/ibt.h Executable file → Normal file
View File

@@ -69,8 +69,7 @@ typedef struct ibt_data IBT_DATA;
break; \ break; \
} }
struct ibt_data struct ibt_data {
{
IBT_DATA *next; /**< Pointer to next IBT in the list */ IBT_DATA *next; /**< Pointer to next IBT in the list */
IBT_DATA *prev; /**< Pointer to previous IBT in the list */ IBT_DATA *prev; /**< Pointer to previous IBT in the list */
char *text; /**< Header Text for this IBT */ char *text; /**< Header Text for this IBT */

View File

@@ -64,339 +64,342 @@ cpp_extern const struct command_info cmd_info[] = {
{ "RESERVED", "", 0, 0, 0, 0 }, /* this must be first -- for specprocs */ { "RESERVED", "", 0, 0, 0, 0 }, /* this must be first -- for specprocs */
/* directions must come before other commands but after RESERVED */ /* directions must come before other commands but after RESERVED */
{ "north" , "n" , POS_STANDING, do_move , 0, SCMD_NORTH }, { "north", "n", POS_STANDING, do_move, 0, SCMD_NORTH },
{ "east" , "e" , POS_STANDING, do_move , 0, SCMD_EAST }, { "east", "e", POS_STANDING, do_move, 0, SCMD_EAST },
{ "south" , "s" , POS_STANDING, do_move , 0, SCMD_SOUTH }, { "south", "s", POS_STANDING, do_move, 0, SCMD_SOUTH },
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST }, { "west", "w", POS_STANDING, do_move, 0, SCMD_WEST },
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP }, { "up", "u", POS_STANDING, do_move, 0, SCMD_UP },
{ "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN }, { "down", "d", POS_STANDING, do_move, 0, SCMD_DOWN },
{ "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW }, { "northwest", "northw", POS_STANDING, do_move, 0, SCMD_NW },
{ "nw" , "nw" , POS_STANDING, do_move , 0, SCMD_NW }, { "nw", "nw", POS_STANDING, do_move, 0, SCMD_NW },
{ "northeast", "northe" , POS_STANDING, do_move , 0, SCMD_NE }, { "northeast", "northe", POS_STANDING, do_move, 0, SCMD_NE },
{ "ne" , "ne" , POS_STANDING, do_move , 0, SCMD_NE }, { "ne", "ne", POS_STANDING, do_move, 0, SCMD_NE },
{ "southeast", "southe" , POS_STANDING, do_move , 0, SCMD_SE }, { "southeast", "southe", POS_STANDING, do_move, 0, SCMD_SE },
{ "se" , "se" , POS_STANDING, do_move , 0, SCMD_SE }, { "se", "se", POS_STANDING, do_move, 0, SCMD_SE },
{ "southwest", "southw" , POS_STANDING, do_move , 0, SCMD_SW }, { "southwest", "southw", POS_STANDING, do_move, 0, SCMD_SW },
{ "sw" , "sw" , POS_STANDING, do_move , 0, SCMD_SW }, { "sw", "sw", POS_STANDING, do_move, 0, SCMD_SW },
/* now, the main list */ /* now, the main list */
{ "at" , "at" , POS_DEAD , do_at , LVL_IMMORT, 0 }, { "at", "at", POS_DEAD, do_at, LVL_IMMORT, 0 },
{ "advance" , "adv" , POS_DEAD , do_advance , LVL_GRGOD, 0 }, { "advance", "adv", POS_DEAD, do_advance, LVL_GRGOD, 0 },
{ "aedit" , "aed" , POS_DEAD , do_oasis_aedit, LVL_GOD, 0 }, { "aedit", "aed", POS_DEAD, do_oasis_aedit, LVL_GOD, 0 },
{ "alias" , "ali" , POS_DEAD , do_alias , 0, 0 }, { "alias", "ali", POS_DEAD, do_alias, 0, 0 },
{ "afk" , "afk" , POS_DEAD , do_gen_tog , 0, SCMD_AFK }, { "afk", "afk", POS_DEAD, do_gen_tog, 0, SCMD_AFK },
{ "areas" , "are" , POS_DEAD , do_areas , 0, 0 }, { "areas", "are", POS_DEAD, do_areas, 0, 0 },
{ "assist" , "as" , POS_FIGHTING, do_assist , 1, 0 }, { "assist", "as", POS_FIGHTING, do_assist, 1, 0 },
{ "ask" , "ask" , POS_RESTING , do_spec_comm, 0, SCMD_ASK }, { "ask", "ask", POS_RESTING, do_spec_comm, 0, SCMD_ASK },
{ "astat" , "ast" , POS_DEAD , do_astat , 0, 0 }, { "astat", "ast", POS_DEAD, do_astat, 0, 0 },
{ "attach" , "attach" , POS_DEAD , do_attach , LVL_BUILDER, 0 }, { "attach", "attach", POS_DEAD, do_attach, LVL_BUILDER, 0 },
{ "auction" , "auc" , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION }, { "auction", "auc", POS_SLEEPING, do_gen_comm, 0, SCMD_AUCTION },
{ "autoexits" , "autoex" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOEXIT }, { "autoexits", "autoex", POS_DEAD, do_gen_tog, 0, SCMD_AUTOEXIT },
{ "autoassist","autoass" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOASSIST }, { "autoassist","autoass", POS_DEAD, do_gen_tog, 0, SCMD_AUTOASSIST },
{ "autodoor" , "autodoor", POS_DEAD , do_gen_tog , 0, SCMD_AUTODOOR }, { "autodoor", "autodoor", POS_DEAD, do_gen_tog, 0, SCMD_AUTODOOR },
{ "autogold" , "autogold", POS_DEAD , do_gen_tog , 0, SCMD_AUTOGOLD }, { "autogold", "autogold", POS_DEAD, do_gen_tog, 0, SCMD_AUTOGOLD },
{ "autokey" , "autokey" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOKEY }, { "autokey", "autokey", POS_DEAD, do_gen_tog, 0, SCMD_AUTOKEY },
{ "autoloot" , "autoloot", POS_DEAD , do_gen_tog , 0, SCMD_AUTOLOOT }, { "autoloot", "autoloot", POS_DEAD, do_gen_tog, 0, SCMD_AUTOLOOT },
{ "automap" , "automap" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOMAP }, { "automap", "automap", POS_DEAD, do_gen_tog, 0, SCMD_AUTOMAP },
{ "autosac" , "autosac" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOSAC }, { "autosac", "autosac", POS_DEAD, do_gen_tog, 0, SCMD_AUTOSAC },
{ "autosplit", "autospl" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOSPLIT }, { "autosplit", "autospl", POS_DEAD, do_gen_tog, 0, SCMD_AUTOSPLIT },
{ "backstab" , "ba" , POS_STANDING, do_backstab , 1, 0 }, { "backstab", "ba", POS_STANDING, do_backstab, 1, 0 },
{ "ban" , "ban" , POS_DEAD , do_ban , LVL_GRGOD, 0 }, { "ban", "ban", POS_DEAD, do_ban, LVL_GRGOD, 0 },
{ "bandage" , "band" , POS_RESTING , do_bandage , 1, 0 }, { "bandage", "band", POS_RESTING, do_bandage, 1, 0 },
{ "balance" , "bal" , POS_STANDING, do_not_here , 1, 0 }, { "balance", "bal", POS_STANDING, do_not_here, 1, 0 },
{ "bash" , "bas" , POS_FIGHTING, do_bash , 1, 0 }, { "bash", "bas", POS_FIGHTING, do_bash, 1, 0 },
{ "brief" , "br" , POS_DEAD , do_gen_tog , 0, SCMD_BRIEF }, { "brief", "br", POS_DEAD, do_gen_tog, 0, SCMD_BRIEF },
{ "buildwalk", "buildwalk", POS_STANDING, do_gen_tog , LVL_BUILDER, SCMD_BUILDWALK }, { "buildwalk", "buildwalk", POS_STANDING, do_gen_tog, LVL_BUILDER, SCMD_BUILDWALK },
{ "buy" , "bu" , POS_STANDING, do_not_here , 0, 0 }, { "buy", "bu", POS_STANDING, do_not_here, 0, 0 },
{ "bug" , "bug" , POS_DEAD , do_ibt , 0, SCMD_BUG }, { "bug", "bug", POS_DEAD, do_ibt, 0, SCMD_BUG },
{ "cast" , "c" , POS_SITTING , do_cast , 1, 0 }, { "cast", "c", POS_SITTING, do_cast, 1, 0 },
{ "cedit" , "cedit" , POS_DEAD , do_oasis_cedit, LVL_IMPL, 0 }, { "cedit", "cedit", POS_DEAD, do_oasis_cedit, LVL_IMPL, 0 },
{ "changelog", "cha" , POS_DEAD , do_changelog, LVL_IMPL, 0 }, { "changelog", "cha", POS_DEAD, do_changelog, LVL_IMPL, 0 },
{ "check" , "ch" , POS_STANDING, do_not_here , 1, 0 }, { "check", "ch", POS_STANDING, do_not_here, 1, 0 },
{ "checkload", "checkl" , POS_DEAD , do_checkloadstatus, LVL_GOD, 0 }, { "checkload", "checkl", POS_DEAD, do_checkloadstatus, LVL_GOD, 0 },
{ "close" , "cl" , POS_SITTING , do_gen_door , 0, SCMD_CLOSE }, { "close", "cl", POS_SITTING, do_gen_door, 0, SCMD_CLOSE },
{ "clear" , "cle" , POS_DEAD , do_gen_ps , 0, SCMD_CLEAR }, { "clear", "cle", POS_DEAD, do_gen_ps, 0, SCMD_CLEAR },
{ "cls" , "cls" , POS_DEAD , do_gen_ps , 0, SCMD_CLEAR }, { "cls", "cls", POS_DEAD, do_gen_ps, 0, SCMD_CLEAR },
{ "consider" , "con" , POS_RESTING , do_consider , 0, 0 }, { "consider", "con", POS_RESTING, do_consider, 0, 0 },
{ "commands" , "com" , POS_DEAD , do_commands , 0, SCMD_COMMANDS }, { "commands", "com", POS_DEAD, do_commands, 0, SCMD_COMMANDS },
{ "compact" , "comp" , POS_DEAD , do_gen_tog , 0, SCMD_COMPACT }, { "compact", "comp", POS_DEAD, do_gen_tog, 0, SCMD_COMPACT },
{ "copyover" , "copyover", POS_DEAD , do_copyover , LVL_GRGOD, 0 }, { "copyover", "copyover", POS_DEAD, do_copyover, LVL_GRGOD, 0 },
{ "credits" , "cred" , POS_DEAD , do_gen_ps , 0, SCMD_CREDITS }, { "credits", "cred", POS_DEAD, do_gen_ps, 0, SCMD_CREDITS },
{ "date" , "da" , POS_DEAD , do_date , LVL_IMMORT, SCMD_DATE }, { "date", "da", POS_DEAD, do_date, LVL_IMMORT, SCMD_DATE },
{ "dc" , "dc" , POS_DEAD , do_dc , LVL_GOD, 0 }, { "dc", "dc", POS_DEAD, do_dc, LVL_GOD, 0 },
{ "deposit" , "depo" , POS_STANDING, do_not_here , 1, 0 }, { "deposit", "depo", POS_STANDING, do_not_here, 1, 0 },
{ "detach" , "detach" , POS_DEAD , do_detach , LVL_BUILDER, 0 }, { "detach", "detach", POS_DEAD, do_detach, LVL_BUILDER, 0 },
{ "diagnose" , "diag" , POS_RESTING , do_diagnose , 0, 0 }, { "diagnose", "diag", POS_RESTING, do_diagnose, 0, 0 },
{ "dig" , "dig" , POS_DEAD , do_dig , LVL_BUILDER, 0 }, { "dig", "dig", POS_DEAD, do_dig, LVL_BUILDER, 0 },
{ "display" , "disp" , POS_DEAD , do_display , 0, 0 }, { "display", "disp", POS_DEAD, do_display, 0, 0 },
{ "donate" , "don" , POS_RESTING , do_drop , 0, SCMD_DONATE }, { "donate", "don", POS_RESTING, do_drop, 0, SCMD_DONATE },
{ "drink" , "dri" , POS_RESTING , do_drink , 0, SCMD_DRINK }, { "drink", "dri", POS_RESTING, do_drink, 0, SCMD_DRINK },
{ "drop" , "dro" , POS_RESTING , do_drop , 0, SCMD_DROP }, { "drop", "dro", POS_RESTING, do_drop, 0, SCMD_DROP },
{ "eat" , "ea" , POS_RESTING , do_eat , 0, SCMD_EAT }, { "eat", "ea", POS_RESTING, do_eat, 0, SCMD_EAT },
{ "echo" , "ec" , POS_SLEEPING, do_echo , LVL_IMMORT, SCMD_ECHO }, { "echo", "ec", POS_SLEEPING, do_echo, LVL_IMMORT, SCMD_ECHO },
{ "emote" , "em" , POS_RESTING , do_echo , 0, SCMD_EMOTE }, { "emote", "em", POS_RESTING, do_echo, 0, SCMD_EMOTE },
{ ":" , ":" , POS_RESTING, do_echo , 1, SCMD_EMOTE }, { ":", ":", POS_RESTING, do_echo, 1, SCMD_EMOTE },
{ "enter" , "ent" , POS_STANDING, do_enter , 0, 0 }, { "enter", "ent", POS_STANDING, do_enter, 0, 0 },
{ "equipment", "eq" , POS_SLEEPING, do_equipment, 0, 0 }, { "equipment", "eq", POS_SLEEPING, do_equipment, 0, 0 },
{ "exits" , "ex" , POS_RESTING , do_exits , 0, 0 }, { "exits", "ex", POS_RESTING, do_exits, 0, 0 },
{ "examine" , "exa" , POS_SITTING , do_examine , 0, 0 }, { "examine", "exa", POS_SITTING, do_examine, 0, 0 },
{ "export" , "export" , POS_DEAD , do_export_zone, LVL_IMPL, 0 }, { "export", "export", POS_DEAD, do_export_zone, LVL_IMPL, 0 },
{ "force" , "force" , POS_SLEEPING, do_force , LVL_GOD, 0 }, { "force", "force", POS_SLEEPING, do_force, LVL_GOD, 0 },
{ "fill" , "fil" , POS_STANDING, do_pour , 0, SCMD_FILL }, { "fill", "fil", POS_STANDING, do_pour, 0, SCMD_FILL },
{ "file" , "file" , POS_SLEEPING, do_file , LVL_GOD, 0 }, { "file", "file", POS_SLEEPING, do_file, LVL_GOD, 0 },
{ "flee" , "fl" , POS_FIGHTING, do_flee , 1, 0 }, { "flee", "fl", POS_FIGHTING, do_flee, 1, 0 },
{ "follow" , "fol" , POS_RESTING , do_follow , 0, 0 }, { "follow", "fol", POS_RESTING, do_follow, 0, 0 },
{ "freeze" , "freeze" , POS_DEAD , do_wizutil , LVL_GRGOD, SCMD_FREEZE }, { "freeze", "freeze", POS_DEAD, do_wizutil, LVL_GRGOD, SCMD_FREEZE },
{ "get" , "g" , POS_RESTING , do_get , 0, 0 }, { "get", "g", POS_RESTING, do_get, 0, 0 },
{ "gecho" , "gecho" , POS_DEAD , do_gecho , LVL_GOD, 0 }, { "gecho", "gecho", POS_DEAD, do_gecho, LVL_GOD, 0 },
{ "gemote" , "gem" , POS_SLEEPING, do_gen_comm , 0, SCMD_GEMOTE }, { "gemote", "gem", POS_SLEEPING, do_gen_comm, 0, SCMD_GEMOTE },
{ "give" , "giv" , POS_RESTING , do_give , 0, 0 }, { "give", "giv", POS_RESTING, do_give, 0, 0 },
{ "goto" , "go" , POS_SLEEPING, do_goto , LVL_IMMORT, 0 }, { "goto", "go", POS_SLEEPING, do_goto, LVL_IMMORT, 0 },
{ "gold" , "gol" , POS_RESTING , do_gold , 0, 0 }, { "gold", "gol", POS_RESTING, do_gold, 0, 0 },
{ "gossip" , "gos" , POS_SLEEPING, do_gen_comm , 0, SCMD_GOSSIP }, { "gossip", "gos", POS_SLEEPING, do_gen_comm, 0, SCMD_GOSSIP },
{ "group" , "gr" , POS_RESTING , do_group , 1, 0 }, { "group", "gr", POS_RESTING, do_group, 1, 0 },
{ "grab" , "grab" , POS_RESTING , do_grab , 0, 0 }, { "grab", "grab", POS_RESTING, do_grab, 0, 0 },
{ "grats" , "grat" , POS_SLEEPING, do_gen_comm , 0, SCMD_GRATZ }, { "grats", "grat", POS_SLEEPING, do_gen_comm, 0, SCMD_GRATZ },
{ "gsay" , "gsay" , POS_SLEEPING, do_gsay , 0, 0 }, { "gsay", "gsay", POS_SLEEPING, do_gsay, 0, 0 },
{ "gtell" , "gt" , POS_SLEEPING, do_gsay , 0, 0 }, { "gtell", "gt", POS_SLEEPING, do_gsay, 0, 0 },
{ "help" , "h" , POS_DEAD , do_help , 0, 0 }, { "help", "h", POS_DEAD, do_help, 0, 0 },
{ "happyhour", "ha" , POS_DEAD , do_happyhour, 0, 0 }, { "happyhour", "ha", POS_DEAD, do_happyhour, 0, 0 },
{ "hedit" , "hedit" , POS_DEAD , do_oasis_hedit, LVL_GOD , 0 }, { "hedit", "hedit", POS_DEAD, do_oasis_hedit, LVL_GOD, 0 },
{ "helpcheck", "helpch" , POS_DEAD , do_helpcheck, LVL_GOD, 0 }, { "helpcheck", "helpch", POS_DEAD, do_helpcheck, LVL_GOD, 0 },
{ "hide" , "hi" , POS_RESTING , do_hide , 1, 0 }, { "hide", "hi", POS_RESTING, do_hide, 1, 0 },
{ "hindex" , "hind" , POS_DEAD , do_hindex , 0, 0 }, { "hindex", "hind", POS_DEAD, do_hindex, 0, 0 },
{ "handbook" , "handb" , POS_DEAD , do_gen_ps , LVL_IMMORT, SCMD_HANDBOOK }, { "handbook", "handb", POS_DEAD, do_gen_ps, LVL_IMMORT, SCMD_HANDBOOK },
{ "hcontrol" , "hcontrol", POS_DEAD , do_hcontrol , LVL_GRGOD, 0 }, { "hcontrol", "hcontrol", POS_DEAD, do_hcontrol, LVL_GRGOD, 0 },
{ "history" , "history" , POS_DEAD , do_history, 0, 0}, { "history", "history", POS_DEAD, do_history, 0, 0},
{ "hit" , "hit" , POS_FIGHTING, do_hit , 0, SCMD_HIT }, { "hit", "hit", POS_FIGHTING, do_hit, 0, SCMD_HIT },
{ "hold" , "hold" , POS_RESTING , do_grab , 1, 0 }, { "hold", "hold", POS_RESTING, do_grab, 1, 0 },
{ "holler" , "holler" , POS_RESTING , do_gen_comm , 1, SCMD_HOLLER }, { "holler", "holler", POS_RESTING, do_gen_comm, 1, SCMD_HOLLER },
{ "holylight", "holy" , POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_HOLYLIGHT }, { "holylight", "holy", POS_DEAD, do_gen_tog, LVL_IMMORT, SCMD_HOLYLIGHT },
{ "house" , "house" , POS_RESTING , do_house , 0, 0 }, { "house", "house", POS_RESTING, do_house, 0, 0 },
{ "inventory", "i" , POS_DEAD , do_inventory, 0, 0 }, { "inventory", "i", POS_DEAD, do_inventory, 0, 0 },
{ "identify" , "id" , POS_STANDING, do_not_here , 1, 0 }, { "identify", "id", POS_STANDING, do_not_here, 1, 0 },
{ "idea" , "ide" , POS_DEAD , do_ibt , 0, SCMD_IDEA }, { "idea", "ide", POS_DEAD, do_ibt, 0, SCMD_IDEA },
{ "imotd" , "imo" , POS_DEAD , do_gen_ps , LVL_IMMORT, SCMD_IMOTD }, { "imotd", "imo", POS_DEAD, do_gen_ps, LVL_IMMORT, SCMD_IMOTD },
{ "immlist" , "imm" , POS_DEAD , do_gen_ps , 0, SCMD_IMMLIST }, { "immlist", "imm", POS_DEAD, do_gen_ps, 0, SCMD_IMMLIST },
{ "info" , "info" , POS_SLEEPING, do_gen_ps , 0, SCMD_INFO }, { "info", "info", POS_SLEEPING, do_gen_ps, 0, SCMD_INFO },
{ "invis" , "invi" , POS_DEAD , do_invis , LVL_IMMORT, 0 }, { "invis", "invi", POS_DEAD, do_invis, LVL_IMMORT, 0 },
{ "junk" , "j" , POS_RESTING , do_drop , 0, SCMD_JUNK }, { "junk", "j", POS_RESTING, do_drop, 0, SCMD_JUNK },
{ "kill" , "k" , POS_FIGHTING, do_kill , 0, 0 }, { "kill", "k", POS_FIGHTING, do_kill, 0, 0 },
{ "kick" , "ki" , POS_FIGHTING, do_kick , 1, 0 }, { "kick", "ki", POS_FIGHTING, do_kick, 1, 0 },
{ "look" , "l" , POS_RESTING , do_look , 0, SCMD_LOOK }, { "look", "l", POS_RESTING, do_look, 0, SCMD_LOOK },
{ "last" , "last" , POS_DEAD , do_last , LVL_GOD, 0 }, { "last", "last", POS_DEAD, do_last, LVL_GOD, 0 },
{ "leave" , "lea" , POS_STANDING, do_leave , 0, 0 }, { "leave", "lea", POS_STANDING, do_leave, 0, 0 },
{ "levels" , "lev" , POS_DEAD , do_levels , 0, 0 }, { "levels", "lev", POS_DEAD, do_levels, 0, 0 },
{ "list" , "lis" , POS_STANDING, do_not_here , 0, 0 }, { "list", "lis", POS_STANDING, do_not_here, 0, 0 },
{ "links" , "lin" , POS_STANDING, do_links , LVL_GOD, 0 }, { "links", "lin", POS_STANDING, do_links, LVL_GOD, 0 },
{ "lock" , "loc" , POS_SITTING , do_gen_door , 0, SCMD_LOCK }, { "lock", "loc", POS_SITTING, do_gen_door, 0, SCMD_LOCK },
{ "load" , "load" , POS_DEAD , do_load , LVL_BUILDER, 0 }, { "load", "load", POS_DEAD, do_load, LVL_BUILDER, 0 },
{ "motd" , "motd" , POS_DEAD , do_gen_ps , 0, SCMD_MOTD }, { "motd", "motd", POS_DEAD, do_gen_ps, 0, SCMD_MOTD },
{ "mail" , "mail" , POS_STANDING, do_not_here , 1, 0 }, { "mail", "mail", POS_STANDING, do_not_here, 1, 0 },
{ "map" , "map" , POS_STANDING, do_map , 1, 0 }, { "map", "map", POS_STANDING, do_map, 1, 0 },
{ "medit" , "med" , POS_DEAD , do_oasis_medit, LVL_BUILDER, 0 }, { "medit", "med", POS_DEAD, do_oasis_medit, LVL_BUILDER, 0 },
{ "mlist" , "mlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_MLIST }, { "mlist", "mlist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_MLIST },
{ "mcopy" , "mcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_MEDIT }, { "mcopy", "mcopy", POS_DEAD, do_oasis_copy, LVL_GOD, CON_MEDIT },
{ "msgedit" , "msgedit" , POS_DEAD , do_msgedit, LVL_GOD, 0 }, { "msgedit", "msgedit", POS_DEAD, do_msgedit, LVL_GOD, 0 },
{ "mute" , "mute" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_MUTE }, { "mute", "mute", POS_DEAD, do_wizutil, LVL_GOD, SCMD_MUTE },
{ "news" , "news" , POS_SLEEPING, do_gen_ps , 0, SCMD_NEWS }, { "news", "news", POS_SLEEPING, do_gen_ps, 0, SCMD_NEWS },
{ "noauction", "noauction",POS_DEAD , do_gen_tog , 0, SCMD_NOAUCTION }, { "noauction", "noauction",POS_DEAD, do_gen_tog, 0, SCMD_NOAUCTION },
{ "nogossip" , "nogossip", POS_DEAD , do_gen_tog , 0, SCMD_NOGOSSIP }, { "nogossip", "nogossip", POS_DEAD, do_gen_tog, 0, SCMD_NOGOSSIP },
{ "nograts" , "nograts" , POS_DEAD , do_gen_tog , 0, SCMD_NOGRATZ }, { "nograts", "nograts", POS_DEAD, do_gen_tog, 0, SCMD_NOGRATZ },
{ "nohassle" , "nohassle", POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_NOHASSLE }, { "nohassle", "nohassle", POS_DEAD, do_gen_tog, LVL_IMMORT, SCMD_NOHASSLE },
{ "norepeat" , "norepeat", POS_DEAD , do_gen_tog , 0, SCMD_NOREPEAT }, { "norepeat", "norepeat", POS_DEAD, do_gen_tog, 0, SCMD_NOREPEAT },
{ "noshout" , "noshout" , POS_SLEEPING, do_gen_tog , 1, SCMD_NOSHOUT }, { "noshout", "noshout", POS_SLEEPING, do_gen_tog, 1, SCMD_NOSHOUT },
{ "nosummon" , "nosummon", POS_DEAD , do_gen_tog , 1, SCMD_NOSUMMON }, { "nosummon", "nosummon", POS_DEAD, do_gen_tog, 1, SCMD_NOSUMMON },
{ "notell" , "notell" , POS_DEAD , do_gen_tog , 1, SCMD_NOTELL }, { "notell", "notell", POS_DEAD, do_gen_tog, 1, SCMD_NOTELL },
{ "notitle" , "notitle" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_NOTITLE }, { "notitle", "notitle", POS_DEAD, do_wizutil, LVL_GOD, SCMD_NOTITLE },
{ "nowiz" , "nowiz" , POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_NOWIZ }, { "nowiz", "nowiz", POS_DEAD, do_gen_tog, LVL_IMMORT, SCMD_NOWIZ },
{ "open" , "o" , POS_SITTING , do_gen_door , 0, SCMD_OPEN }, { "open", "o", POS_SITTING, do_gen_door, 0, SCMD_OPEN },
{ "order" , "ord" , POS_RESTING , do_order , 1, 0 }, { "order", "ord", POS_RESTING, do_order, 1, 0 },
{ "offer" , "off" , POS_STANDING, do_not_here , 1, 0 }, { "offer", "off", POS_STANDING, do_not_here, 1, 0 },
{ "olc" , "olc" , POS_DEAD , do_show_save_list, LVL_BUILDER, 0 }, { "olc", "olc", POS_DEAD, do_show_save_list, LVL_BUILDER, 0 },
{ "olist" , "olist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_OLIST }, { "olist", "olist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_OLIST },
{ "oedit" , "oedit" , POS_DEAD , do_oasis_oedit, LVL_BUILDER, 0 }, { "oedit", "oedit", POS_DEAD, do_oasis_oedit, LVL_BUILDER, 0 },
{ "oset" , "oset" , POS_DEAD , do_oset, LVL_BUILDER, 0 }, { "oset", "oset", POS_DEAD, do_oset, LVL_BUILDER, 0 },
{ "ocopy" , "ocopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_OEDIT }, { "ocopy", "ocopy", POS_DEAD, do_oasis_copy, LVL_GOD, CON_OEDIT },
{ "put" , "p" , POS_RESTING , do_put , 0, 0 }, { "put", "p", POS_RESTING, do_put, 0, 0 },
{ "peace" , "pe" , POS_DEAD , do_peace , LVL_BUILDER, 0 }, { "peace", "pe", POS_DEAD, do_peace, LVL_BUILDER, 0 },
{ "pick" , "pi" , POS_STANDING, do_gen_door , 1, SCMD_PICK }, { "pick", "pi", POS_STANDING, do_gen_door, 1, SCMD_PICK },
{ "practice" , "pr" , POS_RESTING , do_practice , 1, 0 }, { "practice", "pr", POS_RESTING, do_practice, 1, 0 },
{ "page" , "pag" , POS_DEAD , do_page , 1, 0 }, { "page", "pag", POS_DEAD, do_page, 1, 0 },
{ "pardon" , "pardon" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_PARDON }, { "pardon", "pardon", POS_DEAD, do_wizutil, LVL_GOD, SCMD_PARDON },
{ "plist" , "plist" , POS_DEAD , do_plist , LVL_GOD, 0 }, { "plist", "plist", POS_DEAD, do_plist, LVL_GOD, 0 },
{ "policy" , "pol" , POS_DEAD , do_gen_ps , 0, SCMD_POLICIES }, { "policy", "pol", POS_DEAD, do_gen_ps, 0, SCMD_POLICIES },
{ "pour" , "pour" , POS_STANDING, do_pour , 0, SCMD_POUR }, { "pour", "pour", POS_STANDING, do_pour, 0, SCMD_POUR },
{ "prompt" , "pro" , POS_DEAD , do_display , 0, 0 }, { "prompt", "pro", POS_DEAD, do_display, 0, 0 },
{ "prefedit" , "pre" , POS_DEAD , do_oasis_prefedit , 0, 0 }, { "prefedit", "pre", POS_DEAD, do_oasis_prefedit, 0, 0 },
{ "purge" , "purge" , POS_DEAD , do_purge , LVL_BUILDER, 0 }, { "purge", "purge", POS_DEAD, do_purge, LVL_BUILDER, 0 },
{ "qedit" , "qedit" , POS_DEAD , do_oasis_qedit, LVL_BUILDER, 0 }, { "qedit", "qedit", POS_DEAD, do_oasis_qedit, LVL_BUILDER, 0 },
{ "qlist" , "qlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_QLIST }, { "qlist", "qlist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_QLIST },
{ "quaff" , "qua" , POS_RESTING , do_use , 0, SCMD_QUAFF }, { "quaff", "qua", POS_RESTING, do_use, 0, SCMD_QUAFF },
{ "qecho" , "qec" , POS_DEAD , do_qcomm , LVL_GOD, SCMD_QECHO }, { "qecho", "qec", POS_DEAD, do_qcomm, LVL_GOD, SCMD_QECHO },
{ "quest" , "que" , POS_DEAD , do_quest , 0, 0 }, { "quest", "que", POS_DEAD, do_quest, 0, 0 },
{ "qui" , "qui" , POS_DEAD , do_quit , 0, 0 }, { "qui", "qui", POS_DEAD, do_quit, 0, 0 },
{ "quit" , "quit" , POS_DEAD , do_quit , 0, SCMD_QUIT }, { "quit", "quit", POS_DEAD, do_quit, 0, SCMD_QUIT },
{ "qsay" , "qsay" , POS_RESTING , do_qcomm , 0, SCMD_QSAY }, { "qsay", "qsay", POS_RESTING, do_qcomm, 0, SCMD_QSAY },
{ "reply" , "r" , POS_SLEEPING, do_reply , 0, 0 }, { "reply", "r", POS_SLEEPING, do_reply, 0, 0 },
{ "rest" , "res" , POS_RESTING , do_rest , 0, 0 }, { "rest", "res", POS_RESTING, do_rest, 0, 0 },
{ "read" , "rea" , POS_RESTING , do_look , 0, SCMD_READ }, { "read", "rea", POS_RESTING, do_look, 0, SCMD_READ },
{ "reload" , "reload" , POS_DEAD , do_reboot , LVL_IMPL, 0 }, { "reload", "reload", POS_DEAD, do_reboot, LVL_IMPL, 0 },
{ "recite" , "reci" , POS_RESTING , do_use , 0, SCMD_RECITE }, { "recite", "reci", POS_RESTING, do_use, 0, SCMD_RECITE },
{ "receive" , "rece" , POS_STANDING, do_not_here , 1, 0 }, { "receive", "rece", POS_STANDING, do_not_here, 1, 0 },
{ "recent" , "recent" , POS_DEAD , do_recent , LVL_IMMORT, 0 }, { "recent", "recent", POS_DEAD, do_recent, LVL_IMMORT, 0 },
{ "remove" , "rem" , POS_RESTING , do_remove , 0, 0 }, { "remove", "rem", POS_RESTING, do_remove, 0, 0 },
{ "rent" , "rent" , POS_STANDING, do_not_here , 1, 0 }, { "rent", "rent", POS_STANDING, do_not_here, 1, 0 },
{ "report" , "repo" , POS_RESTING , do_report , 0, 0 }, { "report", "repo", POS_RESTING, do_report, 0, 0 },
{ "reroll" , "rero" , POS_DEAD , do_wizutil , LVL_GRGOD, SCMD_REROLL }, { "reroll", "rero", POS_DEAD, do_wizutil, LVL_GRGOD, SCMD_REROLL },
{ "rescue" , "resc" , POS_FIGHTING, do_rescue , 1, 0 }, { "rescue", "resc", POS_FIGHTING, do_rescue, 1, 0 },
{ "restore" , "resto" , POS_DEAD , do_restore , LVL_GOD, 0 }, { "restore", "resto", POS_DEAD, do_restore, LVL_GOD, 0 },
{ "return" , "retu" , POS_DEAD , do_return , 0, 0 }, { "return", "retu", POS_DEAD, do_return, 0, 0 },
{ "redit" , "redit" , POS_DEAD , do_oasis_redit, LVL_BUILDER, 0 }, { "redit", "redit", POS_DEAD, do_oasis_redit, LVL_BUILDER, 0 },
{ "rlist" , "rlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_RLIST }, { "rlist", "rlist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_RLIST },
{ "rcopy" , "rcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_REDIT }, { "rcopy", "rcopy", POS_DEAD, do_oasis_copy, LVL_GOD, CON_REDIT },
{ "roomflags", "roomflags", POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_SHOWVNUMS }, { "roomflags", "roomflags", POS_DEAD, do_gen_tog, LVL_IMMORT, SCMD_SHOWVNUMS },
{ "sacrifice", "sac" , POS_RESTING , do_sac , 0, 0 }, { "sacrifice", "sac", POS_RESTING, do_sac, 0, 0 },
{ "say" , "s" , POS_RESTING , do_say , 0, 0 }, { "say", "s", POS_RESTING, do_say, 0, 0 },
{ "score" , "sc" , POS_DEAD , do_score , 0, 0 }, { "score", "sc", POS_DEAD, do_score, 0, 0 },
{ "scan" , "sca" , POS_RESTING , do_scan , 0, 0 }, { "scan", "sca", POS_RESTING, do_scan, 0, 0 },
{ "scopy" , "scopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_SEDIT }, { "scopy", "scopy", POS_DEAD, do_oasis_copy, LVL_GOD, CON_SEDIT },
{ "sit" , "si" , POS_RESTING , do_sit , 0, 0 }, { "sit", "si", POS_RESTING, do_sit, 0, 0 },
{ "'" , "'" , POS_RESTING , do_say , 0, 0 }, { "'", "'", POS_RESTING, do_say, 0, 0 },
{ "save" , "sav" , POS_SLEEPING, do_save , 0, 0 }, { "save", "sav", POS_SLEEPING, do_save, 0, 0 },
{ "saveall" , "saveall" , POS_DEAD , do_saveall , LVL_BUILDER, 0}, { "saveall", "saveall", POS_DEAD, do_saveall, LVL_BUILDER, 0},
{ "sell" , "sell" , POS_STANDING, do_not_here , 0, 0 }, { "sell", "sell", POS_STANDING, do_not_here, 0, 0 },
{ "sedit" , "sedit" , POS_DEAD , do_oasis_sedit, LVL_BUILDER, 0 }, { "sedit", "sedit", POS_DEAD, do_oasis_sedit, LVL_BUILDER, 0 },
{ "send" , "send" , POS_SLEEPING, do_send , LVL_GOD, 0 }, { "send", "send", POS_SLEEPING, do_send, LVL_GOD, 0 },
{ "set" , "set" , POS_DEAD , do_set , LVL_IMMORT, 0 }, { "set", "set", POS_DEAD, do_set, LVL_IMMORT, 0 },
{ "shout" , "sho" , POS_RESTING , do_gen_comm , 0, SCMD_SHOUT }, { "shout", "sho", POS_RESTING, do_gen_comm, 0, SCMD_SHOUT },
{ "show" , "show" , POS_DEAD , do_show , LVL_IMMORT, 0 }, { "show", "show", POS_DEAD, do_show, LVL_IMMORT, 0 },
{ "shutdow" , "shutdow" , POS_DEAD , do_shutdown , LVL_IMPL, 0 }, { "shutdow", "shutdow", POS_DEAD, do_shutdown, LVL_IMPL, 0 },
{ "shutdown" , "shutdown", POS_DEAD , do_shutdown , LVL_IMPL, SCMD_SHUTDOWN }, { "shutdown", "shutdown", POS_DEAD, do_shutdown, LVL_IMPL, SCMD_SHUTDOWN },
{ "sip" , "sip" , POS_RESTING , do_drink , 0, SCMD_SIP }, { "sip", "sip", POS_RESTING, do_drink, 0, SCMD_SIP },
{ "skillset" , "skillset", POS_SLEEPING, do_skillset , LVL_GRGOD, 0 }, { "skillset", "skillset", POS_SLEEPING, do_skillset, LVL_GRGOD, 0 },
{ "sleep" , "sl" , POS_SLEEPING, do_sleep , 0, 0 }, { "sleep", "sl", POS_SLEEPING, do_sleep, 0, 0 },
{ "slist" , "slist" , POS_SLEEPING, do_oasis_list, LVL_BUILDER, SCMD_OASIS_SLIST }, { "slist", "slist", POS_SLEEPING, do_oasis_list, LVL_BUILDER, SCMD_OASIS_SLIST },
{ "sneak" , "sneak" , POS_STANDING, do_sneak , 1, 0 }, { "sneak", "sneak", POS_STANDING, do_sneak, 1, 0 },
{ "snoop" , "snoop" , POS_DEAD , do_snoop , LVL_GOD, 0 }, { "snoop", "snoop", POS_DEAD, do_snoop, LVL_GOD, 0 },
{ "socials" , "socials" , POS_DEAD , do_commands , 0, SCMD_SOCIALS }, { "socials", "socials", POS_DEAD, do_commands, 0, SCMD_SOCIALS },
{ "split" , "split" , POS_SITTING , do_split , 1, 0 }, { "split", "split", POS_SITTING, do_split, 1, 0 },
{ "stand" , "st" , POS_RESTING , do_stand , 0, 0 }, { "stand", "st", POS_RESTING, do_stand, 0, 0 },
{ "stat" , "stat" , POS_DEAD , do_stat , LVL_IMMORT, 0 }, { "stat", "stat", POS_DEAD, do_stat, LVL_IMMORT, 0 },
{ "steal" , "ste" , POS_STANDING, do_steal , 1, 0 }, { "steal", "ste", POS_STANDING, do_steal, 1, 0 },
{ "switch" , "switch" , POS_DEAD , do_switch , LVL_GOD, 0 }, { "switch", "switch", POS_DEAD, do_switch, LVL_GOD, 0 },
{ "tell" , "t" , POS_DEAD , do_tell , 0, 0 }, { "tell", "t", POS_DEAD, do_tell, 0, 0 },
{ "take" , "ta" , POS_RESTING , do_get , 0, 0 }, { "take", "ta", POS_RESTING, do_get, 0, 0 },
{ "taste" , "tas" , POS_RESTING , do_eat , 0, SCMD_TASTE }, { "taste", "tas", POS_RESTING, do_eat, 0, SCMD_TASTE },
{ "teleport" , "tele" , POS_DEAD , do_teleport , LVL_BUILDER, 0 }, { "teleport", "tele", POS_DEAD, do_teleport, LVL_BUILDER, 0 },
{ "tedit" , "tedit" , POS_DEAD , do_tedit , LVL_GOD, 0 }, /* XXX: Oasisify */ { "tedit", "tedit", POS_DEAD, do_tedit, LVL_GOD, 0 }, /* XXX: Oasisify */
{ "thaw" , "thaw" , POS_DEAD , do_wizutil , LVL_GRGOD, SCMD_THAW }, { "thaw", "thaw", POS_DEAD, do_wizutil, LVL_GRGOD, SCMD_THAW },
{ "title" , "title" , POS_DEAD , do_title , 0, 0 }, { "title", "title", POS_DEAD, do_title, 0, 0 },
{ "time" , "time" , POS_DEAD , do_time , 0, 0 }, { "time", "time", POS_DEAD, do_time, 0, 0 },
{ "toggle" , "toggle" , POS_DEAD , do_toggle , 0, 0 }, { "toggle", "toggle", POS_DEAD, do_toggle, 0, 0 },
{ "track" , "track" , POS_STANDING, do_track , 0, 0 }, { "track", "track", POS_STANDING, do_track, 0, 0 },
{ "transfer" , "transfer", POS_SLEEPING, do_trans , LVL_GOD, 0 }, { "transfer", "transfer", POS_SLEEPING, do_trans, LVL_GOD, 0 },
{ "trigedit" , "trigedit", POS_DEAD , do_oasis_trigedit, LVL_BUILDER, 0 }, { "trigedit", "trigedit", POS_DEAD, do_oasis_trigedit, LVL_BUILDER, 0 },
{ "typo" , "typo" , POS_DEAD , do_ibt , 0, SCMD_TYPO }, { "typo", "typo", POS_DEAD, do_ibt, 0, SCMD_TYPO },
{ "tlist" , "tlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_TLIST }, { "tlist", "tlist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_TLIST },
{ "tcopy" , "tcopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_TRIGEDIT }, { "tcopy", "tcopy", POS_DEAD, do_oasis_copy, LVL_GOD, CON_TRIGEDIT },
{ "tstat" , "tstat" , POS_DEAD , do_tstat , LVL_BUILDER, 0 }, { "tstat", "tstat", POS_DEAD, do_tstat, LVL_BUILDER, 0 },
{ "unlock" , "unlock" , POS_SITTING , do_gen_door , 0, SCMD_UNLOCK }, { "unlock", "unlock", POS_SITTING, do_gen_door, 0, SCMD_UNLOCK },
{ "unban" , "unban" , POS_DEAD , do_unban , LVL_GRGOD, 0 }, { "unban", "unban", POS_DEAD, do_unban, LVL_GRGOD, 0 },
{ "unaffect" , "unaffect", POS_DEAD , do_wizutil , LVL_GOD, SCMD_UNAFFECT }, { "unaffect", "unaffect", POS_DEAD, do_wizutil, LVL_GOD, SCMD_UNAFFECT },
{ "unfollow" , "unf" , POS_RESTING , do_unfollow , 0, 0 }, { "unfollow", "unf", POS_RESTING, do_unfollow, 0, 0 },
{ "uptime" , "uptime" , POS_DEAD , do_date , LVL_GOD, SCMD_UPTIME }, { "uptime", "uptime", POS_DEAD, do_date, LVL_GOD, SCMD_UPTIME },
{ "use" , "use" , POS_SITTING , do_use , 1, SCMD_USE }, { "use", "use", POS_SITTING, do_use, 1, SCMD_USE },
{ "users" , "users" , POS_DEAD , do_users , LVL_GOD, 0 }, { "users", "users", POS_DEAD, do_users, LVL_GOD, 0 },
{ "value" , "val" , POS_STANDING, do_not_here , 0, 0 }, { "value", "val", POS_STANDING, do_not_here, 0, 0 },
{ "version" , "ver" , POS_DEAD , do_gen_ps , 0, SCMD_VERSION }, { "version", "ver", POS_DEAD, do_gen_ps, 0, SCMD_VERSION },
{ "visible" , "vis" , POS_RESTING , do_visible , 1, 0 }, { "visible", "vis", POS_RESTING, do_visible, 1, 0 },
{ "vnum" , "vnum" , POS_DEAD , do_vnum , LVL_IMMORT, 0 }, { "vnum", "vnum", POS_DEAD, do_vnum, LVL_IMMORT, 0 },
{ "vstat" , "vstat" , POS_DEAD , do_vstat , LVL_IMMORT, 0 }, { "vstat", "vstat", POS_DEAD, do_vstat, LVL_IMMORT, 0 },
{ "vdelete" , "vdelete" , POS_DEAD , do_vdelete , LVL_BUILDER, 0 }, { "vdelete", "vdelete", POS_DEAD, do_vdelete, LVL_BUILDER, 0 },
{ "wake" , "wake" , POS_SLEEPING, do_wake , 0, 0 }, { "wake", "wake", POS_SLEEPING, do_wake, 0, 0 },
{ "wear" , "wea" , POS_RESTING , do_wear , 0, 0 }, { "wear", "wea", POS_RESTING, do_wear, 0, 0 },
{ "weather" , "weather" , POS_RESTING , do_weather , 0, 0 }, { "weather", "weather", POS_RESTING, do_weather, 0, 0 },
{ "who" , "wh" , POS_DEAD , do_who , 0, 0 }, { "who", "wh", POS_DEAD, do_who, 0, 0 },
{ "whois" , "whoi" , POS_DEAD , do_whois , 0, 0 }, { "whois", "whoi", POS_DEAD, do_whois, 0, 0 },
{ "whoami" , "whoami" , POS_DEAD , do_gen_ps , 0, SCMD_WHOAMI }, { "whoami", "whoami", POS_DEAD, do_gen_ps, 0, SCMD_WHOAMI },
{ "where" , "where" , POS_RESTING , do_where , 1, 0 }, { "where", "where", POS_RESTING, do_where, 1, 0 },
{ "whirlwind", "whirl" , POS_FIGHTING, do_whirlwind, 0, 0 }, { "whirlwind", "whirl", POS_FIGHTING, do_whirlwind, 0, 0 },
{ "whisper" , "whisper" , POS_RESTING , do_spec_comm, 0, SCMD_WHISPER }, { "whisper", "whisper", POS_RESTING, do_spec_comm, 0, SCMD_WHISPER },
{ "wield" , "wie" , POS_RESTING , do_wield , 0, 0 }, { "wield", "wie", POS_RESTING, do_wield, 0, 0 },
{ "withdraw" , "withdraw", POS_STANDING, do_not_here , 1, 0 }, { "withdraw", "withdraw", POS_STANDING, do_not_here, 1, 0 },
{ "wiznet" , "wiz" , POS_DEAD , do_wiznet , LVL_IMMORT, 0 }, { "wiznet", "wiz", POS_DEAD, do_wiznet, LVL_IMMORT, 0 },
{ ";" , ";" , POS_DEAD , do_wiznet , LVL_IMMORT, 0 }, { ";", ";", POS_DEAD, do_wiznet, LVL_IMMORT, 0 },
{ "wizhelp" , "wizhelp" , POS_DEAD , do_wizhelp , LVL_IMMORT, 0 }, { "wizhelp", "wizhelp", POS_DEAD, do_wizhelp, LVL_IMMORT, 0 },
{ "wizlist" , "wizlist" , POS_DEAD , do_gen_ps , 0, SCMD_WIZLIST }, { "wizlist", "wizlist", POS_DEAD, do_gen_ps, 0, SCMD_WIZLIST },
{ "wizupdate", "wizupde" , POS_DEAD , do_wizupdate, LVL_GRGOD, 0 }, { "wizupdate", "wizupde", POS_DEAD, do_wizupdate, LVL_GRGOD, 0 },
{ "wizlock" , "wizlock" , POS_DEAD , do_wizlock , LVL_IMPL, 0 }, { "wizlock", "wizlock", POS_DEAD, do_wizlock, LVL_IMPL, 0 },
{ "write" , "write" , POS_STANDING, do_write , 1, 0 }, { "write", "write", POS_STANDING, do_write, 1, 0 },
{ "zoneresets", "zoner" , POS_DEAD , do_gen_tog , LVL_IMPL, SCMD_ZONERESETS }, { "zoneresets", "zoner", POS_DEAD, do_gen_tog, LVL_IMPL, SCMD_ZONERESETS },
{ "zreset" , "zreset" , POS_DEAD , do_zreset , LVL_BUILDER, 0 }, { "zreset", "zreset", POS_DEAD, do_zreset, LVL_BUILDER, 0 },
{ "zedit" , "zedit" , POS_DEAD , do_oasis_zedit, LVL_BUILDER, 0 }, { "zedit", "zedit", POS_DEAD, do_oasis_zedit, LVL_BUILDER, 0 },
{ "zlist" , "zlist" , POS_DEAD , do_oasis_list, LVL_BUILDER, SCMD_OASIS_ZLIST }, { "zlist", "zlist", POS_DEAD, do_oasis_list, LVL_BUILDER, SCMD_OASIS_ZLIST },
{ "zlock" , "zlock" , POS_DEAD , do_zlock , LVL_GOD, 0 }, { "zlock", "zlock", POS_DEAD, do_zlock, LVL_GOD, 0 },
{ "zunlock" , "zunlock" , POS_DEAD , do_zunlock , LVL_GOD, 0 }, { "zunlock", "zunlock", POS_DEAD, do_zunlock, LVL_GOD, 0 },
{ "zcheck" , "zcheck" , POS_DEAD , do_zcheck , LVL_BUILDER, 0 }, { "zcheck", "zcheck", POS_DEAD, do_zcheck, LVL_BUILDER, 0 },
{ "zpurge" , "zpurge" , POS_DEAD , do_zpurge , LVL_BUILDER, 0 }, { "zpurge", "zpurge", POS_DEAD, do_zpurge, LVL_BUILDER, 0 },
{ "\n", "zzzzzzz", 0, 0, 0, 0 } }; /* this must be last */ { "\n", "zzzzzzz", 0, 0, 0, 0 }
}; /* this must be last */
/* Thanks to Melzaren for this change to allow DG Scripts to be attachable /* Thanks to Melzaren for this change to allow DG Scripts to be attachable
*to player's while still disallowing them to manually use the DG-Commands. */ *to player's while still disallowing them to manually use the DG-Commands. */
static const struct mob_script_command_t mob_script_commands[] = { static const struct mob_script_command_t mob_script_commands[] = {
/* DG trigger commands. minimum_level should be set to -1. */ /* DG trigger commands. minimum_level should be set to -1. */
{ "masound" , do_masound , 0 }, { "masound", do_masound, 0 },
{ "mkill" , do_mkill , 0 }, { "mkill", do_mkill, 0 },
{ "mjunk" , do_mjunk , 0 }, { "mjunk", do_mjunk, 0 },
{ "mdamage" , do_mdamage , 0 }, { "mdamage", do_mdamage, 0 },
{ "mdoor" , do_mdoor , 0 }, { "mdoor", do_mdoor, 0 },
{ "mecho" , do_mecho , 0 }, { "mecho", do_mecho, 0 },
{ "mrecho" , do_mrecho , 0 }, { "mrecho", do_mrecho, 0 },
{ "mechoaround", do_mechoaround , 0 }, { "mechoaround", do_mechoaround, 0 },
{ "msend" , do_msend , 0 }, { "msend", do_msend, 0 },
{ "mload" , do_mload , 0 }, { "mload", do_mload, 0 },
{ "mpurge" , do_mpurge , 0 }, { "mpurge", do_mpurge, 0 },
{ "mgoto" , do_mgoto , 0 }, { "mgoto", do_mgoto, 0 },
{ "mat" , do_mat , 0 }, { "mat", do_mat, 0 },
{ "mteleport", do_mteleport, 0 }, { "mteleport", do_mteleport, 0 },
{ "mforce" , do_mforce , 0 }, { "mforce", do_mforce, 0 },
{ "mhunt" , do_mhunt , 0 }, { "mhunt", do_mhunt, 0 },
{ "mremember", do_mremember, 0 }, { "mremember", do_mremember, 0 },
{ "mforget" , do_mforget , 0 }, { "mforget", do_mforget, 0 },
{ "mtransform", do_mtransform , 0 }, { "mtransform", do_mtransform, 0 },
{ "mzoneecho", do_mzoneecho, 0 }, { "mzoneecho", do_mzoneecho, 0 },
{ "mfollow" , do_mfollow , 0 }, { "mfollow", do_mfollow, 0 },
{ "mlog" , do_mlog , 0 }, { "mlog", do_mlog, 0 },
{ "\n" , do_not_here , 0 } }; { "\n", do_not_here, 0 }
};
int script_command_interpreter(struct char_data *ch, char *arg) { int script_command_interpreter(struct char_data *ch, char *arg)
{
/* DG trigger commands */ /* DG trigger commands */
int i; int i;
@@ -422,8 +425,7 @@ int script_command_interpreter(struct char_data *ch, char *arg) {
return 1; // We took care of execution. Let caller know. return 1; // We took care of execution. Let caller know.
} }
static const char *fill[] = static const char *fill[] = {
{
"in", "in",
"from", "from",
"with", "with",
@@ -434,8 +436,7 @@ static const char *fill[] =
"\n" "\n"
}; };
static const char *reserved[] = static const char *reserved[] = {
{
"a", "a",
"an", "an",
"self", "self",
@@ -532,25 +533,21 @@ void command_interpreter(struct char_data *ch, char *argument)
int found = 0; int found = 0;
send_to_char(ch, "%s", CONFIG_HUH); send_to_char(ch, "%s", CONFIG_HUH);
for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++) for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++) {
{
if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch)) if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch))
continue; continue;
/* Only apply levenshtein counts if the command is not a trigger command. */ /* Only apply levenshtein counts if the command is not a trigger command. */
if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) && if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) &&
(cmd_info[cmd].minimum_level >= 0) ) (cmd_info[cmd].minimum_level >= 0) ) {
{ if (!found) {
if (!found)
{
send_to_char(ch, "\r\nDid you mean:\r\n"); send_to_char(ch, "\r\nDid you mean:\r\n");
found = 1; found = 1;
} }
send_to_char(ch, " %s\r\n", cmd_info[cmd].command); send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
} }
} }
} } else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
send_to_char(ch, "You try, but the mind-numbing cold prevents you...\r\n"); send_to_char(ch, "You try, but the mind-numbing cold prevents you...\r\n");
else if (complete_cmd_info[cmd].command_pointer == NULL) else if (complete_cmd_info[cmd].command_pointer == NULL)
send_to_char(ch, "Sorry, that command hasn't been implemented yet.\r\n"); send_to_char(ch, "Sorry, that command hasn't been implemented yet.\r\n");
@@ -1149,7 +1146,8 @@ static int perform_dupe_check(struct descriptor_data *d)
case RECON: case RECON:
write_to_output(d, "Reconnecting.\r\n"); write_to_output(d, "Reconnecting.\r\n");
act("$n has reconnected.", TRUE, d->character, 0, 0, TO_ROOM); act("$n has reconnected.", TRUE, d->character, 0, 0, TO_ROOM);
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character),
d->host);
if (has_mail(GET_IDNUM(d->character))) if (has_mail(GET_IDNUM(d->character)))
write_to_output(d, "You have mail waiting.\r\n"); write_to_output(d, "You have mail waiting.\r\n");
break; break;
@@ -1163,7 +1161,8 @@ static int perform_dupe_check(struct descriptor_data *d)
break; break;
case UNSWITCH: case UNSWITCH:
write_to_output(d, "Reconnecting to unswitched char."); write_to_output(d, "Reconnecting to unswitched char.");
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character),
d->host);
break; break;
} }
@@ -1295,7 +1294,8 @@ EVENTFUNC(get_protocols)
/* Clear extra white space from the "protocol scroll" */ /* Clear extra white space from the "protocol scroll" */
write_to_output(d, ""); write_to_output(d, "");
len = snprintf(buf, MAX_STRING_LENGTH, "\tO[\toClient\tO] \tw%s\tn | ", d->pProtocol->pVariables[eMSDP_CLIENT_ID]->pValueString); len = snprintf(buf, MAX_STRING_LENGTH, "\tO[\toClient\tO] \tw%s\tn | ",
d->pProtocol->pVariables[eMSDP_CLIENT_ID]->pValueString);
if (d->pProtocol->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt) if (d->pProtocol->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt)
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toColors\tO] \tw256\tn | "); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toColors\tO] \tw256\tn | ");
@@ -1305,7 +1305,8 @@ EVENTFUNC(get_protocols)
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "[Colors] No Color | "); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "[Colors] No Color | ");
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No"); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No");
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ", d->pProtocol->bMSDP ? "Yes" : "No"); len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ",
d->pProtocol->bMSDP ? "Yes" : "No");
snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No"); snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No");
write_to_output(d, buf, 0); write_to_output(d, buf, 0);
@@ -1525,13 +1526,13 @@ void nanny(struct descriptor_data *d, char *arg)
write_to_output(d, "%s", motd); write_to_output(d, "%s", motd);
if (GET_INVIS_LEV(d->character)) if (GET_INVIS_LEV(d->character))
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s has connected. (invis %d)", GET_NAME(d->character), GET_INVIS_LEV(d->character)); mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s has connected. (invis %d)", GET_NAME(d->character),
GET_INVIS_LEV(d->character));
else else
mudlog(BRF, LVL_IMMORT, TRUE, "%s has connected.", GET_NAME(d->character)); mudlog(BRF, LVL_IMMORT, TRUE, "%s has connected.", GET_NAME(d->character));
/* Add to the list of 'recent' players (since last reboot) */ /* Add to the list of 'recent' players (since last reboot) */
if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, FALSE) == FALSE) if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, FALSE) == FALSE) {
{
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE)."); mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
} }
@@ -1554,7 +1555,8 @@ void nanny(struct descriptor_data *d, char *arg)
write_to_output(d, "\r\nIllegal password.\r\nPassword: "); write_to_output(d, "\r\nIllegal password.\r\nPassword: ");
return; return;
} }
strncpy(GET_PASSWD(d->character), CRYPT(arg, GET_PC_NAME(d->character)), MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH+1) */ strncpy(GET_PASSWD(d->character), CRYPT(arg, GET_PC_NAME(d->character)),
MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH+1) */
*(GET_PASSWD(d->character) + MAX_PWD_LENGTH) = '\0'; *(GET_PASSWD(d->character) + MAX_PWD_LENGTH) = '\0';
write_to_output(d, "\r\nPlease retype password: "); write_to_output(d, "\r\nPlease retype password: ");
@@ -1634,15 +1636,14 @@ void nanny(struct descriptor_data *d, char *arg)
mudlog(NRM, LVL_GOD, TRUE, "%s [%s] new player.", GET_NAME(d->character), d->host); mudlog(NRM, LVL_GOD, TRUE, "%s [%s] new player.", GET_NAME(d->character), d->host);
/* Add to the list of 'recent' players (since last reboot) */ /* Add to the list of 'recent' players (since last reboot) */
if (AddRecentPlayer(GET_NAME(d->character), d->host, TRUE, FALSE) == FALSE) if (AddRecentPlayer(GET_NAME(d->character), d->host, TRUE, FALSE) == FALSE) {
{
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE)."); mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
} }
break; break;
case CON_RMOTD: /* read CR after printing motd */ case CON_RMOTD: /* read CR after printing motd */
write_to_output(d, "%s", CONFIG_MENU); write_to_output(d, "%s", CONFIG_MENU);
if (IS_HAPPYHOUR > 0){ if (IS_HAPPYHOUR > 0) {
write_to_output(d, "\r\n"); write_to_output(d, "\r\n");
write_to_output(d, "\tyThere is currently a Happyhour!\tn\r\n"); write_to_output(d, "\tyThere is currently a Happyhour!\tn\r\n");
write_to_output(d, "\r\n"); write_to_output(d, "\r\n");

View File

@@ -66,8 +66,7 @@ struct header_data_type {
}; };
/* size of the data part of a header block */ /* size of the data part of a header block */
#define HEADER_BLOCK_DATASIZE \ #define HEADER_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(struct header_data_type) - sizeof(char))
(BLOCK_SIZE - sizeof(long) - sizeof(struct header_data_type) - sizeof(char))
/* size of the data part of a data block */ /* size of the data part of a data block */
#define DATA_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(char)) #define DATA_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(char))

View File

@@ -107,7 +107,7 @@ struct oasis_olc_data {
int trigger_position; int trigger_position;
int item_type; int item_type;
struct trig_proto_list *script; /* for assigning triggers in [r|o|m]edit*/ struct trig_proto_list *script; /* for assigning triggers in [r|o|m]edit*/
struct help_index_element*help; /* Hedit uses this */ struct help_index_element *help; /* Hedit uses this */
}; };
/* Exported globals. */ /* Exported globals. */

3
src/prefedit.h Executable file → Normal file
View File

@@ -10,8 +10,7 @@
**************************************************************************/ **************************************************************************/
/* Toggle structure held for OLC purposes */ /* Toggle structure held for OLC purposes */
struct prefs_data struct prefs_data {
{
struct char_data *ch; /* Pointer to char being edited */ struct char_data *ch; /* Pointer to char being edited */
int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */ int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */
int wimp_level; /* Copy of player's wimp level */ int wimp_level; /* Copy of player's wimp level */

View File

@@ -71,22 +71,19 @@ typedef struct descriptor_data descriptor_t;
Types. Types.
******************************************************************************/ ******************************************************************************/
typedef enum typedef enum {
{
false, false,
true true
} bool_t; } bool_t;
typedef enum typedef enum {
{
eUNKNOWN, eUNKNOWN,
eNO, eNO,
eSOMETIMES, eSOMETIMES,
eYES eYES
} support_t; } support_t;
typedef enum typedef enum {
{
eMSDP_NONE = -1, /* This must always be first. */ eMSDP_NONE = -1, /* This must always be first. */
/* General */ /* General */
@@ -165,8 +162,7 @@ typedef enum
eMSDP_MAX /* This must always be last */ eMSDP_MAX /* This must always be last */
} variable_t; } variable_t;
typedef struct typedef struct {
{
variable_t Variable; /* The enum type of this variable */ variable_t Variable; /* The enum type of this variable */
const char *pName; /* The string name of this variable */ const char *pName; /* The string name of this variable */
bool_t bString; /* Is this variable a string or a number? */ bool_t bString; /* Is this variable a string or a number? */
@@ -179,23 +175,20 @@ typedef struct
const char *pDefault; /* The default value for a string */ const char *pDefault; /* The default value for a string */
} variable_name_t; } variable_name_t;
typedef struct typedef struct {
{
bool_t bReport; /* Is this variable being reported? */ bool_t bReport; /* Is this variable being reported? */
bool_t bDirty; /* Does this variable need to be sent again? */ bool_t bDirty; /* Does this variable need to be sent again? */
int ValueInt; /* The numeric value of the variable */ int ValueInt; /* The numeric value of the variable */
char *pValueString; /* The string value of the variable */ char *pValueString; /* The string value of the variable */
} MSDP_t; } MSDP_t;
typedef struct typedef struct {
{
const char *pName; /* The name of the MSSP variable */ const char *pName; /* The name of the MSSP variable */
const char *pValue; /* The value of the MSSP variable */ const char *pValue; /* The value of the MSSP variable */
const char *(*pFunction)(void); /* Optional function to return the value */ const char *(*pFunction)(void); /* Optional function to return the value */
} MSSP_t; } MSSP_t;
typedef struct typedef struct {
{
int WriteOOB; /* Used internally to indicate OOB data */ int WriteOOB; /* Used internally to indicate OOB data */
bool_t bIACMode; /* Current mode - deals with broken packets */ bool_t bIACMode; /* Current mode - deals with broken packets */
bool_t bNegotiated; /* Indicates client successfully negotiated */ bool_t bNegotiated; /* Indicates client successfully negotiated */

View File

@@ -47,7 +47,8 @@ const char *aq_flags[] = {
static int cmd_tell; static int cmd_tell;
static const char *quest_cmd[] = { static const char *quest_cmd[] = {
"list", "history", "join", "leave", "progress", "status", "\n"}; "list", "history", "join", "leave", "progress", "status", "\n"
};
static const char *quest_mort_usage = static const char *quest_mort_usage =
"Usage: quest list | history | progress | join <nn> | leave"; "Usage: quest list | history | progress | join <nn> | leave";
@@ -102,7 +103,7 @@ void destroy_quests(void)
if (!aquest_table) if (!aquest_table)
return; return;
for (rnum = 0; rnum < total_quests; rnum++){ for (rnum = 0; rnum < total_quests; rnum++) {
free_quest_strings(&aquest_table[rnum]); free_quest_strings(&aquest_table[rnum]);
} }
free(aquest_table); free(aquest_table);
@@ -487,7 +488,8 @@ static void quest_hist(struct char_data *ch)
for (i = 0; i < GET_NUM_QUESTS(ch); i++) { for (i = 0; i < GET_NUM_QUESTS(ch); i++) {
if ((rnum = real_quest(ch->player_specials->saved.completed_quests[i])) != NOTHING) if ((rnum = real_quest(ch->player_specials->saved.completed_quests[i])) != NOTHING)
send_to_char(ch, "\tg%4d\tn) \tc%-52.52s\tn \ty%s\tn\r\n", send_to_char(ch, "\tg%4d\tn) \tc%-52.52s\tn \ty%s\tn\r\n",
++counter, QST_DESC(rnum), (real_mobile(QST_MASTER(rnum)) == NOBODY) ? "Unknown" : GET_NAME(&mob_proto[(real_mobile(QST_MASTER(rnum)))])); ++counter, QST_DESC(rnum), (real_mobile(QST_MASTER(rnum)) == NOBODY) ? "Unknown" : GET_NAME(&mob_proto[(real_mobile(
QST_MASTER(rnum)))]));
else else
send_to_char(ch, send_to_char(ch,
"\tg%4d\tn) \tcUnknown Quest (it no longer exists)\tn\r\n", ++counter); "\tg%4d\tn) \tcUnknown Quest (it no longer exists)\tn\r\n", ++counter);

View File

@@ -212,9 +212,7 @@ struct spell_info_type {
#define SPELL_TYPE_STAFF 3 #define SPELL_TYPE_STAFF 3
#define SPELL_TYPE_SCROLL 4 #define SPELL_TYPE_SCROLL 4
#define ASPELL(spellname) \ #define ASPELL(spellname) void spellname(int level, struct char_data *ch, struct char_data *victim, struct obj_data *obj)
void spellname(int level, struct char_data *ch, \
struct char_data *victim, struct obj_data *obj)
#define MANUAL_SPELL(spellname) spellname(level, caster, cvict, ovict); #define MANUAL_SPELL(spellname) spellname(level, caster, cvict, ovict);
@@ -233,11 +231,9 @@ ASPELL(spell_detect_poison);
int find_skill_num(char *name); int find_skill_num(char *name);
int mag_damage(int level, struct char_data *ch, struct char_data *victim, int mag_damage(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
int spellnum, int savetype);
void mag_affects(int level, struct char_data *ch, struct char_data *victim, void mag_affects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
int spellnum, int savetype);
void mag_groups(int level, struct char_data *ch, int spellnum, int savetype); void mag_groups(int level, struct char_data *ch, int spellnum, int savetype);
@@ -247,28 +243,21 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype);
void mag_rooms(int level, struct char_data *ch, int spellnum); void mag_rooms(int level, struct char_data *ch, int spellnum);
void mag_summons(int level, struct char_data *ch, struct obj_data *obj, void mag_summons(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int savetype);
int spellnum, int savetype);
void mag_points(int level, struct char_data *ch, struct char_data *victim, void mag_points(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
int spellnum, int savetype);
void mag_unaffects(int level, struct char_data *ch, struct char_data *victim, void mag_unaffects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int type);
int spellnum, int type);
void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj, void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int type);
int spellnum, int type);
void mag_creations(int level, struct char_data *ch, int spellnum); void mag_creations(int level, struct char_data *ch, int spellnum);
int call_magic(struct char_data *caster, struct char_data *cvict, int call_magic(struct char_data *caster, struct char_data *cvict, struct obj_data *ovict, int spellnum, int level, int casttype);
struct obj_data *ovict, int spellnum, int level, int casttype);
void mag_objectmagic(struct char_data *ch, struct obj_data *obj, void mag_objectmagic(struct char_data *ch, struct obj_data *obj, char *argument);
char *argument);
int cast_spell(struct char_data *ch, struct char_data *tch, int cast_spell(struct char_data *ch, struct char_data *tch, struct obj_data *tobj, int spellnum);
struct obj_data *tobj, int spellnum);
/* other prototypes */ /* other prototypes */
void spell_level(int spell, int chclass, int level); void spell_level(int spell, int chclass, int level);

View File

@@ -47,8 +47,7 @@
#endif #endif
/** Function macro for the mob, obj and room special functions */ /** Function macro for the mob, obj and room special functions */
#define SPECIAL(name) \ #define SPECIAL(name) int (name)(struct char_data *ch, void *me, int cmd, char *argument)
int (name)(struct char_data *ch, void *me, int cmd, char *argument)
/* room-related defines */ /* room-related defines */
/* The cardinal directions: used as index to room_data.dir_option[] */ /* The cardinal directions: used as index to room_data.dir_option[] */
@@ -659,8 +658,7 @@ typedef unsigned long int bitvector_t;
* the mob, object or room. * the mob, object or room.
* Multiple extra descriptions on the same object are implemented as a * Multiple extra descriptions on the same object are implemented as a
* linked list. */ * linked list. */
struct extra_descr_data struct extra_descr_data {
{
char *keyword; /**< Keyword for look/examine */ char *keyword; /**< Keyword for look/examine */
char *description; /**< What is shown when this keyword is 'seen' */ char *description; /**< What is shown when this keyword is 'seen' */
struct extra_descr_data *next; /**< Next description for this mob/obj/room */ struct extra_descr_data *next; /**< Next description for this mob/obj/room */
@@ -674,8 +672,7 @@ struct extra_descr_data
/** object flags used in obj_data. These represent the instance values for /** object flags used in obj_data. These represent the instance values for
* a real object, values that can change during gameplay. */ * a real object, values that can change during gameplay. */
struct obj_flag_data struct obj_flag_data {
{
int value[NUM_OBJ_VAL_POSITIONS]; /**< Values of the item (see list) */ int value[NUM_OBJ_VAL_POSITIONS]; /**< Values of the item (see list) */
byte type_flag; /**< Type of item */ byte type_flag; /**< Type of item */
int level; /**< Minimum level to use object */ int level; /**< Minimum level to use object */
@@ -690,15 +687,13 @@ struct obj_flag_data
/** Used in obj_file_elem. DO NOT CHANGE if you are using binary object files /** Used in obj_file_elem. DO NOT CHANGE if you are using binary object files
* and already have a player base and don't want to do a player wipe. */ * and already have a player base and don't want to do a player wipe. */
struct obj_affected_type struct obj_affected_type {
{
byte location; /**< Which ability to change (APPLY_XXX) */ byte location; /**< Which ability to change (APPLY_XXX) */
sbyte modifier; /**< How much it changes by */ sbyte modifier; /**< How much it changes by */
}; };
/** The Object structure. */ /** The Object structure. */
struct obj_data struct obj_data {
{
obj_rnum item_number; /**< The unique id of this object instance. */ obj_rnum item_number; /**< The unique id of this object instance. */
room_rnum in_room; /**< What room is the object lying in, or -1? */ room_rnum in_room; /**< What room is the object lying in, or -1? */
@@ -731,8 +726,7 @@ struct obj_data
/** Instance info for an object that gets saved to disk. /** Instance info for an object that gets saved to disk.
* DO NOT CHANGE if you are using binary object files * DO NOT CHANGE if you are using binary object files
* and already have a player base and don't want to do a player wipe. */ * and already have a player base and don't want to do a player wipe. */
struct obj_file_elem struct obj_file_elem {
{
obj_vnum item_number; /**< The prototype, non-unique info for this object. */ obj_vnum item_number; /**< The prototype, non-unique info for this object. */
#if USE_AUTOEQ #if USE_AUTOEQ
@@ -754,8 +748,7 @@ struct obj_file_elem
* int datatype. * int datatype.
* NOTE: This is *not* used with the ascii playerfiles. * NOTE: This is *not* used with the ascii playerfiles.
* NOTE 2: This structure appears to be unused in this codebase? */ * NOTE 2: This structure appears to be unused in this codebase? */
struct rent_info struct rent_info {
{
int time; int time;
int rentcode; /**< How this character rented */ int rentcode; /**< How this character rented */
int net_cost_per_diem; /**< ? Appears to be unused ? */ int net_cost_per_diem; /**< ? Appears to be unused ? */
@@ -775,8 +768,7 @@ struct rent_info
/* room-related structures */ /* room-related structures */
/** Direction (north, south, east...) information for rooms. */ /** Direction (north, south, east...) information for rooms. */
struct room_direction_data struct room_direction_data {
{
char *general_description; /**< Show to char looking in this direction. */ char *general_description; /**< Show to char looking in this direction. */
char *keyword; /**< for interacting (open/close) this direction */ char *keyword; /**< for interacting (open/close) this direction */
@@ -787,8 +779,7 @@ struct room_direction_data
}; };
/** The Room Structure. */ /** The Room Structure. */
struct room_data struct room_data {
{
room_vnum number; /**< Rooms number (vnum) */ room_vnum number; /**< Rooms number (vnum) */
zone_rnum zone; /**< Room zone (for resetting) */ zone_rnum zone; /**< Room zone (for resetting) */
int sector_type; /**< sector type (move/hide) */ int sector_type; /**< sector type (move/hide) */
@@ -809,8 +800,7 @@ struct room_data
/* char-related structures */ /* char-related structures */
/** Memory structure used by NPCs to remember specific PCs. */ /** Memory structure used by NPCs to remember specific PCs. */
struct memory_rec_struct struct memory_rec_struct {
{
long id; /**< The PC id to remember. */ long id; /**< The PC id to remember. */
struct memory_rec_struct *next; /**< Next PC to remember */ struct memory_rec_struct *next; /**< Next PC to remember */
}; };
@@ -820,8 +810,7 @@ typedef struct memory_rec_struct memory_rec;
/** This structure is purely intended to be an easy way to transfer and return /** This structure is purely intended to be an easy way to transfer and return
* information about time (real or mudwise). */ * information about time (real or mudwise). */
struct time_info_data struct time_info_data {
{
int hours; /**< numeric hour */ int hours; /**< numeric hour */
int day; /**< numeric day */ int day; /**< numeric day */
int month; /**< numeric month */ int month; /**< numeric month */
@@ -829,16 +818,14 @@ struct time_info_data
}; };
/** Player specific time information. */ /** Player specific time information. */
struct time_data struct time_data {
{
time_t birth; /**< Represents the PCs birthday, used to calculate age. */ time_t birth; /**< Represents the PCs birthday, used to calculate age. */
time_t logon; /**< Time of the last logon, used to calculate time played */ time_t logon; /**< Time of the last logon, used to calculate time played */
int played; /**< This is the total accumulated time played in secs */ int played; /**< This is the total accumulated time played in secs */
}; };
/* Group Data Struct */ /* Group Data Struct */
struct group_data struct group_data {
{
struct char_data * leader; struct char_data * leader;
struct list_data * members; struct list_data * members;
int group_flags; int group_flags;
@@ -848,15 +835,13 @@ struct group_data
/** The pclean_criteria_data is set up in config.c and used in db.c to determine /** The pclean_criteria_data is set up in config.c and used in db.c to determine
* the conditions which will cause a player character to be deleted from disk * the conditions which will cause a player character to be deleted from disk
* if the automagic pwipe system is enabled (see config.c). */ * if the automagic pwipe system is enabled (see config.c). */
struct pclean_criteria_data struct pclean_criteria_data {
{
int level; /**< PC level and below to check for deletion */ int level; /**< PC level and below to check for deletion */
int days; /**< time limit in days, for this level of PC */ int days; /**< time limit in days, for this level of PC */
}; };
/** General info used by PC's and NPC's. */ /** General info used by PC's and NPC's. */
struct char_player_data struct char_player_data {
{
char passwd[MAX_PWD_LENGTH+1]; /**< PC's password */ char passwd[MAX_PWD_LENGTH+1]; /**< PC's password */
char *name; /**< PC / NPC name */ char *name; /**< PC / NPC name */
char *short_descr; /**< NPC 'actions' */ char *short_descr; /**< NPC 'actions' */
@@ -874,8 +859,7 @@ struct char_player_data
/** Character abilities. Different instances of this structure are used for /** Character abilities. Different instances of this structure are used for
* both inherent and current ability scores (like when poison affects the * both inherent and current ability scores (like when poison affects the
* player strength). */ * player strength). */
struct char_ability_data struct char_ability_data {
{
sbyte str; /**< Strength. */ sbyte str; /**< Strength. */
sbyte str_add; /**< Strength multiplier if str = 18. Usually from 0 to 100 */ sbyte str_add; /**< Strength multiplier if str = 18. Usually from 0 to 100 */
sbyte intel; /**< Intelligence */ sbyte intel; /**< Intelligence */
@@ -886,8 +870,7 @@ struct char_ability_data
}; };
/** Character 'points', or health statistics. */ /** Character 'points', or health statistics. */
struct char_point_data struct char_point_data {
{
sh_int mana; /**< Current mana level */ sh_int mana; /**< Current mana level */
sh_int max_mana; /**< Max mana level */ sh_int max_mana; /**< Max mana level */
sh_int hit; /**< Curent hit point, or health, level */ sh_int hit; /**< Curent hit point, or health, level */
@@ -911,8 +894,7 @@ struct char_point_data
/** char_special_data_saved: specials which both a PC and an NPC have in /** char_special_data_saved: specials which both a PC and an NPC have in
* common, but which must be saved to the players file for PC's. */ * common, but which must be saved to the players file for PC's. */
struct char_special_data_saved struct char_special_data_saved {
{
int alignment; /**< -1000 (evil) to 1000 (good) range. */ int alignment; /**< -1000 (evil) to 1000 (good) range. */
long idnum; /**< PC's idnum; -1 for mobiles. */ long idnum; /**< PC's idnum; -1 for mobiles. */
int act[PM_ARRAY_MAX]; /**< act flags for NPC's; player flag for PC's */ int act[PM_ARRAY_MAX]; /**< act flags for NPC's; player flag for PC's */
@@ -921,8 +903,7 @@ struct char_special_data_saved
}; };
/** Special playing constants shared by PCs and NPCs which aren't in pfile */ /** Special playing constants shared by PCs and NPCs which aren't in pfile */
struct char_special_data struct char_special_data {
{
struct char_data *fighting; /**< Target of fight; else NULL */ struct char_data *fighting; /**< Target of fight; else NULL */
struct char_data *hunting; /**< Target of NPC hunt; else NULL */ struct char_data *hunting; /**< Target of NPC hunt; else NULL */
struct obj_data *furniture; /**< Object being sat on/in; else NULL */ struct obj_data *furniture; /**< Object being sat on/in; else NULL */
@@ -938,8 +919,7 @@ struct char_special_data
}; };
/** Data only needed by PCs, and needs to be saved to disk. */ /** Data only needed by PCs, and needs to be saved to disk. */
struct player_special_data_saved struct player_special_data_saved {
{
byte skills[MAX_SKILLS+1]; /**< Character skills. */ byte skills[MAX_SKILLS+1]; /**< Character skills. */
int wimp_level; /**< Below this # of hit points, flee! */ int wimp_level; /**< Below this # of hit points, flee! */
byte freeze_level; /**< Level of god who froze char, if any */ byte freeze_level; /**< Level of god who froze char, if any */
@@ -954,7 +934,7 @@ struct player_special_data_saved
int spells_to_learn; /**< Remaining number of practice sessions */ int spells_to_learn; /**< Remaining number of practice sessions */
int olc_zone; /**< Current olc permissions */ int olc_zone; /**< Current olc permissions */
int questpoints; /**< Number of quest points earned */ int questpoints; /**< Number of quest points earned */
qst_vnum *completed_quests; /**< Quests completed */ qst_vnum *completed_quests;/**< Quests completed */
int num_completed_quests; /**< Number completed */ int num_completed_quests; /**< Number completed */
int current_quest; /**< vnum of current quest */ int current_quest; /**< vnum of current quest */
int quest_time; /**< time left on current quest */ int quest_time; /**< time left on current quest */
@@ -966,13 +946,12 @@ struct player_special_data_saved
/** Specials needed only by PCs, not NPCs. Space for this structure is /** Specials needed only by PCs, not NPCs. Space for this structure is
* not allocated in memory for NPCs, but it is for PCs and the portion * not allocated in memory for NPCs, but it is for PCs and the portion
* of it labelled 'saved' is saved in the players file. */ * of it labelled 'saved' is saved in the players file. */
struct player_special_data struct player_special_data {
{
struct player_special_data_saved saved; /**< Information to be saved. */ struct player_special_data_saved saved; /**< Information to be saved. */
char *poofin; /**< Description displayed to room on arrival of a god. */ char *poofin; /**< Description displayed to room on arrival of a god. */
char *poofout; /**< Description displayed to room at a god's exit. */ char *poofout; /**< Description displayed to room at a god's exit. */
struct alias_data *aliases; /**< Command aliases */ struct alias_data *aliases;/**< Command aliases */
long last_tell; /**< idnum of PC who last told this PC, used to reply */ long last_tell; /**< idnum of PC who last told this PC, used to reply */
void *last_olc_targ; /**< ? Currently Unused ? */ void *last_olc_targ; /**< ? Currently Unused ? */
int last_olc_mode; /**< ? Currently Unused ? */ int last_olc_mode; /**< ? Currently Unused ? */
@@ -981,8 +960,7 @@ struct player_special_data
}; };
/** Special data used by NPCs, not PCs */ /** Special data used by NPCs, not PCs */
struct mob_special_data struct mob_special_data {
{
memory_rec *memory; /**< List of PCs to remember */ memory_rec *memory; /**< List of PCs to remember */
byte attack_type; /**< The primary attack type (bite, sting, hit, etc.) */ byte attack_type; /**< The primary attack type (bite, sting, hit, etc.) */
byte default_pos; /**< Default position (standing, sleeping, etc.) */ byte default_pos; /**< Default position (standing, sleeping, etc.) */
@@ -991,8 +969,7 @@ struct mob_special_data
}; };
/** An affect structure. */ /** An affect structure. */
struct affected_type struct affected_type {
{
sh_int spell; /**< The spell that caused this */ sh_int spell; /**< The spell that caused this */
sh_int duration; /**< For how long its effects will last */ sh_int duration; /**< For how long its effects will last */
sbyte modifier; /**< Added/subtracted to/from apropriate ability */ sbyte modifier; /**< Added/subtracted to/from apropriate ability */
@@ -1004,15 +981,13 @@ struct affected_type
/** The list element that makes up a list of characters following this /** The list element that makes up a list of characters following this
* character. */ * character. */
struct follow_type struct follow_type {
{
struct char_data *follower; /**< Character directly following. */ struct char_data *follower; /**< Character directly following. */
struct follow_type *next; /**< Next character following. */ struct follow_type *next; /**< Next character following. */
}; };
/** Master structure for PCs and NPCs. */ /** Master structure for PCs and NPCs. */
struct char_data struct char_data {
{
int pfilepos; /**< PC playerfile pos and id number */ int pfilepos; /**< PC playerfile pos and id number */
mob_rnum nr; /**< NPC real instance number */ mob_rnum nr; /**< NPC real instance number */
room_rnum in_room; /**< Current location (real room number) */ room_rnum in_room; /**< Current location (real room number) */
@@ -1053,16 +1028,14 @@ struct char_data
}; };
/** descriptor-related structures */ /** descriptor-related structures */
struct txt_block struct txt_block {
{
char *text; /**< ? */ char *text; /**< ? */
int aliased; /**< ? */ int aliased; /**< ? */
struct txt_block *next; /**< ? */ struct txt_block *next; /**< ? */
}; };
/** ? */ /** ? */
struct txt_q struct txt_q {
{
struct txt_block *head; /**< ? */ struct txt_block *head; /**< ? */
struct txt_block *tail; /**< ? */ struct txt_block *tail; /**< ? */
}; };
@@ -1070,8 +1043,7 @@ struct txt_q
/** Master structure players. Holds the real players connection to the mud. /** Master structure players. Holds the real players connection to the mud.
* An analogy is the char_data is the body of the character, the descriptor_data * An analogy is the char_data is the body of the character, the descriptor_data
* is the soul. */ * is the soul. */
struct descriptor_data struct descriptor_data {
{
socket_t descriptor; /**< file descriptor for socket */ socket_t descriptor; /**< file descriptor for socket */
char host[HOST_LENGTH+1]; /**< hostname */ char host[HOST_LENGTH+1]; /**< hostname */
byte bad_pws; /**< number of bad pw attemps this login */ byte bad_pws; /**< number of bad pw attemps this login */
@@ -1112,16 +1084,14 @@ struct descriptor_data
/* other miscellaneous structures */ /* other miscellaneous structures */
/** Fight message display. This structure is used to hold the information to /** Fight message display. This structure is used to hold the information to
* be displayed for every different violent hit type. */ * be displayed for every different violent hit type. */
struct msg_type struct msg_type {
{
char *attacker_msg; /**< Message displayed to attecker. */ char *attacker_msg; /**< Message displayed to attecker. */
char *victim_msg; /**< Message displayed to victim. */ char *victim_msg; /**< Message displayed to victim. */
char *room_msg; /**< Message displayed to rest of players in room. */ char *room_msg; /**< Message displayed to rest of players in room. */
}; };
/** An entire message structure for a type of hit or spell or skill. */ /** An entire message structure for a type of hit or spell or skill. */
struct message_type struct message_type {
{
struct msg_type die_msg; /**< Messages for death strikes. */ struct msg_type die_msg; /**< Messages for death strikes. */
struct msg_type miss_msg; /**< Messages for missed strikes. */ struct msg_type miss_msg; /**< Messages for missed strikes. */
struct msg_type hit_msg; /**< Messages for a succesful strike. */ struct msg_type hit_msg; /**< Messages for a succesful strike. */
@@ -1130,16 +1100,14 @@ struct message_type
}; };
/** Head of list of messages for an attack type. */ /** Head of list of messages for an attack type. */
struct message_list struct message_list {
{
int a_type; /**< The id of this attack type. */ int a_type; /**< The id of this attack type. */
int number_of_attacks; /**< How many attack messages to chose from. */ int number_of_attacks; /**< How many attack messages to chose from. */
struct message_type *msg; /**< List of messages. */ struct message_type *msg; /**< List of messages. */
}; };
/** Social message data structure. */ /** Social message data structure. */
struct social_messg struct social_messg {
{
int act_nr; /**< The social id. */ int act_nr; /**< The social id. */
char *command; /**< The command to activate (smile, wave, etc.) */ char *command; /**< The command to activate (smile, wave, etc.) */
char *sort_as; /**< Priority of social sorted by this. */ char *sort_as; /**< Priority of social sorted by this. */
@@ -1176,8 +1144,7 @@ struct social_messg
/** Describes bonuses, or negatives, applied to thieves skills. In practice /** Describes bonuses, or negatives, applied to thieves skills. In practice
* this list is tied to the character's dexterity attribute. */ * this list is tied to the character's dexterity attribute. */
struct dex_skill_type struct dex_skill_type {
{
sh_int p_pocket; /**< Alters the success rate of pick pockets */ sh_int p_pocket; /**< Alters the success rate of pick pockets */
sh_int p_locks; /**< Alters the success of pick locks */ sh_int p_locks; /**< Alters the success of pick locks */
sh_int traps; /**< Historically alters the success of trap finding. */ sh_int traps; /**< Historically alters the success of trap finding. */
@@ -1187,8 +1154,7 @@ struct dex_skill_type
/** Describes the bonuses applied for a specific value of a character's /** Describes the bonuses applied for a specific value of a character's
* strength attribute. */ * strength attribute. */
struct dex_app_type struct dex_app_type {
{
sh_int reaction; /**< Historically affects reaction savings throws. */ sh_int reaction; /**< Historically affects reaction savings throws. */
sh_int miss_att; /**< Historically affects missile attacks */ sh_int miss_att; /**< Historically affects missile attacks */
sh_int defensive; /**< Alters character's inherent armor class */ sh_int defensive; /**< Alters character's inherent armor class */
@@ -1196,8 +1162,7 @@ struct dex_app_type
/** Describes the bonuses applied for a specific value of a character's /** Describes the bonuses applied for a specific value of a character's
* strength attribute. */ * strength attribute. */
struct str_app_type struct str_app_type {
{
sh_int tohit; /**< To Hit (THAC0) Bonus/Penalty */ sh_int tohit; /**< To Hit (THAC0) Bonus/Penalty */
sh_int todam; /**< Damage Bonus/Penalty */ sh_int todam; /**< Damage Bonus/Penalty */
sh_int carry_w; /**< Maximum weight that can be carrried */ sh_int carry_w; /**< Maximum weight that can be carrried */
@@ -1206,29 +1171,25 @@ struct str_app_type
/** Describes the bonuses applied for a specific value of a character's /** Describes the bonuses applied for a specific value of a character's
* wisdom attribute. */ * wisdom attribute. */
struct wis_app_type struct wis_app_type {
{
byte bonus; /**< how many practices player gains per lev */ byte bonus; /**< how many practices player gains per lev */
}; };
/** Describes the bonuses applied for a specific value of a character's /** Describes the bonuses applied for a specific value of a character's
* intelligence attribute. */ * intelligence attribute. */
struct int_app_type struct int_app_type {
{
byte learn; /**< how many % a player learns a spell/skill */ byte learn; /**< how many % a player learns a spell/skill */
}; };
/** Describes the bonuses applied for a specific value of a /** Describes the bonuses applied for a specific value of a
* character's constitution attribute. */ * character's constitution attribute. */
struct con_app_type struct con_app_type {
{
sh_int hitp; /**< Added to a character's new MAXHP at each new level. */ sh_int hitp; /**< Added to a character's new MAXHP at each new level. */
}; };
/** Stores, and used to deliver, the current weather information /** Stores, and used to deliver, the current weather information
* in the mud world. */ * in the mud world. */
struct weather_data struct weather_data {
{
int pressure; /**< How is the pressure ( Mb )? */ int pressure; /**< How is the pressure ( Mb )? */
int change; /**< How fast and what way does it change? */ int change; /**< How fast and what way does it change? */
int sky; /**< How is the sky? */ int sky; /**< How is the sky? */
@@ -1237,8 +1198,7 @@ struct weather_data
/** Element in monster and object index-tables. /** Element in monster and object index-tables.
NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum) */ NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum) */
struct index_data struct index_data {
{
mob_vnum vnum; /**< virtual number of this mob/obj */ mob_vnum vnum; /**< virtual number of this mob/obj */
int number; /**< number of existing units of this mob/obj */ int number; /**< number of existing units of this mob/obj */
/** Point to any SPECIAL function assoicated with mob/obj. /** Point to any SPECIAL function assoicated with mob/obj.
@@ -1247,18 +1207,16 @@ struct index_data
SPECIAL(*func); SPECIAL(*func);
char *farg; /**< String argument for special function. */ char *farg; /**< String argument for special function. */
struct trig_data *proto; /**< Points to the trigger prototype. */ struct trig_data *proto;/**< Points to the trigger prototype. */
}; };
/** Master linked list for the mob/object prototype trigger lists. */ /** Master linked list for the mob/object prototype trigger lists. */
struct trig_proto_list struct trig_proto_list {
{
int vnum; /**< vnum of the trigger */ int vnum; /**< vnum of the trigger */
struct trig_proto_list *next; /**< next trigger */ struct trig_proto_list *next; /**< next trigger */
}; };
struct guild_info_type struct guild_info_type {
{
int pc_class; int pc_class;
room_vnum guild_room; room_vnum guild_room;
int direction; int direction;
@@ -1273,8 +1231,7 @@ struct happyhour {
}; };
/** structure for list of recent players (see 'recent' command) */ /** structure for list of recent players (see 'recent' command) */
struct recent_player struct recent_player {
{
int vnum; /* The ID number for this instance */ int vnum; /* The ID number for this instance */
char name[MAX_NAME_LENGTH+1];/* The char name of the player */ char name[MAX_NAME_LENGTH+1];/* The char name of the player */
bool new_player; /* Is this a new player? */ bool new_player; /* Is this a new player? */
@@ -1288,8 +1245,7 @@ struct recent_player
/** The game configuration structure used for configurating the game play /** The game configuration structure used for configurating the game play
* variables. */ * variables. */
struct game_data struct game_data {
{
int pk_allowed; /**< Is player killing allowed? */ int pk_allowed; /**< Is player killing allowed? */
int pt_allowed; /**< Is player thieving allowed? */ int pt_allowed; /**< Is player thieving allowed? */
int level_can_shout; /**< Level player must be to shout. */ int level_can_shout; /**< Level player must be to shout. */
@@ -1320,8 +1276,7 @@ struct game_data
}; };
/** The rent and crashsave options. */ /** The rent and crashsave options. */
struct crash_save_data struct crash_save_data {
{
int free_rent; /**< Should the MUD allow rent for free? */ int free_rent; /**< Should the MUD allow rent for free? */
int max_obj_save; /**< Max items players can rent. */ int max_obj_save; /**< Max items players can rent. */
int min_rent_cost; /**< surcharge on top of item costs. */ int min_rent_cost; /**< surcharge on top of item costs. */
@@ -1333,8 +1288,7 @@ struct crash_save_data
/** Important room numbers. This structure stores vnums, not real array /** Important room numbers. This structure stores vnums, not real array
* numbers. */ * numbers. */
struct room_numbers struct room_numbers {
{
room_vnum mortal_start_room; /**< vnum of room that mortals enter at. */ room_vnum mortal_start_room; /**< vnum of room that mortals enter at. */
room_vnum immort_start_room; /**< vnum of room that immorts enter at. */ room_vnum immort_start_room; /**< vnum of room that immorts enter at. */
room_vnum frozen_start_room; /**< vnum of room that frozen ppl enter. */ room_vnum frozen_start_room; /**< vnum of room that frozen ppl enter. */
@@ -1344,8 +1298,7 @@ struct room_numbers
}; };
/** Operational game variables. */ /** Operational game variables. */
struct game_operation struct game_operation {
{
ush_int DFLT_PORT; /**< The default port to run the game. */ ush_int DFLT_PORT; /**< The default port to run the game. */
char *DFLT_IP; /**< Bind to all interfaces. */ char *DFLT_IP; /**< Bind to all interfaces. */
char *DFLT_DIR; /**< The default directory (lib). */ char *DFLT_DIR; /**< The default directory (lib). */
@@ -1368,8 +1321,7 @@ struct game_operation
}; };
/** The Autowizard options. */ /** The Autowizard options. */
struct autowiz_data struct autowiz_data {
{
int use_autowiz; /**< Use the autowiz feature? */ int use_autowiz; /**< Use the autowiz feature? */
int min_wizlist_lev; /**< Minimun level to show on wizlist. */ int min_wizlist_lev; /**< Minimun level to show on wizlist. */
}; };
@@ -1383,8 +1335,7 @@ struct autowiz_data
If changes are made to values of the elements of this structure during game If changes are made to values of the elements of this structure during game
play, the information will be saved to disk. play, the information will be saved to disk.
*/ */
struct config_data struct config_data {
{
/** Path to on-disk file where the config_data structure gets written. */ /** Path to on-disk file where the config_data structure gets written. */
char *CONFFILE; char *CONFFILE;
/** In-game specific global settings, such as allowing player killing. */ /** In-game specific global settings, such as allowing player killing. */

View File

@@ -303,10 +303,10 @@ struct in_addr {
/* SOCKET -- must be after the winsock.h #include. */ /* SOCKET -- must be after the winsock.h #include. */
#ifdef CIRCLE_WINDOWS #ifdef CIRCLE_WINDOWS
# define CLOSE_SOCKET(sock) closesocket(sock) # define CLOSE_SOCKET(sock) closesocket(sock)
typedef SOCKET socket_t; typedef SOCKET socket_t;
#else #else
# define CLOSE_SOCKET(sock) close(sock) # define CLOSE_SOCKET(sock) close(sock)
typedef int socket_t; typedef int socket_t;
#endif #endif
#if defined(__cplusplus) /* C++ */ #if defined(__cplusplus) /* C++ */
@@ -352,213 +352,213 @@ struct in_addr {
#ifndef NO_LIBRARY_PROTOTYPES #ifndef NO_LIBRARY_PROTOTYPES
#ifdef NEED_ATOI_PROTO #ifdef NEED_ATOI_PROTO
int atoi(const char *str); int atoi(const char *str);
#endif #endif
#ifdef NEED_ATOL_PROTO #ifdef NEED_ATOL_PROTO
long atol(const char *str); long atol(const char *str);
#endif #endif
/* bzero is deprecated - use memset() instead. This prototype is needed for /* bzero is deprecated - use memset() instead. This prototype is needed for
* FD_xxx macros on some machines. */ * FD_xxx macros on some machines. */
#ifdef NEED_BZERO_PROTO #ifdef NEED_BZERO_PROTO
void bzero(char *b, int length); void bzero(char *b, int length);
#endif #endif
#ifdef NEED_CRYPT_PROTO #ifdef NEED_CRYPT_PROTO
char *crypt(const char *key, const char *salt); char *crypt(const char *key, const char *salt);
#endif #endif
#ifdef NEED_FCLOSE_PROTO #ifdef NEED_FCLOSE_PROTO
int fclose(FILE *stream); int fclose(FILE *stream);
#endif #endif
#ifdef NEED_FDOPEN_PROTO #ifdef NEED_FDOPEN_PROTO
FILE *fdopen(int fd, const char *mode); FILE *fdopen(int fd, const char *mode);
#endif #endif
#ifdef NEED_FFLUSH_PROTO #ifdef NEED_FFLUSH_PROTO
int fflush(FILE *stream); int fflush(FILE *stream);
#endif #endif
#ifdef NEED_FPRINTF_PROTO #ifdef NEED_FPRINTF_PROTO
int fprintf(FILE *strm, const char *format, /* args */ ... ); int fprintf(FILE *strm, const char *format, /* args */ ... );
#endif #endif
#ifdef NEED_FREAD_PROTO #ifdef NEED_FREAD_PROTO
size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream); size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
#endif #endif
#ifdef NEED_FSCANF_PROTO #ifdef NEED_FSCANF_PROTO
int fscanf(FILE *strm, const char *format, ...); int fscanf(FILE *strm, const char *format, ...);
#endif #endif
#ifdef NEED_FSEEK_PROTO #ifdef NEED_FSEEK_PROTO
int fseek(FILE *stream, long offset, int ptrname); int fseek(FILE *stream, long offset, int ptrname);
#endif #endif
#ifdef NEED_FWRITE_PROTO #ifdef NEED_FWRITE_PROTO
size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream); size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
#endif #endif
#ifdef NEED_GETPID_PROTO #ifdef NEED_GETPID_PROTO
pid_t getpid(void); pid_t getpid(void);
#endif #endif
#ifdef NEED_PERROR_PROTO #ifdef NEED_PERROR_PROTO
void perror(const char *s); void perror(const char *s);
#endif #endif
#ifdef NEED_QSORT_PROTO #ifdef NEED_QSORT_PROTO
void qsort(void *base, size_t nel, size_t width, void qsort(void *base, size_t nel, size_t width,
int (*compar) (const void *, const void *)); int (*compar) (const void *, const void *));
#endif #endif
#ifdef NEED_REWIND_PROTO #ifdef NEED_REWIND_PROTO
void rewind(FILE *stream); void rewind(FILE *stream);
#endif #endif
#ifdef NEED_SPRINTF_PROTO #ifdef NEED_SPRINTF_PROTO
int sprintf(char *s, const char *format, /* args */ ... ); int sprintf(char *s, const char *format, /* args */ ... );
#endif #endif
#ifdef NEED_SSCANF_PROTO #ifdef NEED_SSCANF_PROTO
int sscanf(const char *s, const char *format, ...); int sscanf(const char *s, const char *format, ...);
#endif #endif
#ifdef NEED_STRDUP_PROTO #ifdef NEED_STRDUP_PROTO
char *strdup(const char *txt); char *strdup(const char *txt);
#endif #endif
#ifdef NEED_STRERROR_PROTO #ifdef NEED_STRERROR_PROTO
char *strerror(int errnum); char *strerror(int errnum);
#endif #endif
#ifdef NEED_STRLCPY_PROTO #ifdef NEED_STRLCPY_PROTO
size_t strlcpy(char *dest, const char *src, size_t copylen); size_t strlcpy(char *dest, const char *src, size_t copylen);
#endif #endif
#ifdef NEED_SYSTEM_PROTO #ifdef NEED_SYSTEM_PROTO
int system(const char *string); int system(const char *string);
#endif #endif
#ifdef NEED_TIME_PROTO #ifdef NEED_TIME_PROTO
time_t time(time_t *tloc); time_t time(time_t *tloc);
#endif #endif
#ifdef NEED_UNLINK_PROTO #ifdef NEED_UNLINK_PROTO
int unlink(const char *path); int unlink(const char *path);
#endif #endif
#ifdef NEED_REMOVE_PROTO #ifdef NEED_REMOVE_PROTO
int remove(const char *path); int remove(const char *path);
#endif #endif
#ifdef NEED_ACCEPT_PROTO #ifdef NEED_ACCEPT_PROTO
int accept(socket_t s, struct sockaddr *addr, int *addrlen); int accept(socket_t s, struct sockaddr *addr, int *addrlen);
#endif #endif
#ifdef NEED_BIND_PROTO #ifdef NEED_BIND_PROTO
int bind(socket_t s, const struct sockaddr *name, int namelen); int bind(socket_t s, const struct sockaddr *name, int namelen);
#endif #endif
#ifdef NEED_CHDIR_PROTO #ifdef NEED_CHDIR_PROTO
int chdir(const char *path); int chdir(const char *path);
#endif #endif
#ifdef NEED_CLOSE_PROTO #ifdef NEED_CLOSE_PROTO
int close(int fildes); int close(int fildes);
#endif #endif
#ifdef NEED_FCNTL_PROTO #ifdef NEED_FCNTL_PROTO
int fcntl(int fildes, int cmd, /* arg */ ...); int fcntl(int fildes, int cmd, /* arg */ ...);
#endif #endif
#ifdef NEED_FPUTC_PROTO #ifdef NEED_FPUTC_PROTO
int fputc(char c, FILE *stream); int fputc(char c, FILE *stream);
#endif #endif
#ifdef NEED_FPUTS_PROTO #ifdef NEED_FPUTS_PROTO
int fputs(const char *s, FILE *stream); int fputs(const char *s, FILE *stream);
#endif #endif
#ifdef NEED_GETPEERNAME_PROTO #ifdef NEED_GETPEERNAME_PROTO
int getpeername(socket_t s, struct sockaddr *name, int *namelen); int getpeername(socket_t s, struct sockaddr *name, int *namelen);
#endif #endif
#if defined(HAS_RLIMIT) && defined(NEED_GETRLIMIT_PROTO) #if defined(HAS_RLIMIT) && defined(NEED_GETRLIMIT_PROTO)
int getrlimit(int resource, struct rlimit *rlp); int getrlimit(int resource, struct rlimit *rlp);
#endif #endif
#ifdef NEED_GETSOCKNAME_PROTO #ifdef NEED_GETSOCKNAME_PROTO
int getsockname(socket_t s, struct sockaddr *name, int *namelen); int getsockname(socket_t s, struct sockaddr *name, int *namelen);
#endif #endif
#ifdef NEED_GETTIMEOFDAY_PROTO #ifdef NEED_GETTIMEOFDAY_PROTO
void gettimeofday(struct timeval *tp, void * ); void gettimeofday(struct timeval *tp, void * );
#endif #endif
#ifdef NEED_HTONL_PROTO #ifdef NEED_HTONL_PROTO
ulong htonl(u_long hostlong); ulong htonl(u_long hostlong);
#endif #endif
#ifdef NEED_HTONS_PROTO #ifdef NEED_HTONS_PROTO
u_short htons(u_short hostshort); u_short htons(u_short hostshort);
#endif #endif
#if defined(HAVE_INET_ADDR) && defined(NEED_INET_ADDR_PROTO) #if defined(HAVE_INET_ADDR) && defined(NEED_INET_ADDR_PROTO)
unsigned long int inet_addr(const char *cp); unsigned long int inet_addr(const char *cp);
#endif #endif
#if defined(HAVE_INET_ATON) && defined(NEED_INET_ATON_PROTO) #if defined(HAVE_INET_ATON) && defined(NEED_INET_ATON_PROTO)
int inet_aton(const char *cp, struct in_addr *inp); int inet_aton(const char *cp, struct in_addr *inp);
#endif #endif
#ifdef NEED_INET_NTOA_PROTO #ifdef NEED_INET_NTOA_PROTO
char *inet_ntoa(const struct in_addr in); char *inet_ntoa(const struct in_addr in);
#endif #endif
#ifdef NEED_LISTEN_PROTO #ifdef NEED_LISTEN_PROTO
int listen(socket_t s, int backlog); int listen(socket_t s, int backlog);
#endif #endif
#ifdef NEED_NTOHL_PROTO #ifdef NEED_NTOHL_PROTO
u_long ntohl(u_long netlong); u_long ntohl(u_long netlong);
#endif #endif
#ifdef NEED_PRINTF_PROTO #ifdef NEED_PRINTF_PROTO
int printf(char *format, ...); int printf(char *format, ...);
#endif #endif
#ifdef NEED_READ_PROTO #ifdef NEED_READ_PROTO
ssize_t read(int fildes, void *buf, size_t nbyte); ssize_t read(int fildes, void *buf, size_t nbyte);
#endif #endif
#ifdef NEED_SELECT_PROTO #ifdef NEED_SELECT_PROTO
int select(int nfds, fd_set *readfds, fd_set *writefds, int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout); fd_set *exceptfds, struct timeval *timeout);
#endif #endif
#ifdef NEED_SETITIMER_PROTO #ifdef NEED_SETITIMER_PROTO
int setitimer(int which, const struct itimerval *value, int setitimer(int which, const struct itimerval *value,
struct itimerval *ovalue); struct itimerval *ovalue);
#endif #endif
#if defined(HAS_RLIMIT) && defined(NEED_SETRLIMIT_PROTO) #if defined(HAS_RLIMIT) && defined(NEED_SETRLIMIT_PROTO)
int setrlimit(int resource, const struct rlimit *rlp); int setrlimit(int resource, const struct rlimit *rlp);
#endif #endif
#ifdef NEED_SETSOCKOPT_PROTO #ifdef NEED_SETSOCKOPT_PROTO
int setsockopt(socket_t s, int level, int optname, const char *optval, int setsockopt(socket_t s, int level, int optname, const char *optval,
int optlen); int optlen);
#endif #endif
#ifdef NEED_SOCKET_PROTO #ifdef NEED_SOCKET_PROTO
int socket(int domain, int type, int protocol); int socket(int domain, int type, int protocol);
#endif #endif
#ifdef NEED_WRITE_PROTO #ifdef NEED_WRITE_PROTO
ssize_t write(int fildes, const void *buf, size_t nbyte); ssize_t write(int fildes, const void *buf, size_t nbyte);
#endif #endif
#endif /* NO_LIBRARY_PROTOTYPES */ #endif /* NO_LIBRARY_PROTOTYPES */

View File

@@ -82,8 +82,7 @@ extern char *telcmds[];
#define TELCMD_FIRST xEOF #define TELCMD_FIRST xEOF
#define TELCMD_LAST IAC #define TELCMD_LAST IAC
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \ #define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST)
(unsigned int)(x) >= TELCMD_FIRST)
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST] #define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
/* telnet options */ /* telnet options */

View File

@@ -392,8 +392,7 @@ do \
* when mobs are possessed or charmed by a player. */ * when mobs are possessed or charmed by a player. */
#define IS_NPC(ch) (IS_SET_AR(MOB_FLAGS(ch), MOB_ISNPC)) #define IS_NPC(ch) (IS_SET_AR(MOB_FLAGS(ch), MOB_ISNPC))
/** 1 if the character is a real NPC, 0 if the character is not. */ /** 1 if the character is a real NPC, 0 if the character is not. */
#define IS_MOB(ch) (IS_NPC(ch) && GET_MOB_RNUM(ch) <= top_of_mobt && \ #define IS_MOB(ch) (IS_NPC(ch) && GET_MOB_RNUM(ch) <= top_of_mobt && GET_MOB_RNUM(ch) != NOBODY)
GET_MOB_RNUM(ch) != NOBODY)
/** 1 if ch is flagged an NPC and flag is set in the act bitarray, 0 if not. */ /** 1 if ch is flagged an NPC and flag is set in the act bitarray, 0 if not. */
#define MOB_FLAGGED(ch, flag) (IS_NPC(ch) && IS_SET_AR(MOB_FLAGS(ch), (flag))) #define MOB_FLAGGED(ch, flag) (IS_NPC(ch) && IS_SET_AR(MOB_FLAGS(ch), (flag)))
@@ -437,8 +436,7 @@ do \
/** Return the sector type for the room. If there is no sector type, return /** Return the sector type for the room. If there is no sector type, return
* SECT_INSIDE. */ * SECT_INSIDE. */
#define SECT(room) (VALID_ROOM_RNUM(room) ? \ #define SECT(room) (VALID_ROOM_RNUM(room) ? world[(room)].sector_type : SECT_INSIDE)
world[(room)].sector_type : SECT_INSIDE)
/** Return the zone number for this room */ /** Return the zone number for this room */
#define GET_ROOM_ZONE(room) (VALID_ROOM_RNUM(room) ? world[(room)].zone : NOWHERE) #define GET_ROOM_ZONE(room) (VALID_ROOM_RNUM(room) ? world[(room)].zone : NOWHERE)
@@ -451,11 +449,9 @@ do \
/** 1 if this is a valid room number, 0 if not. */ /** 1 if this is a valid room number, 0 if not. */
#define VALID_ROOM_RNUM(rnum) ((rnum) != NOWHERE && (rnum) <= top_of_world) #define VALID_ROOM_RNUM(rnum) ((rnum) != NOWHERE && (rnum) <= top_of_world)
/** The room number if this is a valid room, NOWHERE if it is not */ /** The room number if this is a valid room, NOWHERE if it is not */
#define GET_ROOM_VNUM(rnum) \ #define GET_ROOM_VNUM(rnum) ((room_vnum)(VALID_ROOM_RNUM(rnum) ? world[(rnum)].number : NOWHERE))
((room_vnum)(VALID_ROOM_RNUM(rnum) ? world[(rnum)].number : NOWHERE))
/** Pointer to the room function, NULL if there is not one. */ /** Pointer to the room function, NULL if there is not one. */
#define GET_ROOM_SPEC(room) \ #define GET_ROOM_SPEC(room) (VALID_ROOM_RNUM(room) ? world[(room)].func : NULL)
(VALID_ROOM_RNUM(room) ? world[(room)].func : NULL)
/* char utils */ /* char utils */
/** What room is PC/NPC in? */ /** What room is PC/NPC in? */
@@ -481,9 +477,7 @@ do \
/** Gets the level of a player even if the player is switched. /** Gets the level of a player even if the player is switched.
* @todo Make this the definition of GET_LEVEL. */ * @todo Make this the definition of GET_LEVEL. */
#define GET_REAL_LEVEL(ch) \ #define GET_REAL_LEVEL(ch) (ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : GET_LEVEL(ch))
(ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : \
GET_LEVEL(ch))
/** Class of ch. */ /** Class of ch. */
#define GET_CLASS(ch) ((ch)->player.chclass) #define GET_CLASS(ch) ((ch)->player.chclass)
@@ -630,8 +624,7 @@ do \
/** Get the real number of the mob instance. */ /** Get the real number of the mob instance. */
#define GET_MOB_RNUM(mob) ((mob)->nr) #define GET_MOB_RNUM(mob) ((mob)->nr)
/** If mob is a mob, return the virtual number of it. */ /** If mob is a mob, return the virtual number of it. */
#define GET_MOB_VNUM(mob) (IS_MOB(mob) ? \ #define GET_MOB_VNUM(mob) (IS_MOB(mob) ? mob_index[GET_MOB_RNUM(mob)].vnum : NOBODY)
mob_index[GET_MOB_RNUM(mob)].vnum : NOBODY)
/** Return the default position of ch. */ /** Return the default position of ch. */
#define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos) #define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos)
@@ -654,8 +647,7 @@ do \
/** Return whether or not ch is awake. */ /** Return whether or not ch is awake. */
#define AWAKE(ch) (GET_POS(ch) > POS_SLEEPING) #define AWAKE(ch) (GET_POS(ch) > POS_SLEEPING)
/** Defines if ch can see in general in the dark. */ /** Defines if ch can see in general in the dark. */
#define CAN_SEE_IN_DARK(ch) \ #define CAN_SEE_IN_DARK(ch) (AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))
(AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))
/** Defines if ch is good. */ /** Defines if ch is good. */
#define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350) #define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350)
@@ -723,15 +715,12 @@ do \
/** Real number of obj instance. */ /** Real number of obj instance. */
#define GET_OBJ_RNUM(obj) ((obj)->item_number) #define GET_OBJ_RNUM(obj) ((obj)->item_number)
/** Virtual number of obj, or NOTHING if not a real obj. */ /** Virtual number of obj, or NOTHING if not a real obj. */
#define GET_OBJ_VNUM(obj) (VALID_OBJ_RNUM(obj) ? \ #define GET_OBJ_VNUM(obj) (VALID_OBJ_RNUM(obj) ? obj_index[GET_OBJ_RNUM(obj)].vnum : NOTHING)
obj_index[GET_OBJ_RNUM(obj)].vnum : NOTHING)
/** Special function attached to obj, or NULL if nothing attached. */ /** Special function attached to obj, or NULL if nothing attached. */
#define GET_OBJ_SPEC(obj) (VALID_OBJ_RNUM(obj) ? \ #define GET_OBJ_SPEC(obj) (VALID_OBJ_RNUM(obj) ? obj_index[GET_OBJ_RNUM(obj)].func : NULL)
obj_index[GET_OBJ_RNUM(obj)].func : NULL)
/** Defines if an obj is a corpse. */ /** Defines if an obj is a corpse. */
#define IS_CORPSE(obj) (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && \ #define IS_CORPSE(obj) (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && GET_OBJ_VAL((obj), 3) == 1)
GET_OBJ_VAL((obj), 3) == 1)
/** Can the obj be worn on body part? */ /** Can the obj be worn on body part? */
#define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part)) #define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part))
@@ -741,8 +730,7 @@ do \
/* Compound utilities and other macros. */ /* Compound utilities and other macros. */
/** Used to compute version. To see if the code running is newer than 3.0pl13, /** Used to compute version. To see if the code running is newer than 3.0pl13,
* you would use: if _CIRCLEMUD > CIRCLEMUD_VERSION(3,0,13) */ * you would use: if _CIRCLEMUD > CIRCLEMUD_VERSION(3,0,13) */
#define CIRCLEMUD_VERSION(major, minor, patchlevel) \ #define CIRCLEMUD_VERSION(major, minor, patchlevel) (((major) << 16) + ((minor) << 8) + (patchlevel))
(((major) << 16) + ((minor) << 8) + (patchlevel))
/** Figures out possessive pronoun for ch. */ /** Figures out possessive pronoun for ch. */
#define HSHR(ch) (GET_SEX(ch) ? (GET_SEX(ch)==SEX_MALE ? "his":"her") :"its") #define HSHR(ch) (GET_SEX(ch) ? (GET_SEX(ch)==SEX_MALE ? "his":"her") :"its")
@@ -776,8 +764,7 @@ do \
/** Defines if sub character can see obj character, assuming immortal /** Defines if sub character can see obj character, assuming immortal
* and mortal settings. */ * and mortal settings. */
#define IMM_CAN_SEE(sub, obj) \ #define IMM_CAN_SEE(sub, obj) (MORT_CAN_SEE(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED(sub, PRF_HOLYLIGHT)))
(MORT_CAN_SEE(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED(sub, PRF_HOLYLIGHT)))
/** Is obj character the same as sub character? */ /** Is obj character the same as sub character? */
#define SELF(sub, obj) ((sub) == (obj)) #define SELF(sub, obj) ((sub) == (obj))
@@ -789,8 +776,7 @@ do \
/* End of CAN_SEE */ /* End of CAN_SEE */
/** Can the sub character see the obj if it is invisible? */ /** Can the sub character see the obj if it is invisible? */
#define INVIS_OK_OBJ(sub, obj) \ #define INVIS_OK_OBJ(sub, obj) (!OBJ_FLAGGED((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS))
(!OBJ_FLAGGED((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS))
/** Is anyone carrying this object and if so, are they visible? */ /** Is anyone carrying this object and if so, are they visible? */
#define CAN_SEE_OBJ_CARRIER(sub, obj) \ #define CAN_SEE_OBJ_CARRIER(sub, obj) \
@@ -798,12 +784,10 @@ do \
(!obj->worn_by || CAN_SEE(sub, obj->worn_by))) (!obj->worn_by || CAN_SEE(sub, obj->worn_by)))
/** Can sub character see the obj, using mortal only checks? */ /** Can sub character see the obj, using mortal only checks? */
#define MORT_CAN_SEE_OBJ(sub, obj) \ #define MORT_CAN_SEE_OBJ(sub, obj) (LIGHT_OK(sub) && INVIS_OK_OBJ(sub, obj) && CAN_SEE_OBJ_CARRIER(sub, obj))
(LIGHT_OK(sub) && INVIS_OK_OBJ(sub, obj) && CAN_SEE_OBJ_CARRIER(sub, obj))
/** Can sub character see the obj, using mortal and immortal checks? */ /** Can sub character see the obj, using mortal and immortal checks? */
#define CAN_SEE_OBJ(sub, obj) \ #define CAN_SEE_OBJ(sub, obj) (MORT_CAN_SEE_OBJ(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED((sub), PRF_HOLYLIGHT)))
(MORT_CAN_SEE_OBJ(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED((sub), PRF_HOLYLIGHT)))
/** Can ch carry obj? */ /** Can ch carry obj? */
#define CAN_CARRY_OBJ(ch,obj) \ #define CAN_CARRY_OBJ(ch,obj) \
@@ -820,12 +804,10 @@ do \
/** If vict can see obj, return obj short description, else return /** If vict can see obj, return obj short description, else return
* "something". */ * "something". */
#define OBJS(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? \ #define OBJS(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? (obj)->short_description : "something")
(obj)->short_description : "something")
/** If vict can see obj, return obj name, else return "something". */ /** If vict can see obj, return obj name, else return "something". */
#define OBJN(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? \ #define OBJN(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? fname((obj)->name) : "something")
fname((obj)->name) : "something")
/** Does direction door exist in the same room as ch? */ /** Does direction door exist in the same room as ch? */
#define EXIT(ch, door) (world[IN_ROOM(ch)].dir_option[door]) #define EXIT(ch, door) (world[IN_ROOM(ch)].dir_option[door])
@@ -853,17 +835,13 @@ do \
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)]) #define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
/** 1 if ch is magic user class, 0 if not. */ /** 1 if ch is magic user class, 0 if not. */
#define IS_MAGIC_USER(ch) (!IS_NPC(ch) && \ #define IS_MAGIC_USER(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_MAGIC_USER))
(GET_CLASS(ch) == CLASS_MAGIC_USER))
/** 1 if ch is cleric class, 0 if not. */ /** 1 if ch is cleric class, 0 if not. */
#define IS_CLERIC(ch) (!IS_NPC(ch) && \ #define IS_CLERIC(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_CLERIC))
(GET_CLASS(ch) == CLASS_CLERIC))
/** 1 if ch is thief class, 0 if not. */ /** 1 if ch is thief class, 0 if not. */
#define IS_THIEF(ch) (!IS_NPC(ch) && \ #define IS_THIEF(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_THIEF))
(GET_CLASS(ch) == CLASS_THIEF))
/** 1 if ch is warrior class, 0 if not. */ /** 1 if ch is warrior class, 0 if not. */
#define IS_WARRIOR(ch) (!IS_NPC(ch) && \ #define IS_WARRIOR(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_WARRIOR))
(GET_CLASS(ch) == CLASS_WARRIOR))
/** Defines if ch is outdoors or not. */ /** Defines if ch is outdoors or not. */
#define OUTSIDE(ch) (!ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS)) #define OUTSIDE(ch) (!ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS))