diff --git a/changelog b/changelog index 0456898..026a23e 100644 --- a/changelog +++ b/changelog @@ -35,6 +35,16 @@ export (QQ's a zone into a tarball)t Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) (lots of major bugfixes too) tbaMUD 3.59 +[Feb 24 2009] - Jamdog + Bug-Fix: Fixed levels command, so it only shows immortal level if it's in the specified range + Bug-Fix: write_mobile_espec now saves CON and CHA values for mobiles in world files + Bug-Fix: stat zone now shows the same as vstat zone (instead of show zone (num) + Bug-Fix: zone 'stat' info (print_zone, oasis_list.c) now shows the number of shops and triggers + Bug-Fix: zone 'show' info (print_zone_to_buf, act.wizard.c) now shows number of quests. + Added saving throws to write_mobile_espec (genmob.c) and interpret_espec (db.c) + Added 'whois' command for all players + medit: All numerical stats moved to new sub-menu, with 'autoroll' option + medit: Advanced or Standard stats sub-menu with cedit toggle (in Game Operations) [Feb 17 2009] - Jamdog Fixed a bug with %obj.extra% so that it now returns the list of extra flags [Feb 11 2009] - Jamdog diff --git a/lib/world/mob/12.mob b/lib/world/mob/12.mob index e1d2c60..9883654 100644 --- a/lib/world/mob/12.mob +++ b/lib/world/mob/12.mob @@ -215,8 +215,19 @@ the test mob~ Test mobs can be whatever you want them to be. ~ 8 0 0 0 0 0 0 0 0 E -3 19 8 0d0+30 1d2+0 -30 900 +22 13 -3 4d4+220 3d3+3 +220 48400 8 8 0 +Str: 14 +Dex: 14 +Int: 14 +Wis: 14 +Con: 14 +Cha: 14 +SavingPara: 5 +SavingRod: 5 +SavingPetri: 5 +SavingBreath: 5 +SavingSpell: 5 E $ diff --git a/src/act.h b/src/act.h index 7f25bde..f594d11 100644 --- a/src/act.h +++ b/src/act.h @@ -99,6 +99,7 @@ ACMD(do_users); ACMD(do_weather); ACMD(do_where); ACMD(do_who); +ACMD(do_whois); /***************************************************************************** * Begin Functions and defines for act.item.c diff --git a/src/act.informative.c b/src/act.informative.c index ff27dcc..50a8713 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -20,7 +20,7 @@ #include "screen.h" #include "constants.h" #include "dg_scripts.h" -#include "mail.h" /**< For the has_mail function */ +#include "mail.h" /**< For the has_mail function */ #include "act.h" #include "class.h" #include "fight.h" @@ -56,13 +56,13 @@ static void print_object_location(int num, struct obj_data *obj, struct char_dat static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mode) { - int found = 0; + int found = 0; struct char_data *temp; - + if (!obj || !ch) { log("SYSERR: NULL pointer in show_obj_to_char(): obj=%p ch=%p", obj, ch); - /* SYSERR_DESC: Somehow a NULL pointer was sent to show_obj_to_char() in - * either the 'obj' or the 'ch' variable. The error will indicate which + /* SYSERR_DESC: Somehow a NULL pointer was sent to show_obj_to_char() in + * either the 'obj' or the 'ch' variable. The error will indicate which * was NULL by listing both of the pointers passed to it. This is often a * difficult one to trace, and may require stepping through a debugger. */ return; @@ -91,10 +91,10 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) { send_to_char(ch, "[%d] ", GET_OBJ_VNUM(obj)); - if (SCRIPT(obj)) { - if (!TRIGGERS(SCRIPT(obj))->next) - send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); - else + if (SCRIPT(obj)) { + if (!TRIGGERS(SCRIPT(obj))->next) + send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); + else send_to_char(ch, "[TRIGS] "); } } @@ -105,11 +105,11 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod case SHOW_OBJ_SHORT: if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) { send_to_char(ch, "[%d] ", GET_OBJ_VNUM(obj)); - if (SCRIPT(obj)) { - if (!TRIGGERS(SCRIPT(obj))->next) - send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); - else - send_to_char(ch, "[TRIGS] "); + if (SCRIPT(obj)) { + if (!TRIGGERS(SCRIPT(obj))->next) + send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); + else + send_to_char(ch, "[TRIGS] "); } } send_to_char(ch, "%s", obj->short_description); @@ -139,9 +139,9 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod default: log("SYSERR: Bad display mode (%d) in show_obj_to_char().", mode); - /* SYSERR_DESC: show_obj_to_char() has some predefined 'mode's (argument - * #3) to tell it what to display to the character when it is called. If - * the mode is not one of these, it will output this error, and indicate + /* SYSERR_DESC: show_obj_to_char() has some predefined 'mode's (argument + * #3) to tell it what to display to the character when it is called. If + * the mode is not one of these, it will output this error, and indicate * what mode was passed to it. To correct it, you will need to find the * call with the incorrect mode and change it to an acceptable mode. */ return; @@ -170,53 +170,53 @@ static void show_obj_modifiers(struct obj_data *obj, struct char_data *ch) send_to_char(ch, " ..It emits a faint humming sound!"); } -static void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show) -{ - struct obj_data *i, *j, *display; - bool found; - int num; +static void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show) +{ + struct obj_data *i, *j, *display; + bool found; + int num; - found = FALSE; + found = FALSE; - /* Loop through the list of objects */ - for (i = list; i; i = i->next_content) { - num = 0; + /* Loop through the list of objects */ + for (i = list; i; i = i->next_content) { + num = 0; - /* Check the list to see if we've already counted this object */ - for (j = list; j != i; j = j->next_content) - if ((j->short_description == i->short_description && j->name == i->name) || - (!strcmp(j->short_description, i->short_description) && !strcmp(j->name, i->name))) - break; /* found a matching object */ - if (j != i) - continue; /* we counted object i earlier in the list */ + /* Check the list to see if we've already counted this object */ + for (j = list; j != i; j = j->next_content) + if ((j->short_description == i->short_description && j->name == i->name) || + (!strcmp(j->short_description, i->short_description) && !strcmp(j->name, i->name))) + break; /* found a matching object */ + if (j != i) + continue; /* we counted object i earlier in the list */ - /* Count matching objects, including this one */ - for (display = j = i; j; j = j->next_content) - /* This if-clause should be exactly the same as the one in the loop above */ - if ((j->short_description == i->short_description && j->name == i->name) || - (!strcmp(j->short_description, i->short_description) && !strcmp(j->name, i->name))) - if (CAN_SEE_OBJ(ch, j)) { - ++num; - /* If the original item can't be seen, switch it for this one */ - if (display == i && !CAN_SEE_OBJ(ch, display)) - display = j; - } + /* Count matching objects, including this one */ + for (display = j = i; j; j = j->next_content) + /* This if-clause should be exactly the same as the one in the loop above */ + if ((j->short_description == i->short_description && j->name == i->name) || + (!strcmp(j->short_description, i->short_description) && !strcmp(j->name, i->name))) + if (CAN_SEE_OBJ(ch, j)) { + ++num; + /* If the original item can't be seen, switch it for this one */ + if (display == i && !CAN_SEE_OBJ(ch, display)) + display = j; + } - /* When looking in room, hide objects starting with '.', except for holylight */ - if (num > 0 && (mode != SHOW_OBJ_LONG || *display->description != '.' || - (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))) { - if (mode == SHOW_OBJ_LONG) - send_to_char(ch, "%s", CCGRN(ch, C_NRM)); - if (num != 1) - send_to_char(ch, "(%2i) ", num); - show_obj_to_char(display, ch, mode); - send_to_char(ch, "%s", CCNRM(ch, C_NRM)); - found = TRUE; - } - } - if (!found && show) - send_to_char(ch, " Nothing.\r\n"); -} + /* When looking in room, hide objects starting with '.', except for holylight */ + if (num > 0 && (mode != SHOW_OBJ_LONG || *display->description != '.' || + (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))) { + if (mode == SHOW_OBJ_LONG) + send_to_char(ch, "%s", CCGRN(ch, C_NRM)); + if (num != 1) + send_to_char(ch, "(%2i) ", num); + show_obj_to_char(display, ch, mode); + send_to_char(ch, "%s", CCNRM(ch, C_NRM)); + found = TRUE; + } + } + if (!found && show) + send_to_char(ch, " Nothing.\r\n"); +} static void diag_char_to_char(struct char_data *i, struct char_data *ch) { @@ -276,9 +276,9 @@ static void look_at_char(struct char_data *i, struct char_data *ch) show_obj_to_char(GET_EQ(i, j), ch, SHOW_OBJ_SHORT); } } - if (ch != i && (IS_THIEF(ch) || GET_LEVEL(ch) >= LVL_IMMORT)) { - act("\r\nYou attempt to peek at $s inventory:", FALSE, i, 0, ch, TO_VICT); - list_obj_to_char(i->carrying, ch, SHOW_OBJ_SHORT, TRUE); + if (ch != i && (IS_THIEF(ch) || GET_LEVEL(ch) >= LVL_IMMORT)) { + act("\r\nYou attempt to peek at $s inventory:", FALSE, i, 0, ch, TO_VICT); + list_obj_to_char(i->carrying, ch, SHOW_OBJ_SHORT, TRUE); } } @@ -297,15 +297,15 @@ static void list_one_char(struct char_data *i, struct char_data *ch) " is standing here." }; - if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) { + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) { if (IS_NPC(i)) - send_to_char(ch, "[%d] ", GET_MOB_VNUM(i)); + send_to_char(ch, "[%d] ", GET_MOB_VNUM(i)); if (SCRIPT(i) && TRIGGERS(SCRIPT(i))) { - if (!TRIGGERS(SCRIPT(i))->next) - send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(i)))); - else - send_to_char(ch, "[TRIGS] "); - } + if (!TRIGGERS(SCRIPT(i))->next) + send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(i)))); + else + send_to_char(ch, "[TRIGS] "); + } } if (IS_NPC(i) && i->player.long_descr && GET_POS(i) == GET_DEFAULT_POS(i)) { @@ -322,14 +322,14 @@ static void list_one_char(struct char_data *i, struct char_data *ch) if (AFF_FLAGGED(i, AFF_SANCTUARY)) act("...$e glows with a bright light!", FALSE, i, 0, ch, TO_VICT); - if (AFF_FLAGGED(i, AFF_BLIND) && GET_LEVEL(i) < LVL_IMMORT) + if (AFF_FLAGGED(i, AFF_BLIND) && GET_LEVEL(i) < LVL_IMMORT) act("...$e is groping around blindly!", FALSE, i, 0, ch, TO_VICT); return; } - if (IS_NPC(i)) - send_to_char(ch, "%c%s", UPPER(*i->player.short_descr), i->player.short_descr + 1); + if (IS_NPC(i)) + send_to_char(ch, "%c%s", UPPER(*i->player.short_descr), i->player.short_descr + 1); else send_to_char(ch, "%s%s%s", i->player.name, *GET_TITLE(i) ? " " : "", GET_TITLE(i)); @@ -351,8 +351,8 @@ static void list_one_char(struct char_data *i, struct char_data *ch) send_to_char(ch, "%s", positions[(int) GET_POS(i)]); else { furniture = SITTING(i); - send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ? - "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")), + send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ? + "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")), OBJS(furniture, ch)); } } else { @@ -392,13 +392,13 @@ static void list_char_to_char(struct char_data *list, struct char_data *ch) if (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT) && IS_NPC(i) && i->player.long_descr && *i->player.long_descr == '.') continue; - send_to_char(ch, "%s", CCYEL(ch, C_NRM)); + send_to_char(ch, "%s", CCYEL(ch, C_NRM)); if (CAN_SEE(ch, i)) list_one_char(i, ch); else if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch) && AFF_FLAGGED(i, AFF_INFRAVISION)) send_to_char(ch, "You see a pair of glowing red eyes looking your way.\r\n"); - send_to_char(ch, "%s", CCNRM(ch, C_NRM)); + send_to_char(ch, "%s", CCNRM(ch, C_NRM)); } } @@ -442,7 +442,7 @@ ACMD(do_exits) len++; - if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) + if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) send_to_char(ch, "%-5s - [%5d] %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room), world[EXIT(ch, door)->to_room].name); else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) { /* But we tell them the door is closed */ @@ -465,7 +465,7 @@ void look_at_room(struct char_data *ch, int ignore_brief) room_vnum target_room; target_room = IN_ROOM(ch); - + if (!ch->desc) return; @@ -483,14 +483,14 @@ void look_at_room(struct char_data *ch, int ignore_brief) sprintbitarray(ROOM_FLAGS(IN_ROOM(ch)), room_bits, RF_ARRAY_MAX, buf); send_to_char(ch, "[%5d] ", GET_ROOM_VNUM(IN_ROOM(ch))); send_to_char(ch, "%s [ %s] ", world[IN_ROOM(ch)].name, buf); - + if (SCRIPT(rm)) { send_to_char(ch, "[T"); for (t = TRIGGERS(SCRIPT(rm)); t; t = t->next) send_to_char(ch, " %d", GET_TRIG_VNUM(t)); send_to_char(ch, "]"); } - } + } else send_to_char(ch, "%s", world[IN_ROOM(ch)].name); send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM)); @@ -578,7 +578,7 @@ static void look_in_obj(struct char_data *ch, char *arg) sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); send_to_char(ch, "It's full of a %s liquid.\r\n", buf2); } - else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0)) + else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0)) send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */ else { char buf2[MAX_STRING_LENGTH]; @@ -604,7 +604,7 @@ char *find_exdesc(char *word, struct extra_descr_data *list) /* Given the argument "look at ", figure out what object or char * matches the target. First, see if there is another char in the room with - * the name. Then check local objs for exdescs. Thanks to Angus Mezick for + * the name. Then check local objs for exdescs. Thanks to Angus Mezick for * the suggested fix to this problem. */ static void look_at_target(struct char_data *ch, char *arg) { @@ -813,7 +813,7 @@ ACMD(do_score) else send_to_char(ch, "and your current quest is %d.\r\n", GET_QUEST(ch) == NOTHING ? -1 : GET_QUEST(ch)); - + playing_time = *real_time_passed((time(0) - ch->player.time.logon) + ch->player.time.played, 0); send_to_char(ch, "You have been playing for %d day%s and %d hour%s.\r\n", @@ -953,9 +953,9 @@ ACMD(do_time) (time_info.hours % 12 == 0) ? 12 : (time_info.hours % 12), time_info.hours >= 12 ? "pm" : "am", weekdays[weekday]); - /* Peter Ajamian supplied the following as a fix for a bug introduced in the - * ordinal display that caused 11, 12, and 13 to be incorrectly displayed as - * 11st, 12nd, and 13rd. Nate Winters had already submitted a fix, but it + /* Peter Ajamian supplied the following as a fix for a bug introduced in the + * ordinal display that caused 11, 12, and 13 to be incorrectly displayed as + * 11st, 12nd, and 13rd. Nate Winters had already submitted a fix, but it * hard-coded a limit on ordinal display which I want to avoid. -dak */ suf = "th"; @@ -1009,43 +1009,43 @@ void space_to_minus(char *str) *str = '-'; } -int search_help(const char *argument, int level) -{ - int chk, bot, top, mid, minlen; +int search_help(const char *argument, int level) +{ + int chk, bot, top, mid, minlen; - bot = 0; - top = top_of_helpt; - minlen = strlen(argument); + bot = 0; + top = top_of_helpt; + minlen = strlen(argument); - while (bot <= top) { - mid = (bot + top) / 2; + while (bot <= top) { + mid = (bot + top) / 2; - if (!(chk = strn_cmp(argument, help_table[mid].keywords, minlen))) { - while ((mid > 0) && !strn_cmp(argument, help_table[mid - 1].keywords, minlen)) - mid--; + if (!(chk = strn_cmp(argument, help_table[mid].keywords, minlen))) { + while ((mid > 0) && !strn_cmp(argument, help_table[mid - 1].keywords, minlen)) + mid--; - while (level < help_table[mid].min_level && mid < (bot + top) / 2) - mid++; + while (level < help_table[mid].min_level && mid < (bot + top) / 2) + mid++; // if (strn_cmp(argument, help_table[mid].keywords, minlen) || level < help_table[mid].min_level) if (strn_cmp(argument, help_table[mid].keywords, minlen)) - break; + break; return mid; } - else if (chk > 0) - bot = mid + 1; - else - top = mid - 1; - } - return NOWHERE; + else if (chk > 0) + bot = mid + 1; + else + top = mid - 1; + } + return NOWHERE; } ACMD(do_help) { int mid = 0; int i, found = 0; - + if (!ch->desc) return; @@ -1294,7 +1294,7 @@ ACMD(do_who) if (d->connected == CON_HEDIT) send_to_char(ch, " (Help edit)"); if (d->connected == CON_QEDIT) - send_to_char(ch, " (Quest Edit)"); + send_to_char(ch, " (Quest Edit)"); if (PRF_FLAGGED(tch, PRF_BUILDWALK)) send_to_char(ch, " (Buildwalking)"); if (PRF_FLAGGED(tch, PRF_AFK)) @@ -1484,7 +1484,7 @@ ACMD(do_gen_ps) page_string(ch->desc, credits, 0); break; case SCMD_NEWS: - GET_LAST_NEWS(ch) = time(0); + GET_LAST_NEWS(ch) = time(0); page_string(ch->desc, news, 0); break; case SCMD_INFO: @@ -1503,7 +1503,7 @@ ACMD(do_gen_ps) page_string(ch->desc, policies, 0); break; case SCMD_MOTD: - GET_LAST_MOTD(ch) = time(0); + GET_LAST_MOTD(ch) = time(0); page_string(ch->desc, motd, 0); break; case SCMD_IMOTD: @@ -1521,10 +1521,10 @@ ACMD(do_gen_ps) default: log("SYSERR: Unhandled case in do_gen_ps. (%d)", subcmd); /* SYSERR_DESC: General page string function for such things as 'credits', - * 'news', 'wizlist', 'clear', 'version'. This occurs when a call is made - * to this routine that is not one of the predefined calls. To correct it, - * either a case needs to be added into the function to account for the - * subcmd that is being passed to it, or the call to the function needs to + * 'news', 'wizlist', 'clear', 'version'. This occurs when a call is made + * to this routine that is not one of the predefined calls. To correct it, + * either a case needs to be added into the function to account for the + * subcmd that is being passed to it, or the call to the function needs to * have the correct subcmd put into place. */ return; } @@ -1537,8 +1537,8 @@ static void perform_mortal_where(struct char_data *ch, char *arg) int j; if (!*arg) { - j = world[(IN_ROOM(ch))].zone; - send_to_char(ch, "Players in %s@n.\r\n--------------------\r\n", zone_table[j].name); + j = world[(IN_ROOM(ch))].zone; + send_to_char(ch, "Players in %s@n.\r\n--------------------\r\n", zone_table[j].name); for (d = descriptor_list; d; d = d->next) { if (STATE(d) != CON_PLAYING || d->character == ch) continue; @@ -1573,12 +1573,12 @@ static void print_object_location(int num, struct obj_data *obj, struct char_dat else send_to_char(ch, "%33s", " - "); - if (SCRIPT(obj)) { - if (!TRIGGERS(SCRIPT(obj))->next) - send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); - else - send_to_char(ch, "[TRIGS] "); - } + if (SCRIPT(obj)) { + if (!TRIGGERS(SCRIPT(obj))->next) + send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(obj)))); + else + send_to_char(ch, "[TRIGS] "); + } if (IN_ROOM(obj) != NOWHERE) send_to_char(ch, "[%5d] %s%s\r\n", GET_ROOM_VNUM(IN_ROOM(obj)), world[IN_ROOM(obj)].name, QNRM); @@ -1602,8 +1602,8 @@ static void perform_immort_where(struct char_data *ch, char *arg) int num = 0, found = 0; if (!*arg) { - send_to_char(ch, "Players Room Location Zone\r\n"); - send_to_char(ch, "-------- ------- ------------------------------ -------------------\r\n"); + send_to_char(ch, "Players Room Location Zone\r\n"); + send_to_char(ch, "-------- ------- ------------------------------ -------------------\r\n"); for (d = descriptor_list; d; d = d->next) if (IS_PLAYING(d)) { i = (d->original ? d->original : d->character); @@ -1614,9 +1614,9 @@ static void perform_immort_where(struct char_data *ch, char *arg) world[IN_ROOM(d->character)].name, QNRM, GET_NAME(d->character), QNRM); else send_to_char(ch, "%-8s%s %s[%s%5d%s]%s %-*s%s %s%s\r\n", GET_NAME(i), QNRM, - QCYN, QYEL, GET_ROOM_VNUM(IN_ROOM(i)), QCYN, QNRM, - 30+count_color_chars(world[IN_ROOM(i)].name), world[IN_ROOM(i)].name, QNRM, - zone_table[(world[IN_ROOM(i)].zone)].name, QNRM); + QCYN, QYEL, GET_ROOM_VNUM(IN_ROOM(i)), QCYN, QNRM, + 30+count_color_chars(world[IN_ROOM(i)].name), world[IN_ROOM(i)].name, QNRM, + zone_table[(world[IN_ROOM(i)].zone)].name, QNRM); } } } else { @@ -1625,12 +1625,12 @@ static void perform_immort_where(struct char_data *ch, char *arg) found = 1; send_to_char(ch, "M%3d. %-25s%s - [%5d] %-25s%s", ++num, GET_NAME(i), QNRM, GET_ROOM_VNUM(IN_ROOM(i)), world[IN_ROOM(i)].name, QNRM); - if (SCRIPT(i) && TRIGGERS(SCRIPT(i))) { - if (!TRIGGERS(SCRIPT(i))->next) - send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(i)))); - else - send_to_char(ch, "[TRIGS] "); - } + if (SCRIPT(i) && TRIGGERS(SCRIPT(i))) { + if (!TRIGGERS(SCRIPT(i))->next) + send_to_char(ch, "[T%d] ", GET_TRIG_VNUM(TRIGGERS(SCRIPT(i)))); + else + send_to_char(ch, "[TRIGS] "); + } send_to_char(ch, "%s\r\n", QNRM); } for (num = 0, k = object_list; k; k = k->next) @@ -1657,47 +1657,47 @@ ACMD(do_where) ACMD(do_levels) { - char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH]; - size_t len = 0, nlen; + char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH]; + size_t len = 0, nlen; int i, ret, min_lev=1, max_lev=LVL_IMMORT, val; if (IS_NPC(ch)) { send_to_char(ch, "You ain't nothin' but a hound-dog.\r\n"); return; } - one_argument(argument, arg); + one_argument(argument, arg); - if (arg != NULL && *arg) { - if (isdigit(*arg)) { - ret = sscanf(arg, "%d-%d", &min_lev, &max_lev); - if (ret == 0) { - /* No valid args found */ - min_lev = 1; - max_lev = LVL_IMMORT; - } - else if (ret == 1) { - /* One arg = range is (num) either side of current level */ - val = min_lev; - max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT); - min_lev = MAX(GET_LEVEL(ch) - val, 1); - } - else if (ret == 2) { - /* Two args = min-max range limit - just do sanity checks */ - min_lev = MAX(min_lev, 1); - max_lev = MIN(max_lev + 1, LVL_IMMORT); - } - } - else - { - send_to_char(ch, "Usage: %slevels [- | ]%s\r\n\r\n", QYEL, QNRM); - send_to_char(ch, "Displays exp required for levels.\r\n"); - send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, (LVL_IMMORT-1)); - send_to_char(ch, "%slevels 5 %s- shows 5 levels either side of your current level\r\n", QCYN, QNRM); - send_to_char(ch, "%slevels 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM); - return; - } + if (arg != NULL && *arg) { + if (isdigit(*arg)) { + ret = sscanf(arg, "%d-%d", &min_lev, &max_lev); + if (ret == 0) { + /* No valid args found */ + min_lev = 1; + max_lev = LVL_IMMORT; + } + else if (ret == 1) { + /* One arg = range is (num) either side of current level */ + val = min_lev; + max_lev = MIN(GET_LEVEL(ch) + val, LVL_IMMORT); + min_lev = MAX(GET_LEVEL(ch) - val, 1); + } + else if (ret == 2) { + /* Two args = min-max range limit - just do sanity checks */ + min_lev = MAX(min_lev, 1); + max_lev = MIN(max_lev + 1, LVL_IMMORT); + } + } + else + { + send_to_char(ch, "Usage: %slevels [- | ]%s\r\n\r\n", QYEL, QNRM); + send_to_char(ch, "Displays exp required for levels.\r\n"); + send_to_char(ch, "%slevels %s- shows all levels (1-%d)\r\n", QCYN, QNRM, (LVL_IMMORT-1)); + send_to_char(ch, "%slevels 5 %s- shows 5 levels either side of your current level\r\n", QCYN, QNRM); + send_to_char(ch, "%slevels 10-40 %s- shows level 10 to level 40\r\n",QCYN, QNRM); + return; + } } - + for (i = min_lev; i < max_lev; i++) { nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d-%-8d : ", (int)i, level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i + 1) - 1); @@ -1722,7 +1722,7 @@ ACMD(do_levels) len += nlen; } - if (len < sizeof(buf)) + if (len < sizeof(buf) && max_lev == LVL_IMMORT) snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d : Immortality\r\n", LVL_IMMORT, level_exp(GET_CLASS(ch), LVL_IMMORT)); page_string(ch->desc, buf, TRUE); @@ -1966,7 +1966,7 @@ ACMD(do_toggle) " Pagelength: %-3d " " Screenwidth: %-3d " " AFK: %-3s\r\n" - + " Color: %s \r\n ", ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)), @@ -2000,7 +2000,7 @@ ACMD(do_toggle) GET_PAGE_LENGTH(ch), GET_SCREEN_WIDTH(ch), ONOFF(PRF_FLAGGED(ch, PRF_AFK)), - + types[COLOR_LEV(ch)]); return; } @@ -2074,9 +2074,9 @@ ACMD(do_toggle) act("$n is now away from $s keyboard.", TRUE, ch, 0, 0, TO_ROOM); else { act("$n has returned to $s keyboard.", TRUE, ch, 0, 0, TO_ROOM); - if (has_mail(GET_IDNUM(ch))) - send_to_char(ch, "You have mail waiting.\r\n"); - } + if (has_mail(GET_IDNUM(ch))) + send_to_char(ch, "You have mail waiting.\r\n"); + } break; case SCMD_WIMPY: if (!*arg2) { @@ -2196,8 +2196,8 @@ ACMD(do_commands) vict == ch ? "you" : GET_NAME(vict)); /* cmd_num starts at 1, not 0, to remove 'RESERVED' */ - for (no = 0, cmd_num = 1; - complete_cmd_info[cmd_sort_info[cmd_num]].command[0] != '\n'; + for (no = 0, cmd_num = 1; + complete_cmd_info[cmd_sort_info[cmd_num]].command[0] != '\n'; ++cmd_num) { i = cmd_sort_info[cmd_num]; @@ -2211,7 +2211,7 @@ ACMD(do_commands) if (!wizhelp && socials != (complete_cmd_info[i].command_pointer == do_action)) continue; - if (wizhelp && complete_cmd_info[i].command_pointer == do_action) + if (wizhelp && complete_cmd_info[i].command_pointer == do_action) continue; if (--overflow < 0) @@ -2227,15 +2227,15 @@ ACMD(do_commands) void free_history(struct char_data *ch, int type) { - struct txt_block *tmp = GET_HISTORY(ch, type), *ftmp; + struct txt_block *tmp = GET_HISTORY(ch, type), *ftmp; while ((ftmp = tmp)) { tmp = tmp->next; - if (ftmp->text) + if (ftmp->text) free(ftmp->text); free(ftmp); } - GET_HISTORY(ch, type) = NULL; + GET_HISTORY(ch, type) = NULL; } ACMD(do_history) @@ -2272,7 +2272,7 @@ ACMD(do_history) send_to_char(ch, "You have no history in that channel.\r\n"); } -#define HIST_LENGTH 100 +#define HIST_LENGTH 100 void add_history(struct char_data *ch, char *str, int type) { int i = 0; @@ -2280,7 +2280,7 @@ void add_history(struct char_data *ch, char *str, int type) struct txt_block *tmp; time_t ct; - if (IS_NPC(ch)) + if (IS_NPC(ch)) return; tmp = GET_HISTORY(ch, type); @@ -2292,8 +2292,8 @@ void add_history(struct char_data *ch, char *str, int type) if (!tmp) { CREATE(GET_HISTORY(ch, type), struct txt_block, 1); GET_HISTORY(ch, type)->text = strdup(buf); - } - else { + } + else { while (tmp->next) tmp = tmp->next; CREATE(tmp->next, struct txt_block, 1); @@ -2313,3 +2313,90 @@ void add_history(struct char_data *ch, char *str, int type) if (type != HIST_ALL) add_history(ch, str, HIST_ALL); } + +ACMD(do_whois) +{ + struct char_data *victim = 0; + int hours; + int got_from_file = 0; + char buf[MAX_STRING_LENGTH]; + + one_argument(argument, buf); + + if (!*buf) { + send_to_char(ch, "Whois who?\r\n"); + return; + } + + if (!(victim=get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD))) + { + CREATE(victim, struct char_data, 1); + clear_char(victim); + CREATE(victim->player_specials, struct player_special_data, 1); + + if (load_char(buf, victim) > -1) + got_from_file = 1; + else { + send_to_char (ch, "There is no such player.\r\n"); + free_char (victim); + return; + } + } + + /* We either have our victim from file or he's playing or function has returned. */ + sprinttype(GET_SEX(victim), genders, buf, sizeof(buf)); + send_to_char(ch, "Name: %s %s\r\nSex: %s\r\n", GET_NAME(victim), + (victim->player.title ? victim->player.title : ""), buf); + + sprinttype (victim->player.chclass, pc_class_types, buf, sizeof(buf)); + send_to_char(ch, "Class: %s\r\n", buf); + + send_to_char(ch, "Level: %d\r\n", GET_LEVEL(victim)); + + if (!(GET_LEVEL(victim) < LVL_IMMORT) || (GET_LEVEL(ch) >= GET_LEVEL(victim))) + { + strcpy (buf, (char *) asctime(localtime(&(victim->player.time.logon)))); + buf[10] = '\0'; + + hours = (time(0) - victim->player.time.logon) / 3600; + + if (!got_from_file) + { + send_to_char(ch, "Last Logon: They're playing now! (Idle %d Minutes)", + victim->char_specials.timer * SECS_PER_MUD_HOUR / SECS_PER_REAL_MIN); + + if (!victim->desc) + { + send_to_char(ch, " (Linkless)\r\n"); + } + else + { + send_to_char(ch, "\r\n"); + } + if (PRF_FLAGGED(victim, PRF_AFK)) + { + send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM), GET_NAME(victim), GET_SEX(victim) == SEX_NEUTRAL ? "it" : (GET_SEX(victim) == SEX_MALE ? "he" : "she"), CCNRM(ch, C_NRM)); + } + } + else if (hours > 0) + { + send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours/24, hours%24); + } + else + { + send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n", + buf, (int)(time(0) - victim->player.time.logon)/60); + } + } + + if (has_mail(GET_IDNUM(victim))) + send_to_char (ch, "They have mail waiting.\r\n"); + else + send_to_char (ch, "They have no mail waiting.\r\n"); + + if (PLR_FLAGGED(victim, PLR_DELETED)) + send_to_char (ch, "***DELETED***\r\n"); + + if (got_from_file) + free_char (victim); +} diff --git a/src/act.wizard.c b/src/act.wizard.c index 37de133..2da2382 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -1367,7 +1367,7 @@ ACMD(do_vstat) break; case 'z': sprintf(buf2, "zone %d", atoi(buf2)); - do_show(ch, buf2, 0, 0); + do_stat(ch, buf2, 0, 0); break; case 't': sprintf(buf2, "%d", atoi(buf2)); @@ -2353,7 +2353,7 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l size_t tmp; if (listall) { - int i, j, k, l, m, n; + int i, j, k, l, m, n, o; tmp = snprintf(bufptr, left, "%3d %-30.30s%s By: %-10.10s%s Age: %3d; Reset: %3d (%1d); Range: %5d-%5d\r\n", @@ -2361,7 +2361,7 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l zone_table[zone].age, zone_table[zone].lifespan, zone_table[zone].reset_mode, zone_table[zone].bot, zone_table[zone].top); - i = j = k = l = m = n = 0; + i = j = k = l = m = n = o = 0; for (i = 0; i < top_of_world; i++) if (world[i].number >= zone_table[zone].bot && world[i].number <= zone_table[zone].top) @@ -2383,6 +2383,8 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l if (trig_index[i]->vnum >= zone_table[zone].bot && trig_index[i]->vnum <= zone_table[zone].top) n++; + o = count_quests(zone_table[zone].bot, zone_table[zone].top); + tmp += snprintf(bufptr + tmp, left - tmp, " Zone stats:\r\n" " ---------------\r\n" @@ -2390,8 +2392,9 @@ static size_t print_zone_to_buf(char *bufptr, size_t left, zone_rnum zone, int l " Objects: %2d\r\n" " Mobiles: %2d\r\n" " Shops: %2d\r\n" - " Triggers: %2d\r\n", - j, k, l, m, n); + " Triggers: %2d\r\n" + " Quests: %2d\r\n", + j, k, l, m, n, o); return tmp; } diff --git a/src/cedit.c b/src/cedit.c index c0e69af..cee9aab 100644 --- a/src/cedit.c +++ b/src/cedit.c @@ -131,6 +131,7 @@ static void cedit_setup(struct descriptor_data *d) OLC_CONFIG(d)->operation.use_new_socials = CONFIG_NEW_SOCIALS; OLC_CONFIG(d)->operation.auto_save_olc = CONFIG_OLC_SAVE; OLC_CONFIG(d)->operation.nameserver_is_slow = CONFIG_NS_IS_SLOW; + OLC_CONFIG(d)->operation.medit_advanced = CONFIG_MEDIT_ADVANCED; /* Autowiz */ OLC_CONFIG(d)->autowiz.use_autowiz = CONFIG_USE_AUTOWIZ; @@ -228,6 +229,7 @@ static void cedit_save_internally(struct descriptor_data *d) CONFIG_NEW_SOCIALS = OLC_CONFIG(d)->operation.use_new_socials; CONFIG_NS_IS_SLOW = OLC_CONFIG(d)->operation.nameserver_is_slow; CONFIG_OLC_SAVE = OLC_CONFIG(d)->operation.auto_save_olc; + CONFIG_MEDIT_ADVANCED = OLC_CONFIG(d)->operation.medit_advanced; /* Autowiz */ CONFIG_USE_AUTOWIZ = OLC_CONFIG(d)->autowiz.use_autowiz; @@ -365,10 +367,10 @@ int save_config( IDXTYPE nowhere ) "default_map_size = %d\n\n", CONFIG_MAP_SIZE); fprintf(fl, "* Default minimap size shown to the right of room descriptions\n" "default_minimap_size = %d\n\n", CONFIG_MINIMAP_SIZE); - fprintf(fl, "* Do you want scripts to be attachable to players?\n" + fprintf(fl, "* Do you want scripts to be attachable to players?\n" "script_players = %d\n\n", CONFIG_SCRIPT_PLAYERS); - + strcpy(buf, CONFIG_OK); strip_cr(buf); @@ -517,6 +519,10 @@ int save_config( IDXTYPE nowhere ) "START_MESSG = \n%s~\n\n", buf); } + fprintf(fl, "* Should the medit OLC show the advanced stats menu (1) or not (0).\n" + "medit_advanced_stats = %d\n\n", + CONFIG_MEDIT_ADVANCED); + fprintf(fl, "\n\n\n* [ Autowiz Options ]\n"); fprintf(fl, "* Should the game automatically create a new wizlist/immlist every time\n" @@ -574,7 +580,7 @@ static void cedit_disp_game_play_options(struct descriptor_data *d) clear_screen(d); - + write_to_output(d, "\r\n\r\n" "%sA%s) Player Killing Allowed : %s%s\r\n" "%sB%s) Player Thieving Allowed : %s%s\r\n" @@ -709,6 +715,7 @@ static void cedit_disp_operation_options(struct descriptor_data *d) "%sL%s) Main Menu : \r\n%s%s\r\n" "%sM%s) Welcome Message : \r\n%s%s\r\n" "%sN%s) Start Message : \r\n%s%s\r\n" + "%sO%s) Medit Stats Menu : %s%s\r\n" "%sQ%s) Exit To The Main Menu\r\n" "Enter your choice : ", grn, nrm, cyn, OLC_CONFIG(d)->operation.DFLT_PORT, @@ -725,6 +732,7 @@ static void cedit_disp_operation_options(struct descriptor_data *d) grn, nrm, cyn, OLC_CONFIG(d)->operation.MENU ? OLC_CONFIG(d)->operation.MENU : "", grn, nrm, cyn, OLC_CONFIG(d)->operation.WELC_MESSG ? OLC_CONFIG(d)->operation.WELC_MESSG : "", grn, nrm, cyn, OLC_CONFIG(d)->operation.START_MESSG ? OLC_CONFIG(d)->operation.START_MESSG : "", + grn, nrm, cyn, OLC_CONFIG(d)->operation.medit_advanced ? "Advanced" : "Standard", grn, nrm ); @@ -954,8 +962,8 @@ void cedit_parse(struct descriptor_data *d, char *arg) write_to_output(d, "Enter default mini-map size (1-12) : "); OLC_MODE(d) = CEDIT_MINIMAP_SIZE; return; - case '7': - TOGGLE_VAR(OLC_CONFIG(d)->play.script_players); + case '7': + TOGGLE_VAR(OLC_CONFIG(d)->play.script_players); break; case 'q': @@ -1183,6 +1191,11 @@ void cedit_parse(struct descriptor_data *d, char *arg) string_write(d, &OLC_CONFIG(d)->operation.START_MESSG, MAX_INPUT_LENGTH, 0, oldtext); return; + case 'o': + case 'O': + TOGGLE_VAR(OLC_CONFIG(d)->operation.medit_advanced); + break; + case 'q': case 'Q': cedit_disp_menu(d); @@ -1600,7 +1613,7 @@ void cedit_parse(struct descriptor_data *d, char *arg) cedit_disp_game_play_options(d); } break; - + default: /* We should never get here, but just in case... */ cleanup_olc(d, CLEANUP_CONFIG); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: cedit_parse(): Reached default case!"); diff --git a/src/config.c b/src/config.c index 812eec0..f90277e 100644 --- a/src/config.c +++ b/src/config.c @@ -28,23 +28,23 @@ * to change one of the constants (assuming you keep your object files around) * is change the constant in this file and type 'make'. Make will recompile * this file and relink; you don't have to wait for the whole thing to recompile - * as you do if you change a header file. I realize that it would be slightly - * more efficient to have lots of #defines strewn about, so that, for example, - * the autowiz code isn't compiled at all if you don't want to use autowiz. - * However, the actual code for the various options is quite small, as is the - * computational time in checking the option you've selected at run-time, so - * I've decided the convenience of having all your options in this one file + * as you do if you change a header file. I realize that it would be slightly + * more efficient to have lots of #defines strewn about, so that, for example, + * the autowiz code isn't compiled at all if you don't want to use autowiz. + * However, the actual code for the various options is quite small, as is the + * computational time in checking the option you've selected at run-time, so + * I've decided the convenience of having all your options in this one file * outweighs the efficency of doing it the other way. */ /* YES / NO; TRUE / FALSE are all defined in utils.h */ -/* Can Scripts be attached to players? */ +/* Can Scripts be attached to players? */ int script_players = NO; -/* pk_allowed sets the tone of the entire game. If pk_allowed is set to NO, - * then players will not be allowed to kill, summon, charm, or sleep other +/* pk_allowed sets the tone of the entire game. If pk_allowed is set to NO, + * then players will not be allowed to kill, summon, charm, or sleep other * players, as well as a variety of other "asshole player" protections. However, - * if you decide you want to have an all-out knock-down drag-out PK Mud, just + * if you decide you want to have an all-out knock-down drag-out PK Mud, just * set pk_allowed to YES - and anything goes. */ int pk_allowed = NO; @@ -57,7 +57,7 @@ int level_can_shout = 1; /* Number of movement points it costs to holler. */ int holler_move_cost = 20; -/* How many people can get into a tunnel? The default is two, but there is +/* How many people can get into a tunnel? The default is two, but there is * also an alternate message in the case of one person being allowed. */ int tunnel_size = 2; @@ -91,18 +91,18 @@ const char *NOPERSON = "No one by that name here.\r\n"; const char *NOEFFECT = "Nothing seems to happen.\r\n"; /* You can define or not define TRACK_THOUGH_DOORS, depending on whether or not - * you want track to find paths which lead through closed or hidden doors. A - * setting of 'NO' means to not go through the doors while 'YES' will pass + * you want track to find paths which lead through closed or hidden doors. A + * setting of 'NO' means to not go through the doors while 'YES' will pass * through doors to find the target. */ int track_through_doors = YES; -/* If you do not want mortals to level up to immortal once they have enough - * experience, then set this to YES. Subtracting this from LVL_IMMORT gives +/* If you do not want mortals to level up to immortal once they have enough + * experience, then set this to YES. Subtracting this from LVL_IMMORT gives * the top level that people can advance to in gain_exp() in limits.c */ int no_mort_to_immort = YES; /* RENT/CRASHSAVE OPTIONS */ -/* Should the MUD allow you to 'rent' for free? (i.e. if you just quit, your +/* Should the MUD allow you to 'rent' for free? (i.e. if you just quit, your * objects are saved at no cost). */ int free_rent = YES; @@ -112,8 +112,8 @@ int max_obj_save = 30; /* Receptionist's surcharge on top of item costs. */ int min_rent_cost = 100; -/* Should the game automatically save people? (i.e., save player data every 4 - * kills (on average), and Crash-save as defined below. If auto_save is YES, +/* Should the game automatically save people? (i.e., save player data every 4 + * kills (on average), and Crash-save as defined below. If auto_save is YES, * then the 'save' command will be disabled to prevent item duplication via * game crashes. */ int auto_save = YES; @@ -132,15 +132,15 @@ int rent_file_timeout = 30; /* Do you want to automatically wipe players who've been gone too long? */ int auto_pwipe = NO; -/* Autowipe deletion criteria. This struct holds information used to determine - * which players to wipe when the mud boots. The levels must be in ascending - * order, with a descending level marking the end of the array. A level -1 - * entry in the beginning is the case for players with the PLR_DELETED flag. +/* Autowipe deletion criteria. This struct holds information used to determine + * which players to wipe when the mud boots. The levels must be in ascending + * order, with a descending level marking the end of the array. A level -1 + * entry in the beginning is the case for players with the PLR_DELETED flag. * The values below match the stock purgeplay.c criteria. Detailed explanation by array element: * Element 0, level -1, days 0: Players with PLR_DELETED flag are always wiped - * Element 1, level 0, days 0: Players at level 0 have created a character, + * Element 1, level 0, days 0: Players at level 0 have created a character, but have never actually entered the game, so always wipe them. * Element 2, level 1, days 4: Players at level 1 are wiped if they haven't logged on in the past 4 days. @@ -149,7 +149,7 @@ int auto_pwipe = NO; * Element 4, level 10, days 30: Players level 5-10 get 30 days. * Element 5, level LVL_IMMORT - 1, days 60: All other mortals get 60 days. * Element 6, level LVL_IMPL, days 90: Immortals get 90 days. - * Element 7: Because -2 is less than LVL_IMPL, this is assumed to be the end + * Element 7: Because -2 is less than LVL_IMPL, this is assumed to be the end of the criteria. The days entry is not used in this case. */ struct pclean_criteria_data pclean_criteria[] = { /* LEVEL DAYS */ @@ -175,7 +175,7 @@ room_vnum immort_start_room = 1204; /* Virtual number of room that frozen players should enter at. */ room_vnum frozen_start_room = 1202; -/* Virtual numbers of donation rooms. note: you must change code in do_drop of +/* Virtual numbers of donation rooms. note: you must change code in do_drop of * act.item.c if you change the number of non-NOWHERE donation rooms. */ room_vnum donation_room_1 = 3063; room_vnum donation_room_2 = 5510; @@ -187,23 +187,23 @@ room_vnum donation_room_3 = 235; * exit with a warning when encountering stock world files. */ int bitwarning = FALSE; -/* If you want to look at normal world files but DO NOT want to save to 128bit - * format, turn this to false. However, do not save through olc, or your +/* If you want to look at normal world files but DO NOT want to save to 128bit + * format, turn this to false. However, do not save through olc, or your * world files will be 128bit anyway. */ int bitsavetodisk = TRUE; -/* This is the default port on which the game should run if no port is given on - * the command-line. NOTE WELL: If you're using the 'autorun' script, the port - * number there will override this setting. Change the PORT= line in autorun +/* This is the default port on which the game should run if no port is given on + * the command-line. NOTE WELL: If you're using the 'autorun' script, the port + * number there will override this setting. Change the PORT= line in autorun * instead of (or in addition to) changing this. */ ush_int DFLT_PORT = 4000; -/* IP address to which the MUD should bind. This is only useful if you're - * running Circle on a host that host more than one IP interface, and you only - * want to bind to *one* of them instead of all of them. Setting this to NULL - * (the default) causes Circle to bind to all interfaces on the host. - * Otherwise, specify a numeric IP address in dotted quad format, and Circle - * will only bind to that IP address. (Of course, that IP address must be one +/* IP address to which the MUD should bind. This is only useful if you're + * running Circle on a host that host more than one IP interface, and you only + * want to bind to *one* of them instead of all of them. Setting this to NULL + * (the default) causes Circle to bind to all interfaces on the host. + * Otherwise, specify a numeric IP address in dotted quad format, and Circle + * will only bind to that IP address. (Of course, that IP address must be one * of your host's interfaces, or it won't work.) */ const char *DFLT_IP = NULL; /* bind to all interfaces */ /* const char *DFLT_IP = "192.168.1.1"; -- bind only to one interface */ @@ -211,9 +211,9 @@ const char *DFLT_IP = NULL; /* bind to all interfaces */ /* Default directory to use as data directory. */ const char *DFLT_DIR = "lib"; -/* What file to log messages to (ex: "log/syslog"). Setting this to NULL means - * you want to log to stderr, which was the default in earlier versions of - * Circle. If you specify a file, you don't get messages to the screen. (Hint: +/* What file to log messages to (ex: "log/syslog"). Setting this to NULL means + * you want to log to stderr, which was the default in earlier versions of + * Circle. If you specify a file, you don't get messages to the screen. (Hint: * Try 'tail -f' if you have a UNIX machine.) */ const char *LOGNAME = NULL; /* const char *LOGNAME = "log/syslog"; -- useful for Windows users */ @@ -237,23 +237,23 @@ int max_bad_pws = 3; * rather than what is currently done? */ int siteok_everyone = TRUE; -/* Some nameservers are very slow and cause the game to lag terribly every time +/* Some nameservers are very slow and cause the game to lag terribly every time * someone logs in. The lag is caused by the gethostbyaddr() function which is - * responsible for resolving numeric IP addresses to alphabetic names. + * responsible for resolving numeric IP addresses to alphabetic names. * Sometimes, nameservers can be so slow that the incredible lag caused by * gethostbyaddr() isn't worth the luxury of having names instead of numbers - * for players' sitenames. If your nameserver is fast, set the variable below - * to NO. If your nameserver is slow, of it you would simply prefer to have + * for players' sitenames. If your nameserver is fast, set the variable below + * to NO. If your nameserver is slow, of it you would simply prefer to have * numbers instead of names for some other reason, set the variable to YES. - * You can experiment with the setting of nameserver_is_slow on-line using the + * You can experiment with the setting of nameserver_is_slow on-line using the * SLOWNS command from within the MUD. */ int nameserver_is_slow = NO; /* Will changes save automaticaly in OLC? */ int auto_save_olc = YES; -/* if you wish to enable Aedit, set this to YES. This will make the mud look - * for a file called socials.new, which is in a different format than the +/* if you wish to enable Aedit, set this to YES. This will make the mud look + * for a file called socials.new, which is in a different format than the * stock socials file. */ int use_new_socials = YES; @@ -280,8 +280,8 @@ const char *START_MESSG = "meeting people from around the world!\r\n"; /* AUTOWIZ OPTIONS */ -/* Should the game automatically create a new wizlist/immlist every time someone - * immorts, or is promoted to a higher (or lower) god level? NOTE: this only +/* Should the game automatically create a new wizlist/immlist every time someone + * immorts, or is promoted to a higher (or lower) god level? NOTE: this only * works under UNIX systems. */ int use_autowiz = YES; @@ -299,3 +299,6 @@ int display_closed_doors = YES; int map_option = MAP_IMM_ONLY; int default_map_size = 6; int default_minimap_size = 2; + +/* Medit Stats menu - show 'advanced' options? */ +int medit_advanced_stats = YES; diff --git a/src/config.h b/src/config.h index a70fed4..03bc156 100644 --- a/src/config.h +++ b/src/config.h @@ -1,13 +1,13 @@ /** * @file comm.h * Configuration of various aspects of tbaMUD operation. -* +* * Part of the core tbaMUD source code distribution, which is a derivative * of, and continuation of, CircleMUD. -* -* All rights reserved. See license for complete information. -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University -* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. +* +* All rights reserved. See license for complete information. +* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University +* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * */ #ifndef _CONFIG_H_ @@ -71,8 +71,10 @@ extern int display_closed_doors; extern int map_option; extern int default_map_size; extern int default_minimap_size; -/* - * Variables not controlled by cedit + +extern int medit_advanced_stats; +/* + * Variables not controlled by cedit */ /* Game operation settings. */ extern int bitwarning; diff --git a/src/db.c b/src/db.c index 408a100..3af0824 100644 --- a/src/db.c +++ b/src/db.c @@ -108,7 +108,7 @@ struct help_index_element *help_table = NULL; struct social_messg *soc_mess_list = NULL; /* list of socials */ int top_of_socialt = -1; /* number of socials */ - time_t newsmod; /* Time news file was last modified. */ + time_t newsmod; /* Time news file was last modified. */ time_t motdmod; /* Time motd file was last modified. */ struct time_info_data time_info; /* the infomation about the time */ @@ -156,7 +156,7 @@ char *fread_action(FILE *fl, int nr) buf1 = fgets(buf, MAX_STRING_LENGTH, fl); if (feof(fl)) { log("SYSERR: fread_action: unexpected EOF near action #%d", nr); - /* SYSERR_DESC: fread_action() will fail if it discovers an end of file + /* SYSERR_DESC: fread_action() will fail if it discovers an end of file * marker before it is able to read in the expected string. This can be * caused by a truncated socials file. */ exit(1); @@ -179,7 +179,7 @@ void boot_social_messages(void) if (!(fl = fopen(SOCMESS_FILE_NEW, "r"))) { log("SYSERR: can't open socials file '%s': %s", SOCMESS_FILE_NEW, strerror(errno)); /* SYSERR_DESC: This error, from boot_social_messages(), occurs when the - * server fails to open the file containing the social messages. The + * server fails to open the file containing the social messages. The * error at the end will indicate the reason why. */ exit(1); } @@ -195,7 +195,7 @@ void boot_social_messages(void) if (!(fl = fopen(SOCMESS_FILE, "r"))) { log("SYSERR: can't open socials file '%s': %s", SOCMESS_FILE, strerror(errno)); /* SYSERR_DESC: This error, from boot_social_messages(), occurs when the - * server fails to open the file containing the social messages. The + * server fails to open the file containing the social messages. The * error at the end will indicate the reason why. */ exit(1); } @@ -220,10 +220,10 @@ void boot_social_messages(void) if (fscanf(fl, " %s %d %d %d %d \n", sorted, &hide, &min_char_pos, &min_pos, &min_lvl) != 5) { log("SYSERR: format error in social file near social '%s'", next_soc); - /* SYSERR_DESC: From boot_social_messages(), this error is output when + /* SYSERR_DESC: From boot_social_messages(), this error is output when * the server is expecting to find the remainder of the first line of the * social ('hide' and 'minimum position'). These must follow the name of - * the social with a single space such as: 'accuse 0 5\n'. This error + * the social with a single space such as: 'accuse 0 5\n'. This error * often occurs when one of the numbers is missing or the social name has * a space in it (i.e., 'bend over'). */ exit(1); @@ -241,7 +241,7 @@ void boot_social_messages(void) /* SYSERR_DESC: From boot_social_messages(), this error is output when the * server is expecting to find the remainder of the first line of the * social ('hide' and 'minimum position'). These must follow the name of - * the social with a single space such as: 'accuse 0 5\n'. This error + * the social with a single space such as: 'accuse 0 5\n'. This error * often occurs when one of the numbers is missing or the social name has * a space in it (i.e., 'bend over'). */ exit(1); @@ -318,8 +318,8 @@ void free_text_files(void) } } -/* Too bad it doesn't check the return values to let the user know about -1 - * values. This will result in an 'Okay.' to a 'reload' command even when the +/* Too bad it doesn't check the return values to let the user know about -1 + * values. This will result in an 'Okay.' to a 'reload' command even when the * string was not replaced. To fix later. */ ACMD(do_reboot) { @@ -442,15 +442,15 @@ void boot_world(void) log("Saving 128bit world files to disk."); save_all(); } - + if (!no_specials) { log("Loading shops."); index_boot(DB_BOOT_SHP); } - + log("Loading quests."); index_boot(DB_BOOT_QST); - + } static void free_extra_descriptions(struct extra_descr_data *edesc) @@ -562,7 +562,7 @@ void destroy_db(void) /* Quests */ destroy_quests(); - + /* Zones */ #define THIS_CMD zone_table[cnt].cmd[itr] @@ -813,7 +813,7 @@ void save_mud_time(struct time_info_data *when) } } -/* Thanks to Andrey (andrey@alex-ua.com) for this bit of code, although I did +/* Thanks to Andrey (andrey@alex-ua.com) for this bit of code, although I did * add the 'goto' and changed some "while()" into "do { } while()". -gg */ static int count_alias_records(FILE *fl) { @@ -1148,7 +1148,7 @@ void parse_room(FILE *fl, int virtual_nr) { static int room_nr = 0, zone = 0; int t[10], i, retval; - char line[READ_SIZE], flags[128], flags2[128], flags3[128]; + char line[READ_SIZE], flags[128], flags2[128], flags3[128]; char flags4[128], buf2[MAX_STRING_LENGTH], buf[128]; struct extra_descr_data *new_descr; char letter; @@ -1157,7 +1157,7 @@ void parse_room(FILE *fl, int virtual_nr) snprintf(buf2, sizeof(buf2), "room #%d", virtual_nr); if (virtual_nr < zone_table[zone].bot) { - log("SYSERR: Room #%d is below zone %d (bot=%d, top=%d).", virtual_nr, zone_table[zone].number, zone_table[zone].bot, zone_table[zone].top); + log("SYSERR: Room #%d is below zone %d (bot=%d, top=%d).", virtual_nr, zone_table[zone].number, zone_table[zone].bot, zone_table[zone].top); exit(1); } while (virtual_nr > zone_table[zone].top) @@ -1180,7 +1180,7 @@ void parse_room(FILE *fl, int virtual_nr) log("WARNING: Conventional world files detected. See config.c."); exit(1); } else if ((retval == 3) && (bitwarning == FALSE)) { - /* Looks like the implementor is ready, so let's load the world files. We + /* Looks like the implementor is ready, so let's load the world files. We * load the extra three flags as 0, since they won't be anything anyway. We * will save the entire world later on, when every room, mobile, and object * is converted. */ @@ -1190,13 +1190,13 @@ void parse_room(FILE *fl, int virtual_nr) world[room_nr].room_flags[2] = 0; world[room_nr].room_flags[3] = 0; - /* In the old-style files, the 3rd item was the sector-type */ - world[room_nr].sector_type = atoi(flags2); - + /* In the old-style files, the 3rd item was the sector-type */ + world[room_nr].sector_type = atoi(flags2); + sprintf(flags, "room #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */ /* No need to scan the other three sections; they're 0 anyway. */ - check_bitvector_names(world[room_nr].room_flags[0], room_bits_count, flags, "room"); + check_bitvector_names(world[room_nr].room_flags[0], room_bits_count, flags, "room"); if(bitsavetodisk) { /* Maybe the implementor just wants to look at the 128bit files */ add_to_save_list(zone_table[real_zone_by_thing(virtual_nr)].number, 3); @@ -1213,11 +1213,11 @@ void parse_room(FILE *fl, int virtual_nr) world[room_nr].room_flags[3] = asciiflag_conv(flags4); sprintf(flags, "object #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */ - for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) + for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) check_bitvector_names(world[room_nr].room_flags[taeller], room_bits_count, flags, "room"); - /* Added Sanity check */ - if (t[2] > NUM_ROOM_SECTORS) t[2] = SECT_INSIDE; + /* Added Sanity check */ + if (t[2] > NUM_ROOM_SECTORS) t[2] = SECT_INSIDE; world[room_nr].sector_type = t[2]; } else { @@ -1250,7 +1250,7 @@ void parse_room(FILE *fl, int virtual_nr) CREATE(new_descr, struct extra_descr_data, 1); new_descr->keyword = fread_string(fl, buf2); new_descr->description = fread_string(fl, buf2); - /* Fix for crashes in the editor when formatting. E-descs are assumed to + /* Fix for crashes in the editor when formatting. E-descs are assumed to * end with a \r\n. -Welcor */ { char *end = strchr(new_descr->description, '\0'); @@ -1352,8 +1352,8 @@ void renum_world(void) #endif #define ZCMD zone_table[zone].cmd[cmd_no] -/* Resolve vnums into rnums in the zone reset tables. In English: Once all of - * the zone reset tables have been loaded, we resolve the virtual numbers into +/* Resolve vnums into rnums in the zone reset tables. In English: Once all of + * the zone reset tables have been loaded, we resolve the virtual numbers into * real numbers all at once so we don't have to do it repeatedly while the game * is running. This does make adding any room, mobile, or object a little more * difficult while the game is running. Assumes NOWHERE == NOBODY == NOTHING. @@ -1493,15 +1493,15 @@ static void parse_simple_mob(FILE *mob_f, int i, int nr) GET_WEIGHT(mob_proto + i) = 200; GET_HEIGHT(mob_proto + i) = 198; - /* These are now save applies; base save numbers for MOBs are now from the + /* These are now save applies; base save numbers for MOBs are now from the * warrior save table. */ for (j = 0; j < NUM_OF_SAVING_THROWS; j++) GET_SAVE(mob_proto + i, j) = 0; } -/* interpret_espec is the function that takes espec keywords and values and - * assigns the correct value to the mob as appropriate. Adding new e-specs is - * absurdly easy -- just add a new CASE statement to this function! No other +/* interpret_espec is the function that takes espec keywords and values and + * assigns the correct value to the mob as appropriate. Adding new e-specs is + * absurdly easy -- just add a new CASE statement to this function! No other * changes need to be made anywhere in the code. * CASE : Requires a parameter through 'value'. * BOOL_CASE : Being specified at all is its value. */ @@ -1561,6 +1561,31 @@ static void interpret_espec(const char *keyword, const char *value, int i, int n mob_proto[i].real_abils.cha = num_arg; } + CASE("SavingPara") { + RANGE(0, 100); + mob_proto[i].char_specials.saved.apply_saving_throw[SAVING_PARA] = num_arg; + } + + CASE("SavingRod") { + RANGE(0, 100); + mob_proto[i].char_specials.saved.apply_saving_throw[SAVING_ROD] = num_arg; + } + + CASE("SavingPetri") { + RANGE(0, 100); + mob_proto[i].char_specials.saved.apply_saving_throw[SAVING_PETRI] = num_arg; + } + + CASE("SavingBreath") { + RANGE(0, 100); + mob_proto[i].char_specials.saved.apply_saving_throw[SAVING_BREATH] = num_arg; + } + + CASE("SavingSpell") { + RANGE(0, 100); + mob_proto[i].char_specials.saved.apply_saving_throw[SAVING_SPELL] = num_arg; + } + if (!matched) { log("SYSERR: Warning: unrecognized espec keyword %s in mob #%d", keyword, nr); @@ -1640,7 +1665,7 @@ void parse_mobile(FILE *mob_f, int nr) exit(1); } - if (((retval = sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, t + 2, &letter)) != 10) && (bitwarning == TRUE)) { + if (((retval = sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, t + 2, &letter)) != 10) && (bitwarning == TRUE)) { /* Let's make the implementor read some, before converting his world files. */ log("WARNING: Conventional mobile files detected. See config.c."); exit(1); @@ -1651,7 +1676,7 @@ void parse_mobile(FILE *mob_f, int nr) MOB_FLAGS(mob_proto + i)[2] = 0; MOB_FLAGS(mob_proto + i)[3] = 0; check_bitvector_names(MOB_FLAGS(mob_proto + i)[0], action_bits_count, buf2, "mobile"); - + AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv_aff(f2); AFF_FLAGS(mob_proto + i)[1] = 0; AFF_FLAGS(mob_proto + i)[2] = 0; @@ -1660,11 +1685,11 @@ void parse_mobile(FILE *mob_f, int nr) GET_ALIGNMENT(mob_proto + i) = atoi(f3); /* Make some basic checks. */ - REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_CHARM); + REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_CHARM); REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_POISON); REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_GROUP); REMOVE_BIT_AR(AFF_FLAGS(mob_proto + i), AFF_SLEEP); - if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_GOOD)) + if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_GOOD)) REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_GOOD); if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_NEUTRAL)) REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_NEUTRAL); @@ -1673,9 +1698,9 @@ void parse_mobile(FILE *mob_f, int nr) check_bitvector_names(AFF_FLAGS(mob_proto + i)[0], affected_bits_count, buf2, "mobile affect"); - /* This is necessary, since if we have conventional world files, &letter is - * loaded into f4 instead of the letter characters. So what we do, is copy - * f4 into letter. Disadvantage is that &letter cannot be longer then 128 + /* This is necessary, since if we have conventional world files, &letter is + * loaded into f4 instead of the letter characters. So what we do, is copy + * f4 into letter. Disadvantage is that &letter cannot be longer then 128 * characters, but this shouldn't occur anyway. */ letter = *f4; @@ -1692,17 +1717,17 @@ void parse_mobile(FILE *mob_f, int nr) MOB_FLAGS(mob_proto + i)[1] = asciiflag_conv(f2); MOB_FLAGS(mob_proto + i)[2] = asciiflag_conv(f3); MOB_FLAGS(mob_proto + i)[3] = asciiflag_conv(f4); - for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) + for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) check_bitvector_names(MOB_FLAGS(mob_proto + i)[taeller], action_bits_count, buf2, "mobile"); - + AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv(f5); AFF_FLAGS(mob_proto + i)[1] = asciiflag_conv(f6); AFF_FLAGS(mob_proto + i)[2] = asciiflag_conv(f7); AFF_FLAGS(mob_proto + i)[3] = asciiflag_conv(f8); GET_ALIGNMENT(mob_proto + i) = t[2]; - - for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) + + for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) check_bitvector_names(AFF_FLAGS(mob_proto + i)[taeller], affected_bits_count, buf2, "mobile affect"); } else { log("SYSERR: Format error after string section of mob #%d\n ...expecting line of form '# # # {S | E}'", nr); @@ -1791,18 +1816,18 @@ char *parse_object(FILE *obj_f, int nr) exit(1); } - if (((retval = sscanf(line, " %d %s %s %s %s %s %s %s %s %s %s %s %s", t, f1, f2, f3, + if (((retval = sscanf(line, " %d %s %s %s %s %s %s %s %s %s %s %s %s", t, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12)) == 4) && (bitwarning == TRUE)) { /* Let's make the implementor read some, before converting his world files. */ log("WARNING: Conventional object files detected. Please see config.c."); exit(1); } else if (((retval == 4) || (retval == 3)) && (bitwarning == FALSE)) { - + if (retval == 3) t[3] = 0; else if (retval == 4) t[3] = asciiflag_conv_aff(f3); - + log("Converting object #%d to 128bits..", nr); GET_OBJ_EXTRA(obj_proto + i)[0] = asciiflag_conv(f1); GET_OBJ_EXTRA(obj_proto + i)[1] = 0; @@ -1816,15 +1841,15 @@ char *parse_object(FILE *obj_f, int nr) GET_OBJ_PERM(obj_proto + i)[1] = 0; GET_OBJ_PERM(obj_proto + i)[2] = 0; GET_OBJ_PERM(obj_proto + i)[3] = 0; - - if(bitsavetodisk) { + + if(bitsavetodisk) { add_to_save_list(zone_table[real_zone_by_thing(nr)].number, 1); converting = TRUE; } log(" done."); } else if (retval == 13) { - + GET_OBJ_EXTRA(obj_proto + i)[0] = asciiflag_conv(f1); GET_OBJ_EXTRA(obj_proto + i)[1] = asciiflag_conv(f2); GET_OBJ_EXTRA(obj_proto + i)[2] = asciiflag_conv(f3); @@ -1866,11 +1891,11 @@ char *parse_object(FILE *obj_f, int nr) if ((retval = sscanf(line, "%d %d %d %d %d", t, t + 1, t + 2, t + 3, t + 4)) != 5) { if (retval == 3) { t[3] = 0; - t[4] = 0; - } else if (retval == 4) + t[4] = 0; + } else if (retval == 4) t[4] = 0; else { - log("SYSERR: Format error in third numeric line (expecting 5 args, got %d), %s", retval, buf2); + log("SYSERR: Format error in third numeric line (expecting 5 args, got %d), %s", retval, buf2); exit(1); } } @@ -1967,7 +1992,7 @@ static void load_zones(FILE *fl, char *zonename) get_line(fl, buf); /* More accurate count. Previous was always 4 or 5 too high. -gg Note that if - * a new zone command is added to reset_zone(), this string will need to be + * a new zone command is added to reset_zone(), this string will need to be * updated to suit. - ae. */ while (get_line(fl, buf)) if ((strchr("MOPGERDTV", buf[0]) && buf[1] == ' ') || (buf[0] == 'S' && buf[1] == '\0')) @@ -2001,8 +2026,8 @@ static void load_zones(FILE *fl, char *zonename) line_num += get_line(fl, buf); if (sscanf(buf, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { - /* This may be due to the fact that the zone has no builder. So, we just - * attempt to fix this by copying the previous 2 last reads into this + /* This may be due to the fact that the zone has no builder. So, we just + * attempt to fix this by copying the previous 2 last reads into this * variable and the last one. */ log("SYSERR: Format error in numeric constant line of %s, attempting to fix.", zname); if (sscanf(Z.name, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { @@ -2093,7 +2118,7 @@ static void get_one_line(FILE *fl, char *buf) buf[strlen(buf) - 1] = '\0'; /* take off the trailing \n */ } -void free_help(struct help_index_element *hentry) +void free_help(struct help_index_element *hentry) { if (hentry->keywords) free(hentry->keywords); @@ -2180,14 +2205,14 @@ void load_help(FILE * fl, char *name) } } -static int hsort(const void *a, const void *b) +static int hsort(const void *a, const void *b) { const struct help_index_element *a1, *b1; a1 = (const struct help_index_element *) a; b1 = (const struct help_index_element *) b; - return (str_cmp(a1->keywords, b1->keywords)); + return (str_cmp(a1->keywords, b1->keywords)); } int vnum_mobile(char *searchname, struct char_data *ch) @@ -2357,7 +2382,7 @@ void zone_update(void) /* jelson 10/22/92 */ if (((++timer * PULSE_ZONE) / PASSES_PER_SEC) >= 60) { - /* one minute has passed NOT accurate unless PULSE_ZONE is a multiple of + /* one minute has passed NOT accurate unless PULSE_ZONE is a multiple of * PASSES_PER_SEC or a factor of 60 */ timer = 0; @@ -2389,7 +2414,7 @@ void zone_update(void) } } /* end - one minute has passed */ - /* Dequeue zones (if possible) and reset. This code is executed every 10 + /* Dequeue zones (if possible) and reset. This code is executed every 10 * seconds (i.e. PULSE_ZONE). */ for (update_u = reset_q.head; update_u; update_u = update_u->next) if (zone_table[update_u->zone_to_reset].reset_mode == 2 || @@ -2441,7 +2466,7 @@ void reset_zone(zone_rnum zone) if (ZCMD.if_flag && !last_cmd) continue; - /* This is the list of actual zone commands. If any new zone commands are + /* This is the list of actual zone commands. If any new zone commands are * added to the game, be certain to update the list of commands in load_zone * () so that the counting will still be correct. - ae. */ switch (ZCMD.command) { @@ -2670,7 +2695,7 @@ int is_empty(zone_rnum zone_nr) continue; if (world[IN_ROOM(i->character)].zone != zone_nr) continue; - /* If an immortal has nohassle off, he counts as present. Added for testing + /* If an immortal has nohassle off, he counts as present. Added for testing * zone reset triggers -Welcor */ if ((!IS_NPC(i->character)) && (GET_LEVEL(i->character) >= LVL_IMMORT) && (PRF_FLAGGED(i->character, PRF_NOHASSLE))) continue; @@ -2775,8 +2800,8 @@ void free_char(struct char_data *ch) for (i = 0; i < NUM_HIST; i++) if (GET_HISTORY(ch, i)) free(GET_HISTORY(ch, i)); - - if (ch->player_specials) + + if (ch->player_specials) free(ch->player_specials); /* free script proto list */ @@ -2811,7 +2836,7 @@ void free_char(struct char_data *ch) if (ch->desc) ch->desc->character = NULL; - /* find_char helper, when free_char is called with a blank character struct, + /* find_char helper, when free_char is called with a blank character struct, * ID is set to 0, and has not yet been added to the lookup table. */ if (GET_ID(ch) != 0) remove_from_lookup_table(GET_ID(ch)); @@ -2842,14 +2867,14 @@ void free_obj(struct obj_data *obj) free(obj); } -/* Steps: 1: Read contents of a text file. 2: Make sure no one is using the +/* Steps: 1: Read contents of a text file. 2: Make sure no one is using the * pointer in paging. 3: Allocate space. 4: Point 'buf' to it. * We don't want to free() the string that someone may be viewing in the pager. - * page_string() keeps the internal strdup()'d copy on ->showstr_head and it - * won't care if we delete the original. Otherwise, strings are kept on - * ->showstr_vector but we'll only match if the pointer is to the string we're - * interested in and not a copy. If someone is reading a global copy we're - * trying to replace, give everybody using it a different copy so as to avoid + * page_string() keeps the internal strdup()'d copy on ->showstr_head and it + * won't care if we delete the original. Otherwise, strings are kept on + * ->showstr_vector but we'll only match if the pointer is to the string we're + * interested in and not a copy. If someone is reading a global copy we're + * trying to replace, give everybody using it a different copy so as to avoid * special cases. */ static int file_to_string_alloc(const char *name, char **buf) { @@ -2897,16 +2922,16 @@ static int file_to_string(const char *name, char *buf) return (-1); } - /* Grab the date/time the file was last edited */ - if (!strcmp(name, NEWS_FILE)) - { - fstat(fileno(fl), &statbuf); - newsmod = statbuf.st_mtime; - } - if (!strcmp(name, MOTD_FILE)) - { - fstat(fileno(fl), &statbuf); - motdmod = statbuf.st_mtime; + /* Grab the date/time the file was last edited */ + if (!strcmp(name, NEWS_FILE)) + { + fstat(fileno(fl), &statbuf); + newsmod = statbuf.st_mtime; + } + if (!strcmp(name, MOTD_FILE)) + { + fstat(fileno(fl), &statbuf); + motdmod = statbuf.st_mtime; } for (;;) { @@ -2988,7 +3013,7 @@ void clear_object(struct obj_data *obj) obj->worn_on = NOWHERE; } -/* Called during character creation after picking character class (and then +/* Called during character creation after picking character class (and then * never again for that character). */ void init_char(struct char_data *ch) { @@ -3020,16 +3045,16 @@ void init_char(struct char_data *ch) GET_NUM_QUESTS(ch) = 0; ch->player_specials->saved.completed_quests = NULL; GET_QUEST(ch) = -1; - + ch->player.time.birth = time(0); ch->player.time.logon = time(0); ch->player.time.played = 0; GET_AC(ch) = 100; - /* Bias the height and weight of the character depending on what gender - * they have chosen. While it is possible to have a tall, heavy female it's - * not as likely as a male. Height is in centimeters. Weight is in pounds. + /* Bias the height and weight of the character depending on what gender + * they have chosen. While it is possible to have a tall, heavy female it's + * not as likely as a male. Height is in centimeters. Weight is in pounds. * The only place they're ever printed (in stock code) is SPELL_IDENTIFY. */ if (GET_SEX(ch) == SEX_MALE) { GET_WEIGHT(ch) = rand_number(120, 180); @@ -3105,10 +3130,10 @@ mob_rnum real_mobile(mob_vnum vnum) bot = 0; top = top_of_mobt; - /* quickly reject out-of-range vnums */ - if (mob_index[bot].vnum > vnum || mob_index[top].vnum < vnum) - return (NOBODY); - + /* quickly reject out-of-range vnums */ + if (mob_index[bot].vnum > vnum || mob_index[top].vnum < vnum) + return (NOBODY); + /* perform binary search on mob-table */ while (bot <= top) { mid = (bot + top) / 2; @@ -3131,9 +3156,9 @@ obj_rnum real_object(obj_vnum vnum) bot = 0; top = top_of_objt; - /* quickly reject out-of-range vnums */ - if (obj_index[bot].vnum > vnum || obj_index[top].vnum < vnum) - return (NOTHING); + /* quickly reject out-of-range vnums */ + if (obj_index[bot].vnum > vnum || obj_index[top].vnum < vnum) + return (NOTHING); /* perform binary search on obj-table */ while (bot <= top) { @@ -3159,7 +3184,7 @@ zone_rnum real_zone(zone_vnum vnum) if (zone_table[bot].number > vnum || zone_table[top].number < vnum) return (NOWHERE); - + /* perform binary search on zone-table */ while (bot <= top) { mid = (bot + top) / 2; @@ -3207,7 +3232,7 @@ static int check_object(struct obj_data *obj) } /* Fall through. */ case ITEM_FOUNTAIN: - if ((GET_OBJ_VAL(obj,0) > 0) && (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) + if ((GET_OBJ_VAL(obj,0) > 0) && (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) && (error = TRUE))) log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).", GET_OBJ_VNUM(obj), obj->short_description, @@ -3245,7 +3270,7 @@ static int check_object(struct obj_data *obj) case ITEM_FURNITURE: if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) && (error = TRUE)) log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).", - GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, 1), + GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 0)); break; } @@ -3261,7 +3286,7 @@ static int check_object_spell_number(struct obj_data *obj, int val) if (GET_OBJ_VAL(obj, val) == -1 || GET_OBJ_VAL(obj, val) == 0) /* no spell */ return (error); - /* Check for negative spells, spells beyond the top define, and any spell + /* Check for negative spells, spells beyond the top define, and any spell * which is actually a skill. */ if (GET_OBJ_VAL(obj, val) < 0) error = TRUE; @@ -3318,7 +3343,7 @@ static int check_bitvector_names(bitvector_t bits, size_t namecount, const char static void load_default_config( void ) { - /* This function is called only once, at boot-time. We assume config_info is + /* This function is called only once, at boot-time. We assume config_info is * empty. -Welcor */ /* Game play options. */ CONFIG_PK_ALLOWED = pk_allowed; @@ -3388,6 +3413,7 @@ static void load_default_config( void ) CONFIG_MENU = strdup(MENU); CONFIG_WELC_MESSG = strdup(WELC_MESSG); CONFIG_START_MESSG = strdup(START_MESSG); + CONFIG_MEDIT_ADVANCED = medit_advanced_stats; /* Autowiz options. */ CONFIG_USE_AUTOWIZ = use_autowiz; @@ -3543,6 +3569,8 @@ void load_config( void ) CONFIG_MORTAL_START = num; else if (!str_cmp(tag, "map_option")) CONFIG_MAP = num; + else if (!str_cmp(tag, "medit_advanced_stats")) + CONFIG_MEDIT_ADVANCED = num; break; case 'n': @@ -3588,7 +3616,7 @@ void load_config( void ) case 's': if (!str_cmp(tag, "siteok_everyone")) CONFIG_SITEOK_ALL = num; - else if (!str_cmp(tag, "script_players")) + else if (!str_cmp(tag, "script_players")) CONFIG_SCRIPT_PLAYERS = num; else if (!str_cmp(tag, "start_messg")) { strncpy(buf, "Reading start message in load_config()", sizeof(buf)); diff --git a/src/genmob.c b/src/genmob.c index 066f873..e2e2eeb 100644 --- a/src/genmob.c +++ b/src/genmob.c @@ -16,6 +16,7 @@ #include "genmob.h" #include "genzon.h" #include "dg_olc.h" +#include "spells.h" /* local functions */ static void extract_mobile_all(mob_vnum vnum); @@ -203,7 +204,7 @@ int free_mobile_strings(struct char_data *mob) return TRUE; } -/* Free a mobile structure that has been edited. Take care of existing mobiles +/* Free a mobile structure that has been edited. Take care of existing mobiles * and their mob_proto! */ int free_mobile(struct char_data *mob) { @@ -302,6 +303,20 @@ int write_mobile_espec(mob_vnum mvnum, struct char_data *mob, FILE *fd) fprintf(fd, "Int: %d\n", GET_INT(mob)); if (GET_WIS(mob) != 11) fprintf(fd, "Wis: %d\n", GET_WIS(mob)); + if (GET_CON(mob) != 11) + fprintf(fd, "Con: %d\n", GET_CON(mob)); + if (GET_CHA(mob) != 11) + fprintf(fd, "Cha: %d\n", GET_CHA(mob)); + if (GET_SAVE(mob, SAVING_PARA) != 0) + fprintf(fd, "SavingPara: %d\n", GET_SAVE(mob, SAVING_PARA)); + if (GET_SAVE(mob, SAVING_ROD) != 0) + fprintf(fd, "SavingRod: %d\n", GET_SAVE(mob, SAVING_ROD)); + if (GET_SAVE(mob, SAVING_PETRI) != 0) + fprintf(fd, "SavingPetri: %d\n", GET_SAVE(mob, SAVING_PETRI)); + if (GET_SAVE(mob, SAVING_BREATH) != 0) + fprintf(fd, "SavingBreath: %d\n", GET_SAVE(mob, SAVING_BREATH)); + if (GET_SAVE(mob, SAVING_SPELL) != 0) + fprintf(fd, "SavingSpell: %d\n", GET_SAVE(mob, SAVING_SPELL)); fputs("E\n", fd); return TRUE; } diff --git a/src/interpreter.c b/src/interpreter.c index 0927da8..bf9c46a 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -313,6 +313,7 @@ cpp_extern const struct command_info cmd_info[] = { { "wear" , "wea" , POS_RESTING , do_wear , 0, 0 }, { "weather" , "weather" , POS_RESTING , do_weather , 0, 0 }, { "who" , "wh" , POS_DEAD , do_who , 0, 0 }, + { "whois" , "whoi" , POS_DEAD , do_whois , 0, 0 }, { "whoami" , "whoami" , POS_DEAD , do_gen_ps , 0, SCMD_WHOAMI }, { "where" , "where" , POS_RESTING , do_where , 1, 0 }, { "whisper" , "whisper" , POS_RESTING , do_spec_comm, 0, SCMD_WHISPER }, diff --git a/src/medit.c b/src/medit.c index 667ed5a..496e12f 100644 --- a/src/medit.c +++ b/src/medit.c @@ -50,7 +50,7 @@ ACMD(do_oasis_medit) /* No building as a mob or while being forced. */ if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) return; - + /* Parse any arguments */ buf3 = two_arguments(argument, buf1, buf2); @@ -228,6 +228,12 @@ static void init_mobile(struct char_data *mob) mob->real_abils.dex = mob->real_abils.con = mob->real_abils.cha = 11; mob->aff_abils = mob->real_abils; + GET_SAVE(mob, SAVING_PARA) = 0; + GET_SAVE(mob, SAVING_ROD) = 0; + GET_SAVE(mob, SAVING_PETRI) = 0; + GET_SAVE(mob, SAVING_BREATH) = 0; + GET_SAVE(mob, SAVING_SPELL) = 0; + SET_BIT_AR(MOB_FLAGS(mob), MOB_ISNPC); mob->player_specials = &dummy_mob; } @@ -289,7 +295,7 @@ void medit_save_internally(struct descriptor_data *d) OLC_ZONE(dsc)->cmd[i].arg1++; } -/* Menu functions +/* Menu functions Display positions. (sitting, standing, etc) */ static void medit_disp_positions(struct descriptor_data *d) { @@ -354,7 +360,7 @@ static void medit_disp_aff_flags(struct descriptor_data *d) get_char_colors(d->character); clear_screen(d); - + /* +1 since AFF_FLAGS don't start at 0. */ column_list(d->character, 2, affected_bits + 1, NUM_AFF_FLAGS, TRUE); @@ -378,41 +384,25 @@ static void medit_disp_menu(struct descriptor_data *d) "%s1%s) Sex: %s%-7.7s%s %s2%s) Keywords: %s%s\r\n" "%s3%s) S-Desc: %s%s\r\n" "%s4%s) L-Desc:-\r\n%s%s" - "%s5%s) D-Desc:-\r\n%s%s" - "%s6%s) Level: [%s%4d%s], %s7%s) Alignment: [%s%4d%s]\r\n" - "%s8%s) Hitroll: [%s%4d%s], %s9%s) Damroll: [%s%4d%s]\r\n" - "%sA%s) NumDamDice: [%s%4d%s], %sB%s) SizeDamDice: [%s%4d%s]\r\n" - "%sC%s) Num HP Dice: [%s%4d%s], %sD%s) Size HP Dice: [%s%4d%s], %sE%s) HP Bonus: [%s%5d%s]\r\n" - "%sF%s) Armor Class: [%s%4d%s], %sG%s) Exp: [%s%9d%s], %sH%s) Gold: [%s%8d%s]\r\n", + "%s5%s) D-Desc:-\r\n%s%s", cyn, OLC_NUM(d), nrm, grn, nrm, yel, genders[(int)GET_SEX(mob)], nrm, grn, nrm, yel, GET_ALIAS(mob), grn, nrm, yel, GET_SDESC(mob), grn, nrm, yel, GET_LDESC(mob), - grn, nrm, yel, GET_DDESC(mob), - grn, nrm, cyn, GET_LEVEL(mob), nrm, - grn, nrm, cyn, GET_ALIGNMENT(mob), nrm, - grn, nrm, cyn, GET_HITROLL(mob), nrm, - grn, nrm, cyn, GET_DAMROLL(mob), nrm, - grn, nrm, cyn, GET_NDD(mob), nrm, - grn, nrm, cyn, GET_SDD(mob), nrm, - grn, nrm, cyn, GET_HIT(mob), nrm, - grn, nrm, cyn, GET_MANA(mob), nrm, - grn, nrm, cyn, GET_MOVE(mob), nrm, - grn, nrm, cyn, GET_AC(mob), nrm, - grn, nrm, cyn, GET_EXP(mob), nrm, - grn, nrm, cyn, GET_GOLD(mob), nrm + grn, nrm, yel, GET_DDESC(mob) ); sprintbitarray(MOB_FLAGS(mob), action_bits, AF_ARRAY_MAX, flags); sprintbitarray(AFF_FLAGS(mob), affected_bits, AF_ARRAY_MAX, flag2); write_to_output(d, - "%sI%s) Position : %s%s\r\n" - "%sJ%s) Default : %s%s\r\n" - "%sK%s) Attack : %s%s\r\n" - "%sL%s) NPC Flags : %s%s\r\n" - "%sM%s) AFF Flags : %s%s\r\n" + "%s6%s) Position : %s%s\r\n" + "%s7%s) Default : %s%s\r\n" + "%s8%s) Attack : %s%s\r\n" + "%s9%s) Stats Menu...\r\n" + "%sA%s) NPC Flags : %s%s\r\n" + "%sB%s) AFF Flags : %s%s\r\n" "%sS%s) Script : %s%s\r\n" "%sW%s) Copy mob\r\n" "%sX%s) Delete mob\r\n" @@ -422,6 +412,7 @@ static void medit_disp_menu(struct descriptor_data *d) grn, nrm, yel, position_types[(int)GET_POS(mob)], grn, nrm, yel, position_types[(int)GET_DEFAULT_POS(mob)], grn, nrm, yel, attack_hit_text[(int)GET_ATTACK(mob)].singular, + grn, nrm, grn, nrm, cyn, flags, grn, nrm, cyn, flag2, grn, nrm, cyn, OLC_SCRIPT(d) ?"Set.":"Not Set.", @@ -433,6 +424,71 @@ static void medit_disp_menu(struct descriptor_data *d) OLC_MODE(d) = MEDIT_MAIN_MENU; } +/* Display main menu. */ +static void medit_disp_stats_menu(struct descriptor_data *d) +{ + struct char_data *mob; + char buf[MAX_STRING_LENGTH]; + + mob = OLC_MOB(d); + get_char_colors(d->character); + clear_screen(d); + + /* Color codes have to be used here, for count_color_codes to work */ + sprintf(buf, "(range @y%d@n to @y%d@n)", GET_HIT(mob) + GET_MOVE(mob), (GET_HIT(mob) * GET_MANA(mob)) + GET_MOVE(mob)); + + /* Top section - standard stats */ + write_to_output(d, + "-- Mob Number: %s[%s%d%s]%s\r\n" + "(%s1%s) Level: %s[%s%4d%s]%s\r\n" + "(%s2%s) %sAuto Set Stats (based on level)%s\r\n\r\n" + "Hit Points (xdy+z): Bare Hand Damage (xdy+z): \r\n" + "(%s3%s) HP NumDice: %s[%s%5d%s]%s (%s6%s) BHD NumDice: %s[%s%5d%s]%s\r\n" + "(%s4%s) HP SizeDice: %s[%s%5d%s]%s (%s7%s) BHD SizeDice: %s[%s%5d%s]%s\r\n" + "(%s5%s) HP Addition: %s[%s%5d%s]%s (%s8%s) DamRoll: %s[%s%5d%s]%s\r\n" + "%-*s(range %s%d%s to %s%d%s)\r\n\r\n" + + "(%sA%s) Armor Class: %s[%s%4d%s]%s (%sD%s) Hitroll: %s[%s%5d%s]%s\r\n" + "(%sB%s) Exp Points: %s[%s%10d%s]%s (%sE%s) Alignment: %s[%s%5d%s]%s\r\n" + "(%sC%s) Gold: %s[%s%10d%s]%s\r\n\r\n", + cyn, yel, OLC_NUM(d), cyn, nrm, + cyn, nrm, cyn, yel, GET_LEVEL(mob), cyn, nrm, + cyn, nrm, cyn, nrm, + cyn, nrm, cyn, yel, GET_HIT(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_NDD(mob), cyn, nrm, + cyn, nrm, cyn, yel, GET_MANA(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SDD(mob), cyn, nrm, + cyn, nrm, cyn, yel, GET_MOVE(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_DAMROLL(mob), cyn, nrm, + + count_color_chars(buf)+28, buf, + yel, GET_NDD(mob) + GET_DAMROLL(mob), nrm, + yel, (GET_NDD(mob) * GET_SDD(mob)) + GET_DAMROLL(mob), nrm, + + cyn, nrm, cyn, yel, GET_AC(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_HITROLL(mob), cyn, nrm, + cyn, nrm, cyn, yel, GET_EXP(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_ALIGNMENT(mob), cyn, nrm, + cyn, nrm, cyn, yel, GET_GOLD(mob), cyn, nrm + ); + + /* Bottom section - non-standard stats, togglable in cedit */ + write_to_output(d, + "(%sF%s) Str: %s[%s%2d/%3d%s]%s Saving Throws\r\n" + "(%sG%s) Int: %s[%s%3d%s]%s (%sL%s) Paralysis %s[%s%3d%s]%s\r\n" + "(%sH%s) Wis: %s[%s%3d%s]%s (%sM%s) Rods/Staves %s[%s%3d%s]%s\r\n" + "(%sI%s) Dex: %s[%s%3d%s]%s (%sN%s) Petrification %s[%s%3d%s]%s\r\n" + "(%sJ%s) Con: %s[%s%3d%s]%s (%sO%s) Breath %s[%s%3d%s]%s\r\n" + "(%sK%s) Cha: %s[%s%3d%s]%s (%sP%s) Spells %s[%s%3d%s]%s\r\n\r\n", + cyn, nrm, cyn, yel, GET_STR(mob), GET_ADD(mob), cyn, nrm, + cyn, nrm, cyn, yel, GET_INT(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SAVE(mob, SAVING_PARA), cyn, nrm, + cyn, nrm, cyn, yel, GET_WIS(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SAVE(mob, SAVING_ROD), cyn, nrm, + cyn, nrm, cyn, yel, GET_DEX(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SAVE(mob, SAVING_PETRI), cyn, nrm, + cyn, nrm, cyn, yel, GET_CON(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SAVE(mob, SAVING_BREATH), cyn, nrm, + cyn, nrm, cyn, yel, GET_CHA(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SAVE(mob, SAVING_SPELL), cyn, nrm + ); + + /* Quit to previous menu option */ + write_to_output(d, "(%sQ%s) Quit to main menu\r\nEnter choice : ", cyn, nrm); + + OLC_MODE(d) = MEDIT_STATS_MENU; +} + void medit_parse(struct descriptor_data *d, char *arg) { int i = -1; @@ -467,8 +523,8 @@ void medit_parse(struct descriptor_data *d, char *arg) return; case 'n': case 'N': - /* If not saving, we must free the script_proto list. We do so by - * assigning it to the edited mob and letting free_mobile in + /* If not saving, we must free the script_proto list. We do so by + * assigning it to the edited mob and letting free_mobile in * cleanup_olc handle it. */ OLC_MOB(d)->proto_script = OLC_SCRIPT(d); cleanup_olc(d, CLEANUP_ALL); @@ -519,83 +575,28 @@ void medit_parse(struct descriptor_data *d, char *arg) OLC_VAL(d) = 1; return; case '6': - OLC_MODE(d) = MEDIT_LEVEL; - i++; - break; - case '7': - OLC_MODE(d) = MEDIT_ALIGNMENT; - i++; - break; - case '8': - OLC_MODE(d) = MEDIT_HITROLL; - i++; - break; - case '9': - OLC_MODE(d) = MEDIT_DAMROLL; - i++; - break; - case 'a': - case 'A': - OLC_MODE(d) = MEDIT_NDD; - i++; - break; - case 'b': - case 'B': - OLC_MODE(d) = MEDIT_SDD; - i++; - break; - case 'c': - case 'C': - OLC_MODE(d) = MEDIT_NUM_HP_DICE; - i++; - break; - case 'd': - case 'D': - OLC_MODE(d) = MEDIT_SIZE_HP_DICE; - i++; - break; - case 'e': - case 'E': - OLC_MODE(d) = MEDIT_ADD_HP; - i++; - break; - case 'f': - case 'F': - OLC_MODE(d) = MEDIT_AC; - i++; - break; - case 'g': - case 'G': - OLC_MODE(d) = MEDIT_EXP; - i++; - break; - case 'h': - case 'H': - OLC_MODE(d) = MEDIT_GOLD; - i++; - break; - case 'i': - case 'I': OLC_MODE(d) = MEDIT_POS; medit_disp_positions(d); return; - case 'j': - case 'J': + case '7': OLC_MODE(d) = MEDIT_DEFAULT_POS; medit_disp_positions(d); return; - case 'k': - case 'K': + case '8': OLC_MODE(d) = MEDIT_ATTACK; medit_disp_attack_types(d); return; - case 'l': - case 'L': + case '9': + OLC_MODE(d) = MEDIT_STATS_MENU; + medit_disp_stats_menu(d); + return; + case 'a': + case 'A': OLC_MODE(d) = MEDIT_NPC_FLAGS; medit_disp_mob_flags(d); return; - case 'm': - case 'M': + case 'b': + case 'B': OLC_MODE(d) = MEDIT_AFF_FLAGS; medit_disp_aff_flags(d); return; @@ -628,6 +629,139 @@ void medit_parse(struct descriptor_data *d, char *arg) write_to_output(d, "Oops...\r\n"); return; + case MEDIT_STATS_MENU: + i=0; + switch(*arg) { + case 'q': + case 'Q': + medit_disp_menu(d); + return; + case '1': /* Edit level */ + OLC_MODE(d) = MEDIT_LEVEL; + i++; + break; + case '2': /* Autoroll stats */ + medit_autoroll_stats(d); + medit_disp_stats_menu(d); + return; + case '3': + OLC_MODE(d) = MEDIT_NUM_HP_DICE; + i++; + break; + case '4': + OLC_MODE(d) = MEDIT_SIZE_HP_DICE; + i++; + break; + case '5': + OLC_MODE(d) = MEDIT_ADD_HP; + i++; + break; + case '6': + OLC_MODE(d) = MEDIT_NDD; + i++; + break; + case '7': + OLC_MODE(d) = MEDIT_SDD; + i++; + break; + case '8': + OLC_MODE(d) = MEDIT_DAMROLL; + i++; + break; + case 'a': + case 'A': + OLC_MODE(d) = MEDIT_AC; + i++; + break; + case 'b': + case 'B': + OLC_MODE(d) = MEDIT_EXP; + i++; + break; + case 'c': + case 'C': + OLC_MODE(d) = MEDIT_GOLD; + i++; + break; + case 'd': + case 'D': + OLC_MODE(d) = MEDIT_HITROLL; + i++; + break; + case 'e': + case 'E': + OLC_MODE(d) = MEDIT_ALIGNMENT; + i++; + break; + case 'f': + case 'F': + OLC_MODE(d) = MEDIT_STR; + i++; + break; + case 'g': + case 'G': + OLC_MODE(d) = MEDIT_INT; + i++; + break; + case 'h': + case 'H': + OLC_MODE(d) = MEDIT_WIS; + i++; + break; + case 'i': + case 'I': + OLC_MODE(d) = MEDIT_DEX; + i++; + break; + case 'j': + case 'J': + OLC_MODE(d) = MEDIT_CON; + i++; + break; + case 'k': + case 'K': + OLC_MODE(d) = MEDIT_CHA; + i++; + break; + case 'l': + case 'L': + OLC_MODE(d) = MEDIT_PARA; + i++; + break; + case 'm': + case 'M': + OLC_MODE(d) = MEDIT_ROD; + i++; + break; + case 'n': + case 'N': + OLC_MODE(d) = MEDIT_PETRI; + i++; + break; + case 'o': + case 'O': + OLC_MODE(d) = MEDIT_BREATH; + i++; + break; + case 'p': + case 'P': + OLC_MODE(d) = MEDIT_SPELL; + i++; + break; + default: + medit_disp_stats_menu(d); + return; + } + if (i == 0) + break; + else if (i == 1) + write_to_output(d, "\r\nEnter new value : "); + else if (i == -1) + write_to_output(d, "\r\nEnter new text :\r\n] "); + else + write_to_output(d, "Oops...\r\n"); + return; + case OLC_SCRIPT_EDIT: if (dg_script_edit_parse(d, arg)) return; break; @@ -694,47 +828,134 @@ void medit_parse(struct descriptor_data *d, char *arg) case MEDIT_SEX: GET_SEX(OLC_MOB(d)) = LIMIT(i, 0, NUM_GENDERS - 1); - break; + medit_disp_stats_menu(d); + return; case MEDIT_HITROLL: GET_HITROLL(OLC_MOB(d)) = LIMIT(i, 0, 50); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_DAMROLL: GET_DAMROLL(OLC_MOB(d)) = LIMIT(i, 0, 50); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_NDD: GET_NDD(OLC_MOB(d)) = LIMIT(i, 0, 30); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_SDD: GET_SDD(OLC_MOB(d)) = LIMIT(i, 0, 127); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_NUM_HP_DICE: GET_HIT(OLC_MOB(d)) = LIMIT(i, 0, 30); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_SIZE_HP_DICE: GET_MANA(OLC_MOB(d)) = LIMIT(i, 0, 1000); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_ADD_HP: GET_MOVE(OLC_MOB(d)) = LIMIT(i, 0, 30000); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_AC: GET_AC(OLC_MOB(d)) = LIMIT(i, -200, 200); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_EXP: GET_EXP(OLC_MOB(d)) = LIMIT(i, 0, MAX_MOB_EXP); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_GOLD: GET_GOLD(OLC_MOB(d)) = LIMIT(i, 0, MAX_MOB_GOLD); - break; + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_STR: + GET_STR(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_INT: + GET_INT(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_WIS: + GET_WIS(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_DEX: + GET_DEX(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_CON: + GET_CON(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_CHA: + GET_CHA(OLC_MOB(d)) = LIMIT(i, 11, 25); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_PARA: + GET_SAVE(OLC_MOB(d), SAVING_PARA) = LIMIT(i, 0, 100); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_ROD: + GET_SAVE(OLC_MOB(d), SAVING_ROD) = LIMIT(i, 0, 100); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_PETRI: + GET_SAVE(OLC_MOB(d), SAVING_PETRI) = LIMIT(i, 0, 100); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_BREATH: + GET_SAVE(OLC_MOB(d), SAVING_BREATH) = LIMIT(i, 0, 100); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; + + case MEDIT_SPELL: + GET_SAVE(OLC_MOB(d), SAVING_SPELL) = LIMIT(i, 0, 100); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_POS: GET_POS(OLC_MOB(d)) = LIMIT(i, 0, NUM_POSITIONS - 1); @@ -749,22 +970,10 @@ void medit_parse(struct descriptor_data *d, char *arg) break; case MEDIT_LEVEL: - GET_LEVEL(OLC_MOB(d)) = LIMIT(i, 1, 34); - { - int mob_lev = GET_LEVEL(OLC_MOB(d)); - - GET_MOVE(OLC_MOB(d)) = mob_lev*10; /* hit point bonus */ - GET_HIT(OLC_MOB(d)) = mob_lev/5; /* number of hitpoint dice */ - GET_MANA(OLC_MOB(d)) = mob_lev/5; /* size of hitpoint dice */ - GET_HITROLL(OLC_MOB(d)) = mob_lev/3; /* hitroll 0-10 */ - GET_DAMROLL(OLC_MOB(d)) = mob_lev/6; /* damroll 0-5 */ - GET_AC(OLC_MOB(d)) = (100-(mob_lev*6)); /* AC 94 to -80 */ - GET_NDD(OLC_MOB(d)) = MAX(1, mob_lev/6); /* number damage dice 1-5 */ - GET_SDD(OLC_MOB(d)) = MAX(2, mob_lev/6); /* size of damage dice 2-5 */ - GET_EXP(OLC_MOB(d)) = (mob_lev*mob_lev*100); - GET_GOLD(OLC_MOB(d)) = (mob_lev*10); - } - break; + GET_LEVEL(OLC_MOB(d)) = LIMIT(i, 1, LVL_IMPL); + OLC_VAL(d) = TRUE; + medit_disp_stats_menu(d); + return; case MEDIT_ALIGNMENT: GET_ALIGNMENT(OLC_MOB(d)) = LIMIT(i, -1000, 1000); @@ -776,10 +985,10 @@ void medit_parse(struct descriptor_data *d, char *arg) } else write_to_output(d, "That mob does not exist.\r\n"); break; - + case MEDIT_DELETE: if (*arg == 'y' || *arg == 'Y') { - if (delete_mobile(GET_MOB_RNUM(OLC_MOB(d))) != NOBODY) + if (delete_mobile(GET_MOB_RNUM(OLC_MOB(d))) != NOBODY) write_to_output(d, "Mobile deleted.\r\n"); else write_to_output(d, "Couldn't delete the mobile!\r\n"); @@ -793,7 +1002,7 @@ void medit_parse(struct descriptor_data *d, char *arg) } else write_to_output(d, "Please answer 'Y' or 'N': "); break; - + default: /* We should never get here. */ cleanup_olc(d, CLEANUP_ALL); @@ -819,3 +1028,37 @@ void medit_string_cleanup(struct descriptor_data *d, int terminator) break; } } + +void medit_autoroll_stats(struct descriptor_data *d) +{ + int mob_lev; + + mob_lev = GET_LEVEL(OLC_MOB(d)); + mob_lev = GET_LEVEL(OLC_MOB(d)) = LIMIT(mob_lev, 1, LVL_IMPL); + + GET_MOVE(OLC_MOB(d)) = mob_lev*10; /* hit point bonus */ + GET_HIT(OLC_MOB(d)) = mob_lev/5; /* number of hitpoint dice */ + GET_MANA(OLC_MOB(d)) = mob_lev/5; /* size of hitpoint dice */ + + GET_NDD(OLC_MOB(d)) = MAX(1, mob_lev/6); /* number damage dice 1-5 */ + GET_SDD(OLC_MOB(d)) = MAX(2, mob_lev/6); /* size of damage dice 2-5 */ + GET_DAMROLL(OLC_MOB(d)) = mob_lev/6; /* damroll (dam bonus) 0-5 */ + + GET_HITROLL(OLC_MOB(d)) = mob_lev/3; /* hitroll 0-10 */ + GET_EXP(OLC_MOB(d)) = (mob_lev*mob_lev*100); + GET_GOLD(OLC_MOB(d)) = (mob_lev*10); + GET_AC(OLC_MOB(d)) = (100-(mob_lev*6)); /* AC 94 to -80 */ + + GET_STR(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); /* 2/3 level in range 11 to 18 */ + GET_INT(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); + GET_WIS(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); + GET_DEX(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); + GET_CON(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); + GET_CHA(OLC_MOB(d)) = LIMIT((mob_lev*2)/3, 11, 18); + + GET_SAVE(OLC_MOB(d), SAVING_PARA) = mob_lev / 4; /* All Saving throws */ + GET_SAVE(OLC_MOB(d), SAVING_ROD) = mob_lev / 4; /* set to a quarter */ + GET_SAVE(OLC_MOB(d), SAVING_PETRI) = mob_lev / 4; /* of the mobs level */ + GET_SAVE(OLC_MOB(d), SAVING_BREATH) = mob_lev / 4; + GET_SAVE(OLC_MOB(d), SAVING_SPELL) = mob_lev / 4; +} diff --git a/src/oasis.h b/src/oasis.h index c7bf4b2..655ad64 100644 --- a/src/oasis.h +++ b/src/oasis.h @@ -1,10 +1,10 @@ /** * @file oasis.h * Oasis online creation general defines. -* +* * Part of the core tbaMUD source code distribution, which is a derivative * of, and continuation of, CircleMUD. -* +* * This source code, which was not part of the CircleMUD legacy code, * is attributed to: * By Levork. Copyright 1996 by Harvey Gilpin, 1997-2001 by George Greer. @@ -58,7 +58,7 @@ #define MAX_OBJ_TIMER 1071000 -/* this defines how much memory is alloacted for 'bit strings' when saving in +/* this defines how much memory is alloacted for 'bit strings' when saving in * OLC. Remember to change it if you go for longer bitvectors. */ #define BIT_STRING_LENGTH 33 @@ -230,14 +230,15 @@ extern const char *nrm, *grn, *cyn, *yel; #define ZEDIT_SARG2 21 /* Submodes of MEDIT connectedness. */ -#define MEDIT_MAIN_MENU 0 -#define MEDIT_KEYWORD 1 -#define MEDIT_S_DESC 2 -#define MEDIT_L_DESC 3 -#define MEDIT_D_DESC 4 -#define MEDIT_NPC_FLAGS 5 -#define MEDIT_AFF_FLAGS 6 -#define MEDIT_CONFIRM_SAVESTRING 7 +#define MEDIT_MAIN_MENU 0 +#define MEDIT_KEYWORD 1 +#define MEDIT_S_DESC 2 +#define MEDIT_L_DESC 3 +#define MEDIT_D_DESC 4 +#define MEDIT_NPC_FLAGS 5 +#define MEDIT_AFF_FLAGS 6 +#define MEDIT_CONFIRM_SAVESTRING 7 +#define MEDIT_STATS_MENU 8 /* Numerical responses. */ #define MEDIT_NUMERICAL_RESPONSE 10 @@ -259,6 +260,17 @@ extern const char *nrm, *grn, *cyn, *yel; #define MEDIT_ALIGNMENT 26 #define MEDIT_DELETE 27 #define MEDIT_COPY 28 +#define MEDIT_STR 29 +#define MEDIT_INT 30 +#define MEDIT_WIS 31 +#define MEDIT_DEX 32 +#define MEDIT_CON 33 +#define MEDIT_CHA 34 +#define MEDIT_PARA 35 +#define MEDIT_ROD 36 +#define MEDIT_PETRI 37 +#define MEDIT_BREATH 38 +#define MEDIT_SPELL 39 /* Submodes of SEDIT connectedness. */ #define SEDIT_MAIN_MENU 0 @@ -356,7 +368,7 @@ extern const char *nrm, *grn, *cyn, *yel; #define HEDIT_CONFIRM_EDIT 1 #define HEDIT_CONFIRM_ADD 2 #define HEDIT_MAIN_MENU 3 -#define HEDIT_ENTRY 4 +#define HEDIT_ENTRY 4 #define HEDIT_KEYWORDS 5 #define HEDIT_MIN_LEVEL 6 @@ -373,6 +385,7 @@ void medit_save_internally(struct descriptor_data *d); void medit_parse(struct descriptor_data *d, char *arg); void medit_string_cleanup(struct descriptor_data *d, int terminator); ACMD(do_oasis_medit); +void medit_autoroll_stats(struct descriptor_data *d); /* public functions from oedit.c */ void oedit_setup_existing(struct descriptor_data *d, int rnum); diff --git a/src/oasis_list.c b/src/oasis_list.c index 6bddd18..0023e74 100644 --- a/src/oasis_list.c +++ b/src/oasis_list.c @@ -127,13 +127,13 @@ ACMD(do_oasis_list) switch (subcmd) { case SCMD_OASIS_MLIST: - + two_arguments(argument, arg, arg2); - + if (is_abbrev(arg, "level") || is_abbrev(arg, "flags")) { - + int i; - + if (!*arg2) { send_to_char(ch, "Which mobile flag or level do you want to list?\r\n"); for (i=0; i= bottom && mob_index[i].vnum <= top) { counter++; @@ -336,9 +336,9 @@ static void list_objects(struct char_data *ch, zone_rnum rnum, room_vnum vmin, r "Index VNum Object Name Object Type\r\n" "----- ------- -------------------------------------------- ----------------\r\n"); - if (!top_of_objt) + if (!top_of_objt) return; - + for (i = 0; i <= top_of_objt; i++) { if (obj_index[i].vnum >= bottom && obj_index[i].vnum <= top) { counter++; @@ -421,9 +421,9 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon "VNum Zone Name Builder(s)\r\n" "----- ------------------------------ --------------------------------------\r\n"); - if (!top_of_zone_table) + if (!top_of_zone_table) return; - + for (i = 0; i <= top_of_zone_table; i++) { if (zone_table[i].number >= bottom && zone_table[i].number <= top) { send_to_char(ch, "[%s%3d%s] %s%-*s %s%-1s%s\r\n", @@ -441,7 +441,7 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon void print_zone(struct char_data *ch, zone_vnum vnum) { zone_rnum rnum; - int size_rooms, size_objects, size_mobiles, size_quests, i; + int size_rooms, size_objects, size_mobiles, size_quests, size_shops, size_trigs, i; room_vnum top, bottom; int largest_table; @@ -462,6 +462,8 @@ void print_zone(struct char_data *ch, zone_vnum vnum) size_rooms = 0; size_objects = 0; size_mobiles = 0; + size_shops = 0; + size_trigs = 0; size_quests = 0; top = zone_table[rnum].top; bottom = zone_table[rnum].bot; @@ -479,8 +481,16 @@ void print_zone(struct char_data *ch, zone_vnum vnum) if (mob_index[i].vnum >= bottom && mob_index[i].vnum <= top) size_mobiles++; } + for (i = 0; i<= top_shop; i++) + if (SHOP_NUM(i) >= bottom && SHOP_NUM(i) <= top) + size_shops++; + + for (i = 0; i < top_of_trigt; i++) + if (trig_index[i]->vnum >= bottom && trig_index[i]->vnum <= top) + size_trigs++; + size_quests = count_quests(bottom, top); - + /* Display all of the zone information at once. */ send_to_char(ch, "%sVirtual Number = %s%d\r\n" @@ -495,6 +505,8 @@ void print_zone(struct char_data *ch, zone_vnum vnum) "%s Rooms = %s%d\r\n" "%s Objects = %s%d\r\n" "%s Mobiles = %s%d\r\n" + "%s Shops = %s%d\r\n" + "%s Triggers = %s%d\r\n" "%s Quests = %s%d%s\r\n", QGRN, QCYN, zone_table[rnum].number, QGRN, QCYN, zone_table[rnum].name, @@ -509,6 +521,8 @@ void print_zone(struct char_data *ch, zone_vnum vnum) QGRN, QCYN, size_rooms, QGRN, QCYN, size_objects, QGRN, QCYN, size_mobiles, + QGRN, QCYN, size_shops, + QGRN, QCYN, size_trigs, QGRN, QCYN, size_quests, QNRM); } @@ -556,10 +570,10 @@ static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, } } - if (counter == 0) { - if (rnum == NOWHERE) - send_to_char(ch, "No triggers found from %d to %d\r\n", vmin, vmax); - else - send_to_char(ch, "No triggers found for zone #%d\r\n", zone_table[rnum].number); - } + if (counter == 0) { + if (rnum == NOWHERE) + send_to_char(ch, "No triggers found from %d to %d\r\n", vmin, vmax); + else + send_to_char(ch, "No triggers found for zone #%d\r\n", zone_table[rnum].number); + } } diff --git a/src/structs.h b/src/structs.h index f5b8f74..eb872e3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,36 +1,36 @@ /** * @file structs.h * Core structures used within the core mud code. -* +* * Part of the core tbaMUD source code distribution, which is a derivative * of, and continuation of, CircleMUD. -* -* All rights reserved. See license for complete information. -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University -* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. +* +* All rights reserved. See license for complete information. +* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University +* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. */ -#ifndef _STRUCTS_H_ +#ifndef _STRUCTS_H_ #define _STRUCTS_H_ -/** Intended use of this macro is to allow external packages to work with a +/** Intended use of this macro is to allow external packages to work with a * variety of versions without modifications. For instance, an IS_CORPSE() - * macro was introduced in pl13. Any future code add-ons could take into - * account the version and supply their own definition for the macro if used - * on an older version. You are supposed to compare this with the macro + * macro was introduced in pl13. Any future code add-ons could take into + * account the version and supply their own definition for the macro if used + * on an older version. You are supposed to compare this with the macro * TBAMUD_VERSION() in utils.h. * It is read as Major/Minor/Patchlevel - MMmmPP */ #define _TBAMUD 0x030580 /** If you want equipment to be automatically equipped to the same place - * it was when players rented, set the define below to 1 because + * it was when players rented, set the define below to 1 because * TRUE/FALSE aren't defined yet. */ #define USE_AUTOEQ 1 /* preamble */ -/** As of bpl20, it should be safe to use unsigned data types for the various - * virtual and real number data types. There really isn't a reason to use - * signed anymore so use the unsigned types and get 65,535 objects instead of - * 32,768. NOTE: This will likely be unconditionally unsigned later. +/** As of bpl20, it should be safe to use unsigned data types for the various + * virtual and real number data types. There really isn't a reason to use + * signed anymore so use the unsigned types and get 65,535 objects instead of + * 32,768. NOTE: This will likely be unconditionally unsigned later. * 0 = use signed indexes; 1 = use unsigned indexes */ #define CIRCLE_UNSIGNED_INDEX 1 @@ -49,7 +49,7 @@ # define NOWHERE ((IDXTYPE)-1) /**< nil reference for rooms */ # define NOTHING ((IDXTYPE)-1) /**< nil reference for objects */ # define NOBODY ((IDXTYPE)-1) /**< nil reference for mobiles */ -# define NOFLAG ((IDXTYPE)-1) /**< nil reference for flags */ +# define NOFLAG ((IDXTYPE)-1) /**< nil reference for flags */ #endif /** Function macro for the mob, obj and room special functions */ @@ -64,10 +64,10 @@ #define WEST 3 /**< The direction west */ #define UP 4 /**< The direction up */ #define DOWN 5 /**< The direction down */ -/** Total number of directions available to move in. BEFORE CHANGING THIS, make - * sure you change every other direction and movement based item that this will +/** Total number of directions available to move in. BEFORE CHANGING THIS, make + * sure you change every other direction and movement based item that this will * impact. */ -#define NUM_OF_DIRS 6 +#define NUM_OF_DIRS 6 /* Room flags: used in room_data.room_flags */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ @@ -135,7 +135,7 @@ #define CLASS_THIEF 2 /**< PC Class Thief */ #define CLASS_WARRIOR 3 /**< PC Class Warrior */ /** Total number of available PC Classes */ -#define NUM_CLASSES 4 +#define NUM_CLASSES 4 /* NPC classes (currently unused - feel free to implement!) */ #define CLASS_OTHER 0 /**< NPC Class Other (or undefined) */ @@ -241,7 +241,7 @@ #define PRF_AUTOASSIST 30 /**< Auto-assist toggle */ #define PRF_AUTOMAP 31 /**< Show map at the side of room descs */ /** Total number of available PRF flags */ -#define NUM_PRF_FLAGS 32 +#define NUM_PRF_FLAGS 32 /* Affect bits: used in char_data.char_specials.saved.affected_by */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ @@ -326,7 +326,7 @@ #define WEAR_WIELD 16 /**< Equipment Location Weapon */ #define WEAR_HOLD 17 /**< Equipment Location held in offhand */ /** Total number of available equipment lcoations */ -#define NUM_WEARS 18 +#define NUM_WEARS 18 /* object-related defines */ /* Item types: used by obj_data.obj_flags.type_flag */ @@ -469,7 +469,7 @@ #define SUN_SET 3 /**< Dusk */ /* Sky conditions for weather_data */ -#define SKY_CLOUDLESS 0 /**< Weather = No clouds */ +#define SKY_CLOUDLESS 0 /**< Weather = No clouds */ #define SKY_CLOUDY 1 /**< Weather = Cloudy */ #define SKY_RAINING 2 /**< Weather = Rain */ #define SKY_LIGHTNING 3 /**< Weather = Lightning storm */ @@ -487,7 +487,7 @@ #define PM_ARRAY_MAX 4 /**< # Bytes in Bit vector - Act and Player flags */ #define PR_ARRAY_MAX 4 /**< # Bytes in Bit vector - Player Pref Flags */ #define AF_ARRAY_MAX 4 /**< # Bytes in Bit vector - Affect flags */ -#define TW_ARRAY_MAX 4 /**< # Bytes in Bit vector - Obj Wear Locations */ +#define TW_ARRAY_MAX 4 /**< # Bytes in Bit vector - Obj Wear Locations */ #define EF_ARRAY_MAX 4 /**< # Bytes in Bit vector - Obj Extra Flags */ /* other #defined constants */ @@ -507,7 +507,7 @@ #define LVL_BUILDER LVL_IMMORT /** Arbitrary number that won't be in a string */ -#define MAGIC_NUMBER (0x06) +#define MAGIC_NUMBER (0x06) /** OPT_USEC determines how many commands will be processed by the MUD per * second and how frequently it does socket I/O. A low setting will cause @@ -515,7 +515,7 @@ * more cycling to check. A high setting (e.g. 1 Hz) may upset your players * as actions (such as large speedwalking chains) take longer to be executed. * You shouldn't need to adjust this. - * This will equate to 10 passes per second. + * This will equate to 10 passes per second. * @see PASSES_PER_SEC * @see RL_SEC */ @@ -525,7 +525,7 @@ * @see RL_SEC */ #define PASSES_PER_SEC (1000000 / OPT_USEC) -/** Used with other macros to define at how many heartbeats a control loop +/** Used with other macros to define at how many heartbeats a control loop * gets executed. Helps to translate pulse counts to real seconds for * human comprehension. * @see PASSES_PER_SEC @@ -546,11 +546,11 @@ #define PULSE_IDLEPWD (15 RL_SEC) /** Currently unused. */ #define PULSE_SANITY (30 RL_SEC) -/** How often to log # connected sockets and # active players. +/** How often to log # connected sockets and # active players. * Currently set for 5 minutes. */ #define PULSE_USAGE (5 * 60 RL_SEC) -/** Controls when to save the current ingame MUD time to disk. +/** Controls when to save the current ingame MUD time to disk. * This should be set >= SECS_PER_MUD_HOUR */ #define PULSE_TIMESAVE (30 * 60 RL_SEC) @@ -572,7 +572,7 @@ #define HOST_LENGTH 40 /**< Max hostname resolution length */ #define PLR_DESC_LENGTH 4096 /**< Max length for PC description */ #define MAX_SKILLS 200 /**< Max number of skills/spells */ -#define MAX_AFFECT 32 /**< Max number of player affections */ +#define MAX_AFFECT 32 /**< Max number of player affections */ #define MAX_OBJ_AFFECT 6 /**< Max object affects */ #define MAX_NOTE_LENGTH 4000 /**< Max length of text on a note obj */ #define MAX_LAST_ENTRIES 6000 /**< Max log entries?? */ @@ -580,7 +580,7 @@ #define MAX_HELP_ENTRY MAX_STRING_LENGTH /**< Max size of help entry */ #define MAX_COMPLETED_QUESTS 1024 /**< Maximum number of completed quests allowed */ -/** Define the largest set of commands for a trigger. +/** Define the largest set of commands for a trigger. * 16k should be plenty and then some. */ #define MAX_CMD_LENGTH 16384 @@ -601,7 +601,7 @@ typedef signed char byte; /**< Technically 1 signed byte; vals should only = TRU typedef IDXTYPE room_vnum; /**< vnum specifically for room */ typedef IDXTYPE obj_vnum; /**< vnum specifically for object */ typedef IDXTYPE mob_vnum; /**< vnum specifically for mob (NPC) */ -typedef IDXTYPE zone_vnum; /**< vnum specifically for zone */ +typedef IDXTYPE zone_vnum; /**< vnum specifically for zone */ typedef IDXTYPE shop_vnum; /**< vnum specifically for shop */ typedef IDXTYPE trig_vnum; /**< vnum specifically for triggers */ typedef IDXTYPE qst_vnum; /**< vnum specifically for quests */ @@ -615,15 +615,15 @@ typedef IDXTYPE shop_rnum; /**< references an instance of a shop */ typedef IDXTYPE trig_rnum; /**< references an instance of a trigger */ typedef IDXTYPE qst_rnum; /**< references an instance of a quest */ -/** Bitvector type for 32 bit unsigned long bitvectors. 'unsigned long long' - * will give you at least 64 bits if you have GCC. You'll have to search - * throughout the code for "bitvector_t" and change them yourself if you'd +/** Bitvector type for 32 bit unsigned long bitvectors. 'unsigned long long' + * will give you at least 64 bits if you have GCC. You'll have to search + * throughout the code for "bitvector_t" and change them yourself if you'd * like this extra flexibility. */ typedef unsigned long int bitvector_t; /** Extra description: used in objects, mobiles, and rooms. For example, * a 'look hair' might pull up an extra description (if available) for - * the mob, object or room. + * the mob, object or room. * Multiple extra descriptions on the same object are implemented as a * linked list. */ struct extra_descr_data @@ -635,9 +635,9 @@ struct extra_descr_data /* object-related structures */ /**< Number of elements in the object value array. Raising this will provide - * more configurability per object type, and shouldn't break anything. + * more configurability per object type, and shouldn't break anything. * DO NOT LOWER from the default value of 4. */ -#define NUM_OBJ_VAL_POSITIONS 4 +#define NUM_OBJ_VAL_POSITIONS 4 /** object flags used in obj_data. These represent the instance values for * a real object, values that can change during gameplay. */ @@ -693,7 +693,7 @@ struct obj_data struct char_data *sitting_here; /**< For furniture, who is sitting in it */ }; -/** 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 * and already have a player base and don't want to do a player wipe. */ struct obj_file_elem @@ -708,20 +708,20 @@ struct obj_file_elem int weight; /**< Object weight */ int timer; /**< Current object timer setting */ int bitvector[AF_ARRAY_MAX]; /**< Object affects */ - struct obj_affected_type affected[MAX_OBJ_AFFECT]; /**< Affects to mobs */ + struct obj_affected_type affected[MAX_OBJ_AFFECT]; /**< Affects to mobs */ }; /** Header block for rent files. * DO NOT CHANGE the structure 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. * If you are using binary player files, feel free to turn the spare * variables into something more meaningful, as long as you keep the - * int datatype. - * NOTE: This is *not* used with the ascii playerfiles. + * int datatype. + * NOTE: This is *not* used with the ascii playerfiles. * NOTE 2: This structure appears to be unused in this codebase? */ struct rent_info { - int time; + int time; int rentcode; /**< How this character rented */ int net_cost_per_diem; /**< ? Appears to be unused ? */ int gold; /**< ? Appears to be unused ? */ @@ -781,7 +781,7 @@ struct memory_rec_struct /** memory_rec_struct typedef */ 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). */ struct time_info_data { @@ -800,7 +800,7 @@ struct time_data }; /** 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). */ struct pclean_criteria_data { @@ -825,8 +825,8 @@ struct char_player_data ubyte height; /**< PC / NPC height */ }; -/** Character abilities. Different instances of this structure are used for - * both inherent and current ability scores (like when poison affects the +/** Character abilities. Different instances of this structure are used for + * both inherent and current ability scores (like when poison affects the * player strength). */ struct char_ability_data { @@ -852,9 +852,9 @@ struct char_point_data /** Current armor class. Internal use goes from -100 (totally armored) to * 100 (totally naked). Externally expressed as -10 (totally armored) to * 10 (totally naked). Currently follows the old and decrepit Advanced - * Dungeons and Dragons method of dealing with character defense, or - * Armor class. */ - sh_int armor; + * Dungeons and Dragons method of dealing with character defense, or + * Armor class. */ + sh_int armor; int gold; /**< Current gold carried on character */ int bank_gold; /**< Gold the char has in a bank account */ int exp; /**< The experience points, or value, of the character. */ @@ -960,7 +960,7 @@ struct affected_type struct follow_type { 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. */ @@ -1009,7 +1009,7 @@ struct txt_block struct txt_block *next; /**< ? */ }; -/** ? */ +/** ? */ struct txt_q { struct txt_block *head; /**< ? */ @@ -1213,7 +1213,7 @@ struct guild_info_type /* Config structs */ -/** The game configuration structure used for configurating the game play +/** The game configuration structure used for configurating the game play * variables. */ struct game_data { @@ -1237,8 +1237,8 @@ struct game_data int map_option; /**< MAP_ON, MAP_OFF or MAP_IMM_ONLY */ int map_size; /**< Default size for map command */ int minimap_size; /**< Default size for mini-map (automap) */ - int script_players; /**< Is attaching scripts to players allowed? */ - + int script_players; /**< Is attaching scripts to players allowed? */ + char *OK; /**< When player receives 'Okay.' text. */ char *NOPERSON; /**< 'No one by that name here.' */ char *NOEFFECT; /**< 'Nothing seems to happen.' */ @@ -1256,7 +1256,7 @@ struct crash_save_data int rent_file_timeout; /**< Lifetime of normal rent files in days */ }; -/** Important room numbers. This structure stores vnums, not real array +/** Important room numbers. This structure stores vnums, not real array * numbers. */ struct room_numbers { @@ -1285,6 +1285,7 @@ struct game_operation char *MENU; /**< The MAIN MENU. */ char *WELC_MESSG; /**< The welcome message. */ char *START_MESSG; /**< The start msg for new characters. */ + int medit_advanced; /**< Does the medit OLC show the advanced stats menu ? */ }; /** The Autowizard options. */ @@ -1294,9 +1295,9 @@ struct autowiz_data int min_wizlist_lev; /**< Minimun level to show on wizlist. */ }; -/** +/** Main Game Configuration Structure. - Global variables that can be changed within the game are held within this + Global variables that can be changed within the game are held within this structure. During gameplay, elements within this structure can be altered, thus affecting the gameplay immediately, and avoiding the need to recompile the code. diff --git a/src/utils.h b/src/utils.h index 5111d11..84ef3ce 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,26 +1,26 @@ /** -* @file utils.h -* Utility macros and prototypes of utility functions. -* +* @file utils.h +* Utility macros and prototypes of utility functions. +* * Part of the core tbaMUD source code distribution, which is a derivative * of, and continuation of, CircleMUD. -* -* All rights reserved. See license for complete information. -* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University +* +* All rights reserved. See license for complete information. +* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. -* -* @todo Merge structs, random and other very generic functions and macros into +* +* @todo Merge structs, random and other very generic functions and macros into * the utils module. -* @todo Take more mud specific functions and function prototypes (follower +* @todo Take more mud specific functions and function prototypes (follower * functions, move functions, char_from_furniture) out of utils and declare / -* define elsewhere. +* define elsewhere. */ #ifndef _UTILS_H_ /* Begin header file protection */ #define _UTILS_H_ /** Definition of the action command, for the do_ series of in game functions. * This macro is placed here (for now) because it's too general of a macro - * to be first defined in interpreter.h. The reason for using a macro is + * to be first defined in interpreter.h. The reason for using a macro is * to allow for easier addition of parameters to the otherwise generic and * static function structure. */ #define ACMD(name) \ @@ -29,7 +29,7 @@ /* external declarations and prototypes */ /** direct all log() references to basic_mud_log() function. */ -#define log basic_mud_log +#define log basic_mud_log /** Standard line size, used for many string limits. */ #define READ_SIZE 256 @@ -148,7 +148,7 @@ void char_from_furniture(struct char_data *ch); /* get_filename() types of files to open */ #define CRASH_FILE 0 /**< Open up a player crash save file */ -#define ETEXT_FILE 1 /**< ???? */ +#define ETEXT_FILE 1 /**< ???? */ #define SCRIPT_VARS_FILE 2 /**< Reference to a global variable file. */ #define PLR_FILE 3 /**< The standard player file */ @@ -160,16 +160,16 @@ void char_from_furniture(struct char_data *ch); #define BFS_NO_PATH (-3) /**< No path through here. */ /** Number of real life seconds per mud hour. - * @todo The definitions based on SECS_PER_MUD_HOUR should be configurable. + * @todo The definitions based on SECS_PER_MUD_HOUR should be configurable. * See act.informative.c and utils.c for other places to change. */ #define SECS_PER_MUD_HOUR 75 -/** Real life seconds in one mud day. +/** Real life seconds in one mud day. * Current calculation = 30 real life minutes. */ #define SECS_PER_MUD_DAY (24*SECS_PER_MUD_HOUR) -/** Real life seconds per mud month. +/** Real life seconds per mud month. * Current calculation = 17.5 real life hours */ #define SECS_PER_MUD_MONTH (35*SECS_PER_MUD_DAY) -/** Real life seconds per mud month. +/** Real life seconds per mud month. * Current calculation ~= 12.4 real life days */ #define SECS_PER_MUD_YEAR (17*SECS_PER_MUD_MONTH) @@ -198,15 +198,15 @@ void char_from_furniture(struct char_data *ch); /** If ch is equal to either a newline or a carriage return, return 1, * else 0. - * @todo Recommend using the ? operator for clarity. */ + * @todo Recommend using the ? operator for clarity. */ #define ISNEWL(ch) ((ch) == '\n' || (ch) == '\r') /** If string begins a vowel (upper or lower case), return "an"; else return * "a". */ #define AN(string) (strchr("aeiouAEIOU", *string) ? "an" : "a") -/** A calloc based memory allocation macro. - * @param result Pointer to created memory. +/** A calloc based memory allocation macro. + * @param result Pointer to created memory. * @param type The type of memory (int, struct char_data, etc.). * @param number How many of type to make. */ #define CREATE(result, type, number) do {\ @@ -217,19 +217,19 @@ void char_from_furniture(struct char_data *ch); /** A realloc based memory reallocation macro. Reminder: realloc can reduce * the size of an array as well as increase it. - * @param result Pointer to created memory. + * @param result Pointer to created memory. * @param type The type of memory (int, struct char_data, etc.). - * @param number How many of type to make. */ + * @param number How many of type to make. */ #define RECREATE(result, type, number) do {\ if (!((result) = (type *) realloc ((result), sizeof(type) * (number))))\ { perror("SYSERR: realloc failure"); abort(); } } while(0) -/** Remove an item from a linked list and reset the links. +/** Remove an item from a linked list and reset the links. * If item is at the list head, change the head, else traverse the * list looking for the item before the one to be removed. - * @pre Requires that a variable 'temp' be declared as the same type as the - * list to be manipulated. - * @post List pointers are correctly reset and item is no longer in the list. + * @pre Requires that a variable 'temp' be declared as the same type as the + * list to be manipulated. + * @post List pointers are correctly reset and item is no longer in the list. * item can now be changed, removed, etc independently from the list it was in. * @param item Pointer to item to remove from the list. * @param head Pointer to the head of the linked list. @@ -276,7 +276,7 @@ void char_from_furniture(struct char_data *ch); * for it, 'wimpy' would be an extremely bad thing for a mob to do, as an * example. If you really couldn't care less, change this to a '#if 0'. */ #if 1 -/** Warn if accessing player_specials on a mob. +/** Warn if accessing player_specials on a mob. * @todo Subtle bug in the var reporting, but works well for now. */ #define CHECK_PLAYER_SPECIAL(ch, var) \ (*(((ch)->player_specials == &dummy_mob) ? (log("SYSERR: Mob using '"#var"' at %s:%d.", __FILE__, __LINE__), &(var)) : &(var))) @@ -300,11 +300,11 @@ void char_from_furniture(struct char_data *ch); #define SPELL_ROUTINES(spl) (spell_info[spl].routines) /* IS_MOB() acts as a VALID_MOB_RNUM()-like function.*/ -/** 1 if the character has the NPC bit set, 0 if the character does not. +/** 1 if the character has the NPC bit set, 0 if the character does not. * Used to prevents NPCs and mobs from doing things they shouldn't, even * when mobs are possessed or charmed by a player. */ #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 && \ GET_MOB_RNUM(ch) != NOBODY) @@ -461,7 +461,7 @@ void char_from_furniture(struct char_data *ch); /** Alignment value for ch. */ #define GET_ALIGNMENT(ch) ((ch)->char_specials.saved.alignment) -/** Return condition i (DRUNK, HUNGER, THIRST) of ch. */ +/** Return condition i (DRUNK, HUNGER, THIRST) of ch. */ #define GET_COND(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.conditions[(i)])) /** The room to load player ch into. */ #define GET_LOADROOM(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.load_room)) @@ -482,8 +482,8 @@ void char_from_furniture(struct char_data *ch); #define POOFIN(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->poofin)) /** The poofout string for the ch. */ #define POOFOUT(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->poofout)) -/** The OLC zoon permission for ch. - * @deprecated Currently unused? */ +/** The OLC zoon permission for ch. + * @deprecated Currently unused? */ #define GET_OLC_ZONE(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.olc_zone)) /** Currently unused? * @deprecated Currently unused? */ @@ -499,9 +499,9 @@ void char_from_furniture(struct char_data *ch); #define GET_PREF(ch) ((ch)->pref) /** Get host name or ip of ch. */ #define GET_HOST(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->host)) -#define GET_LAST_MOTD(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.lastmotd)) -#define GET_LAST_NEWS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.lastnews)) -/** Get channel history i for ch. */ +#define GET_LAST_MOTD(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.lastmotd)) +#define GET_LAST_NEWS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.lastnews)) +/** Get channel history i for ch. */ #define GET_HISTORY(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.comm_hist[i])) /** Return the page length (height) for ch. */ #define GET_PAGE_LENGTH(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.page_length)) @@ -518,7 +518,7 @@ void char_from_furniture(struct char_data *ch); #define GET_QUEST_TIME(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.quest_time)) /** The number of quests completed by ch. */ #define GET_NUM_QUESTS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.num_completed_quests)) -/** The type of quest ch is currently participating in. */ +/** The type of quest ch is currently participating in. */ #define GET_QUEST_TYPE(ch) (real_quest(GET_QUEST((ch))) != NOTHING ? aquest_table[real_quest(GET_QUEST((ch)))].type : AQ_UNDEFINED ) /** The current skill level of ch for skill i. */ @@ -557,7 +557,7 @@ void char_from_furniture(struct char_data *ch); #define CAN_CARRY_N(ch) (5 + (GET_DEX(ch) >> 1) + (GET_LEVEL(ch) >> 1)) /** Return whether or not ch is awake. */ #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) \ (AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT))) @@ -590,7 +590,7 @@ void char_from_furniture(struct char_data *ch); STATE(d) == CON_ZEDIT || STATE(d) == CON_SEDIT || \ STATE(d) == CON_CEDIT || STATE(d) == CON_PLAYING || \ STATE(d) == CON_TRIGEDIT || STATE(d) == CON_AEDIT || \ - STATE(d) == CON_HEDIT || STATE(d) == CON_QEDIT) + STATE(d) == CON_HEDIT || STATE(d) == CON_QEDIT) /** Defines if it is ok to send a message to ch. */ #define SENDOK(ch) (((ch)->desc || SCRIPT_CHECK((ch), MTRIG_ACT)) && \ @@ -598,8 +598,8 @@ void char_from_furniture(struct char_data *ch); !PLR_FLAGGED((ch), PLR_WRITING)) /* object utils */ -/** Check for NOWHERE or the top array index? If using unsigned types, the top - * array index will catch everything. If using signed types, NOTHING will +/** Check for NOWHERE or the top array index? If using unsigned types, the top + * array index will catch everything. If using signed types, NOTHING will * catch the majority of bad accesses. */ #define VALID_OBJ_RNUM(obj) (GET_OBJ_RNUM(obj) <= top_of_objt && \ GET_OBJ_RNUM(obj) != NOTHING) @@ -647,7 +647,7 @@ void char_from_furniture(struct char_data *ch); #define GET_OBJ_SHORT(obj) ((obj)->short_description) /* 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) */ #define CIRCLEMUD_VERSION(major, minor, patchlevel) \ (((major) << 16) + ((minor) << 8) + (patchlevel)) @@ -676,11 +676,11 @@ void char_from_furniture(struct char_data *ch); ((!AFF_FLAGGED((obj),AFF_INVISIBLE) || AFF_FLAGGED(sub,AFF_DETECT_INVIS)) && \ (!AFF_FLAGGED((obj), AFF_HIDE) || AFF_FLAGGED(sub, AFF_SENSE_LIFE))) -/** Defines if sub character can see obj character, assuming mortal only +/** Defines if sub character can see obj character, assuming mortal only * settings. */ #define MORT_CAN_SEE(sub, obj) (LIGHT_OK(sub) && INVIS_OK(sub, obj)) -/** Defines if sub character can see obj character, assuming immortal +/** Defines if sub character can see obj character, assuming immortal * and mortal settings. */ #define IMM_CAN_SEE(sub, obj) \ (MORT_CAN_SEE(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED(sub, PRF_HOLYLIGHT))) @@ -722,7 +722,7 @@ void char_from_furniture(struct char_data *ch); CAN_SEE_OBJ((ch),(obj))) /** If vict can see ch, return ch name, else return "someone". */ -#define PERS(ch, vict) (CAN_SEE(vict, ch) ? GET_NAME(ch) : (GET_LEVEL(ch) > LVL_IMMORT ? "an immortal" : "someone")) +#define PERS(ch, vict) (CAN_SEE(vict, ch) ? GET_NAME(ch) : (GET_LEVEL(ch) > LVL_IMMORT ? "an immortal" : "someone")) /** If vict can see obj, return obj short description, else return * "something". */ @@ -800,8 +800,8 @@ void char_from_furniture(struct char_data *ch); #define SEEK_END 2 #endif -/* NOCRYPT can be defined by an implementor manually in sysdep.h. CIRCLE_CRYPT - * is a variable that the 'configure' script automatically sets when it +/* NOCRYPT can be defined by an implementor manually in sysdep.h. CIRCLE_CRYPT + * is a variable that the 'configure' script automatically sets when it * determines whether or not the system is capable of encrypting. */ #if defined(NOCRYPT) || !defined(CIRCLE_CRYPT) /** When crypt is not defined. (NOTE: Player passwords will be plain text.) */ @@ -863,8 +863,8 @@ void char_from_furniture(struct char_data *ch); #define CONFIG_MAP_SIZE config_info.play.map_size #define CONFIG_MINIMAP_SIZE config_info.play.minimap_size -/* DG Script Options */ -#define CONFIG_SCRIPT_PLAYERS config_info.play.script_players +/* DG Script Options */ +#define CONFIG_SCRIPT_PLAYERS config_info.play.script_players /* Crash Saves */ /** Get free rent setting. */ @@ -925,6 +925,8 @@ void char_from_furniture(struct char_data *ch); #define CONFIG_WELC_MESSG config_info.operation.WELC_MESSG /** Get the standard new character message. */ #define CONFIG_START_MESSG config_info.operation.START_MESSG +/** Should medit show the advnaced stats menu? */ +#define CONFIG_MEDIT_ADVANCED config_info.operation.medit_advanced /* Autowiz */ /** Use autowiz or not? */