Major: Backport to rvn 241, with the addition of all previously found bug fixes.

This commit is contained in:
Vatiken 2012-02-06 19:13:03 +00:00
parent e4cdc51eb1
commit 479dbb6cbd
86 changed files with 3771 additions and 7913 deletions

View file

@ -35,93 +35,13 @@ export (QQ's a zone into a tarball)
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too) (lots of major bugfixes too)
@ @
[Jan 30 2012] - Rumble [Feb 04 2012] - Vatiken
Fixed redit/zedit menu bug. Feature: Added 'Experience' and 'Thaco' to the do_show() command.
[Aug 25 2011] - Rumble Bug Fix: Nipped a bug where shopkeepers weren't sending tells.
Comment fixes, clarification, and warning cleanup. (thanks Kyle) Visuals: Fixed a small glitch in redit where things weren't lining up right with extra dirs activated.
[Sep 11 2011] - Fizban Made olist, mlist, and rlist, page_string() compatible.
Added MXP, MSP, MSSP, MSDP, ATCP, CHARSET, NAWS, TTYPE, 256-color protocols. (Thanks KaVir) Bug Fix: Editing extra directions is now doable from redit.
[Aug 18 2011] - Fizban MAJOR: Reverted back to 3.62 Revision 241, followed up by backporting bug fixes and some of the positive changes implemented by Jamdog. Not coming along for the ride currently are the new mail system, housing system and the admin level system.
Added hitroll and damroll fields to DG Scripts. Also made them editable via scripts.
Made do_stat_character show scripts attached to players.
[Mar 31 2011] - Rumble
Fixed several typos and formatting issues. (Thanks Kyle)
Added check to prevent immortals from getting poisoned.
Fixed crash bug on advance.
Added output to helpcheck command instead of an empty return.
Fixed do_levels max/min level confusion.
Fixed do_score which was showing gold as exp. (Thanks Rhade)
Added free_olc_ibt.
Added CONFIG_IBT_AUTOSAVE.
Fixed bug when casting invis on objects.
Added mudmail.pdf instructions to /doc.
[Dec 16 2010] - Jamdog
Bug-Fix: Fixed illegal mob flag bug where medit set wrong flag
[Dec 10 2010] - Jamdog
Minor bug fixes, added MAIL flag names and fixed compile warnings
Bug Fix: Alignment in medit now saves when it's the only thing edited (thanks cosine_omerta)
Added ZONE_WORLDMAP flag to set a whole zone to worldmap style maps
[Dec 08 2010] - Jamdog
Added olist <name>
page_string now uses player's screen width and correctly parses ANSI color codes
[Dec 07 2010] - Jamdog
Fixed erroneous SYSERR report and incorrect contant in new house system (thanks Vatiken)
Buildwalk now allows builder to specify default sector type (thanks Mirad)
Added happyhour script variables (thanks Kam)
Added affects list and type list to olist command
[Dec 06 2010] - Jamdog
Added new mail system, with inbox OLC, index rebuilder and first mail (to ID 1)
Bug-Fix: levels command wasn't showing max level, or validating high/low levels
score <mob> now shows stats for the mobile (same as 'stat <mob>')
[Dec 05 2010] - Jamdog
Bug-Fix: 'Did you mean' now only shows commands you have access to (thanks Welcor)
Bug-Fix: Fixed crash bug introduced by new house system when saving house contents
Scan command now tells you when nothing is nearby (thanks Mirad)
zlist command can now list by builder, like show zones
zlist command now uses page_string (thanks Mirad)
areas command now uses page_string (thanks Mirad)
[Dec 02 2010] - Jamdog
Bug-Fix: identify command in shops was listing incorrect buy price (thanks Kam)
Added %actor.admlevel% and %actor.admlevel(<level>)% to dg-scripts
Earthquake spell now misses flying people
[Dec 01 2010] - Jamdog
Fixed do_cheat so that only ID 1 can get a full restoration
Added zone checks for load/purge commands below admin level 3 (GrGod)
[Nov 30 2010] - Jamdog
Bug-Fix: Fixed incorrect rnum showing on stat room <vnum> (Thanks Kam)
Added hsedit House Editor OLC
[Nov 28 2010] - Jamdog
Converted houses (lib/etc/hcontrol file) to ASCII file format
Added hcontrol file converter (hstoascii.c) to src/utils folder
Converted houses to work as linked lists, not wasteful fixed-size arrays
Added GOD houses and player-owned shops as house types
Added 'receptionist' and 'player-shopkeeper' type spec-procs for houses
[Nov 26 2010] - Jamdog
Bug-Fix: set level now allows GRGOD or higher to set to any mortal level
Advance command changed to work for both mortal and admin levels
Added increase_gold and increase_bank functions to prevent cash overflows
Added dupe check for new characters in char creation (thanks Mirad)
Bug-Fix: Since admin update, real mortals didn't show on who list (thanks Rhade)
[Nov 25 2010] - Jamdog
Added diagonal directions with cedit toggle (default to 'off')
Bug-Fix: admin <player> default now targets the victim player
Bug-Fix: Crash bug developed due to no 'vict' in is_tell_ok, added checks
Added HIDDEN flag for doors, hiding from exits, autoexits, scan and map
Admins now show admin level instead of class on who list
[Nov 24 2010] - Jamdog
Split mortal and admin levels (thanks fnord for original patch/idea)
Mortal level converted to ubyte for 255 max
Max mortal level now configurable in cedit
Level on help files now indicates admin level
Added 'set <player> admlevel <num>'
Added admin command for imms
Added mortal command, and modified return command to work for everyone
Added admin level to player index (for autowiz)
Added mortal flag to player index (for autowiz)
Autowiz converted to work with new admin levels
Socials are now admin-level dependant
Added imm ability to 'score <player>'
Minor Bug Fix: Cured problem where Imps didn't regain default flags when using 'return'
[Nov 06 2010] - Jamdog [Nov 06 2010] - Jamdog
Added HappyHour feature Added HappyHour feature
Added game_info function for sending global messages to all players Added game_info function for sending global messages to all players

View file

@ -81,7 +81,7 @@ ACMD(do_gsay)
for (f = k->followers; f; f = f->next) for (f = k->followers; f; f = f->next)
if (AFF_FLAGGED(f->follower, AFF_GROUP) && (f->follower != ch)) if (AFF_FLAGGED(f->follower, AFF_GROUP) && (f->follower != ch))
act(buf, FALSE, ch, 0, f->follower, TO_VICT | TO_SLEEP); act(buf, FALSE, ch, 0, f->follower, TO_VICT | TO_SLEEP);
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else else
@ -101,7 +101,7 @@ static void perform_tell(struct char_data *ch, struct char_data *vict, char *arg
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else { else {
snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", CCRED(ch, C_NRM), arg, CCNRM(ch, C_NRM)); snprintf(buf, sizeof(buf), "%sYou tell $N, '%s'%s", CCRED(ch, C_NRM), arg, CCNRM(ch, C_NRM));
msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); msg = act(buf, FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
add_history(ch, msg, HIST_TELL); add_history(ch, msg, HIST_TELL);
} }
@ -119,13 +119,13 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
send_to_char(ch, "You try to tell yourself something.\r\n"); send_to_char(ch, "You try to tell yourself something.\r\n");
else if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOTELL)) else if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOTELL))
send_to_char(ch, "You can't tell other people while you have notell on.\r\n"); send_to_char(ch, "You can't tell other people while you have notell on.\r\n");
else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && !(IS_ADMIN(ch, ADMLVL_GOD))) else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
send_to_char(ch, "The walls seem to absorb your words.\r\n"); send_to_char(ch, "The walls seem to absorb your words.\r\n");
else if (!IS_NPC(vict) && !vict->desc) /* linkless */ else if (!IS_NPC(vict) && !vict->desc) /* linkless */
act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else if (PLR_FLAGGED(vict, PLR_WRITING)) else if (PLR_FLAGGED(vict, PLR_WRITING))
act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && !(IS_ADMIN(ch, ADMLVL_GOD)))) else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || (ROOM_FLAGGED(IN_ROOM(vict), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)))
act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP);
else else
return (TRUE); return (TRUE);
@ -138,7 +138,6 @@ static int is_tell_ok(struct char_data *ch, struct char_data *vict)
ACMD(do_tell) ACMD(do_tell)
{ {
struct char_data *vict = NULL; struct char_data *vict = NULL;
struct descriptor_data *d = NULL;
char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH]; char buf[MAX_INPUT_LENGTH], buf2[MAX_INPUT_LENGTH];
half_chop(argument, buf, buf2); half_chop(argument, buf, buf2);
@ -179,22 +178,11 @@ ACMD(do_tell)
last_webster_teller = GET_IDNUM(ch); last_webster_teller = GET_IDNUM(ch);
send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word); send_to_char(ch, "You look up '%s' in Merriam-Webster.\r\n", word);
#endif /* platform specific part */ #endif /* platform specific part */
} } else if (GET_LEVEL(ch) < LVL_IMMORT && !(vict = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
else if (is_abbrev(buf, "all") && ADM_FLAGGED(ch, ADM_TELLALL)) { send_to_char(ch, "%s", CONFIG_NOPERSON);
for (d = descriptor_list; d; d = d->next) { else if (GET_LEVEL(ch) >= LVL_IMMORT && !(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
if (!(vict = d->character)) send_to_char(ch, "%s", CONFIG_NOPERSON);
continue; else if (is_tell_ok(ch, vict))
if (vict == ch || STATE(d) != CON_PLAYING)
continue;
perform_tell(ch, vict, buf2);
}
}
else if (IS_ADMIN(ch, ADMLVL_IMMORT) && !(vict = get_player_vis(ch, buf, NULL, FIND_CHAR_WORLD))) {
if (!(vict = get_char_vis(ch, buf, NULL, FIND_CHAR_WORLD)))
send_to_char(ch, "%s", CONFIG_NOPERSON);
else if (is_tell_ok(ch, vict))
perform_tell(ch, vict, buf2);
} else if (is_tell_ok(ch, vict))
perform_tell(ch, vict, buf2); perform_tell(ch, vict, buf2);
} }
@ -215,8 +203,8 @@ ACMD(do_reply)
/* Make sure the person you're replying to is still playing by searching /* Make sure the person you're replying to is still playing by searching
* for them. Note, now last tell is stored as player IDnum instead of * for them. Note, now last tell is stored as player IDnum instead of
* a pointer, which is much better because it's safer, plus will still * a pointer, which is much better because it's safer, plus will still
* work if someone logs out and back in again. A descriptor list based * work if someone logs out and back in again. A descriptor list based
* search would be faster although we could not find link dead people. * search would be faster although we could not find link dead people.
* Not that they can hear tells anyway. :) -gg 2/24/98 */ * Not that they can hear tells anyway. :) -gg 2/24/98 */
while (tch && (IS_NPC(tch) || GET_IDNUM(tch) != GET_LAST_TELL(ch))) while (tch && (IS_NPC(tch) || GET_IDNUM(tch) != GET_LAST_TELL(ch)))
tch = tch->next; tch = tch->next;
@ -268,7 +256,7 @@ ACMD(do_spec_comm)
snprintf(buf1, sizeof(buf1), "$n %s you, '%s'", action_plur, buf2); snprintf(buf1, sizeof(buf1), "$n %s you, '%s'", action_plur, buf2);
act(buf1, FALSE, ch, 0, vict, TO_VICT); act(buf1, FALSE, ch, 0, vict, TO_VICT);
if ((!IS_NPC(ch)) && (PRF_FLAGGED(ch, PRF_NOREPEAT))) if ((!IS_NPC(ch)) && (PRF_FLAGGED(ch, PRF_NOREPEAT)))
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else else
send_to_char(ch, "You %s %s, '%s'\r\n", action_sing, GET_NAME(vict), buf2); send_to_char(ch, "You %s %s, '%s'\r\n", action_sing, GET_NAME(vict), buf2);
@ -372,20 +360,20 @@ ACMD(do_page)
snprintf(buf, sizeof(buf), "\007\007*$n* %s", buf2); snprintf(buf, sizeof(buf), "\007\007*$n* %s", buf2);
if (!str_cmp(arg, "all")) { if (!str_cmp(arg, "all")) {
if (ADM_FLAGGED(ch, ADM_TELLALL)) { if (GET_LEVEL(ch) > LVL_GOD) {
for (d = descriptor_list; d; d = d->next) for (d = descriptor_list; d; d = d->next)
if (STATE(d) == CON_PLAYING && d->character) if (STATE(d) == CON_PLAYING && d->character)
act(buf, FALSE, ch, 0, d->character, TO_VICT); act(buf, FALSE, ch, 0, d->character, TO_VICT);
} else } else
send_to_char(ch, "You will never be godly enough to do that!\r\n"); send_to_char(ch, "You will never be godly enough to do that!\r\n");
return; return;
} }
if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) { if ((vict = get_char_vis(ch, arg, NULL, FIND_CHAR_WORLD))) {
act(buf, FALSE, ch, 0, vict, TO_VICT); act(buf, FALSE, ch, 0, vict, TO_VICT);
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT)) if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOREPEAT))
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else else
act(buf, FALSE, ch, 0, vict, TO_CHAR); act(buf, FALSE, ch, 0, vict, TO_CHAR);
} else } else
send_to_char(ch, "There is no such person in the game!\r\n"); send_to_char(ch, "There is no such person in the game!\r\n");
} }
@ -458,7 +446,7 @@ ACMD(do_gen_comm)
send_to_char(ch, "%s", com_msgs[subcmd][0]); send_to_char(ch, "%s", com_msgs[subcmd][0]);
return; return;
} }
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && !(IS_ADMIN(ch, ADMLVL_GOD))) { if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD)) {
send_to_char(ch, "The walls seem to absorb your words.\r\n"); send_to_char(ch, "The walls seem to absorb your words.\r\n");
return; return;
} }
@ -507,7 +495,7 @@ ACMD(do_gen_comm)
else { else {
snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "", snprintf(buf1, sizeof(buf1), "%sYou %s, '%s%s'%s", COLOR_LEV(ch) >= C_CMP ? color_on : "",
com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP)); com_msgs[subcmd][1], argument, COLOR_LEV(ch) >= C_CMP ? color_on : "", CCNRM(ch, C_CMP));
msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR | TO_SLEEP); msg = act(buf1, FALSE, ch, 0, 0, TO_CHAR | TO_SLEEP);
add_history(ch, msg, hist_type[subcmd]); add_history(ch, msg, hist_type[subcmd]);
} }
@ -521,14 +509,14 @@ ACMD(do_gen_comm)
if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING))) if (!IS_NPC(ch) && (PRF_FLAGGED(i->character, channels[subcmd]) || PLR_FLAGGED(i->character, PLR_WRITING)))
continue; continue;
if (ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF) && !(IS_ADMIN(ch, ADMLVL_GOD))) if (ROOM_FLAGGED(IN_ROOM(i->character), ROOM_SOUNDPROOF) && (GET_LEVEL(ch) < LVL_GOD))
continue; continue;
if (subcmd == SCMD_SHOUT && ((world[IN_ROOM(ch)].zone != world[IN_ROOM(i->character)].zone) || if (subcmd == SCMD_SHOUT && ((world[IN_ROOM(ch)].zone != world[IN_ROOM(i->character)].zone) ||
!AWAKE(i->character))) !AWAKE(i->character)))
continue; continue;
snprintf(buf2, sizeof(buf2), "%s%s%s", (COLOR_LEV(i->character) >= C_NRM) ? color_on : "", buf1, KNRM); snprintf(buf2, sizeof(buf2), "%s%s%s", (COLOR_LEV(i->character) >= C_NRM) ? color_on : "", buf1, KNRM);
msg = act(buf2, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP); msg = act(buf2, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP);
add_history(i->character, msg, hist_type[subcmd]); add_history(i->character, msg, hist_type[subcmd]);
} }
@ -560,7 +548,7 @@ ACMD(do_qcomm)
snprintf(buf, sizeof(buf), "$n quest-says, '%s'", argument); snprintf(buf, sizeof(buf), "$n quest-says, '%s'", argument);
else { else {
strlcpy(buf, argument, sizeof(buf)); strlcpy(buf, argument, sizeof(buf));
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "(GC) %s qechoed: %s", GET_NAME(ch), argument); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "(GC) %s qechoed: %s", GET_NAME(ch), argument);
} }
for (i = descriptor_list; i; i = i->next) for (i = descriptor_list; i; i = i->next)
if (STATE(i) == CON_PLAYING && i != ch->desc && PRF_FLAGGED(i->character, PRF_QUEST)) if (STATE(i) == CON_PLAYING && i != ch->desc && PRF_FLAGGED(i->character, PRF_QUEST))

View file

@ -51,21 +51,12 @@ ACMD(do_write);
* Begin Functions and defines for act.informative.c * Begin Functions and defines for act.informative.c
****************************************************************************/ ****************************************************************************/
/* Utility Functions */ /* Utility Functions */
/* do_look, do_inventory utility functions */
void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mode);
void list_obj_to_char(struct obj_data *list, struct char_data *ch, int mode, int show);
/** @todo Move to a utility library */ /** @todo Move to a utility library */
char *find_exdesc(char *word, struct extra_descr_data *list); char *find_exdesc(char *word, struct extra_descr_data *list);
/** @todo Move to a mud centric string utility library */ /** @todo Move to a mud centric string utility library */
void space_to_minus(char *str); void space_to_minus(char *str);
/** @todo Move to a help module? */ /** @todo Move to a help module? */
int search_help(const char *argument, int level); int search_help(const char *argument, int level);
/* Used by show_obj_to_char */
#define SHOW_OBJ_LONG 0
#define SHOW_OBJ_SHORT 1
#define SHOW_OBJ_ACTION 2
/* functions with subcommands */ /* functions with subcommands */
/* do_commands */ /* do_commands */
ACMD(do_commands); ACMD(do_commands);
@ -290,9 +281,6 @@ void perform_immort_vis(struct char_data *ch);
void snoop_check(struct char_data *ch); void snoop_check(struct char_data *ch);
bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_name); bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_name);
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr); bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
void set_default_admin_privs(struct char_data *ch, bool keep_old);
int get_admin_level_by_string(char *lv);
void do_stat_character(struct char_data *ch, struct char_data *k);
/* Functions with subcommands */ /* Functions with subcommands */
/* do_date */ /* do_date */
ACMD(do_date); ACMD(do_date);
@ -319,7 +307,6 @@ ACMD(do_wizutil);
#define SCMD_THAW 5 #define SCMD_THAW 5
#define SCMD_UNAFFECT 6 #define SCMD_UNAFFECT 6
/* Functions without subcommands */ /* Functions without subcommands */
ACMD(do_admin);
ACMD(do_advance); ACMD(do_advance);
ACMD(do_at); ACMD(do_at);
ACMD(do_checkloadstatus); ACMD(do_checkloadstatus);
@ -333,7 +320,6 @@ ACMD(do_goto);
ACMD(do_invis); ACMD(do_invis);
ACMD(do_links); ACMD(do_links);
ACMD(do_load); ACMD(do_load);
ACMD(do_mortal);
ACMD(do_peace); ACMD(do_peace);
ACMD(do_plist); ACMD(do_plist);
ACMD(do_purge); ACMD(do_purge);

File diff suppressed because it is too large Load diff

View file

@ -121,39 +121,39 @@ ACMD(do_put)
send_to_char(ch, "You don't see %s %s here.\r\n", AN(thecont), thecont); send_to_char(ch, "You don't see %s %s here.\r\n", AN(thecont), thecont);
else if (GET_OBJ_TYPE(cont) != ITEM_CONTAINER) else if (GET_OBJ_TYPE(cont) != ITEM_CONTAINER)
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR); act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
else if (OBJVAL_FLAGGED(cont, CONT_CLOSED) && (!(IS_ADMIN(ch, ADMLVL_IMMORT)) || !PRF_FLAGGED(ch, PRF_NOHASSLE))) else if (OBJVAL_FLAGGED(cont, CONT_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || !PRF_FLAGGED(ch, PRF_NOHASSLE)))
send_to_char(ch, "You'd better open it first!\r\n"); send_to_char(ch, "You'd better open it first!\r\n");
else { else {
if (obj_dotmode == FIND_INDIV) { /* put <obj> <container> */ if (obj_dotmode == FIND_INDIV) { /* put <obj> <container> */
if (!(obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying))) if (!(obj = get_obj_in_list_vis(ch, theobj, NULL, ch->carrying)))
send_to_char(ch, "You aren't carrying %s %s.\r\n", AN(theobj), theobj); send_to_char(ch, "You aren't carrying %s %s.\r\n", AN(theobj), theobj);
else if (obj == cont && howmany == 1) else if (obj == cont && howmany == 1)
send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n"); send_to_char(ch, "You attempt to fold it into itself, but fail.\r\n");
else { else {
while (obj && howmany) { while (obj && howmany) {
next_obj = obj->next_content; next_obj = obj->next_content;
if (obj != cont) { if (obj != cont) {
howmany--; howmany--;
perform_put(ch, obj, cont); perform_put(ch, obj, cont);
} }
obj = get_obj_in_list_vis(ch, theobj, NULL, next_obj); obj = get_obj_in_list_vis(ch, theobj, NULL, next_obj);
} }
} }
} else { } else {
for (obj = ch->carrying; obj; obj = next_obj) { for (obj = ch->carrying; obj; obj = next_obj) {
next_obj = obj->next_content; next_obj = obj->next_content;
if (obj != cont && CAN_SEE_OBJ(ch, obj) && if (obj != cont && CAN_SEE_OBJ(ch, obj) &&
(obj_dotmode == FIND_ALL || isname(theobj, obj->name))) { (obj_dotmode == FIND_ALL || isname(theobj, obj->name))) {
found = 1; found = 1;
perform_put(ch, obj, cont); perform_put(ch, obj, cont);
} }
} }
if (!found) { if (!found) {
if (obj_dotmode == FIND_ALL) if (obj_dotmode == FIND_ALL)
send_to_char(ch, "You don't seem to have anything to put in it.\r\n"); send_to_char(ch, "You don't seem to have anything to put in it.\r\n");
else else
send_to_char(ch, "You don't seem to have any %ss.\r\n", theobj); send_to_char(ch, "You don't seem to have any %ss.\r\n", theobj);
} }
} }
} }
} }
@ -218,7 +218,7 @@ void get_from_container(struct char_data *ch, struct obj_data *cont,
obj_dotmode = find_all_dots(arg); obj_dotmode = find_all_dots(arg);
if (OBJVAL_FLAGGED(cont, CONT_CLOSED) && (!(IS_ADMIN(ch, ADMLVL_IMMORT)) || !PRF_FLAGGED(ch, PRF_NOHASSLE))) if (OBJVAL_FLAGGED(cont, CONT_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || !PRF_FLAGGED(ch, PRF_NOHASSLE)))
act("$p is closed.", FALSE, ch, cont, 0, TO_CHAR); act("$p is closed.", FALSE, ch, cont, 0, TO_CHAR);
else if (obj_dotmode == FIND_INDIV) { else if (obj_dotmode == FIND_INDIV) {
if (!(obj = get_obj_in_list_vis(ch, arg, NULL, cont->contains))) { if (!(obj = get_obj_in_list_vis(ch, arg, NULL, cont->contains))) {
@ -242,19 +242,19 @@ void get_from_container(struct char_data *ch, struct obj_data *cont,
for (obj = cont->contains; obj; obj = next_obj) { for (obj = cont->contains; obj; obj = next_obj) {
next_obj = obj->next_content; next_obj = obj->next_content;
if (CAN_SEE_OBJ(ch, obj) && if (CAN_SEE_OBJ(ch, obj) &&
(obj_dotmode == FIND_ALL || isname(arg, obj->name))) { (obj_dotmode == FIND_ALL || isname(arg, obj->name))) {
found = 1; found = 1;
perform_get_from_container(ch, obj, cont, mode); perform_get_from_container(ch, obj, cont, mode);
} }
} }
if (!found) { if (!found) {
if (obj_dotmode == FIND_ALL) { if (obj_dotmode == FIND_ALL)
act("$p seems to be empty.", FALSE, ch, cont, 0, TO_CHAR); act("$p seems to be empty.", FALSE, ch, cont, 0, TO_CHAR);
} else { else {
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
snprintf(buf, sizeof(buf), "You can't seem to find any %ss in $p.", arg); snprintf(buf, sizeof(buf), "You can't seem to find any %ss in $p.", arg);
act(buf, FALSE, ch, cont, 0, TO_CHAR); act(buf, FALSE, ch, cont, 0, TO_CHAR);
} }
} }
} }
@ -286,7 +286,7 @@ static void get_from_room(struct char_data *ch, char *arg, int howmany)
else { else {
struct obj_data *obj_next; struct obj_data *obj_next;
while(obj && howmany--) { while(obj && howmany--) {
obj_next = obj->next_content; obj_next = obj->next_content;
perform_get_from_room(ch, obj); perform_get_from_room(ch, obj);
obj = get_obj_in_list_vis(ch, arg, NULL, obj_next); obj = get_obj_in_list_vis(ch, arg, NULL, obj_next);
} }
@ -300,15 +300,15 @@ static void get_from_room(struct char_data *ch, char *arg, int howmany)
next_obj = obj->next_content; next_obj = obj->next_content;
if (CAN_SEE_OBJ(ch, obj) && if (CAN_SEE_OBJ(ch, obj) &&
(dotmode == FIND_ALL || isname(arg, obj->name))) { (dotmode == FIND_ALL || isname(arg, obj->name))) {
found = 1; found = 1;
perform_get_from_room(ch, obj); perform_get_from_room(ch, obj);
} }
} }
if (!found) { if (!found) {
if (dotmode == FIND_ALL) if (dotmode == FIND_ALL)
send_to_char(ch, "There doesn't seem to be anything here.\r\n"); send_to_char(ch, "There doesn't seem to be anything here.\r\n");
else else
send_to_char(ch, "You don't see any %ss here.\r\n", arg); send_to_char(ch, "You don't see any %ss here.\r\n", arg);
} }
} }
} }
@ -342,45 +342,43 @@ ACMD(do_get)
if (cont_dotmode == FIND_INDIV) { if (cont_dotmode == FIND_INDIV) {
mode = generic_find(arg2, FIND_OBJ_INV | FIND_OBJ_ROOM, ch, &tmp_char, &cont); mode = generic_find(arg2, FIND_OBJ_INV | FIND_OBJ_ROOM, ch, &tmp_char, &cont);
if (!cont) if (!cont)
send_to_char(ch, "You don't have %s %s.\r\n", AN(arg2), arg2); send_to_char(ch, "You don't have %s %s.\r\n", AN(arg2), arg2);
else if (GET_OBJ_TYPE(cont) != ITEM_CONTAINER) else if (GET_OBJ_TYPE(cont) != ITEM_CONTAINER)
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR); act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
else else
get_from_container(ch, cont, arg1, mode, amount); get_from_container(ch, cont, arg1, mode, amount);
} else { } else {
if (cont_dotmode == FIND_ALLDOT && !*arg2) { if (cont_dotmode == FIND_ALLDOT && !*arg2) {
send_to_char(ch, "Get from all of what?\r\n"); send_to_char(ch, "Get from all of what?\r\n");
return; return;
}
for (cont = ch->carrying; cont; cont = cont->next_content) {
if (CAN_SEE_OBJ(ch, cont) &&
(cont_dotmode == FIND_ALL || isname(arg2, cont->name))) {
if (GET_OBJ_TYPE(cont) == ITEM_CONTAINER) {
found = 1;
get_from_container(ch, cont, arg1, FIND_OBJ_INV, amount);
} else if (cont_dotmode == FIND_ALLDOT) {
found = 1;
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
}
}
}
for (cont = world[IN_ROOM(ch)].contents; cont; cont = cont->next_content) {
if (CAN_SEE_OBJ(ch, cont) &&
(cont_dotmode == FIND_ALL || isname(arg2, cont->name))) {
if (GET_OBJ_TYPE(cont) == ITEM_CONTAINER) {
get_from_container(ch, cont, arg1, FIND_OBJ_ROOM, amount);
found = 1;
} else if (cont_dotmode == FIND_ALLDOT) {
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
found = 1;
}
}
} }
for (cont = ch->carrying; cont; cont = cont->next_content)
if (CAN_SEE_OBJ(ch, cont) &&
(cont_dotmode == FIND_ALL || isname(arg2, cont->name))) {
if (GET_OBJ_TYPE(cont) == ITEM_CONTAINER) {
found = 1;
get_from_container(ch, cont, arg1, FIND_OBJ_INV, amount);
} else if (cont_dotmode == FIND_ALLDOT) {
found = 1;
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
}
}
for (cont = world[IN_ROOM(ch)].contents; cont; cont = cont->next_content)
if (CAN_SEE_OBJ(ch, cont) &&
(cont_dotmode == FIND_ALL || isname(arg2, cont->name))) {
if (GET_OBJ_TYPE(cont) == ITEM_CONTAINER) {
get_from_container(ch, cont, arg1, FIND_OBJ_ROOM, amount);
found = 1;
} else if (cont_dotmode == FIND_ALLDOT) {
act("$p is not a container.", FALSE, ch, cont, 0, TO_CHAR);
found = 1;
}
}
if (!found) { if (!found) {
if (cont_dotmode == FIND_ALL) if (cont_dotmode == FIND_ALL)
send_to_char(ch, "You can't seem to find any containers.\r\n"); send_to_char(ch, "You can't seem to find any containers.\r\n");
else else
send_to_char(ch, "You can't seem to find any %ss here.\r\n", arg2); send_to_char(ch, "You can't seem to find any %ss here.\r\n", arg2);
} }
} }
} }
@ -399,11 +397,11 @@ static void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_
WAIT_STATE(ch, PULSE_VIOLENCE); /* to prevent coin-bombing */ WAIT_STATE(ch, PULSE_VIOLENCE); /* to prevent coin-bombing */
obj = create_money(amount); obj = create_money(amount);
if (mode == SCMD_DONATE) { if (mode == SCMD_DONATE) {
send_to_char(ch, "You throw some gold into the air where it disappears in a puff of smoke!\r\n"); send_to_char(ch, "You throw some gold into the air where it disappears in a puff of smoke!\r\n");
act("$n throws some gold into the air where it disappears in a puff of smoke!", act("$n throws some gold into the air where it disappears in a puff of smoke!",
FALSE, ch, 0, 0, TO_ROOM); FALSE, ch, 0, 0, TO_ROOM);
obj_to_room(obj, RDR); obj_to_room(obj, RDR);
act("$p suddenly appears in a puff of orange smoke!", 0, 0, obj, 0, TO_ROOM); act("$p suddenly appears in a puff of orange smoke!", 0, 0, obj, 0, TO_ROOM);
} else { } else {
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@ -412,11 +410,11 @@ static void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_
return; return;
} }
snprintf(buf, sizeof(buf), "$n drops %s.", money_desc(amount)); snprintf(buf, sizeof(buf), "$n drops %s.", money_desc(amount));
act(buf, TRUE, ch, 0, 0, TO_ROOM); act(buf, TRUE, ch, 0, 0, TO_ROOM);
send_to_char(ch, "You drop some gold.\r\n"); send_to_char(ch, "You drop some gold.\r\n");
obj_to_room(obj, IN_ROOM(ch)); obj_to_room(obj, IN_ROOM(ch));
} }
} else { } else {
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@ -555,45 +553,44 @@ ACMD(do_drop)
/* Can't junk or donate all */ /* Can't junk or donate all */
if ((dotmode == FIND_ALL) && (subcmd == SCMD_JUNK || subcmd == SCMD_DONATE)) { if ((dotmode == FIND_ALL) && (subcmd == SCMD_JUNK || subcmd == SCMD_DONATE)) {
if (subcmd == SCMD_JUNK) if (subcmd == SCMD_JUNK)
send_to_char(ch, "Go to the dump if you want to junk EVERYTHING!\r\n"); send_to_char(ch, "Go to the dump if you want to junk EVERYTHING!\r\n");
else else
send_to_char(ch, "Go do the donation room if you want to donate EVERYTHING!\r\n"); send_to_char(ch, "Go do the donation room if you want to donate EVERYTHING!\r\n");
return; return;
} }
if (dotmode == FIND_ALL) { if (dotmode == FIND_ALL) {
if (!ch->carrying) { if (!ch->carrying)
send_to_char(ch, "You don't seem to be carrying anything.\r\n"); send_to_char(ch, "You don't seem to be carrying anything.\r\n");
} else { else
for (obj = ch->carrying; obj; obj = next_obj) { for (obj = ch->carrying; obj; obj = next_obj) {
next_obj = obj->next_content; next_obj = obj->next_content;
amount += perform_drop(ch, obj, mode, sname, RDR); amount += perform_drop(ch, obj, mode, sname, RDR);
} }
}
} else if (dotmode == FIND_ALLDOT) { } else if (dotmode == FIND_ALLDOT) {
if (!*arg) { if (!*arg) {
send_to_char(ch, "What do you want to %s all of?\r\n", sname); send_to_char(ch, "What do you want to %s all of?\r\n", sname);
return; return;
} }
if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))
send_to_char(ch, "You don't seem to have any %ss.\r\n", arg); send_to_char(ch, "You don't seem to have any %ss.\r\n", arg);
while (obj) { while (obj) {
next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content); next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content);
amount += perform_drop(ch, obj, mode, sname, RDR); amount += perform_drop(ch, obj, mode, sname, RDR);
obj = next_obj; obj = next_obj;
} }
} else { } else {
if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg); send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
else else
amount += perform_drop(ch, obj, mode, sname, RDR); amount += perform_drop(ch, obj, mode, sname, RDR);
} }
} }
if (amount && (subcmd == SCMD_JUNK)) { if (amount && (subcmd == SCMD_JUNK)) {
send_to_char(ch, "You have been rewarded by the gods!\r\n"); send_to_char(ch, "You have been rewarded by the gods!\r\n");
act("$n has been rewarded by the gods!", TRUE, ch, 0, 0, TO_ROOM); act("$n has been rewarded by the gods!", TRUE, ch, 0, 0, TO_ROOM);
increase_gold(ch, amount); GET_GOLD(ch) += amount;
} }
} }
@ -609,11 +606,11 @@ static void perform_give(struct char_data *ch, struct char_data *vict,
act("You can't let go of $p!! Yeech!", FALSE, ch, obj, 0, TO_CHAR); act("You can't let go of $p!! Yeech!", FALSE, ch, obj, 0, TO_CHAR);
return; return;
} }
if (IS_CARRYING_N(vict) >= CAN_CARRY_N(vict) && !(IS_ADMIN(ch, ADMLVL_IMMORT)) && !(IS_ADMIN(vict, ADMLVL_IMMORT))) { if (IS_CARRYING_N(vict) >= CAN_CARRY_N(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT) {
act("$N seems to have $S hands full.", FALSE, ch, 0, vict, TO_CHAR); act("$N seems to have $S hands full.", FALSE, ch, 0, vict, TO_CHAR);
return; return;
} }
if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && !(IS_ADMIN(ch, ADMLVL_IMMORT)) && !(IS_ADMIN(vict, ADMLVL_IMMORT))) { if (GET_OBJ_WEIGHT(obj) + IS_CARRYING_W(vict) > CAN_CARRY_W(vict) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT) {
act("$E can't carry that much weight.", FALSE, ch, 0, vict, TO_CHAR); act("$E can't carry that much weight.", FALSE, ch, 0, vict, TO_CHAR);
return; return;
} }
@ -653,7 +650,7 @@ static void perform_give_gold(struct char_data *ch, struct char_data *vict,
send_to_char(ch, "Heh heh heh ... we are jolly funny today, eh?\r\n"); send_to_char(ch, "Heh heh heh ... we are jolly funny today, eh?\r\n");
return; return;
} }
if ((GET_GOLD(ch) < amount) && (IS_NPC(ch) || (!ADM_FLAGGED(ch, ADM_MONEY)))) { if ((GET_GOLD(ch) < amount) && (IS_NPC(ch) || (GET_LEVEL(ch) < LVL_GOD))) {
send_to_char(ch, "You don't have that many coins!\r\n"); send_to_char(ch, "You don't have that many coins!\r\n");
return; return;
} }
@ -665,10 +662,10 @@ static void perform_give_gold(struct char_data *ch, struct char_data *vict,
snprintf(buf, sizeof(buf), "$n gives %s to $N.", money_desc(amount)); snprintf(buf, sizeof(buf), "$n gives %s to $N.", money_desc(amount));
act(buf, TRUE, ch, 0, vict, TO_NOTVICT); act(buf, TRUE, ch, 0, vict, TO_NOTVICT);
if (IS_NPC(ch) || (!ADM_FLAGGED(ch, ADM_MONEY))) if (IS_NPC(ch) || (GET_LEVEL(ch) < LVL_GOD))
decrease_gold(ch, amount); decrease_gold(ch, amount);
increase_gold(vict, amount); increase_gold(vict, amount);
bribe_mtrigger(vict, ch, amount); bribe_mtrigger(vict, ch, amount);
} }
@ -689,7 +686,7 @@ ACMD(do_give)
if (!str_cmp("coins", arg) || !str_cmp("coin", arg)) { if (!str_cmp("coins", arg) || !str_cmp("coin", arg)) {
one_argument(argument, arg); one_argument(argument, arg);
if ((vict = give_find_vict(ch, arg)) != NULL) if ((vict = give_find_vict(ch, arg)) != NULL)
perform_give_gold(ch, vict, amount); perform_give_gold(ch, vict, amount);
return; return;
} else if (!*arg) /* Give multiple code. */ } else if (!*arg) /* Give multiple code. */
send_to_char(ch, "What do you want to give %d of?\r\n", amount); send_to_char(ch, "What do you want to give %d of?\r\n", amount);
@ -699,9 +696,9 @@ ACMD(do_give)
send_to_char(ch, "You don't seem to have any %ss.\r\n", arg); send_to_char(ch, "You don't seem to have any %ss.\r\n", arg);
else { else {
while (obj && amount--) { while (obj && amount--) {
next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content); next_obj = get_obj_in_list_vis(ch, arg, NULL, obj->next_content);
perform_give(ch, vict, obj); perform_give(ch, vict, obj);
obj = next_obj; obj = next_obj;
} }
} }
} else { } else {
@ -713,24 +710,23 @@ ACMD(do_give)
dotmode = find_all_dots(arg); dotmode = find_all_dots(arg);
if (dotmode == FIND_INDIV) { if (dotmode == FIND_INDIV) {
if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg); send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
else else
perform_give(ch, vict, obj); perform_give(ch, vict, obj);
} else { } else {
if (dotmode == FIND_ALLDOT && !*arg) { if (dotmode == FIND_ALLDOT && !*arg) {
send_to_char(ch, "All of what?\r\n"); send_to_char(ch, "All of what?\r\n");
return; return;
}
if (!ch->carrying) {
send_to_char(ch, "You don't seem to be holding anything.\r\n");
} else {
for (obj = ch->carrying; obj; obj = next_obj) {
next_obj = obj->next_content;
if (CAN_SEE_OBJ(ch, obj) &&
((dotmode == FIND_ALL || isname(arg, obj->name))))
perform_give(ch, vict, obj);
}
} }
if (!ch->carrying)
send_to_char(ch, "You don't seem to be holding anything.\r\n");
else
for (obj = ch->carrying; obj; obj = next_obj) {
next_obj = obj->next_content;
if (CAN_SEE_OBJ(ch, obj) &&
((dotmode == FIND_ALL || isname(arg, obj->name))))
perform_give(ch, vict, obj);
}
} }
} }
} }
@ -847,17 +843,16 @@ ACMD(do_drink)
send_to_char(ch, "You don't feel thirsty any more.\r\n"); send_to_char(ch, "You don't feel thirsty any more.\r\n");
return; return;
default: default:
send_to_char(ch, "Drink from what?\r\n"); send_to_char(ch, "Drink from what?\r\n");
return; return;
} }
} }
if (!(temp = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) { if (!(temp = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) {
if (!(temp = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents))) { if (!(temp = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents))) {
send_to_char(ch, "You can't find it!\r\n"); send_to_char(ch, "You can't find it!\r\n");
return; return;
} else { } else
on_ground = 1; on_ground = 1;
}
} }
if ((GET_OBJ_TYPE(temp) != ITEM_DRINKCON) && if ((GET_OBJ_TYPE(temp) != ITEM_DRINKCON) &&
(GET_OBJ_TYPE(temp) != ITEM_FOUNTAIN)) { (GET_OBJ_TYPE(temp) != ITEM_FOUNTAIN)) {
@ -926,7 +921,7 @@ ACMD(do_drink)
if (GET_COND(ch, HUNGER) > 20) if (GET_COND(ch, HUNGER) > 20)
send_to_char(ch, "You are full.\r\n"); send_to_char(ch, "You are full.\r\n");
if (GET_OBJ_VAL(temp, 3) && (!ADM_FLAGGED(ch, ADM_NOPOISON))) { /* The crap was poisoned! */ if (GET_OBJ_VAL(temp, 3) && GET_LEVEL(ch) < LVL_IMMORT) { /* The crap was poisoned ! */
send_to_char(ch, "Oops, it tasted rather strange!\r\n"); send_to_char(ch, "Oops, it tasted rather strange!\r\n");
act("$n chokes and utters some strange sounds.", TRUE, ch, 0, 0, TO_ROOM); act("$n chokes and utters some strange sounds.", TRUE, ch, 0, 0, TO_ROOM);
@ -973,7 +968,7 @@ ACMD(do_eat)
do_drink(ch, argument, 0, SCMD_SIP); do_drink(ch, argument, 0, SCMD_SIP);
return; return;
} }
if ((GET_OBJ_TYPE(food) != ITEM_FOOD) && (!ADM_FLAGGED(ch, ADM_EATANYTHING))) { if ((GET_OBJ_TYPE(food) != ITEM_FOOD) && (GET_LEVEL(ch) < LVL_IMMORT)) {
send_to_char(ch, "You can't eat THAT!\r\n"); send_to_char(ch, "You can't eat THAT!\r\n");
return; return;
} }
@ -1000,7 +995,7 @@ ACMD(do_eat)
if (GET_COND(ch, HUNGER) > 20) if (GET_COND(ch, HUNGER) > 20)
send_to_char(ch, "You are full.\r\n"); send_to_char(ch, "You are full.\r\n");
if (GET_OBJ_VAL(food, 3) && (!ADM_FLAGGED(ch, ADM_NOPOISON))) { if (GET_OBJ_VAL(food, 3) && (GET_LEVEL(ch) < LVL_IMMORT)) {
/* The crap was poisoned ! */ /* The crap was poisoned ! */
send_to_char(ch, "Oops, that tasted rather strange!\r\n"); send_to_char(ch, "Oops, that tasted rather strange!\r\n");
act("$n coughs and utters some strange sounds.", FALSE, ch, 0, 0, TO_ROOM); act("$n coughs and utters some strange sounds.", FALSE, ch, 0, 0, TO_ROOM);
@ -1153,7 +1148,8 @@ ACMD(do_pour)
amount = GET_OBJ_VAL(to_obj, 0); amount = GET_OBJ_VAL(to_obj, 0);
} }
/* Poisoned? */ /* Poisoned? */
GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3)); GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3))
;
/* Weight change, except for unlimited. */ /* Weight change, except for unlimited. */
if (GET_OBJ_VAL(from_obj, 0) > 0) { if (GET_OBJ_VAL(from_obj, 0) > 0) {
weight_change_object(from_obj, -amount); weight_change_object(from_obj, -amount);
@ -1356,8 +1352,8 @@ ACMD(do_wear)
send_to_char(ch, "You are not experienced enough to use that.\r\n"); send_to_char(ch, "You are not experienced enough to use that.\r\n");
else { else {
items_worn++; items_worn++;
perform_wear(ch, obj, where); perform_wear(ch, obj, where);
} }
} }
} }
if (!items_worn) if (!items_worn)
@ -1371,16 +1367,15 @@ ACMD(do_wear)
send_to_char(ch, "You don't seem to have any %ss.\r\n", arg1); send_to_char(ch, "You don't seem to have any %ss.\r\n", arg1);
else if (GET_LEVEL(ch) < GET_OBJ_LEVEL(obj)) else if (GET_LEVEL(ch) < GET_OBJ_LEVEL(obj))
send_to_char(ch, "You are not experienced enough to use that.\r\n"); send_to_char(ch, "You are not experienced enough to use that.\r\n");
else { else
while (obj) { while (obj) {
next_obj = get_obj_in_list_vis(ch, arg1, NULL, obj->next_content); next_obj = get_obj_in_list_vis(ch, arg1, NULL, obj->next_content);
if ((where = find_eq_pos(ch, obj, 0)) >= 0) if ((where = find_eq_pos(ch, obj, 0)) >= 0)
perform_wear(ch, obj, where); perform_wear(ch, obj, where);
else else
act("You can't wear $p.", FALSE, ch, obj, 0, TO_CHAR); act("You can't wear $p.", FALSE, ch, obj, 0, TO_CHAR);
obj = next_obj; obj = next_obj;
} }
}
} else { } else {
if (!(obj = get_obj_in_list_vis(ch, arg1, NULL, ch->carrying))) if (!(obj = get_obj_in_list_vis(ch, arg1, NULL, ch->carrying)))
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg1), arg1); send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg1), arg1);
@ -1388,9 +1383,9 @@ ACMD(do_wear)
send_to_char(ch, "You are not experienced enough to use that.\r\n"); send_to_char(ch, "You are not experienced enough to use that.\r\n");
else { else {
if ((where = find_eq_pos(ch, obj, arg2)) >= 0) if ((where = find_eq_pos(ch, obj, arg2)) >= 0)
perform_wear(ch, obj, where); perform_wear(ch, obj, where);
else if (!*arg2) else if (!*arg2)
act("You can't wear $p.", FALSE, ch, obj, 0, TO_CHAR); act("You can't wear $p.", FALSE, ch, obj, 0, TO_CHAR);
} }
} }
} }
@ -1438,9 +1433,9 @@ ACMD(do_grab)
if (!CAN_WEAR(obj, ITEM_WEAR_HOLD) && GET_OBJ_TYPE(obj) != ITEM_WAND && if (!CAN_WEAR(obj, ITEM_WEAR_HOLD) && GET_OBJ_TYPE(obj) != ITEM_WAND &&
GET_OBJ_TYPE(obj) != ITEM_STAFF && GET_OBJ_TYPE(obj) != ITEM_SCROLL && GET_OBJ_TYPE(obj) != ITEM_STAFF && GET_OBJ_TYPE(obj) != ITEM_SCROLL &&
GET_OBJ_TYPE(obj) != ITEM_POTION) GET_OBJ_TYPE(obj) != ITEM_POTION)
send_to_char(ch, "You can't hold that.\r\n"); send_to_char(ch, "You can't hold that.\r\n");
else else
perform_wear(ch, obj, WEAR_HOLD); perform_wear(ch, obj, WEAR_HOLD);
} }
} }
} }
@ -1482,12 +1477,11 @@ ACMD(do_remove)
if (dotmode == FIND_ALL) { if (dotmode == FIND_ALL) {
found = 0; found = 0;
for (i = 0; i < NUM_WEARS; i++) { for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i)) { if (GET_EQ(ch, i)) {
perform_remove(ch, i); perform_remove(ch, i);
found = 1; found = 1;
} }
}
if (!found) if (!found)
send_to_char(ch, "You're not using anything.\r\n"); send_to_char(ch, "You're not using anything.\r\n");
} else if (dotmode == FIND_ALLDOT) { } else if (dotmode == FIND_ALLDOT) {
@ -1495,15 +1489,14 @@ ACMD(do_remove)
send_to_char(ch, "Remove all of what?\r\n"); send_to_char(ch, "Remove all of what?\r\n");
else { else {
found = 0; found = 0;
for (i = 0; i < NUM_WEARS; i++) { for (i = 0; i < NUM_WEARS; i++)
if (GET_EQ(ch, i) && CAN_SEE_OBJ(ch, GET_EQ(ch, i)) && if (GET_EQ(ch, i) && CAN_SEE_OBJ(ch, GET_EQ(ch, i)) &&
isname(arg, GET_EQ(ch, i)->name)) { isname(arg, GET_EQ(ch, i)->name)) {
perform_remove(ch, i); perform_remove(ch, i);
found = 1; found = 1;
} }
}
if (!found) if (!found)
send_to_char(ch, "You don't seem to be using any %ss.\r\n", arg); send_to_char(ch, "You don't seem to be using any %ss.\r\n", arg);
} }
} else { } else {
if ((i = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) < 0) if ((i = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) < 0)
@ -1521,50 +1514,50 @@ ACMD(do_sac)
one_argument(argument, arg); one_argument(argument, arg);
if (!*arg) { if (!*arg) {
send_to_char(ch, "Sacrifice what?\n\r"); send_to_char(ch, "Sacrifice what?\n\r");
return; return;
} }
if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) { if (!(j = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)) && (!(j = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)))) {
send_to_char(ch, "It doesn't seem to be here.\n\r"); send_to_char(ch, "It doesn't seem to be here.\n\r");
return; return;
} }
if (!CAN_WEAR(j, ITEM_WEAR_TAKE)) { if (!CAN_WEAR(j, ITEM_WEAR_TAKE)) {
send_to_char(ch, "You can't sacrifice that!\n\r"); send_to_char(ch, "You can't sacrifice that!\n\r");
return; return;
} }
act("$n sacrifices $p.", FALSE, ch, j, 0, TO_ROOM); act("$n sacrifices $p.", FALSE, ch, j, 0, TO_ROOM);
switch (rand_number(0, 5)) { switch (rand_number(0, 5)) {
case 0: case 0:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j)); send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
increase_gold(ch, 1); increase_gold(ch, 1);
break; break;
case 1: case 1:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j)); send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe Gods ignore your sacrifice.\r\n", GET_OBJ_SHORT(j));
break; break;
case 2: case 2:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j), (2*GET_OBJ_COST(j))); send_to_char(ch, "You sacrifice %s to the Gods.\r\nThe gods give you %d experience points.\r\n", GET_OBJ_SHORT(j), (2*GET_OBJ_COST(j)));
GET_EXP(ch) += (2*GET_OBJ_COST(j)); GET_EXP(ch) += (2*GET_OBJ_COST(j));
break; break;
case 3: case 3:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j), GET_OBJ_COST(j)); send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive %d experience points.\r\n", GET_OBJ_SHORT(j), GET_OBJ_COST(j));
GET_EXP(ch) += GET_OBJ_COST(j); GET_EXP(ch) += GET_OBJ_COST(j);
break; break;
case 4: case 4:
send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins.\r\n", GET_OBJ_COST(j)); send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins.\r\n", GET_OBJ_COST(j));
increase_gold(ch, GET_OBJ_COST(j)); increase_gold(ch, GET_OBJ_COST(j));
break; break;
case 5: case 5:
send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins\r\n", (2*GET_OBJ_COST(j))); send_to_char(ch, "Your sacrifice to the Gods is rewarded with %d gold coins\r\n", (2*GET_OBJ_COST(j)));
increase_gold(ch, (2*GET_OBJ_COST(j))); increase_gold(ch, (2*GET_OBJ_COST(j)));
break; break;
default: default:
send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j)); send_to_char(ch, "You sacrifice %s to the Gods.\r\nYou receive one gold coin for your humility.\r\n", GET_OBJ_SHORT(j));
increase_gold(ch, 1); increase_gold(ch, 1);
break; break;
} }
for (jj = j->contains; jj; jj = next_thing2) { for (jj = j->contains; jj; jj = next_thing2) {
next_thing2 = jj->next_content; /* Next in inventory */ next_thing2 = jj->next_content; /* Next in inventory */

View file

@ -41,7 +41,7 @@ static int has_boat(struct char_data *ch)
struct obj_data *obj; struct obj_data *obj;
int i; int i;
if (ADM_FLAGGED(ch, ADM_WALKANYWHERE)) if (GET_LEVEL(ch) > LVL_IMMORT)
return (1); return (1);
if (AFF_FLAGGED(ch, AFF_WATERWALK) || AFF_FLAGGED(ch, AFF_FLYING)) if (AFF_FLAGGED(ch, AFF_WATERWALK) || AFF_FLAGGED(ch, AFF_FLYING))
@ -66,7 +66,7 @@ int has_flight(struct char_data *ch)
struct obj_data *obj; struct obj_data *obj;
int i; int i;
if (ADM_FLAGGED(ch, ADM_WALKANYWHERE)) if (GET_LEVEL(ch) > LVL_IMMORT)
return (1); return (1);
if (AFF_FLAGGED(ch, AFF_FLYING)) if (AFF_FLAGGED(ch, AFF_FLYING))
@ -91,7 +91,7 @@ int has_scuba(struct char_data *ch)
struct obj_data *obj; struct obj_data *obj;
int i; int i;
if (ADM_FLAGGED(ch, ADM_WALKANYWHERE)) if (GET_LEVEL(ch) > LVL_IMMORT)
return (1); return (1);
if (AFF_FLAGGED(ch, AFF_SCUBA)) if (AFF_FLAGGED(ch, AFF_SCUBA))
@ -219,11 +219,11 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
} }
/* Check zone flag restrictions */ /* Check zone flag restrictions */
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_CLOSED) && !ADM_FLAGGED(ch, ADM_WALKANYWHERE)) { if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_CLOSED)) {
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n"); send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0); return (0);
} }
if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (IS_ADMIN(ch, ADMLVL_IMMORT)) && !(IS_ADMIN(ch, ADMLVL_GRGOD))) { if (ZONE_FLAGGED(GET_ROOM_ZONE(going_to), ZONE_NOIMMORT) && (GET_LEVEL(ch) >= LVL_IMMORT) && (GET_LEVEL(ch) < LVL_GRGOD)) {
send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n"); send_to_char(ch, "A mysterious barrier forces you back! That area is off-limits.\r\n");
return (0); return (0);
} }
@ -240,7 +240,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
} }
/* Room Level Requirements: Is ch privileged enough to enter the room? */ /* Room Level Requirements: Is ch privileged enough to enter the room? */
if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && !(IS_ADMIN(ch, ADMLVL_GOD))) if (ROOM_FLAGGED(going_to, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GOD)
{ {
send_to_char(ch, "You aren't godly enough to use that room!\r\n"); send_to_char(ch, "You aren't godly enough to use that room!\r\n");
return (0); return (0);
@ -253,7 +253,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
movement_loss[SECT(going_to)]) / 2; movement_loss[SECT(going_to)]) / 2;
/* Move Point Requirement Check */ /* Move Point Requirement Check */
if (GET_MOVE(ch) < need_movement && !IS_NPC(ch) && !ADM_FLAGGED(ch, ADM_WALKANYWHERE)) if (GET_MOVE(ch) < need_movement && !IS_NPC(ch))
{ {
if (need_specials_check && ch->master) if (need_specials_check && ch->master)
send_to_char(ch, "You are too exhausted to follow.\r\n"); send_to_char(ch, "You are too exhausted to follow.\r\n");
@ -270,7 +270,7 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
/* Begin: the leave operation. */ /* Begin: the leave operation. */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* If applicable, subtract movement cost. */ /* If applicable, subtract movement cost. */
if (!ADM_FLAGGED(ch, ADM_WALKANYWHERE)) if (GET_LEVEL(ch) < LVL_IMMORT && !IS_NPC(ch))
GET_MOVE(ch) -= need_movement; GET_MOVE(ch) -= need_movement;
/* Generate the leave message and display to others in the was_in room. */ /* Generate the leave message and display to others in the was_in room. */
@ -307,9 +307,9 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
look_at_room(ch, 0); look_at_room(ch, 0);
/* ... and Kill the player if the room is a death trap. */ /* ... and Kill the player if the room is a death trap. */
if (ROOM_FLAGGED(going_to, ROOM_DEATH) && (ADM_FLAGGED(ch, ADM_WALKANYWHERE))) if (ROOM_FLAGGED(going_to, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT)
{ {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name); mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name);
death_cry(ch); death_cry(ch);
extract_char(ch); extract_char(ch);
return (0); return (0);
@ -348,7 +348,7 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
send_to_char(ch, "Alas, you cannot go that way...\r\n"); send_to_char(ch, "Alas, you cannot go that way...\r\n");
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE) else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
send_to_char(ch, "Alas, you cannot go that way...\r\n"); send_to_char(ch, "Alas, you cannot go that way...\r\n");
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (!ADM_FLAGGED(ch, ADM_WALKANYWHERE)) ) { else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE)))) {
if (EXIT(ch, dir)->keyword) if (EXIT(ch, dir)->keyword)
send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword)); send_to_char(ch, "The %s seems to be closed.\r\n", fname(EXIT(ch, dir)->keyword));
else else
@ -365,8 +365,8 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
next = k->next; next = k->next;
if ((IN_ROOM(k->follower) == was_in) && if ((IN_ROOM(k->follower) == was_in) &&
(GET_POS(k->follower) >= POS_STANDING)) { (GET_POS(k->follower) >= POS_STANDING)) {
act("You follow $N.\r\n", FALSE, k->follower, 0, ch, TO_CHAR); act("You follow $N.\r\n", FALSE, k->follower, 0, ch, TO_CHAR);
perform_move(k->follower, dir, 1); perform_move(k->follower, dir, 1);
} }
} }
return (1); return (1);
@ -385,22 +385,22 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
int door; int door;
if (*dir) { /* a direction was specified */ if (*dir) { /* a direction was specified */
if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */ if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */
if ((door = search_block(dir, autoexits, FALSE)) == -1) { /* Check 'short' dirs too */ if ((door = search_block(dir, autoexits, FALSE)) == -1) { /* Check 'short' dirs too */
send_to_char(ch, "That's not a direction.\r\n"); send_to_char(ch, "That's not a direction.\r\n");
return (-1); return (-1);
} }
} }
if (EXIT(ch, door)) { /* Braces added according to indent. -gg */ if (EXIT(ch, door)) { /* Braces added according to indent. -gg */
if (EXIT(ch, door)->keyword) { if (EXIT(ch, door)->keyword) {
if (is_name(type, EXIT(ch, door)->keyword)) if (is_name(type, EXIT(ch, door)->keyword))
return (door); return (door);
else { else {
send_to_char(ch, "I see no %s there.\r\n", type); send_to_char(ch, "I see no %s there.\r\n", type);
return (-1); return (-1);
} }
} else } else
return (door); return (door);
} else { } else {
send_to_char(ch, "I really don't see how you can %s anything there.\r\n", cmdname); send_to_char(ch, "I really don't see how you can %s anything there.\r\n", cmdname);
return (-1); return (-1);
@ -461,9 +461,6 @@ int has_key(struct char_data *ch, obj_vnum key)
{ {
struct obj_data *o; struct obj_data *o;
if (!ch) return (0);
if (!IS_NPC(ch) && ADM_FLAGGED(ch, ADM_NOKEYS)) return (1);
for (o = ch->carrying; o; o = o->next_content) for (o = ch->carrying; o; o = o->next_content)
if (GET_OBJ_VNUM(o) == key) if (GET_OBJ_VNUM(o) == key)
return (1); return (1);
@ -475,10 +472,10 @@ int has_key(struct char_data *ch, obj_vnum key)
return (0); return (0);
} }
#define NEED_OPEN (1 << 0) #define NEED_OPEN (1 << 0)
#define NEED_CLOSED (1 << 1) #define NEED_CLOSED (1 << 1)
#define NEED_UNLOCKED (1 << 2) #define NEED_UNLOCKED (1 << 2)
#define NEED_LOCKED (1 << 3) #define NEED_LOCKED (1 << 3)
/* cmd_door is required external from act.movement.c */ /* cmd_door is required external from act.movement.c */
const char *cmd_door[] = const char *cmd_door[] =
@ -533,7 +530,7 @@ static void do_doorcmd(struct char_data *ch, struct obj_data *obj, int door, int
if (!obj && ((other_room = EXIT(ch, door)->to_room) != NOWHERE)) if (!obj && ((other_room = EXIT(ch, door)->to_room) != NOWHERE))
if ((back = world[other_room].dir_option[rev_dir[door]]) != NULL) if ((back = world[other_room].dir_option[rev_dir[door]]) != NULL)
if (back->to_room != IN_ROOM(ch)) if (back->to_room != IN_ROOM(ch))
back = NULL; back = NULL;
switch (scmd) { switch (scmd) {
case SCMD_OPEN: case SCMD_OPEN:
@ -669,9 +666,11 @@ ACMD(do_gen_door)
send_to_char(ch, "It is locked, and you do not have the key!\r\n"); send_to_char(ch, "It is locked, and you do not have the key!\r\n");
} }
else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) && else if (!(DOOR_IS_UNLOCKED(ch, obj, door)) &&
IS_SET(flags_door[subcmd], NEED_UNLOCKED) && (!ADM_FLAGGED(ch, ADM_NOKEYS) && !PRF_FLAGGED(ch, PRF_NOHASSLE))) IS_SET(flags_door[subcmd], NEED_UNLOCKED) &&
(GET_LEVEL(ch) < LVL_IMMORT || (!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_NOHASSLE))))
send_to_char(ch, "It seems to be locked.\r\n"); send_to_char(ch, "It seems to be locked.\r\n");
else if (!has_key(ch, keynum) && ((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK))) else if (!has_key(ch, keynum) && (GET_LEVEL(ch) < LVL_GOD) &&
((subcmd == SCMD_LOCK) || (subcmd == SCMD_UNLOCK)))
send_to_char(ch, "You don't seem to have the proper key.\r\n"); send_to_char(ch, "You don't seem to have the proper key.\r\n");
else if (ok_pick(ch, keynum, DOOR_IS_PICKPROOF(ch, obj, door), subcmd)) else if (ok_pick(ch, keynum, DOOR_IS_PICKPROOF(ch, obj, door), subcmd))
do_doorcmd(ch, obj, door, subcmd); do_doorcmd(ch, obj, door, subcmd);
@ -690,24 +689,24 @@ ACMD(do_enter)
* keyword */ * keyword */
for (door = 0; door < DIR_COUNT; door++) for (door = 0; door < DIR_COUNT; door++)
if (EXIT(ch, door)) if (EXIT(ch, door))
if (EXIT(ch, door)->keyword) if (EXIT(ch, door)->keyword)
if (!str_cmp(EXIT(ch, door)->keyword, buf)) { if (!str_cmp(EXIT(ch, door)->keyword, buf)) {
perform_move(ch, door, 1); perform_move(ch, door, 1);
return; return;
} }
send_to_char(ch, "There is no %s here.\r\n", buf); send_to_char(ch, "There is no %s here.\r\n", buf);
} else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS)) { } else if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS))
send_to_char(ch, "You are already indoors.\r\n"); send_to_char(ch, "You are already indoors.\r\n");
} else { else {
/* try to locate an entrance */ /* try to locate an entrance */
for (door = 0; door < DIR_COUNT; door++) for (door = 0; door < DIR_COUNT; door++)
if (EXIT(ch, door)) if (EXIT(ch, door))
if (EXIT(ch, door)->to_room != NOWHERE) if (EXIT(ch, door)->to_room != NOWHERE)
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) { ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
perform_move(ch, door, 1); perform_move(ch, door, 1);
return; return;
} }
send_to_char(ch, "You can't seem to find anything to enter.\r\n"); send_to_char(ch, "You can't seem to find anything to enter.\r\n");
} }
} }
@ -721,12 +720,12 @@ ACMD(do_leave)
else { else {
for (door = 0; door < DIR_COUNT; door++) for (door = 0; door < DIR_COUNT; door++)
if (EXIT(ch, door)) if (EXIT(ch, door))
if (EXIT(ch, door)->to_room != NOWHERE) if (EXIT(ch, door)->to_room != NOWHERE)
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) { !ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_INDOORS)) {
perform_move(ch, door, 1); perform_move(ch, door, 1);
return; return;
} }
send_to_char(ch, "I see no obvious exits to the outside.\r\n"); send_to_char(ch, "I see no obvious exits to the outside.\r\n");
} }
} }
@ -960,17 +959,17 @@ ACMD(do_follow)
} else { /* Not Charmed follow person */ } else { /* Not Charmed follow person */
if (leader == ch) { if (leader == ch) {
if (!ch->master) { if (!ch->master) {
send_to_char(ch, "You are already following yourself.\r\n"); send_to_char(ch, "You are already following yourself.\r\n");
return; return;
} }
stop_follower(ch); stop_follower(ch);
} else { } else {
if (circle_follow(ch, leader)) { if (circle_follow(ch, leader)) {
send_to_char(ch, "Sorry, but following in loops is not allowed.\r\n"); send_to_char(ch, "Sorry, but following in loops is not allowed.\r\n");
return; return;
} }
if (ch->master) if (ch->master)
stop_follower(ch); stop_follower(ch);
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_GROUP); REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_GROUP);
add_follower(ch, leader); add_follower(ch, leader);
} }

View file

@ -81,7 +81,7 @@ ACMD(do_hit)
} else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict)) } else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict))
act("$N is just such a good friend, you simply can't hit $M.", FALSE, ch, 0, vict, TO_CHAR); act("$N is just such a good friend, you simply can't hit $M.", FALSE, ch, 0, vict, TO_CHAR);
else { else {
if (!CONFIG_PK_ALLOWED && !IS_NPC(vict) && !IS_NPC(ch)) if (!CONFIG_PK_ALLOWED && !IS_NPC(vict) && !IS_NPC(ch))
check_killer(ch, vict); check_killer(ch, vict);
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) { if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
@ -97,7 +97,7 @@ ACMD(do_kill)
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
struct char_data *vict; struct char_data *vict;
if (!ADM_FLAGGED(ch, ADM_INSTANTKILL)) { if (GET_LEVEL(ch) < LVL_IMMORT || IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
do_hit(ch, argument, cmd, subcmd); do_hit(ch, argument, cmd, subcmd);
return; return;
} }
@ -200,10 +200,10 @@ ACMD(do_order)
act("$n gives $N an order.", FALSE, ch, 0, vict, TO_ROOM); act("$n gives $N an order.", FALSE, ch, 0, vict, TO_ROOM);
if ((vict->master != ch) || !AFF_FLAGGED(vict, AFF_CHARM)) if ((vict->master != ch) || !AFF_FLAGGED(vict, AFF_CHARM))
act("$n has an indifferent look.", FALSE, vict, 0, 0, TO_ROOM); act("$n has an indifferent look.", FALSE, vict, 0, 0, TO_ROOM);
else { else {
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
command_interpreter(vict, message); command_interpreter(vict, message);
} }
} else { /* This is order "followers" */ } else { /* This is order "followers" */
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@ -212,17 +212,16 @@ ACMD(do_order)
act(buf, FALSE, ch, 0, 0, TO_ROOM); act(buf, FALSE, ch, 0, 0, TO_ROOM);
for (k = ch->followers; k; k = k->next) { for (k = ch->followers; k; k = k->next) {
if (IN_ROOM(ch) == IN_ROOM(k->follower)) { if (IN_ROOM(ch) == IN_ROOM(k->follower))
if (AFF_FLAGGED(k->follower, AFF_CHARM)) { if (AFF_FLAGGED(k->follower, AFF_CHARM)) {
found = TRUE; found = TRUE;
command_interpreter(k->follower, message); command_interpreter(k->follower, message);
} }
}
} }
if (found) if (found)
send_to_char(ch, "%s", CONFIG_OK); send_to_char(ch, "%s", CONFIG_OK);
else else
send_to_char(ch, "Nobody here is a loyal subject of yours!\r\n"); send_to_char(ch, "Nobody here is a loyal subject of yours!\r\n");
} }
} }
} }
@ -238,24 +237,24 @@ ACMD(do_flee)
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
attempt = rand_number(0, DIR_COUNT - 1); /* Select a random direction */ attempt = rand_number(0, DIR_COUNT - 1); /* Select a random direction */
if (CAN_GO(ch, attempt) && if (CAN_GO(ch, attempt) &&
!ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) { !ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) {
act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM); act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
was_fighting = FIGHTING(ch); was_fighting = FIGHTING(ch);
if (do_simple_move(ch, attempt, TRUE)) { if (do_simple_move(ch, attempt, TRUE)) {
send_to_char(ch, "You flee head over heels.\r\n"); send_to_char(ch, "You flee head over heels.\r\n");
if (was_fighting && !IS_NPC(ch)) { if (was_fighting && !IS_NPC(ch)) {
loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting); loss = GET_MAX_HIT(was_fighting) - GET_HIT(was_fighting);
loss *= GET_LEVEL(was_fighting); loss *= GET_LEVEL(was_fighting);
gain_exp(ch, -loss); gain_exp(ch, -loss);
} }
if (FIGHTING(ch)) if (FIGHTING(ch))
stop_fighting(ch); stop_fighting(ch);
if (was_fighting && ch == FIGHTING(was_fighting)) if (was_fighting && ch == FIGHTING(was_fighting))
stop_fighting(was_fighting); stop_fighting(was_fighting);
} else { } else {
act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM); act("$n tries to flee, but can't!", TRUE, ch, 0, 0, TO_ROOM);
} }
return; return;
} }
@ -356,9 +355,9 @@ ACMD(do_rescue)
if ((FIGHTING(vict) != NULL) && (FIGHTING(ch) == FIGHTING(vict)) && (tmp_ch == NULL)) { if ((FIGHTING(vict) != NULL) && (FIGHTING(ch) == FIGHTING(vict)) && (tmp_ch == NULL)) {
tmp_ch = FIGHTING(vict); tmp_ch = FIGHTING(vict);
if (FIGHTING(tmp_ch) == ch) { if (FIGHTING(tmp_ch) == ch) {
send_to_char(ch, "You have already rescued %s from %s.\r\n", GET_NAME(vict), GET_NAME(FIGHTING(ch))); send_to_char(ch, "You have already rescued %s from %s.\r\n", GET_NAME(vict), GET_NAME(FIGHTING(ch)));
return; return;
} }
} }
if (!tmp_ch) { if (!tmp_ch) {

View file

@ -43,7 +43,7 @@ ACMD(do_quit)
if (IS_NPC(ch) || !ch->desc) if (IS_NPC(ch) || !ch->desc)
return; return;
if (subcmd != SCMD_QUIT && !IS_ADMIN(ch, ADMLVL_IMMORT)) if (subcmd != SCMD_QUIT && GET_LEVEL(ch) < LVL_IMMORT)
send_to_char(ch, "You have to type quit--no less, to quit!\r\n"); send_to_char(ch, "You have to type quit--no less, to quit!\r\n");
else if (GET_POS(ch) == POS_FIGHTING) else if (GET_POS(ch) == POS_FIGHTING)
send_to_char(ch, "No way! You're fighting for your life!\r\n"); send_to_char(ch, "No way! You're fighting for your life!\r\n");
@ -52,7 +52,7 @@ ACMD(do_quit)
die(ch, NULL); die(ch, NULL);
} else { } else {
act("$n has left the game.", TRUE, ch, 0, 0, TO_ROOM); act("$n has left the game.", TRUE, ch, 0, 0, TO_ROOM);
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has quit the game.", GET_NAME(ch)); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has quit the game.", GET_NAME(ch));
if (GET_QUEST_TIME(ch) != -1) if (GET_QUEST_TIME(ch) != -1)
quest_timeout(ch); quest_timeout(ch);
@ -185,7 +185,7 @@ ACMD(do_steal)
percent -= 50; percent -= 50;
/* No stealing if not allowed. If it is no stealing from Imm's or Shopkeepers. */ /* No stealing if not allowed. If it is no stealing from Imm's or Shopkeepers. */
if (ADM_FLAGGED(vict, ADM_NOSTEAL) || pcsteal || GET_MOB_SPEC(vict) == shop_keeper) if (GET_LEVEL(vict) >= LVL_IMMORT || pcsteal || GET_MOB_SPEC(vict) == shop_keeper)
percent = 101; /* Failure */ percent = 101; /* Failure */
if (str_cmp(obj_name, "coins") && str_cmp(obj_name, "gold")) { if (str_cmp(obj_name, "coins") && str_cmp(obj_name, "gold")) {
@ -253,14 +253,14 @@ ACMD(do_steal)
gold = (GET_GOLD(vict) * rand_number(1, 10)) / 100; gold = (GET_GOLD(vict) * rand_number(1, 10)) / 100;
gold = MIN(1782, gold); gold = MIN(1782, gold);
if (gold > 0) { if (gold > 0) {
increase_gold(ch, gold); increase_gold(ch, gold);
decrease_gold(vict, gold); decrease_gold(vict, gold);
if (gold > 1) if (gold > 1)
send_to_char(ch, "Bingo! You got %d gold coins.\r\n", gold); send_to_char(ch, "Bingo! You got %d gold coins.\r\n", gold);
else else
send_to_char(ch, "You manage to swipe a solitary gold coin.\r\n"); send_to_char(ch, "You manage to swipe a solitary gold coin.\r\n");
} else { } else {
send_to_char(ch, "You couldn't get any gold...\r\n"); send_to_char(ch, "You couldn't get any gold...\r\n");
} }
} }
} }
@ -286,7 +286,7 @@ ACMD(do_practice)
ACMD(do_visible) ACMD(do_visible)
{ {
if (IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) >= LVL_IMMORT) {
perform_immort_vis(ch); perform_immort_vis(ch);
return; return;
} }
@ -554,8 +554,8 @@ ACMD(do_split)
(IN_ROOM(f->follower) == IN_ROOM(ch)) && (IN_ROOM(f->follower) == IN_ROOM(ch)) &&
f->follower != ch) { f->follower != ch) {
increase_gold(f->follower, share); increase_gold(f->follower, share);
send_to_char(f->follower, "%s", buf); send_to_char(f->follower, "%s", buf);
} }
} }
send_to_char(ch, "You split %d coins among %d members -- %d coins each.\r\n", send_to_char(ch, "You split %d coins among %d members -- %d coins each.\r\n",
@ -803,23 +803,25 @@ ACMD(do_gen_tog)
result = PRF_TOG_CHK(ch, PRF_CLS); result = PRF_TOG_CHK(ch, PRF_CLS);
break; break;
case SCMD_BUILDWALK: case SCMD_BUILDWALK:
if (!ADM_FLAGGED(ch, ADM_BUILD)) { if (GET_LEVEL(ch) < LVL_BUILDER) {
send_to_char(ch, "Builders only, sorry.\r\n"); send_to_char(ch, "Builders only, sorry.\r\n");
return; return;
} }
result = PRF_TOG_CHK(ch, PRF_BUILDWALK); result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) { if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
one_argument(argument, arg); one_argument(argument, arg);
for (i=0; *arg && *(sector_types[i]) != '\n'; i++) for (i=0; *arg && *(sector_types[i]) != '\n'; i++)
if (is_abbrev(arg, sector_types[i])) if (is_abbrev(arg, sector_types[i]))
break; break;
if (*(sector_types[i]) == '\n') i=0; if (*(sector_types[i]) == '\n')
GET_BUILDWALK_SECTOR(ch) = i; i=0;
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]); GET_BUILDWALK_SECTOR(ch) = i;
mudlog(CMP, GET_ADMLEVEL(ch), TRUE, send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
mudlog(CMP, GET_LEVEL(ch), TRUE,
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch)); "OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
} else } else
mudlog(CMP, GET_ADMLEVEL(ch), TRUE, mudlog(CMP, GET_LEVEL(ch), TRUE,
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch)); "OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
break; break;
case SCMD_AFK: case SCMD_AFK:
@ -828,7 +830,7 @@ ACMD(do_gen_tog)
act("$n has gone AFK.", TRUE, ch, 0, 0, TO_ROOM); act("$n has gone AFK.", TRUE, ch, 0, 0, TO_ROOM);
else { else {
act("$n has come back from AFK.", TRUE, ch, 0, 0, TO_ROOM); act("$n has come back from AFK.", TRUE, ch, 0, 0, TO_ROOM);
if (has_mail(ch)) if (has_mail(GET_IDNUM(ch)))
send_to_char(ch, "You have mail waiting.\r\n"); send_to_char(ch, "You have mail waiting.\r\n");
} }
break; break;
@ -874,7 +876,7 @@ void show_happyhour(struct char_data *ch)
char happyexp[80], happygold[80], happyqp[80]; char happyexp[80], happygold[80], happyqp[80];
int secs_left; int secs_left;
if ( (IS_HAPPYHOUR) || (IS_ADMIN(ch, ADMLVL_GRGOD)) ) if ((IS_HAPPYHOUR) || (GET_LEVEL(ch) >= LVL_GRGOD))
{ {
if (HAPPY_TIME) if (HAPPY_TIME)
secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick; secs_left = ((HAPPY_TIME - 1) * SECS_PER_MUD_HOUR) + next_tick;
@ -888,9 +890,9 @@ void show_happyhour(struct char_data *ch)
send_to_char(ch, "tbaMUD Happy Hour!\r\n" send_to_char(ch, "tbaMUD Happy Hour!\r\n"
"------------------\r\n" "------------------\r\n"
"%s%s%sTime Remaining: %s%d%s hours %s%d%s mins %s%d%s secs\r\n", "%s%s%sTime Remaining: %s%d%s hours %s%d%s mins %s%d%s secs\r\n",
(IS_HAPPYEXP || IS_ADMIN(ch, ADMLVL_GOD)) ? happyexp : "", (IS_HAPPYEXP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyexp : "",
(IS_HAPPYGOLD || IS_ADMIN(ch, ADMLVL_GOD)) ? happygold : "", (IS_HAPPYGOLD || (GET_LEVEL(ch) >= LVL_GOD)) ? happygold : "",
(IS_HAPPYQP || IS_ADMIN(ch, ADMLVL_GOD)) ? happyqp : "", (IS_HAPPYQP || (GET_LEVEL(ch) >= LVL_GOD)) ? happyqp : "",
CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), (secs_left / 3600), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), (secs_left % 3600) / 60, CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM) ); CCYEL(ch, C_NRM), (secs_left % 60), CCNRM(ch, C_NRM) );
@ -906,7 +908,7 @@ ACMD(do_happyhour)
char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH], val[MAX_INPUT_LENGTH];
int num; int num;
if (IS_ADMIN(ch, ADMLVL_GOD)) if (GET_LEVEL(ch) < LVL_GOD)
{ {
show_happyhour(ch); show_happyhour(ch);
return; return;

View file

@ -40,11 +40,6 @@ ACMD(do_action)
action = &soc_mess_list[act_nr]; action = &soc_mess_list[act_nr];
if (!IS_ADMIN(ch, (action->min_level_char))) {
send_to_char(ch, "You are not powerful enough to do that.\r\n");
return;
}
if (!argument || !*argument) { if (!argument || !*argument) {
send_to_char(ch, "%s\r\n", action->char_no_arg); send_to_char(ch, "%s\r\n", action->char_no_arg);
act(action->others_no_arg, action->hide, ch, 0, 0, TO_ROOM); act(action->others_no_arg, action->hide, ch, 0, 0, TO_ROOM);
@ -147,15 +142,13 @@ void create_command_list(void)
(str_cmp(cmd_info[i].sort_as, soc_mess_list[j].sort_as) < 1)) (str_cmp(cmd_info[i].sort_as, soc_mess_list[j].sort_as) < 1))
complete_cmd_info[k++] = cmd_info[i++]; complete_cmd_info[k++] = cmd_info[i++];
else { else {
soc_mess_list[j].act_nr = k; soc_mess_list[j].act_nr = k;
complete_cmd_info[k].command = soc_mess_list[j].command; complete_cmd_info[k].command = soc_mess_list[j].command;
complete_cmd_info[k].sort_as = soc_mess_list[j].sort_as; complete_cmd_info[k].sort_as = soc_mess_list[j].sort_as;
complete_cmd_info[k].minimum_position = soc_mess_list[j].min_char_position; complete_cmd_info[k].minimum_position = soc_mess_list[j].min_char_position;
complete_cmd_info[k].command_pointer = do_action; complete_cmd_info[k].command_pointer = do_action;
complete_cmd_info[k].minimum_level = 0; complete_cmd_info[k].minimum_level = soc_mess_list[j++].min_level_char;
complete_cmd_info[k].minimum_admlevel = MIN(MAX(soc_mess_list[j++].min_level_char, ADMLVL_MORTAL), ADMLVL_IMPL); complete_cmd_info[k++].subcmd = 0;
complete_cmd_info[k].admin_flag = ADM_NONE;
complete_cmd_info[k++].subcmd = 0;
} }
} }
complete_cmd_info[k] = cmd_info[i]; complete_cmd_info[k] = cmd_info[i];

File diff suppressed because it is too large Load diff

View file

@ -41,7 +41,7 @@ ACMD(do_oasis_aedit)
/* No building as a mob or while being forced. */ /* No building as a mob or while being forced. */
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
return; return;
if (CONFIG_NEW_SOCIALS == 0) { if (CONFIG_NEW_SOCIALS == 0) {
send_to_char(ch, "Socials cannot be edited at the moment.\r\n"); send_to_char(ch, "Socials cannot be edited at the moment.\r\n");
return; return;
@ -68,7 +68,7 @@ ACMD(do_oasis_aedit)
d = ch->desc; d = ch->desc;
if (!str_cmp("save", arg)) { if (!str_cmp("save", arg)) {
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves socials.", GET_NAME(ch)); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves socials.", GET_NAME(ch));
send_to_char(ch, "Writing social file.\r\n"); send_to_char(ch, "Writing social file.\r\n");
aedit_save_to_disk(d); aedit_save_to_disk(d);
send_to_char(ch, "Done.\r\n"); send_to_char(ch, "Done.\r\n");
@ -77,7 +77,7 @@ ACMD(do_oasis_aedit)
/* Give descriptor an OLC structure. */ /* Give descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
CREATE(d->olc, struct oasis_olc_data, 1); CREATE(d->olc, struct oasis_olc_data, 1);
@ -104,7 +104,7 @@ ACMD(do_oasis_aedit)
STATE(d) = CON_AEDIT; STATE(d) = CON_AEDIT;
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing actions.", GET_NAME(ch)); mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
} }
static void aedit_setup_new(struct descriptor_data *d) { static void aedit_setup_new(struct descriptor_data *d) {
@ -253,7 +253,7 @@ static void aedit_disp_menu(struct descriptor_data * d) {
"%s-- Action editor\r\n" "%s-- Action editor\r\n"
"%sn%s) Command : %s%-15.15s%s %s1%s) Sort as Command : %s%-15.15s%s\r\n" "%sn%s) Command : %s%-15.15s%s %s1%s) Sort as Command : %s%-15.15s%s\r\n"
"%s2%s) Min Position[CH]: %s%-8.8s %s3%s) Min Position [VT]: %s%-8.8s\r\n" "%s2%s) Min Position[CH]: %s%-8.8s %s3%s) Min Position [VT]: %s%-8.8s\r\n"
"%s4%s) Min AdmLevel[CH]: %s%-3d %s5%s) Show if Invisible: %s%s\r\n" "%s4%s) Min Level [CH]: %s%-3d %s5%s) Show if Invisible: %s%s\r\n"
"%sa%s) Char [NO ARG]: %s%s\r\n" "%sa%s) Char [NO ARG]: %s%s\r\n"
"%sb%s) Others [NO ARG]: %s%s\r\n" "%sb%s) Others [NO ARG]: %s%s\r\n"
"%sc%s) Char [NOT FOUND]: %s%s\r\n" "%sc%s) Char [NOT FOUND]: %s%s\r\n"
@ -321,7 +321,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
switch (*arg) { switch (*arg) {
case 'y': case 'Y': case 'y': case 'Y':
aedit_save_internally(d); aedit_save_internally(d);
mudlog (CMP, ADMLVL_IMPL, TRUE, "OLC: %s edits action %s", mudlog (CMP, LVL_IMPL, TRUE, "OLC: %s edits action %s",
GET_NAME(d->character), OLC_ACTION(d)->command); GET_NAME(d->character), OLC_ACTION(d)->command);
/* do not free the strings.. just the structure */ /* do not free the strings.. just the structure */
@ -425,7 +425,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
OLC_MODE(d) = AEDIT_MIN_VICT_POS; OLC_MODE(d) = AEDIT_MIN_VICT_POS;
return; return;
case '4': case '4':
write_to_output(d, "Enter new minimum admin level for social: "); write_to_output(d, "Enter new minimum level for social: ");
OLC_MODE(d) = AEDIT_MIN_CHAR_LEVEL; OLC_MODE(d) = AEDIT_MIN_CHAR_LEVEL;
return; return;
case '5': case '5':
@ -586,7 +586,7 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
return; return;
} }
i = atoi(arg); i = atoi(arg);
if ((i < ADMLVL_MORTAL) && (i > ADMLVL_IMPL)) { if ((i < 0) && (i > LVL_IMPL)) {
aedit_disp_menu(d); aedit_disp_menu(d);
return; return;
} }

View file

@ -215,7 +215,7 @@ bool can_see_map(struct char_data *ch) {
/* Is the map funcionality disabled? */ /* Is the map funcionality disabled? */
if (CONFIG_MAP == MAP_OFF) if (CONFIG_MAP == MAP_OFF)
return FALSE; return FALSE;
else if ((CONFIG_MAP == MAP_IMM_ONLY) && (!IS_ADMIN(ch, ADMLVL_IMMORT))) else if ((CONFIG_MAP == MAP_IMM_ONLY) && (GET_LEVEL(ch) < LVL_IMMORT))
return FALSE; return FALSE;
return TRUE; return TRUE;
@ -259,7 +259,7 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
if ( (pexit = world[room].dir_option[door]) != NULL && if ( (pexit = world[room].dir_option[door]) != NULL &&
(pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) && (pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) &&
(!IS_SET(pexit->exit_info, EX_CLOSED)) && (!IS_SET(pexit->exit_info, EX_CLOSED)) &&
(!IS_SET(pexit->exit_info, EX_HIDDEN) || ADM_FLAGGED(ch, ADM_SEESECRET)) ) (!IS_SET(pexit->exit_info, EX_HIDDEN) || PRF_FLAGGED(ch, PRF_HOLYLIGHT)) )
{ /* A real exit */ { /* A real exit */
/* But is the door here... */ /* But is the door here... */
@ -607,11 +607,9 @@ ACMD(do_map) {
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) { if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) {
send_to_char(ch, "It is too dark to see the map.\r\n"); send_to_char(ch, "It is too dark to see the map.\r\n");
return; return;
} else if (AFF_FLAGGED(ch, AFF_BLIND) && !IS_ADMIN(ch, ADMLVL_IMMORT)) { } else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "You can't see the map while blind!\r\n"); send_to_char(ch, "You can't see the map while blind!\r\n");
return; return;
} }
perform_map(ch, argument, show_worldmap(ch)); perform_map(ch, argument, show_worldmap(ch));
} }

View file

@ -186,7 +186,7 @@ ACMD(do_ban)
ban_node->next = ban_list; ban_node->next = ban_list;
ban_list = ban_node; ban_list = ban_node;
mudlog(NRM, MAX(ADMLVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s has banned %s for %s players.", mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s has banned %s for %s players.",
GET_NAME(ch), site, ban_types[ban_node->type]); GET_NAME(ch), site, ban_types[ban_node->type]);
send_to_char(ch, "Site banned.\r\n"); send_to_char(ch, "Site banned.\r\n");
write_ban_list(); write_ban_list();
@ -218,7 +218,7 @@ ACMD(do_unban)
} }
REMOVE_FROM_LIST(ban_node, ban_list, next); REMOVE_FROM_LIST(ban_node, ban_list, next);
send_to_char(ch, "Site unbanned.\r\n"); send_to_char(ch, "Site unbanned.\r\n");
mudlog(NRM, MAX(ADMLVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s removed the %s-player ban on %s.", mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s removed the %s-player ban on %s.",
GET_NAME(ch), ban_types[ban_node->type], ban_node->site); GET_NAME(ch), ban_types[ban_node->type], ban_node->site);
free(ban_node); free(ban_node);
@ -234,12 +234,12 @@ int valid_name(char *newname)
struct descriptor_data *dt; struct descriptor_data *dt;
char tempname[MAX_INPUT_LENGTH]; char tempname[MAX_INPUT_LENGTH];
/* Make sure someone isn't trying to create this same name. We want to do a /* Make sure someone isn't trying to create this same name. We want to do a
* 'str_cmp' so people can't do 'Bob' and 'BoB'. The creating login will not * 'str_cmp' so people can't do 'Bob' and 'BoB'. The creating login will not
* have a character name yet and other people sitting at the prompt won't * have a character name yet and other people sitting at the prompt won't
* have characters yet. New, unindexed characters (i.e., characters who are * have characters yet. New, unindexed characters (i.e., characters who are
* in the process of creating) will have an idnum of -1, set by clear_char() * in the process of creating) will have an idnum of -1, set by clear_char()
* in db.c. If someone is creating a character by the same name as the one * in db.c. If someone is creating a character by the same name as the one
* we are checking, then the name is invalid, to prevent character duping. * we are checking, then the name is invalid, to prevent character duping.
* THIS SHOULD FIX THE 'invalid name' if disconnected from OLC-bug - Welcor */ * THIS SHOULD FIX THE 'invalid name' if disconnected from OLC-bug - Welcor */
for (dt = descriptor_list; dt; dt = dt->next) for (dt = descriptor_list; dt; dt = dt->next)

View file

@ -45,17 +45,16 @@
/* Board appearance order. */ /* Board appearance order. */
#define NEWEST_AT_TOP FALSE #define NEWEST_AT_TOP FALSE
/* Format: vnum, read lvl, write lvl, remove lvl, filename, 0 at end. Be sure /* Format: vnum, read lvl, write lvl, remove lvl, filename, 0 at end. Be sure
* to also change NUM_OF_BOARDS in board.h*/ * to also change NUM_OF_BOARDS in board.h*/
struct board_info_type board_info[NUM_OF_BOARDS] = { struct board_info_type board_info[NUM_OF_BOARDS] = {
/* VNUM Read Level Write Level Remove Level Filename Zero */ {3099, 0, 0, LVL_GOD, LIB_ETC "board.mortal", 0},
{3099, ADMLVL_MORTAL, ADMLVL_MORTAL, ADMLVL_GOD, LIB_ETC "board.mortal", 0}, {3098, LVL_IMMORT, LVL_IMMORT, LVL_GRGOD, LIB_ETC "board.immortal", 0},
{3098, ADMLVL_IMMORT, ADMLVL_IMMORT, ADMLVL_GRGOD, LIB_ETC "board.immortal", 0}, {3097, LVL_IMMORT, LVL_GRGOD, LVL_IMPL, LIB_ETC "board.freeze", 0},
{3097, ADMLVL_IMMORT, ADMLVL_GRGOD, ADMLVL_IMPL, LIB_ETC "board.freeze", 0}, {3096, 0, 0, LVL_IMMORT, LIB_ETC "board.social", 0},
{3096, ADMLVL_MORTAL, ADMLVL_MORTAL, ADMLVL_IMMORT, LIB_ETC "board.social", 0}, {1226, 0, 0, LVL_IMPL, LIB_ETC "board.builder", 0},
{1226, ADMLVL_MORTAL, ADMLVL_MORTAL, ADMLVL_IMPL, LIB_ETC "board.builder", 0}, {1227, 0, 0, LVL_IMPL, LIB_ETC "board.staff", 0},
{1227, ADMLVL_MORTAL, ADMLVL_MORTAL, ADMLVL_IMPL, LIB_ETC "board.staff", 0}, {1228, 0, 0, LVL_IMPL, LIB_ETC "board.advertising", 0},
{1228, ADMLVL_MORTAL, ADMLVL_MORTAL, ADMLVL_IMPL, LIB_ETC "board.advertising", 0},
}; };
/* local (file scope) global variables */ /* local (file scope) global variables */
@ -94,7 +93,7 @@ static int find_board(struct char_data *ch)
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj)) if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
return (i); return (i);
if (IS_ADMIN(ch, ADMLVL_IMMORT)) if (GET_LEVEL(ch) >= LVL_IMMORT)
for (obj = ch->carrying; obj; obj = obj->next_content) for (obj = ch->carrying; obj; obj = obj->next_content)
for (i = 0; i < NUM_OF_BOARDS; i++) for (i = 0; i < NUM_OF_BOARDS; i++)
if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj)) if (BOARD_RNUM(i) == GET_OBJ_RNUM(obj))
@ -138,7 +137,7 @@ SPECIAL(gen_board)
/* These were originally globals for some unknown reason. */ /* These were originally globals for some unknown reason. */
int ACMD_READ, ACMD_LOOK, ACMD_EXAMINE, ACMD_WRITE, ACMD_REMOVE; int ACMD_READ, ACMD_LOOK, ACMD_EXAMINE, ACMD_WRITE, ACMD_REMOVE;
if (!loaded) { if (!loaded) {
init_boards(); init_boards();
loaded = 1; loaded = 1;
@ -177,7 +176,7 @@ int board_write_message(int board_type, struct char_data *ch, char *arg, struct
time_t ct; time_t ct;
char buf[MAX_INPUT_LENGTH], buf2[MAX_NAME_LENGTH + 3], tmstr[MAX_STRING_LENGTH]; char buf[MAX_INPUT_LENGTH], buf2[MAX_NAME_LENGTH + 3], tmstr[MAX_STRING_LENGTH];
if (!IS_ADMIN(ch, WRITE_LVL(board_type))) { if (GET_LEVEL(ch) < WRITE_LVL(board_type)) {
send_to_char(ch, "You are not holy enough to write on this board.\r\n"); send_to_char(ch, "You are not holy enough to write on this board.\r\n");
return (1); return (1);
} }
@ -233,7 +232,7 @@ int board_show_board(int board_type, struct char_data *ch, char *arg, struct obj
if (!*tmp || !isname(tmp, board->name)) if (!*tmp || !isname(tmp, board->name))
return (0); return (0);
if (!IS_ADMIN(ch, READ_LVL(board_type))) { if (GET_LEVEL(ch) < READ_LVL(board_type)) {
send_to_char(ch, "You try but fail to understand the holy words.\r\n"); send_to_char(ch, "You try but fail to understand the holy words.\r\n");
return (1); return (1);
} }
@ -296,7 +295,7 @@ int board_display_msg(int board_type, struct char_data *ch, char *arg, struct ob
if (!(msg = atoi(number))) if (!(msg = atoi(number)))
return (0); return (0);
if (!IS_ADMIN(ch, READ_LVL(board_type))) { if (GET_LEVEL(ch) < READ_LVL(board_type)) {
send_to_char(ch, "You try but fail to understand the holy words.\r\n"); send_to_char(ch, "You try but fail to understand the holy words.\r\n");
return (1); return (1);
} }
@ -367,7 +366,7 @@ int board_remove_msg(int board_type, struct char_data *ch, char *arg, struct obj
return (1); return (1);
} }
snprintf(buf, sizeof(buf), "(%s)", GET_NAME(ch)); snprintf(buf, sizeof(buf), "(%s)", GET_NAME(ch));
if (!IS_ADMIN(ch, REMOVE_LVL(board_type)) && if (GET_LEVEL(ch) < REMOVE_LVL(board_type) &&
!(strstr(MSG_HEADING(board_type, ind), buf))) { !(strstr(MSG_HEADING(board_type, ind), buf))) {
send_to_char(ch, "You are not holy enough to remove other people's messages.\r\n"); send_to_char(ch, "You are not holy enough to remove other people's messages.\r\n");
return (1); return (1);

View file

@ -1,13 +1,13 @@
/** /**
* @file boards.h * @file boards.h
* Header file for the bulletin board system (boards.c). * Header file for the bulletin board system (boards.c).
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
* All rights reserved. See license for complete information. * All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
* *
*/ */
#ifndef _BOARDS_H_ #ifndef _BOARDS_H_
@ -31,9 +31,9 @@ struct board_msginfo {
struct board_info_type { struct board_info_type {
obj_vnum vnum; /* vnum of this board */ obj_vnum vnum; /* vnum of this board */
int read_lvl; /* min admin level to read messages on this board */ int read_lvl; /* min level to read messages on this board */
int write_lvl; /* min admin level to write messages on this board */ int write_lvl; /* min level to write messages on this board */
int remove_lvl; /* min admin level to remove messages from this board */ int remove_lvl; /* min level to remove messages from this board */
char filename[50]; /* file to save this board to */ char filename[50]; /* file to save this board to */
obj_rnum rnum; /* rnum of this board */ obj_rnum rnum; /* rnum of this board */
}; };

View file

@ -46,7 +46,7 @@ ACMD(do_oasis_cedit)
/* Parse any arguments. */ /* Parse any arguments. */
one_argument(argument, buf1); one_argument(argument, buf1);
if (!ADM_FLAGGED(ch, ADM_CEDIT)) { if (GET_LEVEL(ch) < LVL_IMPL) {
send_to_char(ch, "You can't modify the game configuration.\r\n"); send_to_char(ch, "You can't modify the game configuration.\r\n");
return; return;
} }
@ -61,7 +61,7 @@ ACMD(do_oasis_cedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"OLC: %s starts editing the game configuration.", GET_NAME(ch)); "OLC: %s starts editing the game configuration.", GET_NAME(ch));
return; return;
} else if (str_cmp("save", buf1) != 0) { } else if (str_cmp("save", buf1) != 0) {
@ -70,7 +70,7 @@ ACMD(do_oasis_cedit)
} }
send_to_char(ch, "Saving the game configuration.\r\n"); send_to_char(ch, "Saving the game configuration.\r\n");
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves the game configuration.", GET_NAME(ch)); "OLC: %s saves the game configuration.", GET_NAME(ch));
cedit_save_to_disk(); cedit_save_to_disk();
@ -92,7 +92,6 @@ static void cedit_setup(struct descriptor_data *d)
OLC_CONFIG(d)->play.max_exp_loss = CONFIG_MAX_EXP_LOSS; OLC_CONFIG(d)->play.max_exp_loss = CONFIG_MAX_EXP_LOSS;
OLC_CONFIG(d)->play.max_npc_corpse_time = CONFIG_MAX_NPC_CORPSE_TIME; OLC_CONFIG(d)->play.max_npc_corpse_time = CONFIG_MAX_NPC_CORPSE_TIME;
OLC_CONFIG(d)->play.max_pc_corpse_time = CONFIG_MAX_PC_CORPSE_TIME; OLC_CONFIG(d)->play.max_pc_corpse_time = CONFIG_MAX_PC_CORPSE_TIME;
OLC_CONFIG(d)->play.max_mortal_level = CONFIG_MAX_LEVEL;
OLC_CONFIG(d)->play.idle_void = CONFIG_IDLE_VOID; OLC_CONFIG(d)->play.idle_void = CONFIG_IDLE_VOID;
OLC_CONFIG(d)->play.idle_rent_time = CONFIG_IDLE_RENT_TIME; OLC_CONFIG(d)->play.idle_rent_time = CONFIG_IDLE_RENT_TIME;
OLC_CONFIG(d)->play.idle_max_level = CONFIG_IDLE_MAX_LEVEL; OLC_CONFIG(d)->play.idle_max_level = CONFIG_IDLE_MAX_LEVEL;
@ -135,23 +134,10 @@ static void cedit_setup(struct descriptor_data *d)
OLC_CONFIG(d)->operation.nameserver_is_slow = CONFIG_NS_IS_SLOW; OLC_CONFIG(d)->operation.nameserver_is_slow = CONFIG_NS_IS_SLOW;
OLC_CONFIG(d)->operation.medit_advanced = CONFIG_MEDIT_ADVANCED; OLC_CONFIG(d)->operation.medit_advanced = CONFIG_MEDIT_ADVANCED;
OLC_CONFIG(d)->operation.ibt_autosave = CONFIG_IBT_AUTOSAVE; OLC_CONFIG(d)->operation.ibt_autosave = CONFIG_IBT_AUTOSAVE;
/* Autowiz */ /* Autowiz */
OLC_CONFIG(d)->autowiz.use_autowiz = CONFIG_USE_AUTOWIZ; OLC_CONFIG(d)->autowiz.use_autowiz = CONFIG_USE_AUTOWIZ;
OLC_CONFIG(d)->autowiz.min_wizlist_lev = CONFIG_MIN_WIZLIST_LEV; OLC_CONFIG(d)->autowiz.min_wizlist_lev = CONFIG_MIN_WIZLIST_LEV;
/* Mudmail */
OLC_CONFIG(d)->mail.mail_allowed = CONFIG_CAN_MAIL;
OLC_CONFIG(d)->mail.objects_allowed = CONFIG_CAN_MAIL_OBJ;
OLC_CONFIG(d)->mail.gold_allowed = CONFIG_CAN_MAIL_GOLD;
OLC_CONFIG(d)->mail.stamp_cost = CONFIG_STAMP_COST;
OLC_CONFIG(d)->mail.min_level = CONFIG_MIN_MAIL_LEVEL;
OLC_CONFIG(d)->mail.min_free_level = CONFIG_FREE_MAIL_LEVEL;
OLC_CONFIG(d)->mail.allow_drafts = CONFIG_DRAFTS_ALLOWED;
OLC_CONFIG(d)->mail.draft_timeout = CONFIG_DRAFT_TIMEOUT;
OLC_CONFIG(d)->mail.safe_mailing = CONFIG_SAFE_MAILING;
OLC_CONFIG(d)->mail.min_mail_anywhere = CONFIG_MIN_MAIL_ANYWHERE;
OLC_CONFIG(d)->mail.min_send_to_all = CONFIG_MIN_SEND_TO_ALL;
/* Allocate space for the strings. */ /* Allocate space for the strings. */
OLC_CONFIG(d)->play.OK = str_udup(CONFIG_OK); OLC_CONFIG(d)->play.OK = str_udup(CONFIG_OK);
@ -205,13 +191,12 @@ static void cedit_save_internally(struct descriptor_data *d)
CONFIG_MAX_EXP_LOSS = OLC_CONFIG(d)->play.max_exp_loss; CONFIG_MAX_EXP_LOSS = OLC_CONFIG(d)->play.max_exp_loss;
CONFIG_MAX_NPC_CORPSE_TIME = OLC_CONFIG(d)->play.max_npc_corpse_time; CONFIG_MAX_NPC_CORPSE_TIME = OLC_CONFIG(d)->play.max_npc_corpse_time;
CONFIG_MAX_PC_CORPSE_TIME = OLC_CONFIG(d)->play.max_pc_corpse_time; CONFIG_MAX_PC_CORPSE_TIME = OLC_CONFIG(d)->play.max_pc_corpse_time;
CONFIG_MAX_LEVEL = OLC_CONFIG(d)->play.max_mortal_level;
CONFIG_IDLE_VOID = OLC_CONFIG(d)->play.idle_void; CONFIG_IDLE_VOID = OLC_CONFIG(d)->play.idle_void;
CONFIG_IDLE_RENT_TIME = OLC_CONFIG(d)->play.idle_rent_time; CONFIG_IDLE_RENT_TIME = OLC_CONFIG(d)->play.idle_rent_time;
CONFIG_IDLE_MAX_LEVEL = OLC_CONFIG(d)->play.idle_max_level; CONFIG_IDLE_MAX_LEVEL = OLC_CONFIG(d)->play.idle_max_level;
CONFIG_DTS_ARE_DUMPS = OLC_CONFIG(d)->play.dts_are_dumps; CONFIG_DTS_ARE_DUMPS = OLC_CONFIG(d)->play.dts_are_dumps;
CONFIG_LOAD_INVENTORY = OLC_CONFIG(d)->play.load_into_inventory; CONFIG_LOAD_INVENTORY = OLC_CONFIG(d)->play.load_into_inventory;
CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors; CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors;
CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort; CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort;
CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors; CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors;
CONFIG_DIAGONAL_DIRS = OLC_CONFIG(d)->play.diagonal_dirs; CONFIG_DIAGONAL_DIRS = OLC_CONFIG(d)->play.diagonal_dirs;
@ -252,20 +237,6 @@ static void cedit_save_internally(struct descriptor_data *d)
CONFIG_USE_AUTOWIZ = OLC_CONFIG(d)->autowiz.use_autowiz; CONFIG_USE_AUTOWIZ = OLC_CONFIG(d)->autowiz.use_autowiz;
CONFIG_MIN_WIZLIST_LEV = OLC_CONFIG(d)->autowiz.min_wizlist_lev; CONFIG_MIN_WIZLIST_LEV = OLC_CONFIG(d)->autowiz.min_wizlist_lev;
/* Mudmail */
CONFIG_CAN_MAIL = OLC_CONFIG(d)->mail.mail_allowed;
CONFIG_CAN_MAIL_OBJ = OLC_CONFIG(d)->mail.objects_allowed;
CONFIG_CAN_MAIL_GOLD = OLC_CONFIG(d)->mail.gold_allowed;
CONFIG_STAMP_COST = OLC_CONFIG(d)->mail.stamp_cost;
CONFIG_OBJECT_COST = OLC_CONFIG(d)->mail.object_cost;
CONFIG_MIN_MAIL_LEVEL = OLC_CONFIG(d)->mail.min_level;
CONFIG_FREE_MAIL_LEVEL = OLC_CONFIG(d)->mail.min_free_level;
CONFIG_DRAFTS_ALLOWED = OLC_CONFIG(d)->mail.allow_drafts;
CONFIG_DRAFT_TIMEOUT = OLC_CONFIG(d)->mail.draft_timeout;
CONFIG_SAFE_MAILING = OLC_CONFIG(d)->mail.safe_mailing;
CONFIG_MIN_MAIL_ANYWHERE = OLC_CONFIG(d)->mail.min_mail_anywhere;
CONFIG_MIN_SEND_TO_ALL = OLC_CONFIG(d)->mail.min_send_to_all;
/* Allocate space for the strings. */ /* Allocate space for the strings. */
if (CONFIG_OK) if (CONFIG_OK)
free(CONFIG_OK); free(CONFIG_OK);
@ -376,13 +347,11 @@ int save_config( IDXTYPE nowhere )
"max_npc_corpse_time = %d\n\n", CONFIG_MAX_NPC_CORPSE_TIME); "max_npc_corpse_time = %d\n\n", CONFIG_MAX_NPC_CORPSE_TIME);
fprintf(fl, "* Number of tics before PC corpses decompose.\n" fprintf(fl, "* Number of tics before PC corpses decompose.\n"
"max_pc_corpse_time = %d\n\n", CONFIG_MAX_PC_CORPSE_TIME); "max_pc_corpse_time = %d\n\n", CONFIG_MAX_PC_CORPSE_TIME);
fprintf(fl, "* The maximum mortal level.\n"
"max_mortal_level = %d\n\n", CONFIG_MAX_LEVEL);
fprintf(fl, "* Number of tics before a PC is sent to the void.\n" fprintf(fl, "* Number of tics before a PC is sent to the void.\n"
"idle_void = %d\n\n", CONFIG_IDLE_VOID); "idle_void = %d\n\n", CONFIG_IDLE_VOID);
fprintf(fl, "* Number of tics before a PC is autorented.\n" fprintf(fl, "* Number of tics before a PC is autorented.\n"
"idle_rent_time = %d\n\n", CONFIG_IDLE_RENT_TIME); "idle_rent_time = %d\n\n", CONFIG_IDLE_RENT_TIME);
fprintf(fl, "* Admin Level and above of players whom are immune to idle penalties.\n" fprintf(fl, "* Level and above of players whom are immune to idle penalties.\n"
"idle_max_level = %d\n\n", CONFIG_IDLE_MAX_LEVEL); "idle_max_level = %d\n\n", CONFIG_IDLE_MAX_LEVEL);
fprintf(fl, "* Should the items in death traps be junked automatically?\n" fprintf(fl, "* Should the items in death traps be junked automatically?\n"
"dts_are_dumps = %d\n\n", CONFIG_DTS_ARE_DUMPS); "dts_are_dumps = %d\n\n", CONFIG_DTS_ARE_DUMPS);
@ -395,7 +364,7 @@ int save_config( IDXTYPE nowhere )
fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n" fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n"
"disp_closed_doors = %d\n\n", CONFIG_DISP_CLOSED_DOORS); "disp_closed_doors = %d\n\n", CONFIG_DISP_CLOSED_DOORS);
fprintf(fl, "* Are diagonal directions enabled?\n" fprintf(fl, "* Are diagonal directions enabled?\n"
"diagonal_dirs_enabled = %d\n\n", CONFIG_DIAGONAL_DIRS); "diagonal_dirs = %d\n\n", CONFIG_DIAGONAL_DIRS);
fprintf(fl, "* Who can use the map functions? 0=off, 1=on, 2=imm_only\n" fprintf(fl, "* Who can use the map functions? 0=off, 1=on, 2=imm_only\n"
"map_option = %d\n\n", CONFIG_MAP); "map_option = %d\n\n", CONFIG_MAP);
fprintf(fl, "* Default size of map shown by 'map' command\n" fprintf(fl, "* Default size of map shown by 'map' command\n"
@ -559,8 +528,8 @@ int save_config( IDXTYPE nowhere )
CONFIG_MEDIT_ADVANCED); CONFIG_MEDIT_ADVANCED);
fprintf(fl, "* Should the idea, bug and typo commands autosave (1) or not (0).\n" fprintf(fl, "* Should the idea, bug and typo commands autosave (1) or not (0).\n"
"ibt_autosave = %d\n\n", "ibt_autosave = %d\n\n",
CONFIG_IBT_AUTOSAVE); CONFIG_IBT_AUTOSAVE);
fprintf(fl, "\n\n\n* [ Autowiz Options ]\n"); fprintf(fl, "\n\n\n* [ Autowiz Options ]\n");
@ -569,60 +538,10 @@ int save_config( IDXTYPE nowhere )
"use_autowiz = %d\n\n", "use_autowiz = %d\n\n",
CONFIG_USE_AUTOWIZ); CONFIG_USE_AUTOWIZ);
fprintf(fl, "* If yes, what is the lowest admin level which should be on the wizlist?\n" fprintf(fl, "* If yes, what is the lowest level which should be on the wizlist?\n"
"min_wizlist_lev = %d\n\n", "min_wizlist_lev = %d\n\n",
CONFIG_MIN_WIZLIST_LEV); CONFIG_MIN_WIZLIST_LEV);
/* MUDMAIL OPTIONS */
fprintf(fl, "\n\n\n* [ Mudmail Options ]\n");
fprintf(fl, "* Enable/Disable the whole mudmail system\n"
"can_mail = %d\n\n",
CONFIG_CAN_MAIL);
fprintf(fl, "* Can objects be sent via mudmail?\n"
"mail_objects_allowed = %d\n\n",
CONFIG_CAN_MAIL_OBJ);
fprintf(fl, "* Can gold coins be sent via mudmail?\n"
"mail_gold_allowed = %d\n\n",
CONFIG_CAN_MAIL_GOLD);
fprintf(fl, "* How much does it cost to send mudmails\n"
"mail_stamp_cost = %d\n\n",
CONFIG_STAMP_COST);
fprintf(fl, "* How much extra does it cost to add each object mudmails\n"
"mail_object_cost = %d\n\n",
CONFIG_OBJECT_COST);
fprintf(fl, "* The minimum player level that's allowed to send mudmails\n"
"mail_min_level = %d\n\n",
CONFIG_MIN_MAIL_LEVEL);
fprintf(fl, "* The minimum level that can send mudmails for free\n"
"mail_min_free_level = %d\n\n",
CONFIG_FREE_MAIL_LEVEL);
fprintf(fl, "* Are players allowed to create draft mails for sending later?\n"
"mail_drafts_allowed = %d\n\n",
CONFIG_DRAFTS_ALLOWED);
fprintf(fl, "* Number of days before a draft mail is autoremoved (0 for never) \n"
"mail_draft_timeout = %d\n\n",
CONFIG_DRAFT_TIMEOUT);
fprintf(fl, "* When on, the player cannot be attacked or stolen from while mailing. \n"
"mail_safe_mailing = %d\n\n",
CONFIG_SAFE_MAILING);
fprintf(fl, "* This is the minimum level that can send mail from any location (not just at postmaster). \n"
"mail_min_mail_anywhere = %d\n\n",
CONFIG_MIN_MAIL_ANYWHERE);
fprintf(fl, "* This is the minimum level that can send mail to all players. \n"
"mail_min_send_to_all = %d\n\n",
CONFIG_MIN_SEND_TO_ALL);
fclose(fl); fclose(fl);
@ -647,7 +566,6 @@ static void cedit_disp_menu(struct descriptor_data *d)
"%sR%s) Room Numbers\r\n" "%sR%s) Room Numbers\r\n"
"%sO%s) Operation Options\r\n" "%sO%s) Operation Options\r\n"
"%sA%s) Autowiz Options\r\n" "%sA%s) Autowiz Options\r\n"
"%sM%s) Mudmail Options\r\n"
"%sQ%s) Quit\r\n" "%sQ%s) Quit\r\n"
"Enter your choice : ", "Enter your choice : ",
@ -656,7 +574,6 @@ static void cedit_disp_menu(struct descriptor_data *d)
grn, nrm, grn, nrm,
grn, nrm, grn, nrm,
grn, nrm, grn, nrm,
grn, nrm,
grn, nrm grn, nrm
); );
@ -682,16 +599,15 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
"%sG%s) Maximum Experience Loss : %s%d\r\n" "%sG%s) Maximum Experience Loss : %s%d\r\n"
"%sH%s) Max Time for NPC Corpse : %s%d\r\n" "%sH%s) Max Time for NPC Corpse : %s%d\r\n"
"%sI%s) Max Time for PC Corpse : %s%d\r\n" "%sI%s) Max Time for PC Corpse : %s%d\r\n"
"%sJ%s) Max Mortal Level : %s%d\r\n" "%sJ%s) Tics before PC sent to void : %s%d\r\n"
"%sK%s) Tics before PC sent to void : %s%d\r\n" "%sK%s) Tics before PC is autosaved : %s%d\r\n"
"%sL%s) Tics before PC is autosaved : %s%d\r\n" "%sL%s) Level Immune To IDLE : %s%d\r\n"
"%sM%s) Imm Level Immune To IDLE : %s%d\r\n" "%sM%s) Death Traps Junk Items : %s%s\r\n"
"%sN%s) Death Traps Junk Items : %s%s\r\n" "%sN%s) Objects Load Into Inventory : %s%s\r\n"
"%sO%s) Objects Load Into Inventory : %s%s\r\n" "%sO%s) Track Through Doors : %s%s\r\n"
"%sP%s) Track Through Doors : %s%s\r\n" "%sP%s) Display Closed Doors : %s%s\r\n"
"%sR%s) Display Closed Doors : %s%s\r\n" "%sR%s) Diagonal Directions : %s%s\r\n"
"%sS%s) Diagonal Directions : %s%s\r\n" "%sS%s) Mortals Level To Immortal : %s%s\r\n"
"%sT%s) Mortals Level To Immortal : %s%s\r\n"
"%s1%s) OK Message Text : %s%s" "%s1%s) OK Message Text : %s%s"
"%s2%s) NOPERSON Message Text : %s%s" "%s2%s) NOPERSON Message Text : %s%s"
"%s3%s) NOEFFECT Message Text : %s%s" "%s3%s) NOEFFECT Message Text : %s%s"
@ -710,7 +626,6 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
grn, nrm, cyn, OLC_CONFIG(d)->play.max_exp_loss, grn, nrm, cyn, OLC_CONFIG(d)->play.max_exp_loss,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_npc_corpse_time, grn, nrm, cyn, OLC_CONFIG(d)->play.max_npc_corpse_time,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_pc_corpse_time, grn, nrm, cyn, OLC_CONFIG(d)->play.max_pc_corpse_time,
grn, nrm, cyn, OLC_CONFIG(d)->play.max_mortal_level,
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_void, grn, nrm, cyn, OLC_CONFIG(d)->play.idle_void,
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_rent_time, grn, nrm, cyn, OLC_CONFIG(d)->play.idle_rent_time,
@ -790,18 +705,6 @@ static void cedit_disp_room_numbers(struct descriptor_data *d)
OLC_MODE(d) = CEDIT_ROOM_NUMBERS_MENU; OLC_MODE(d) = CEDIT_ROOM_NUMBERS_MENU;
} }
static void cedit_disp_admin_levels(struct descriptor_data *d)
{
int i;
get_char_colors(d->character);
clear_screen(d);
write_to_output(d, "\r\n\r\n");
for (i=ADMLVL_IMMORT; i<=ADMLVL_IMPL; i++) {
write_to_output(d, "%s%d%s) %s%s%s\r\n", grn, i, nrm, cyn, admin_level_names[i], nrm);
}
}
static void cedit_disp_operation_options(struct descriptor_data *d) static void cedit_disp_operation_options(struct descriptor_data *d)
{ {
get_char_colors(d->character); get_char_colors(d->character);
@ -866,50 +769,6 @@ static void cedit_disp_autowiz_options(struct descriptor_data *d)
OLC_MODE(d) = CEDIT_AUTOWIZ_OPTIONS_MENU; OLC_MODE(d) = CEDIT_AUTOWIZ_OPTIONS_MENU;
} }
void cedit_disp_mudmail_options(struct descriptor_data *d)
{
char timeout[MAX_INPUT_LENGTH];
get_char_colors(d->character);
clear_screen(d);
if (OLC_CONFIG(d)->mail.draft_timeout > 0)
sprintf(timeout, "%d days", OLC_CONFIG(d)->mail.draft_timeout);
else
sprintf(timeout, "%s<Never!>", cyn);
write_to_output(d, "\r\n\r\n"
"%sA%s) Use mudmail system : %s%s\r\n"
"%sB%s) Allow object attachments : %s%s\r\n"
"%sC%s) Allow gold attachments : %s%s\r\n"
"%sD%s) Stamp Cost (Normal Mails) : %s%d coins\r\n"
"%sE%s) Cost per object attached : %s%d coins\r\n"
"%sF%s) Allow draft mudmails : %s%s\r\n"
"%sG%s) Draft mail timeout : %s%s\r\n"
"%sH%s) Min. level that can mail : %s%d\r\n"
"%sI%s) Min. level for free mail : %s%d\r\n"
"%sJ%s) Safe while mailing? : %s%s\r\n"
"%sK%s) Min level to mail anywhere : %s%d\r\n"
"%sL%s) Min level to send to all : %s%d\r\n"
"%sQ%s) Exit To The Main Menu\r\n"
"Enter your choice : ",
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->mail.mail_allowed),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->mail.objects_allowed),
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->mail.gold_allowed),
grn, nrm, yel, OLC_CONFIG(d)->mail.stamp_cost,
grn, nrm, yel, OLC_CONFIG(d)->mail.object_cost,
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->mail.allow_drafts),
grn, nrm, yel, timeout,
grn, nrm, yel, OLC_CONFIG(d)->mail.min_level,
grn, nrm, yel, OLC_CONFIG(d)->mail.min_free_level,
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->mail.safe_mailing),
grn, nrm, yel, OLC_CONFIG(d)->mail.min_mail_anywhere,
grn, nrm, yel, OLC_CONFIG(d)->mail.min_send_to_all,
grn, nrm
);
OLC_MODE(d) = CEDIT_MUDMAIL_OPTIONS_MENU;
}
/* The event handler. */ /* The event handler. */
void cedit_parse(struct descriptor_data *d, char *arg) void cedit_parse(struct descriptor_data *d, char *arg)
{ {
@ -921,7 +780,7 @@ void cedit_parse(struct descriptor_data *d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
cedit_save_internally(d); cedit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE,
"OLC: %s modifies the game configuration.", GET_NAME(d->character)); "OLC: %s modifies the game configuration.", GET_NAME(d->character));
cleanup_olc(d, CLEANUP_CONFIG); cleanup_olc(d, CLEANUP_CONFIG);
if (CONFIG_AUTO_SAVE) { if (CONFIG_AUTO_SAVE) {
@ -973,12 +832,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
OLC_MODE(d) = CEDIT_AUTOWIZ_OPTIONS_MENU; OLC_MODE(d) = CEDIT_AUTOWIZ_OPTIONS_MENU;
break; break;
case 'm':
case 'M':
cedit_disp_mudmail_options(d);
OLC_MODE(d) = CEDIT_MUDMAIL_OPTIONS_MENU;
break;
case 'q': case 'q':
case 'Q': case 'Q':
write_to_output(d, "Do you wish to save your changes? : "); write_to_output(d, "Do you wish to save your changes? : ");
@ -1048,57 +901,50 @@ void cedit_parse(struct descriptor_data *d, char *arg)
case 'j': case 'j':
case 'J': case 'J':
write_to_output(d, "Enter the highest possible mortal level (0-254) : ");
OLC_MODE(d) = CEDIT_MAX_LEVEL;
return;
case 'k':
case 'K':
write_to_output(d, "Enter the number of tics before PC's are sent to the void (idle) : "); write_to_output(d, "Enter the number of tics before PC's are sent to the void (idle) : ");
OLC_MODE(d) = CEDIT_IDLE_VOID; OLC_MODE(d) = CEDIT_IDLE_VOID;
return; return;
case 'l': case 'k':
case 'L': case 'K':
write_to_output(d, "Enter the number of tics before PC's are automatically rented and forced to quit : "); write_to_output(d, "Enter the number of tics before PC's are automatically rented and forced to quit : ");
OLC_MODE(d) = CEDIT_IDLE_RENT_TIME; OLC_MODE(d) = CEDIT_IDLE_RENT_TIME;
return; return;
case 'm': case 'l':
case 'M': case 'L':
cedit_disp_admin_levels(d); write_to_output(d, "Enter the level a player must be to become immune to IDLE : ");
write_to_output(d, "Enter the admin level a player must be to become immune to IDLE : ");
OLC_MODE(d) = CEDIT_IDLE_MAX_LEVEL; OLC_MODE(d) = CEDIT_IDLE_MAX_LEVEL;
return; return;
case 'm':
case 'M':
TOGGLE_VAR(OLC_CONFIG(d)->play.dts_are_dumps);
break;
case 'n': case 'n':
case 'N': case 'N':
TOGGLE_VAR(OLC_CONFIG(d)->play.dts_are_dumps); TOGGLE_VAR(OLC_CONFIG(d)->play.load_into_inventory);
break; break;
case 'o': case 'o':
case 'O': case 'O':
TOGGLE_VAR(OLC_CONFIG(d)->play.load_into_inventory); TOGGLE_VAR(OLC_CONFIG(d)->play.track_through_doors);
break; break;
case 'p': case 'p':
case 'P': case 'P':
TOGGLE_VAR(OLC_CONFIG(d)->play.track_through_doors); TOGGLE_VAR(OLC_CONFIG(d)->play.disp_closed_doors);
break; break;
case 'r': case 'r':
case 'R': case 'R':
TOGGLE_VAR(OLC_CONFIG(d)->play.disp_closed_doors); TOGGLE_VAR(OLC_CONFIG(d)->play.diagonal_dirs);
break; break;
case 's': case 's':
case 'S': case 'S':
TOGGLE_VAR(OLC_CONFIG(d)->play.diagonal_dirs); TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort);
break;
case 't':
case 'T':
TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort);
break; break;
case '1': case '1':
@ -1367,10 +1213,10 @@ void cedit_parse(struct descriptor_data *d, char *arg)
TOGGLE_VAR(OLC_CONFIG(d)->operation.medit_advanced); TOGGLE_VAR(OLC_CONFIG(d)->operation.medit_advanced);
break; break;
case 'p': case 'p':
case 'P': case 'P':
TOGGLE_VAR(OLC_CONFIG(d)->operation.ibt_autosave); TOGGLE_VAR(OLC_CONFIG(d)->operation.ibt_autosave);
break; break;
case 'q': case 'q':
case 'Q': case 'Q':
@ -1393,8 +1239,7 @@ void cedit_parse(struct descriptor_data *d, char *arg)
case 'b': case 'b':
case 'B': case 'B':
cedit_disp_admin_levels(d); write_to_output(d, "Enter the minimum level for players to appear on the wizlist : ");
write_to_output(d, "\r\nEnter the minimum admin level for players to appear on the wizlist : ");
OLC_MODE(d) = CEDIT_MIN_WIZLIST_LEV; OLC_MODE(d) = CEDIT_MIN_WIZLIST_LEV;
return; return;
@ -1410,87 +1255,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
cedit_disp_autowiz_options(d); cedit_disp_autowiz_options(d);
return; return;
case CEDIT_MUDMAIL_OPTIONS_MENU:
switch (*arg) {
case 'a':
case 'A':
TOGGLE_VAR(OLC_CONFIG(d)->mail.mail_allowed);
break;
case 'b':
case 'B':
TOGGLE_VAR(OLC_CONFIG(d)->mail.objects_allowed);
break;
case 'c':
case 'C':
TOGGLE_VAR(OLC_CONFIG(d)->mail.gold_allowed);
break;
case 'd':
case 'D':
write_to_output(d, "Enter the cost per mail (without attachments) : ");
OLC_MODE(d) = CEDIT_STAMP_COST;
return;
case 'e':
case 'E':
write_to_output(d, "Enter the cost per object attachment : ");
OLC_MODE(d) = CEDIT_OBJECT_COST;
return;
case 'f':
case 'F':
TOGGLE_VAR(OLC_CONFIG(d)->mail.allow_drafts);
break;
case 'g':
case 'G':
write_to_output(d, "Enter the timeout (in days) before draft mails are auto-removed (0=off) : ");
OLC_MODE(d) = CEDIT_DRAFT_TIMEOUT;
return;
case 'h':
case 'H':
write_to_output(d, "Enter the minimum admin level that can send mudmails : ");
OLC_MODE(d) = CEDIT_MIN_MAIL_LEVEL;
return;
case 'i':
case 'I':
write_to_output(d, "Enter the minimum admin level for free mudmails : ");
OLC_MODE(d) = CEDIT_MIN_FREE_LEVEL;
return;
case 'j':
case 'J':
TOGGLE_VAR(OLC_CONFIG(d)->mail.safe_mailing);
break;
case 'k':
case 'K':
write_to_output(d, "Enter the minimum admin level that can send mail from anywhere : ");
OLC_MODE(d) = CEDIT_MAIL_ANYWHERE;
return;
case 'l':
case 'L':
write_to_output(d, "Enter the minimum admin level that can send to all players : ");
OLC_MODE(d) = CEDIT_MAIL_ALL_PLAYERS;
return;
case 'q':
case 'Q':
cedit_disp_menu(d);
return;
default:
write_to_output(d, "\r\nThat is an invalid choice!\r\n");
}
cedit_disp_mudmail_options(d);
return;
case CEDIT_LEVEL_CAN_SHOUT: case CEDIT_LEVEL_CAN_SHOUT:
if (!*arg) { if (!*arg) {
write_to_output(d, write_to_output(d,
@ -1560,15 +1324,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
} }
break; break;
case CEDIT_MAX_LEVEL:
/* Note: Some things, such as spell_info, use (CONFIG_MAX_LEVEL + 1) */
/* Do not use the max possible for the variable type */
if (*arg)
OLC_CONFIG(d)->play.max_mortal_level = MIN(MAX(atoi(arg),0),254);
cedit_disp_game_play_options(d);
break;
case CEDIT_IDLE_VOID: case CEDIT_IDLE_VOID:
if (!*arg) { if (!*arg) {
write_to_output(d, write_to_output(d,
@ -1593,12 +1348,9 @@ void cedit_parse(struct descriptor_data *d, char *arg)
case CEDIT_IDLE_MAX_LEVEL: case CEDIT_IDLE_MAX_LEVEL:
if (!*arg) { if (!*arg) {
write_to_output(d, "Value not changed!\r\n");
cedit_disp_game_play_options(d);
} else if ((atoi(arg) < ADMLVL_MORTAL) || (atoi(arg) > ADMLVL_IMPL)) {
write_to_output(d, write_to_output(d,
"That is an invalid choice!\r\n" "That is an invalid choice!\r\n"
"Enter the admin level a player must be to become immune to IDLE : "); "Enter the level a player must be to become immune to IDLE : ");
} else { } else {
OLC_CONFIG(d)->play.idle_max_level = atoi(arg); OLC_CONFIG(d)->play.idle_max_level = atoi(arg);
cedit_disp_game_play_options(d); cedit_disp_game_play_options(d);
@ -1840,13 +1592,10 @@ void cedit_parse(struct descriptor_data *d, char *arg)
break; break;
case CEDIT_MIN_WIZLIST_LEV: case CEDIT_MIN_WIZLIST_LEV:
if (!*arg) { if (atoi(arg) > LVL_IMPL) {
write_to_output(d, "Value not changed.\r\n");
cedit_disp_autowiz_options(d);
} else if ((atoi(arg) < ADMLVL_IMMORT) || (atoi(arg) > ADMLVL_IMPL)) {
write_to_output(d, write_to_output(d,
"The minimum wizlist level can't be greater than %d.\r\n" "The minimum wizlist level can't be greater than %d.\r\n"
"Enter the minimum admin level for players to appear on the wizlist : ", ADMLVL_IMPL); "Enter the minimum level for players to appear on the wizlist : ", LVL_IMPL);
} else { } else {
OLC_CONFIG(d)->autowiz.min_wizlist_lev = atoi(arg); OLC_CONFIG(d)->autowiz.min_wizlist_lev = atoi(arg);
cedit_disp_autowiz_options(d); cedit_disp_autowiz_options(d);
@ -1887,44 +1636,9 @@ void cedit_parse(struct descriptor_data *d, char *arg)
} }
break; break;
case CEDIT_STAMP_COST:
OLC_CONFIG(d)->mail.stamp_cost = MIN(MAX(atoi(arg), 0), 1000);
cedit_disp_mudmail_options(d);
break;
case CEDIT_OBJECT_COST:
OLC_CONFIG(d)->mail.object_cost = MIN(MAX(atoi(arg), 0), 1000);
cedit_disp_mudmail_options(d);
break;
case CEDIT_DRAFT_TIMEOUT:
OLC_CONFIG(d)->mail.draft_timeout = MIN(MAX(atoi(arg), 0), 3653); /* up to 10 years */
cedit_disp_mudmail_options(d);
break;
case CEDIT_MIN_MAIL_LEVEL:
OLC_CONFIG(d)->mail.min_level = MIN(MAX(atoi(arg), 0), ADMLVL_IMPL);
cedit_disp_mudmail_options(d);
break;
case CEDIT_MIN_FREE_LEVEL:
OLC_CONFIG(d)->mail.min_free_level = MIN(MAX(atoi(arg), 0), ADMLVL_IMPL);
cedit_disp_mudmail_options(d);
break;
case CEDIT_MAIL_ANYWHERE:
OLC_CONFIG(d)->mail.min_mail_anywhere = MIN(MAX(atoi(arg), 0), ADMLVL_IMPL);
cedit_disp_mudmail_options(d);
break;
case CEDIT_MAIL_ALL_PLAYERS:
OLC_CONFIG(d)->mail.min_send_to_all = MIN(MAX(atoi(arg), 0), ADMLVL_IMPL);
cedit_disp_mudmail_options(d);
break;
default: /* We should never get here, but just in case... */ default: /* We should never get here, but just in case... */
cleanup_olc(d, CLEANUP_CONFIG); cleanup_olc(d, CLEANUP_CONFIG);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: cedit_parse(): Reached default case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: cedit_parse(): Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }

View file

@ -179,16 +179,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 32; case 28: return 32;
case 29: return 30; case 29: return 30;
case 30: return 28; case 30: return 28;
case 31: return 25; case 31: return 0;
case 32: return 23; case 32: return 0;
case 33: return 21; case 33: return 0;
case 34: return 18; case 34: return 0;
case 35: return 15; case 35: return 0;
case 36: return 12; case 36: return 0;
case 37: return 10; case 37: return 0;
case 38: return 7; case 38: return 0;
case 39: return 5; case 39: return 0;
case 40: return 3; case 40: return 0;
default: default:
log("SYSERR: Missing level for mage paralyzation saving throw."); log("SYSERR: Missing level for mage paralyzation saving throw.");
break; break;
@ -226,16 +226,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 11; case 28: return 11;
case 29: return 10; case 29: return 10;
case 30: return 9; case 30: return 9;
case 31: return 8; case 31: return 0;
case 32: return 8; case 32: return 0;
case 33: return 7; case 33: return 0;
case 34: return 6; case 34: return 0;
case 35: return 5; case 35: return 0;
case 36: return 5; case 36: return 0;
case 37: return 4; case 37: return 0;
case 38: return 3; case 38: return 0;
case 39: return 2; case 39: return 0;
case 40: return 1; case 40: return 0;
default: default:
log("SYSERR: Missing level for mage rod saving throw."); log("SYSERR: Missing level for mage rod saving throw.");
break; break;
@ -273,16 +273,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 17; case 28: return 17;
case 29: return 15; case 29: return 15;
case 30: return 13; case 30: return 13;
case 31: return 12; case 31: return 0;
case 32: return 11; case 32: return 0;
case 33: return 10; case 33: return 0;
case 34: return 9; case 34: return 0;
case 35: return 7; case 35: return 0;
case 36: return 6; case 36: return 0;
case 37: return 5; case 37: return 0;
case 38: return 4; case 38: return 0;
case 39: return 3; case 39: return 0;
case 40: return 3; case 40: return 0;
default: default:
log("SYSERR: Missing level for mage petrification saving throw."); log("SYSERR: Missing level for mage petrification saving throw.");
break; break;
@ -320,16 +320,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 27; case 28: return 27;
case 29: return 25; case 29: return 25;
case 30: return 23; case 30: return 23;
case 31: return 22; case 31: return 0;
case 32: return 20; case 32: return 0;
case 33: return 19; case 33: return 0;
case 34: return 18; case 34: return 0;
case 35: return 17; case 35: return 0;
case 36: return 16; case 36: return 0;
case 37: return 15; case 37: return 0;
case 38: return 14; case 38: return 0;
case 39: return 13; case 39: return 0;
case 40: return 12; case 40: return 0;
default: default:
log("SYSERR: Missing level for mage breath saving throw."); log("SYSERR: Missing level for mage breath saving throw.");
break; break;
@ -367,16 +367,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 12; case 28: return 12;
case 29: return 10; case 29: return 10;
case 30: return 8; case 30: return 8;
case 31: return 7; case 31: return 0;
case 32: return 6; case 32: return 0;
case 33: return 6; case 33: return 0;
case 34: return 5; case 34: return 0;
case 35: return 4; case 35: return 0;
case 36: return 4; case 36: return 0;
case 37: return 3; case 37: return 0;
case 38: return 2; case 38: return 0;
case 39: return 1; case 39: return 0;
case 40: return 1; case 40: return 0;
default: default:
log("SYSERR: Missing level for mage spell saving throw."); log("SYSERR: Missing level for mage spell saving throw.");
break; break;
@ -421,15 +421,15 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 9; case 28: return 9;
case 29: return 8; case 29: return 8;
case 30: return 7; case 30: return 7;
case 31: return 6; case 31: return 0;
case 32: return 6; case 32: return 0;
case 33: return 5; case 33: return 0;
case 34: return 4; case 34: return 0;
case 35: return 3; case 35: return 0;
case 36: return 3; case 36: return 0;
case 37: return 2; case 37: return 0;
case 38: return 2; case 38: return 0;
case 39: return 1; case 39: return 0;
case 40: return 0; case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric paralyzation saving throw."); log("SYSERR: Missing level for cleric paralyzation saving throw.");
@ -468,16 +468,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 29; case 28: return 29;
case 29: return 28; case 29: return 28;
case 30: return 27; case 30: return 27;
case 31: return 26; case 31: return 0;
case 32: return 25; case 32: return 0;
case 33: return 24; case 33: return 0;
case 34: return 23; case 34: return 0;
case 35: return 22; case 35: return 0;
case 36: return 21; case 36: return 0;
case 37: return 20; case 37: return 0;
case 38: return 19; case 38: return 0;
case 39: return 18; case 39: return 0;
case 40: return 17; case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric rod saving throw."); log("SYSERR: Missing level for cleric rod saving throw.");
break; break;
@ -515,16 +515,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 24; case 28: return 24;
case 29: return 23; case 29: return 23;
case 30: return 22; case 30: return 22;
case 31: return 21; case 31: return 0;
case 32: return 20; case 32: return 0;
case 33: return 19; case 33: return 0;
case 34: return 18; case 34: return 0;
case 35: return 17; case 35: return 0;
case 36: return 16; case 36: return 0;
case 37: return 15; case 37: return 0;
case 38: return 14; case 38: return 0;
case 39: return 13; case 39: return 0;
case 40: return 13; case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric petrification saving throw."); log("SYSERR: Missing level for cleric petrification saving throw.");
break; break;
@ -562,16 +562,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 39; case 28: return 39;
case 29: return 38; case 29: return 38;
case 30: return 37; case 30: return 37;
case 31: return 35; case 31: return 0;
case 32: return 34; case 32: return 0;
case 33: return 33; case 33: return 0;
case 34: return 32; case 34: return 0;
case 35: return 31; case 35: return 0;
case 36: return 31; case 36: return 0;
case 37: return 30; case 37: return 0;
case 38: return 29; case 38: return 0;
case 39: return 29; case 39: return 0;
case 40: return 28; case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric breath saving throw."); log("SYSERR: Missing level for cleric breath saving throw.");
break; break;
@ -609,16 +609,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 34; case 28: return 34;
case 29: return 33; case 29: return 33;
case 30: return 32; case 30: return 32;
case 31: return 31; case 31: return 0;
case 32: return 30; case 32: return 0;
case 33: return 29; case 33: return 0;
case 34: return 28; case 34: return 0;
case 35: return 27; case 35: return 0;
case 36: return 26; case 36: return 0;
case 37: return 26; case 37: return 0;
case 38: return 25; case 38: return 0;
case 39: return 24; case 39: return 0;
case 40: return 23; case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric spell saving throw."); log("SYSERR: Missing level for cleric spell saving throw.");
break; break;
@ -663,16 +663,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 38; case 28: return 38;
case 29: return 37; case 29: return 37;
case 30: return 36; case 30: return 36;
case 31: return 35; case 31: return 0;
case 32: return 34; case 32: return 0;
case 33: return 33; case 33: return 0;
case 34: return 32; case 34: return 0;
case 35: return 31; case 35: return 0;
case 36: return 31; case 36: return 0;
case 37: return 30; case 37: return 0;
case 38: return 29; case 38: return 0;
case 39: return 29; case 39: return 0;
case 40: return 28; case 40: return 0;
default: default:
log("SYSERR: Missing level for thief paralyzation saving throw."); log("SYSERR: Missing level for thief paralyzation saving throw.");
break; break;
@ -710,16 +710,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 16; case 28: return 16;
case 29: return 14; case 29: return 14;
case 30: return 13; case 30: return 13;
case 31: return 12; case 31: return 0;
case 32: return 11; case 32: return 0;
case 33: return 10; case 33: return 0;
case 34: return 9; case 34: return 0;
case 35: return 8; case 35: return 0;
case 36: return 7; case 36: return 0;
case 37: return 6; case 37: return 0;
case 38: return 5; case 38: return 0;
case 39: return 4; case 39: return 0;
case 40: return 4; case 40: return 0;
default: default:
log("SYSERR: Missing level for thief rod saving throw."); log("SYSERR: Missing level for thief rod saving throw.");
break; break;
@ -757,16 +757,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 33; case 28: return 33;
case 29: return 32; case 29: return 32;
case 30: return 31; case 30: return 31;
case 31: return 30; case 31: return 0;
case 32: return 29; case 32: return 0;
case 33: return 28; case 33: return 0;
case 34: return 27; case 34: return 0;
case 35: return 26; case 35: return 0;
case 36: return 25; case 36: return 0;
case 37: return 24; case 37: return 0;
case 38: return 23; case 38: return 0;
case 39: return 23; case 39: return 0;
case 40: return 22; case 40: return 0;
default: default:
log("SYSERR: Missing level for thief petrification saving throw."); log("SYSERR: Missing level for thief petrification saving throw.");
break; break;
@ -804,16 +804,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 53; case 28: return 53;
case 29: return 52; case 29: return 52;
case 30: return 51; case 30: return 51;
case 31: return 50; case 31: return 0;
case 32: return 49; case 32: return 0;
case 33: return 48; case 33: return 0;
case 34: return 48; case 34: return 0;
case 35: return 47; case 35: return 0;
case 36: return 46; case 36: return 0;
case 37: return 45; case 37: return 0;
case 38: return 44; case 38: return 0;
case 39: return 43; case 39: return 0;
case 40: return 42; case 40: return 0;
default: default:
log("SYSERR: Missing level for thief breath saving throw."); log("SYSERR: Missing level for thief breath saving throw.");
break; break;
@ -851,16 +851,16 @@ byte saving_throws(int class_num, int type, int level)
case 28: return 21; case 28: return 21;
case 29: return 19; case 29: return 19;
case 30: return 17; case 30: return 17;
case 31: return 16; case 31: return 0;
case 32: return 15; case 32: return 0;
case 33: return 14; case 33: return 0;
case 34: return 13; case 34: return 0;
case 35: return 12; case 35: return 0;
case 36: return 11; case 36: return 0;
case 37: return 10; case 37: return 0;
case 38: return 9; case 38: return 0;
case 39: return 8; case 39: return 0;
case 40: return 7; case 40: return 0;
default: default:
log("SYSERR: Missing level for thief spell saving throw."); log("SYSERR: Missing level for thief spell saving throw.");
break; break;
@ -915,8 +915,8 @@ byte saving_throws(int class_num, int type, int level)
case 38: return 4; case 38: return 4;
case 39: return 3; case 39: return 3;
case 40: return 2; case 40: return 2;
case 41: return 1; case 41: return 1; /* Some mobiles. */
case 42: return 1; case 42: return 0;
case 43: return 0; case 43: return 0;
case 44: return 0; case 44: return 0;
case 45: return 0; case 45: return 0;
@ -1211,12 +1211,6 @@ int thaco(int class_num, int level)
case 32: return 10; case 32: return 10;
case 33: return 10; case 33: return 10;
case 34: return 9; case 34: return 9;
case 35: return 9;
case 36: return 9;
case 37: return 8;
case 38: return 8;
case 39: return 8;
case 40: return 8;
default: default:
log("SYSERR: Missing level for mage thac0."); log("SYSERR: Missing level for mage thac0.");
} }
@ -1257,12 +1251,6 @@ int thaco(int class_num, int level)
case 32: return 1; case 32: return 1;
case 33: return 1; case 33: return 1;
case 34: return 1; case 34: return 1;
case 35: return 1;
case 36: return 0;
case 37: return 0;
case 38: return 0;
case 39: return 0;
case 40: return 0;
default: default:
log("SYSERR: Missing level for cleric thac0."); log("SYSERR: Missing level for cleric thac0.");
} }
@ -1303,12 +1291,6 @@ int thaco(int class_num, int level)
case 32: return 5; case 32: return 5;
case 33: return 4; case 33: return 4;
case 34: return 4; case 34: return 4;
case 35: return 4;
case 36: return 3;
case 37: return 3;
case 38: return 3;
case 39: return 2;
case 40: return 2;
default: default:
log("SYSERR: Missing level for thief thac0."); log("SYSERR: Missing level for thief thac0.");
} }
@ -1349,12 +1331,6 @@ int thaco(int class_num, int level)
case 32: return 1; case 32: return 1;
case 33: return 1; case 33: return 1;
case 34: return 1; case 34: return 1;
case 35: return 1;
case 36: return 0;
case 37: return 0;
case 38: return 0;
case 39: return 0;
case 40: return 0;
default: default:
log("SYSERR: Missing level for warrior thac0."); log("SYSERR: Missing level for warrior thac0.");
} }
@ -1440,7 +1416,6 @@ void roll_real_abils(struct char_data *ch)
void do_start(struct char_data *ch) void do_start(struct char_data *ch)
{ {
GET_LEVEL(ch) = 1; GET_LEVEL(ch) = 1;
GET_ADMLEVEL(ch) = ADMLVL_MORTAL;
GET_EXP(ch) = 1; GET_EXP(ch) = 1;
set_title(ch, NULL); set_title(ch, NULL);
@ -1535,9 +1510,7 @@ void advance_level(struct char_data *ch)
else else
GET_PRACTICES(ch) += MIN(2, MAX(1, wis_app[GET_WIS(ch)].bonus)); GET_PRACTICES(ch) += MIN(2, MAX(1, wis_app[GET_WIS(ch)].bonus));
/* Auto-advance to immortality? */ if (GET_LEVEL(ch) >= LVL_IMMORT) {
if (!CONFIG_NO_MORT_TO_IMMORT && GET_LEVEL(ch) >= CONFIG_MAX_LEVEL && !IS_ADMIN(ch, ADMLVL_IMMORT)) {
set_admin_level(ch, ADMLVL_IMMORT); /* Increase admin level and set default admin flags */
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
GET_COND(ch, i) = (char) -1; GET_COND(ch, i) = (char) -1;
SET_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT); SET_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT);
@ -1561,8 +1534,10 @@ int backstab_mult(int level)
return 4; /* level 14 - 20 */ return 4; /* level 14 - 20 */
else if (level <= 28) else if (level <= 28)
return 5; /* level 21 - 28 */ return 5; /* level 21 - 28 */
else else if (level < LVL_IMMORT)
return 6; /* all remaining mortal levels */ return 6; /* all remaining mortal levels */
else
return 20; /* immortals */
} }
/* invalid_class is used by handler.c to determine if a piece of equipment is /* invalid_class is used by handler.c to determine if a piece of equipment is
@ -1670,11 +1645,17 @@ void init_spell_levels(void)
/* Function to return the exp required for each class/level */ /* Function to return the exp required for each class/level */
int level_exp(int chclass, int level) int level_exp(int chclass, int level)
{ {
if (level > CONFIG_MAX_LEVEL || level < 0) { if (level > LVL_IMPL || level < 0) {
log("SYSERR: Requesting exp for invalid mortal level %d!", level); log("SYSERR: Requesting exp for invalid level %d!", level);
return 0; return 0;
} }
/* Gods have exp close to EXP_MAX. This statement should never have to
* changed, regardless of how many mortal or immortal levels exist. */
if (level > LVL_IMMORT) {
return EXP_MAX - ((LVL_IMPL - level) * 1000);
}
/* Exp required for normal mortals is below */ /* Exp required for normal mortals is below */
switch (chclass) { switch (chclass) {
@ -1712,9 +1693,7 @@ int level_exp(int chclass, int level)
case 29: return 6850000; case 29: return 6850000;
case 30: return 7400000; case 30: return 7400000;
/* add new levels here */ /* add new levels here */
default: case LVL_IMMORT: return 8000000;
log("SYSERR: Magic User XP tables not set up correctly in level_exp in class.c!");
return 123456;
} }
break; break;
@ -1752,9 +1731,7 @@ int level_exp(int chclass, int level)
case 29: return 6000000; case 29: return 6000000;
case 30: return 6400000; case 30: return 6400000;
/* add new levels here */ /* add new levels here */
default: case LVL_IMMORT: return 7000000;
log("SYSERR: Cleric XP tables not set up correctly in level_exp in class.c!");
return 123456;
} }
break; break;
@ -1792,9 +1769,7 @@ int level_exp(int chclass, int level)
case 29: return 6300000; case 29: return 6300000;
case 30: return 6650000; case 30: return 6650000;
/* add new levels here */ /* add new levels here */
default: case LVL_IMMORT: return 7000000;
log("SYSERR: Thief XP tables not set up correctly in level_exp in class.c!");
return 123456;
} }
break; break;
@ -1832,9 +1807,7 @@ int level_exp(int chclass, int level)
case 29: return 6850000; case 29: return 6850000;
case 30: return 7400000; case 30: return 7400000;
/* add new levels here */ /* add new levels here */
default: case LVL_IMMORT: return 8000000;
log("SYSERR: Warrior XP tables not set up correctly in level_exp in class.c!");
return 123456;
} }
break; break;
} }
@ -1849,8 +1822,10 @@ int level_exp(int chclass, int level)
/* Default titles of male characters. */ /* Default titles of male characters. */
const char *title_male(int chclass, int level) const char *title_male(int chclass, int level)
{ {
if (level <= 0 || level > CONFIG_MAX_LEVEL) if (level <= 0 || level > LVL_IMPL)
return "the Man"; return "the Man";
if (level == LVL_IMPL)
return "the Implementor";
switch (chclass) { switch (chclass) {
@ -1886,6 +1861,9 @@ const char *title_male(int chclass, int level)
case 28: return "the Shaman"; case 28: return "the Shaman";
case 29: return "the Keeper of Talismans"; case 29: return "the Keeper of Talismans";
case 30: return "the Archmage"; case 30: return "the Archmage";
case LVL_IMMORT: return "the Immortal Warlock";
case LVL_GOD: return "the Avatar of Magic";
case LVL_GRGOD: return "the God of Magic";
default: return "the Mage"; default: return "the Mage";
} }
break; break;
@ -1913,6 +1891,9 @@ const char *title_male(int chclass, int level)
case 19: return "the Arch Bishop"; case 19: return "the Arch Bishop";
case 20: return "the Patriarch"; case 20: return "the Patriarch";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Cardinal";
case LVL_GOD: return "the Inquisitor";
case LVL_GRGOD: return "the God of Good and Evil";
default: return "the Cleric"; default: return "the Cleric";
} }
break; break;
@ -1940,6 +1921,9 @@ const char *title_male(int chclass, int level)
case 19: return "the Brigand"; case 19: return "the Brigand";
case 20: return "the Cut-Throat"; case 20: return "the Cut-Throat";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Assassin";
case LVL_GOD: return "the Demi God of Thieves";
case LVL_GRGOD: return "the God of Thieves and Tradesmen";
default: return "the Thief"; default: return "the Thief";
} }
break; break;
@ -1967,6 +1951,9 @@ const char *title_male(int chclass, int level)
case 19: return "the Cavalier"; case 19: return "the Cavalier";
case 20: return "the Knight"; case 20: return "the Knight";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Warlord";
case LVL_GOD: return "the Extirpator";
case LVL_GRGOD: return "the God of War";
default: return "the Warrior"; default: return "the Warrior";
} }
break; break;
@ -1979,8 +1966,10 @@ const char *title_male(int chclass, int level)
/* Default titles of female characters. */ /* Default titles of female characters. */
const char *title_female(int chclass, int level) const char *title_female(int chclass, int level)
{ {
if (level <= 0 || level > CONFIG_MAX_LEVEL) if (level <= 0 || level > LVL_IMPL)
return "the Woman"; return "the Woman";
if (level == LVL_IMPL)
return "the Implementress";
switch (chclass) { switch (chclass) {
@ -2016,6 +2005,9 @@ const char *title_female(int chclass, int level)
case 28: return "Shaman"; case 28: return "Shaman";
case 29: return "the Keeper of Talismans"; case 29: return "the Keeper of Talismans";
case 30: return "Archwitch"; case 30: return "Archwitch";
case LVL_IMMORT: return "the Immortal Enchantress";
case LVL_GOD: return "the Empress of Magic";
case LVL_GRGOD: return "the Goddess of Magic";
default: return "the Witch"; default: return "the Witch";
} }
break; break;
@ -2043,6 +2035,9 @@ const char *title_female(int chclass, int level)
case 19: return "the Arch Lady of the Church"; case 19: return "the Arch Lady of the Church";
case 20: return "the Matriarch"; case 20: return "the Matriarch";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Priestess";
case LVL_GOD: return "the Inquisitress";
case LVL_GRGOD: return "the Goddess of Good and Evil";
default: return "the Cleric"; default: return "the Cleric";
} }
break; break;
@ -2070,6 +2065,9 @@ const char *title_female(int chclass, int level)
case 19: return "the Brigand"; case 19: return "the Brigand";
case 20: return "the Cut-Throat"; case 20: return "the Cut-Throat";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Assassin";
case LVL_GOD: return "the Demi Goddess of Thieves";
case LVL_GRGOD: return "the Goddess of Thieves and Tradesmen";
default: return "the Thief"; default: return "the Thief";
} }
break; break;
@ -2097,6 +2095,9 @@ const char *title_female(int chclass, int level)
case 19: return "the Cavalier"; case 19: return "the Cavalier";
case 20: return "the Lady Knight"; case 20: return "the Lady Knight";
/* no one ever thought up these titles 21-30 */ /* no one ever thought up these titles 21-30 */
case LVL_IMMORT: return "the Immortal Lady of War";
case LVL_GOD: return "the Queen of Destruction";
case LVL_GRGOD: return "the Goddess of War";
default: return "the Warrior"; default: return "the Warrior";
} }
break; break;

View file

@ -163,7 +163,6 @@ static sigfunc *my_signal(int signo, sigfunc *func);
static RETSIGTYPE websterlink(int sig); static RETSIGTYPE websterlink(int sig);
static size_t proc_colors(char *txt, size_t maxlen, int parse); static size_t proc_colors(char *txt, size_t maxlen, int parse);
static void handle_webster_file(); static void handle_webster_file();
static void msdp_update(void);
/* externally defined functions, used locally */ /* externally defined functions, used locally */
#ifdef __CXREF__ #ifdef __CXREF__
@ -467,7 +466,7 @@ void copyover_recover()
/* Add to the list of 'recent' players (since last reboot) with copyover flag */ /* Add to the list of 'recent' players (since last reboot) with copyover flag */
if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, TRUE) == FALSE) if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, TRUE) == FALSE)
{ {
mudlog(BRF, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE)."); mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
} }
} }
} }
@ -917,13 +916,13 @@ void game_loop(socket_t local_mother_desc)
/* Check for any signals we may have received. */ /* Check for any signals we may have received. */
if (reread_wizlist) { if (reread_wizlist) {
reread_wizlist = FALSE; reread_wizlist = FALSE;
mudlog(CMP, ADMLVL_IMMORT, TRUE, "Signal received - rereading wizlists."); mudlog(CMP, LVL_IMMORT, TRUE, "Signal received - rereading wizlists.");
reboot_wizlists(); reboot_wizlists();
} }
/* Orphaned right now as signal trapping is used for Webster lookup /* Orphaned right now as signal trapping is used for Webster lookup
if (emergency_unban) { if (emergency_unban) {
emergency_unban = FALSE; emergency_unban = FALSE;
mudlog(BRF, ADMLVL_IMMORT, TRUE, "Received SIGUSR2 - completely unrestricting game (emergent)"); mudlog(BRF, LVL_IMMORT, TRUE, "Received SIGUSR2 - completely unrestricting game (emergent)");
ban_list = NULL; ban_list = NULL;
circle_restrict = 0; circle_restrict = 0;
num_invalid = 0; num_invalid = 0;
@ -966,9 +965,6 @@ void heartbeat(int heart_pulse)
if (!(heart_pulse % PULSE_VIOLENCE)) if (!(heart_pulse % PULSE_VIOLENCE))
perform_violence(); perform_violence();
if (!(heart_pulse % PASSES_PER_SEC))
msdp_update();
if (!(heart_pulse % (SECS_PER_MUD_HOUR * PASSES_PER_SEC))) { /* Tick ! */ if (!(heart_pulse % (SECS_PER_MUD_HOUR * PASSES_PER_SEC))) { /* Tick ! */
next_tick = SECS_PER_MUD_HOUR; /* Reset tick coundown */ next_tick = SECS_PER_MUD_HOUR; /* Reset tick coundown */
weather_and_time(1); weather_and_time(1);
@ -1339,12 +1335,6 @@ size_t vwrite_to_output(struct descriptor_data *t, const char *format, va_list a
return (0); return (0);
wantsize = size = vsnprintf(txt, sizeof(txt), format, args); wantsize = size = vsnprintf(txt, sizeof(txt), format, args);
strcpy(txt, ProtocolOutput( t, txt, (int*)&wantsize ));
size = wantsize;
if ( t->pProtocol->WriteOOB > 0 )
--t->pProtocol->WriteOOB;
if (t->character) if (t->character)
wantsize = size = proc_colors(txt, sizeof(txt), COLOR_ON(t->character)); wantsize = size = proc_colors(txt, sizeof(txt), COLOR_ON(t->character));
/* If exceeding the size of the buffer, truncate it for the overflow message */ /* If exceeding the size of the buffer, truncate it for the overflow message */
@ -1509,7 +1499,6 @@ static void init_descriptor (struct descriptor_data *newd, int desc)
if (++last_desc == 1000) if (++last_desc == 1000)
last_desc = 1; last_desc = 1;
newd->desc_num = last_desc; newd->desc_num = last_desc;
newd->pProtocol = ProtocolCreate();
} }
static int new_descriptor(socket_t s) static int new_descriptor(socket_t s)
@ -1569,7 +1558,7 @@ static int new_descriptor(socket_t s)
/* determine if the site is banned */ /* determine if the site is banned */
if (isbanned(newd->host) == BAN_ALL) { if (isbanned(newd->host) == BAN_ALL) {
CLOSE_SOCKET(desc); CLOSE_SOCKET(desc);
mudlog(CMP, ADMLVL_GOD, TRUE, "Connection attempt denied from [%s]", newd->host); mudlog(CMP, LVL_GOD, TRUE, "Connection attempt denied from [%s]", newd->host);
free(newd); free(newd);
return (0); return (0);
} }
@ -1581,8 +1570,6 @@ static int new_descriptor(socket_t s)
newd->next = descriptor_list; newd->next = descriptor_list;
descriptor_list = newd; descriptor_list = newd;
ProtocolNegotiate(newd); /* <--- Add this line */
/* This is where the greetings are actually sent to the new player */ /* This is where the greetings are actually sent to the new player */
/* Adjusted by Jamdog to show color codes on the greetings page */ /* Adjusted by Jamdog to show color codes on the greetings page */
*greet_copy = '\0'; *greet_copy = '\0';
@ -1616,16 +1603,14 @@ static int process_output(struct descriptor_data *t)
/* add the extra CRLF if the person isn't in compact mode */ /* add the extra CRLF if the person isn't in compact mode */
if (STATE(t) == CON_PLAYING && t->character && !IS_NPC(t->character) && !PRF_FLAGGED(t->character, PRF_COMPACT)) if (STATE(t) == CON_PLAYING && t->character && !IS_NPC(t->character) && !PRF_FLAGGED(t->character, PRF_COMPACT))
if ( !t->pProtocol->WriteOOB )
strcat(osb, "\r\n"); /* strcpy: OK (osb:MAX_SOCK_BUF-2 reserves space) */ strcat(osb, "\r\n"); /* strcpy: OK (osb:MAX_SOCK_BUF-2 reserves space) */
/* add a prompt */ /* add a prompt */
if ( !t->pProtocol->WriteOOB )
strcat(i, make_prompt(t)); /* strcpy: OK (i:MAX_SOCK_BUF reserves space) */ strcat(i, make_prompt(t)); /* strcpy: OK (i:MAX_SOCK_BUF reserves space) */
/* now, send the output. If this is an 'interruption', use the prepended /* now, send the output. If this is an 'interruption', use the prepended
* CRLF, otherwise send the straight output sans CRLF. */ * CRLF, otherwise send the straight output sans CRLF. */
if (t->has_prompt && !t->pProtocol->WriteOOB) { if (t->has_prompt) {
t->has_prompt = FALSE; t->has_prompt = FALSE;
result = write_to_descriptor(t->descriptor, i); result = write_to_descriptor(t->descriptor, i);
if (result >= 2) if (result >= 2)
@ -1875,9 +1860,6 @@ static int process_input(struct descriptor_data *t)
size_t space_left; size_t space_left;
char *ptr, *read_point, *write_point, *nl_pos = NULL; char *ptr, *read_point, *write_point, *nl_pos = NULL;
char tmp[MAX_INPUT_LENGTH]; char tmp[MAX_INPUT_LENGTH];
static char read_buf[PROTOCOL_BUFFER];
read_buf[0] = '\0';
/* first, find the point where we left off reading data */ /* first, find the point where we left off reading data */
buf_length = strlen(t->inbuf); buf_length = strlen(t->inbuf);
@ -1890,14 +1872,7 @@ static int process_input(struct descriptor_data *t)
return (-1); return (-1);
} }
bytes_read = perform_socket_read(t->descriptor, read_buf, 2048); bytes_read = perform_socket_read(t->descriptor, read_point, space_left);
if ( bytes_read >= 0 )
{
read_buf[bytes_read] = '\0';
ProtocolInput( t, read_buf, bytes_read, t->inbuf );
bytes_read = strlen(t->inbuf);
}
if (bytes_read < 0) /* Error, disconnect them. */ if (bytes_read < 0) /* Error, disconnect them. */
return (-1); return (-1);
@ -2122,13 +2097,13 @@ void close_socket(struct descriptor_data *d)
/* We are guaranteed to have a person. */ /* We are guaranteed to have a person. */
act("$n has lost $s link.", TRUE, link_challenged, 0, 0, TO_ROOM); act("$n has lost $s link.", TRUE, link_challenged, 0, 0, TO_ROOM);
save_char(link_challenged); save_char(link_challenged);
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(link_challenged)), TRUE, "Closing link to: %s.", GET_NAME(link_challenged)); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(link_challenged)), TRUE, "Closing link to: %s.", GET_NAME(link_challenged));
} else { } else {
mudlog(CMP, ADMLVL_IMMORT, TRUE, "Losing player: %s.", GET_NAME(d->character) ? GET_NAME(d->character) : "<null>"); mudlog(CMP, LVL_IMMORT, TRUE, "Losing player: %s.", GET_NAME(d->character) ? GET_NAME(d->character) : "<null>");
free_char(d->character); free_char(d->character);
} }
} else } else
mudlog(CMP, ADMLVL_IMMORT, TRUE, "Losing descriptor without char."); mudlog(CMP, LVL_IMMORT, TRUE, "Losing descriptor without char.");
/* JE 2/22/95 -- part of my unending quest to make switch stable */ /* JE 2/22/95 -- part of my unending quest to make switch stable */
if (d->original && d->original->desc) if (d->original && d->original->desc)
@ -2148,8 +2123,6 @@ void close_socket(struct descriptor_data *d)
if (d->showstr_count) if (d->showstr_count)
free(d->showstr_vector); free(d->showstr_vector);
ProtocolDestroy( d->pProtocol );
/*. Kill any OLC stuff .*/ /*. Kill any OLC stuff .*/
switch (d->connected) { switch (d->connected) {
case CON_OEDIT: case CON_OEDIT:
@ -2821,61 +2794,3 @@ static void handle_webster_file(void) {
send_to_char(ch, "You get this feedback from Merriam-Webster:\r\n"); send_to_char(ch, "You get this feedback from Merriam-Webster:\r\n");
page_string(ch->desc, retval, 1); page_string(ch->desc, retval, 1);
} }
static void msdp_update( void )
{
struct descriptor_data *d;
int PlayerCount = 0;
for (d = descriptor_list; d; d = d->next)
{
struct char_data *ch = d->character;
if ( ch && !IS_NPC(ch) && d->connected == CON_PLAYING )
{
struct char_data *pOpponent = FIGHTING(ch);
++PlayerCount;
MSDPSetString( d, eMSDP_CHARACTER_NAME, GET_NAME(ch) );
MSDPSetNumber( d, eMSDP_ALIGNMENT, GET_ALIGNMENT(ch) );
MSDPSetNumber( d, eMSDP_EXPERIENCE, GET_EXP(ch) );
MSDPSetNumber( d, eMSDP_HEALTH, GET_HIT(ch) );
MSDPSetNumber( d, eMSDP_HEALTH_MAX, GET_MAX_HIT(ch) );
MSDPSetNumber( d, eMSDP_LEVEL, GET_LEVEL(ch) );
MSDPSetNumber( d, eMSDP_CLASS, GET_CLASS(ch) );
MSDPSetNumber( d, eMSDP_MANA, GET_MANA(ch) );
MSDPSetNumber( d, eMSDP_MANA_MAX, GET_MAX_MANA(ch) );
MSDPSetNumber( d, eMSDP_WIMPY, GET_WIMP_LEV(ch) );
MSDPSetNumber( d, eMSDP_MONEY, GET_GOLD(ch) );
MSDPSetNumber( d, eMSDP_MOVEMENT, GET_MOVE(ch) );
MSDPSetNumber( d, eMSDP_MOVEMENT_MAX, GET_MAX_MOVE(ch) );
MSDPSetNumber( d, eMSDP_AC, compute_armor_class(ch) );
/* This would be better moved elsewhere */
if ( pOpponent != NULL )
{
int hit_points = (GET_HIT(pOpponent) * 100) / GET_MAX_HIT(pOpponent);
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH, hit_points );
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH_MAX, 100 );
MSDPSetNumber( d, eMSDP_OPPONENT_LEVEL, GET_LEVEL(pOpponent) );
MSDPSetString( d, eMSDP_OPPONENT_NAME, PERS(pOpponent, ch) );
}
else /* Clear the values */
{
MSDPSetNumber( d, eMSDP_OPPONENT_HEALTH, 0 );
MSDPSetNumber( d, eMSDP_OPPONENT_LEVEL, 0 );
MSDPSetString( d, eMSDP_OPPONENT_NAME, "" );
}
MSDPUpdate( d );
}
/* Ideally this should be called once at startup, and again whenever
* someone leaves or joins the mud. But this works, and it keeps the
* snippet simple. Optimise as you see fit.
*/
MSSPSetPlayers( PlayerCount );
}
}

View file

@ -69,15 +69,12 @@ int max_exp_loss = 500000; /* max losable per death */
int max_npc_corpse_time = 5; int max_npc_corpse_time = 5;
int max_pc_corpse_time = 10; int max_pc_corpse_time = 10;
/* The maximum mortal level that can be obtained */
int max_mortal_level = 30;
/* How many ticks before a player is sent to the void or idle-rented. */ /* How many ticks before a player is sent to the void or idle-rented. */
int idle_void = 8; int idle_void = 8;
int idle_rent_time = 48; int idle_rent_time = 48;
/* This admin level and up is immune to idling, LVL_IMPL+1 will disable it. */ /* This level and up is immune to idling, LVL_IMPL+1 will disable it. */
int idle_max_level = ADMLVL_GOD; int idle_max_level = LVL_GOD;
/* Should items in death traps automatically be junked? */ /* Should items in death traps automatically be junked? */
int dts_are_dumps = YES; int dts_are_dumps = YES;
@ -105,8 +102,8 @@ int track_through_doors = YES;
int no_mort_to_immort = YES; int no_mort_to_immort = YES;
/* Are diagonal directions enabled? /* Are diagonal directions enabled?
* If set to NO, then only the 6 directions n,e,s,w,u,d are allowed */ * If set to NO, then only the 6 directions n,e,s,w,u,d are allowed */
int diagonal_dirs_enabled = NO; int diagonal_dirs = NO;
/* RENT/CRASHSAVE OPTIONS */ /* 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
@ -154,8 +151,9 @@ int auto_pwipe = NO;
* Element 3, level 4, days 7: Players level 2 through 4 are wiped if they * Element 3, level 4, days 7: Players level 2 through 4 are wiped if they
haven't logged on in the past 7 days. haven't logged on in the past 7 days.
* Element 4, level 10, days 30: Players level 5-10 get 30 days. * Element 4, level 10, days 30: Players level 5-10 get 30 days.
* Element 5, level CONFIG_MAX_LEVEL, days 60: All other mortals get 60 days. * Element 5, level LVL_IMMORT - 1, days 60: All other mortals get 60 days.
* Element 6: Because -2 is less than CONFIG_MAX_LEVEL, this is assumed to be the end * 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
of the criteria. The days entry is not used in this case. */ of the criteria. The days entry is not used in this case. */
struct pclean_criteria_data pclean_criteria[] = { struct pclean_criteria_data pclean_criteria[] = {
/* LEVEL DAYS */ /* LEVEL DAYS */
@ -163,7 +161,8 @@ struct pclean_criteria_data pclean_criteria[] = {
{ 1 ,4 }, { 1 ,4 },
{ 4 ,7 }, { 4 ,7 },
{ 10 ,30 }, { 10 ,30 },
{ 30 ,60 }, /* highest mortal - NOTE: Should be CONFIG_MAX_LEVEL */ { LVL_IMMORT - 1 ,60 }, /* highest mortal */
{ LVL_IMPL ,90 }, /* all immortals */
{ -1 ,0 } /* no more level checks */ { -1 ,0 } /* no more level checks */
}; };
@ -292,7 +291,7 @@ int use_autowiz = YES;
/* If yes, what is the lowest level which should be on the wizlist? (All immort /* If yes, what is the lowest level which should be on the wizlist? (All immort
* levels below the level you specify will go on the immlist instead.) */ * levels below the level you specify will go on the immlist instead.) */
int min_wizlist_lev = ADMLVL_GOD; int min_wizlist_lev = LVL_GOD;
/* To mimic stock behavior set to NO. To allow mortals to see doors in exits /* To mimic stock behavior set to NO. To allow mortals to see doors in exits
* set to YES. */ * set to YES. */
@ -307,6 +306,6 @@ int default_minimap_size = 2;
/* Medit Stats menu - show 'advanced' options? */ /* Medit Stats menu - show 'advanced' options? */
int medit_advanced_stats = YES; int medit_advanced_stats = YES;
/** Does "bug resolve" autosave ? */
int ibt_autosave = YES;
/* Does "bug resolve" autosave ? */
int ibt_autosave = YES;

View file

@ -25,7 +25,6 @@ extern int max_exp_gain;
extern int max_exp_loss; extern int max_exp_loss;
extern int max_npc_corpse_time; extern int max_npc_corpse_time;
extern int max_pc_corpse_time; extern int max_pc_corpse_time;
extern int max_mortal_level;
extern int idle_void; extern int idle_void;
extern int idle_rent_time; extern int idle_rent_time;
extern int idle_max_level; extern int idle_max_level;
@ -36,7 +35,7 @@ extern const char *NOPERSON;
extern const char *NOEFFECT; extern const char *NOEFFECT;
extern int track_through_doors; extern int track_through_doors;
extern int no_mort_to_immort; extern int no_mort_to_immort;
extern int diagonal_dirs_enabled; extern int diagonal_dirs;
extern int free_rent; extern int free_rent;
extern int max_obj_save; extern int max_obj_save;
extern int min_rent_cost; extern int min_rent_cost;

View file

@ -40,7 +40,7 @@ const char *dirs[] =
"west", "west",
"up", "up",
"down", "down",
"northwest", /* Diagonals only used if CONFIG_DIAGONAL_DIRS is set */ "northwest", /* Diagonals only used if CONFIG_DIAGONAL_DIRS is set */
"northeast", "northeast",
"southeast", "southeast",
"southwest", "southwest",
@ -62,82 +62,6 @@ const char *autoexits[] =
"\n" "\n"
}; };
/** Administrative level names
* @pre Must be in the same order as the ADMLVL_ defines.
* Must end array with a single newline. */
const char *admin_level_names[ADMLVL_IMPL + 2] = {
"Mortal", // ADMLVL_NONE
"Immortal", // ADMLVL_IMMORTAL
"God", // ADMLVL_GOD
"Great God", // ADMLVL_GRGOD
"Implementor", // ADMLVL_IMPL
"\n",
};
/** Administrative flag short names
* @pre Must be in the same order as the ADMIN_ defines.
* Must end array with a single newline. */
const char *admin_flag_names[] = {
"TellAll",
"SeeInventory",
"SeeSecret",
"KnowWeather",
"FullWhere",
"Money",
"EatAnything",
"NoPoison",
"WalkAnywhere",
"NoKeys",
"InstantKill",
"NoSteal",
"TransAll",
"SwitchMortal",
"ForceMass",
"AllHouses",
"NoDamage",
"AllShops",
"CEDIT",
"Build",
"AdvBuild",
"Poof",
"Admin",
"SetQP",
"AdvancedIBT",
"\n"
};
/** Administrative flag descriptions
* @pre Must be in the same order as the ADMIN_ defines.
* Must end array with a single newline. */
const char *admin_flags[] = {
"You may use 'page all'",
"You can see other players inventories",
"You may see secret doors",
"You may know weather data",
"You know fully where things are",
"You do not require money",
"You can eat anything",
"You cannot be poisoned",
"You can walk anywhere",
"You do not require keys",
"You have the touch of death",
"You cannot be stolen from",
"You may use 'trans all'",
"You can use 'switch'",
"You may use 'force all'",
"You may enter any house",
"You do not take damage",
"You may use any shop",
"You may use cedit",
"You may use basic OLC tools",
"You may use advanced OLC tools",
"You may use goto and set poofs",
"You may set admin privs",
"You can give and remove qp",
"You can use advanced IBT commands",
"\n"
};
/** Room flag descriptions. /** Room flag descriptions.
* @pre Must be in the same order as the defines. * @pre Must be in the same order as the defines.
* Must end array with a single newline. */ * Must end array with a single newline. */
@ -159,7 +83,6 @@ const char *room_bits[] = {
"OLC", "OLC",
"*", /* The BFS Mark. */ "*", /* The BFS Mark. */
"WORLDMAP", "WORLDMAP",
"MAIL",
"\n" "\n"
}; };
@ -286,7 +209,6 @@ const char *action_bits[] = {
"NO_BASH", "NO_BASH",
"NO_BLIND", "NO_BLIND",
"NO_KILL", "NO_KILL",
"MAILMAN",
"DEAD", /* You should never see this. */ "DEAD", /* You should never see this. */
"\n" "\n"
}; };
@ -571,31 +493,6 @@ const char *container_bits[] = {
"\n", "\n",
}; };
/** Flag descriptions for HOUSE_ flags
* @pre Must be in the same order as the defines.
* Must end array with a single newline. */
const char *house_bits[] = {
"NO_GUEST",
"FREE",
"NO_IMM",
"IMP_ONLY",
"RENTFREE",
"SAVE_!RENT",
"NO_SAVE",
"NO_SPEC",
"\n"
};
/** House mode types for HOUSE_ mode values
* @pre Must be in the same order as the defines.
* Must end array with a single newline. */
const char *house_types[] = {
"PLAYER_OWNED",
"IMM_OWNED",
"PLAYER_SHOP",
"\n"
};
/** Describes the liquid description. /** Describes the liquid description.
* @pre Must be in the same order as the defines. * @pre Must be in the same order as the defines.
* Must end array with a single newline. */ * Must end array with a single newline. */

View file

@ -15,9 +15,6 @@
extern const char *tbamud_version; extern const char *tbamud_version;
extern const char *dirs[]; extern const char *dirs[];
extern const char *autoexits[]; extern const char *autoexits[];
extern const char *admin_level_names[];
extern const char *admin_flag_names[];
extern const char *admin_flags[];
extern const char *room_bits[]; extern const char *room_bits[];
extern const char *zone_bits[]; extern const char *zone_bits[];
extern const char *exit_bits[]; extern const char *exit_bits[];
@ -36,8 +33,6 @@ extern const char *wear_bits[];
extern const char *extra_bits[]; extern const char *extra_bits[];
extern const char *apply_types[]; extern const char *apply_types[];
extern const char *container_bits[]; extern const char *container_bits[];
extern const char *house_bits[];
extern const char *house_types[];
extern const char *drinks[]; extern const char *drinks[];
extern const char *drinknames[]; extern const char *drinknames[];
extern const char *color_liquid[]; extern const char *color_liquid[];

View file

@ -80,7 +80,7 @@ qst_rnum total_quests = 0; /* top of autoquest table */
struct shop_data *shop_index; /* index table for shops */ struct shop_data *shop_index; /* index table for shops */
int top_shop = -1; /* top of shop table */ int top_shop = -1; /* top of shop table */
int can_mail = 1; /* mail enabled? */ int no_mail = 0; /* mail disabled? */
int mini_mud = 0; /* mini-mud mode? */ int mini_mud = 0; /* mini-mud mode? */
int no_rent_check = 0; /* skip rent check on boot? */ int no_rent_check = 0; /* skip rent check on boot? */
time_t boot_time = 0; /* time of mud boot */ time_t boot_time = 0; /* time of mud boot */
@ -704,11 +704,10 @@ void boot_db(void)
sort_spells(); sort_spells();
log("Booting mail system."); log("Booting mail system.");
if (!build_mail_index()) { if (!scan_file()) {
log(" Mail boot failed -- Mail system disabled"); log(" Mail boot failed -- Mail system disabled");
can_mail = 0; no_mail = 1;
} }
log("Reading banned site and invalid-name list."); log("Reading banned site and invalid-name list.");
load_banned(); load_banned();
read_invalid_list(); read_invalid_list();
@ -1244,7 +1243,7 @@ void parse_room(FILE *fl, int virtual_nr)
world[room_nr].people = NULL; world[room_nr].people = NULL;
world[room_nr].light = 0; /* Zero light sources */ world[room_nr].light = 0; /* Zero light sources */
for (i = 0; i < NUM_OF_DIRS; i++) /* NUM_OF_DIRS used here, not DIR_COUNT */ for (i = 0; i < NUM_OF_DIRS; i++) /* NUM_OF_DIRS here, not DIR_COUNT */
world[room_nr].dir_option[i] = NULL; world[room_nr].dir_option[i] = NULL;
world[room_nr].ex_description = NULL; world[room_nr].ex_description = NULL;
@ -2465,7 +2464,7 @@ void zone_update(void)
if (zone_table[update_u->zone_to_reset].reset_mode == 2 || if (zone_table[update_u->zone_to_reset].reset_mode == 2 ||
is_empty(update_u->zone_to_reset)) { is_empty(update_u->zone_to_reset)) {
reset_zone(update_u->zone_to_reset); reset_zone(update_u->zone_to_reset);
mudlog(CMP, ADMLVL_IMPL, FALSE, "Auto zone reset: %s (Zone %d)", mudlog(CMP, LVL_IMPL, FALSE, "Auto zone reset: %s (Zone %d)",
zone_table[update_u->zone_to_reset].name, zone_table[update_u->zone_to_reset].number); zone_table[update_u->zone_to_reset].name, zone_table[update_u->zone_to_reset].number);
/* dequeue */ /* dequeue */
if (update_u == reset_q.head) if (update_u == reset_q.head)
@ -2487,8 +2486,8 @@ void zone_update(void)
static void log_zone_error(zone_rnum zone, int cmd_no, const char *message) static void log_zone_error(zone_rnum zone, int cmd_no, const char *message)
{ {
mudlog(NRM, ADMLVL_GOD, TRUE, "SYSERR: zone file: %s", message); mudlog(NRM, LVL_GOD, TRUE, "SYSERR: zone file: %s", message);
mudlog(NRM, ADMLVL_GOD, TRUE, "SYSERR: ...offending cmd: '%c' cmd in zone #%d, line %d", mudlog(NRM, LVL_GOD, TRUE, "SYSERR: ...offending cmd: '%c' cmd in zone #%d, line %d",
ZCMD.command, zone_table[zone].number, ZCMD.line); ZCMD.command, zone_table[zone].number, ZCMD.line);
} }
@ -2742,7 +2741,7 @@ int is_empty(zone_rnum zone_nr)
continue; 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 */ * zone reset triggers -Welcor */
if ((!IS_NPC(i->character)) && (IS_ADMIN(i->character, ADMLVL_IMMORT)) && (PRF_FLAGGED(i->character, PRF_NOHASSLE))) if ((!IS_NPC(i->character)) && (GET_LEVEL(i->character) >= LVL_IMMORT) && (PRF_FLAGGED(i->character, PRF_NOHASSLE)))
continue; continue;
return (0); return (0);
@ -3377,8 +3376,7 @@ void init_char(struct char_data *ch)
/* If this is our first player make him IMPL. */ /* If this is our first player make him IMPL. */
if (top_of_p_table == 0) { if (top_of_p_table == 0) {
GET_LEVEL(ch) = CONFIG_MAX_LEVEL; GET_LEVEL(ch) = LVL_IMPL;
set_admin_level(ch, ADMLVL_IMPL); /* Set IMP level and IMP flags */
GET_EXP(ch) = 7000000; GET_EXP(ch) = 7000000;
/* The implementor never goes through do_start(). */ /* The implementor never goes through do_start(). */
@ -3423,7 +3421,7 @@ void init_char(struct char_data *ch)
log("SYSERR: init_char: Character '%s' not found in player table.", GET_NAME(ch)); log("SYSERR: init_char: Character '%s' not found in player table.", GET_NAME(ch));
for (i = 1; i <= MAX_SKILLS; i++) { for (i = 1; i <= MAX_SKILLS; i++) {
if (!IS_ADMIN(ch, ADMLVL_IMPL)) if (GET_LEVEL(ch) < LVL_IMPL)
SET_SKILL(ch, i, 0); SET_SKILL(ch, i, 0);
else else
SET_SKILL(ch, i, 100); SET_SKILL(ch, i, 100);
@ -3444,7 +3442,7 @@ void init_char(struct char_data *ch)
ch->real_abils.cha = 25; ch->real_abils.cha = 25;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
GET_COND(ch, i) = (IS_ADMIN(ch, ADMLVL_IMPL) ? -1 : 24); GET_COND(ch, i) = (GET_LEVEL(ch) == LVL_IMPL ? -1 : 24);
GET_LOADROOM(ch) = NOWHERE; GET_LOADROOM(ch) = NOWHERE;
GET_SCREEN_WIDTH(ch) = PAGE_WIDTH; GET_SCREEN_WIDTH(ch) = PAGE_WIDTH;
@ -3669,7 +3667,7 @@ static int check_object_level(struct obj_data *obj, int val)
{ {
int error = FALSE; int error = FALSE;
if ((GET_OBJ_VAL(obj, val) < 0 || GET_OBJ_VAL(obj, val) > CONFIG_MAX_LEVEL) && (error = TRUE)) if ((GET_OBJ_VAL(obj, val) < 0 || GET_OBJ_VAL(obj, val) > LVL_IMPL) && (error = TRUE))
log("SYSERR: Object #%d (%s) has out of range level #%d.", log("SYSERR: Object #%d (%s) has out of range level #%d.",
GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, val)); GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, val));
@ -3701,26 +3699,25 @@ static void load_default_config( void )
/* Game play options. */ /* Game play options. */
CONFIG_PK_ALLOWED = pk_allowed; CONFIG_PK_ALLOWED = pk_allowed;
CONFIG_PT_ALLOWED = pt_allowed; CONFIG_PT_ALLOWED = pt_allowed;
CONFIG_LEVEL_CAN_SHOUT = level_can_shout; CONFIG_LEVEL_CAN_SHOUT = level_can_shout;
CONFIG_HOLLER_MOVE_COST = holler_move_cost; CONFIG_HOLLER_MOVE_COST = holler_move_cost;
CONFIG_TUNNEL_SIZE = tunnel_size; CONFIG_TUNNEL_SIZE = tunnel_size;
CONFIG_MAX_EXP_GAIN = max_exp_gain; CONFIG_MAX_EXP_GAIN = max_exp_gain;
CONFIG_MAX_EXP_LOSS = max_exp_loss; CONFIG_MAX_EXP_LOSS = max_exp_loss;
CONFIG_MAX_NPC_CORPSE_TIME = max_npc_corpse_time; CONFIG_MAX_NPC_CORPSE_TIME = max_npc_corpse_time;
CONFIG_MAX_PC_CORPSE_TIME = max_pc_corpse_time; CONFIG_MAX_PC_CORPSE_TIME = max_pc_corpse_time;
CONFIG_MAX_LEVEL = max_mortal_level; CONFIG_IDLE_VOID = idle_void;
CONFIG_IDLE_VOID = idle_void; CONFIG_IDLE_RENT_TIME = idle_rent_time;
CONFIG_IDLE_RENT_TIME = idle_rent_time; CONFIG_IDLE_MAX_LEVEL = idle_max_level;
CONFIG_IDLE_MAX_LEVEL = idle_max_level; CONFIG_DTS_ARE_DUMPS = dts_are_dumps;
CONFIG_DTS_ARE_DUMPS = dts_are_dumps;
CONFIG_LOAD_INVENTORY = load_into_inventory; CONFIG_LOAD_INVENTORY = load_into_inventory;
CONFIG_OK = strdup(OK); CONFIG_OK = strdup(OK);
CONFIG_NOPERSON = strdup(NOPERSON); CONFIG_NOPERSON = strdup(NOPERSON);
CONFIG_NOEFFECT = strdup(NOEFFECT); CONFIG_NOEFFECT = strdup(NOEFFECT);
CONFIG_TRACK_T_DOORS = track_through_doors; CONFIG_TRACK_T_DOORS = track_through_doors;
CONFIG_NO_MORT_TO_IMMORT = no_mort_to_immort; CONFIG_NO_MORT_TO_IMMORT = no_mort_to_immort;
CONFIG_DISP_CLOSED_DOORS = display_closed_doors; CONFIG_DISP_CLOSED_DOORS = display_closed_doors;
CONFIG_DIAGONAL_DIRS = diagonal_dirs_enabled; CONFIG_DIAGONAL_DIRS = diagonal_dirs;
CONFIG_MAP = map_option; CONFIG_MAP = map_option;
CONFIG_MAP_SIZE = default_map_size; CONFIG_MAP_SIZE = default_map_size;
CONFIG_MINIMAP_SIZE = default_minimap_size; CONFIG_MINIMAP_SIZE = default_minimap_size;
@ -3730,7 +3727,7 @@ static void load_default_config( void )
CONFIG_FREE_RENT = free_rent; CONFIG_FREE_RENT = free_rent;
CONFIG_MAX_OBJ_SAVE = max_obj_save; CONFIG_MAX_OBJ_SAVE = max_obj_save;
CONFIG_MIN_RENT_COST = min_rent_cost; CONFIG_MIN_RENT_COST = min_rent_cost;
CONFIG_AUTO_SAVE = auto_save; CONFIG_AUTO_SAVE = auto_save;
CONFIG_AUTOSAVE_TIME = autosave_time; CONFIG_AUTOSAVE_TIME = autosave_time;
CONFIG_CRASH_TIMEOUT = crash_file_timeout; CONFIG_CRASH_TIMEOUT = crash_file_timeout;
CONFIG_RENT_TIMEOUT = rent_file_timeout; CONFIG_RENT_TIMEOUT = rent_file_timeout;
@ -3769,8 +3766,7 @@ static void load_default_config( void )
CONFIG_WELC_MESSG = strdup(WELC_MESSG); CONFIG_WELC_MESSG = strdup(WELC_MESSG);
CONFIG_START_MESSG = strdup(START_MESSG); CONFIG_START_MESSG = strdup(START_MESSG);
CONFIG_MEDIT_ADVANCED = medit_advanced_stats; CONFIG_MEDIT_ADVANCED = medit_advanced_stats;
CONFIG_IBT_AUTOSAVE = ibt_autosave; CONFIG_IBT_AUTOSAVE = ibt_autosave;
/* Autowiz options. */ /* Autowiz options. */
CONFIG_USE_AUTOWIZ = use_autowiz; CONFIG_USE_AUTOWIZ = use_autowiz;
CONFIG_MIN_WIZLIST_LEV = min_wizlist_lev; CONFIG_MIN_WIZLIST_LEV = min_wizlist_lev;
@ -3811,14 +3807,12 @@ void load_config( void )
case 'c': case 'c':
if (!str_cmp(tag, "crash_file_timeout")) if (!str_cmp(tag, "crash_file_timeout"))
CONFIG_CRASH_TIMEOUT = num; CONFIG_CRASH_TIMEOUT = num;
else if (!str_cmp(tag, "can_mail"))
CONFIG_CAN_MAIL = num;
break; break;
case 'd': case 'd':
if (!str_cmp(tag, "display_closed_doors")) if (!str_cmp(tag, "display_closed_doors"))
CONFIG_DISP_CLOSED_DOORS = num; CONFIG_DISP_CLOSED_DOORS = num;
else if (!str_cmp(tag, "diagonal_dirs_enabled")) else if (!str_cmp(tag, "diagonal_dirs"))
CONFIG_DIAGONAL_DIRS = num; CONFIG_DIAGONAL_DIRS = num;
else if (!str_cmp(tag, "dts_are_dumps")) else if (!str_cmp(tag, "dts_are_dumps"))
CONFIG_DTS_ARE_DUMPS = num; CONFIG_DTS_ARE_DUMPS = num;
@ -3883,7 +3877,7 @@ void load_config( void )
else if (!str_cmp(tag, "immort_start_room")) else if (!str_cmp(tag, "immort_start_room"))
CONFIG_IMMORTAL_START = num; CONFIG_IMMORTAL_START = num;
else if (!str_cmp(tag, "ibt_autosave")) else if (!str_cmp(tag, "ibt_autosave"))
CONFIG_IBT_AUTOSAVE = num; CONFIG_IBT_AUTOSAVE = num;
break; break;
case 'l': case 'l':
@ -3916,8 +3910,6 @@ void load_config( void )
CONFIG_MAX_OBJ_SAVE = num; CONFIG_MAX_OBJ_SAVE = num;
else if (!str_cmp(tag, "max_pc_corpse_time")) else if (!str_cmp(tag, "max_pc_corpse_time"))
CONFIG_MAX_PC_CORPSE_TIME = num; CONFIG_MAX_PC_CORPSE_TIME = num;
else if (!str_cmp(tag, "max_mortal_level"))
CONFIG_MAX_LEVEL = num;
else if (!str_cmp(tag, "max_playing")) else if (!str_cmp(tag, "max_playing"))
CONFIG_MAX_PLAYING = num; CONFIG_MAX_PLAYING = num;
else if (!str_cmp(tag, "menu")) { else if (!str_cmp(tag, "menu")) {
@ -3935,26 +3927,6 @@ void load_config( void )
CONFIG_MAP = num; CONFIG_MAP = num;
else if (!str_cmp(tag, "medit_advanced_stats")) else if (!str_cmp(tag, "medit_advanced_stats"))
CONFIG_MEDIT_ADVANCED = num; CONFIG_MEDIT_ADVANCED = num;
else if (!str_cmp(tag, "mail_object_cost"))
CONFIG_OBJECT_COST = num;
else if (!str_cmp(tag, "mail_objects_allowed"))
CONFIG_CAN_MAIL_OBJ = num;
else if (!str_cmp(tag, "mail_gold_allowed"))
CONFIG_CAN_MAIL_GOLD = num;
else if (!str_cmp(tag, "mail_stamp_cost"))
CONFIG_STAMP_COST = num;
else if (!str_cmp(tag, "mail_min_level"))
CONFIG_MIN_MAIL_LEVEL = num;
else if (!str_cmp(tag, "mail_min_free_level"))
CONFIG_FREE_MAIL_LEVEL = num;
else if (!str_cmp(tag, "mail_drafts_allowed"))
CONFIG_DRAFTS_ALLOWED = num;
else if (!str_cmp(tag, "mail_draft_timeout"))
CONFIG_DRAFT_TIMEOUT = num;
else if (!str_cmp(tag, "mail_min_mail_anywhere"))
CONFIG_MIN_MAIL_ANYWHERE = num;
else if (!str_cmp(tag, "mail_min_send_to_all"))
CONFIG_MIN_SEND_TO_ALL = num;
break; break;
case 'n': case 'n':

View file

@ -34,7 +34,6 @@
#define LIB_PLROBJS ":plrobjs:" #define LIB_PLROBJS ":plrobjs:"
#define LIB_PLRVARS ":plrvars:" #define LIB_PLRVARS ":plrvars:"
#define LIB_PLRFILES ":plrfiles:" #define LIB_PLRFILES ":plrfiles:"
#define LIB_MLFILES ":mudmail:"
#define LIB_HOUSE ":house:" #define LIB_HOUSE ":house:"
#define SLASH ":" #define SLASH ":"
#elif defined(CIRCLE_AMIGA) || defined(CIRCLE_UNIX) || defined(CIRCLE_WINDOWS) || defined(CIRCLE_ACORN) || defined(CIRCLE_VMS) #elif defined(CIRCLE_AMIGA) || defined(CIRCLE_UNIX) || defined(CIRCLE_WINDOWS) || defined(CIRCLE_ACORN) || defined(CIRCLE_VMS)
@ -48,7 +47,6 @@
#define LIB_PLRVARS "plrvars/" #define LIB_PLRVARS "plrvars/"
#define LIB_HOUSE "house/" #define LIB_HOUSE "house/"
#define LIB_PLRFILES "plrfiles/" #define LIB_PLRFILES "plrfiles/"
#define LIB_MLFILES "mudmail/"
#define SLASH "/" #define SLASH "/"
#else #else
#error "Unknown path components." #error "Unknown path components."
@ -58,7 +56,6 @@
#define SUF_TEXT "text" #define SUF_TEXT "text"
#define SUF_MEM "mem" #define SUF_MEM "mem"
#define SUF_PLR "plr" #define SUF_PLR "plr"
#define SUF_MAIL "ml"
#if defined(CIRCLE_AMIGA) #if defined(CIRCLE_AMIGA)
#define EXE_FILE "/bin/circle" /* maybe use argv[0] but it's not reliable */ #define EXE_FILE "/bin/circle" /* maybe use argv[0] but it's not reliable */
@ -146,7 +143,6 @@
#define PINDEX_NODELETE (1 << 1) /* protected player */ #define PINDEX_NODELETE (1 << 1) /* protected player */
#define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting*/ #define PINDEX_SELFDELETE (1 << 2) /* player is selfdeleting*/
#define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist*/ #define PINDEX_NOWIZLIST (1 << 3) /* Player shouldn't be on wizlist*/
#define PINDEX_MORTAL (1 << 4) /* Player is currently mortal (shouldn't be on wizlist) */
#define REAL 0 #define REAL 0
#define VIRTUAL 1 #define VIRTUAL 1
@ -217,7 +213,6 @@ struct player_index_element {
char *name; char *name;
long id; long id;
int level; int level;
int admlevel;
int flags; int flags;
time_t last; time_t last;
}; };
@ -354,7 +349,7 @@ extern int top_of_helpt;
extern struct help_index_element *help_table; extern struct help_index_element *help_table;
/* Mud configurable variables */ /* Mud configurable variables */
extern int can_mail; extern int no_mail;
extern int mini_mud; extern int mini_mud;
extern int no_rent_check; extern int no_rent_check;
extern time_t boot_time; extern time_t boot_time;

View file

@ -142,7 +142,7 @@ void dg_read_trigger(FILE *fp, void *proto, int type)
count = sscanf(line,"%7s %d",junk,&vnum); count = sscanf(line,"%7s %d",junk,&vnum);
if (count != 2) { if (count != 2) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: Error assigning trigger! - Line was\n %s", line); "SYSERR: Error assigning trigger! - Line was\n %s", line);
return; return;
} }
@ -151,17 +151,17 @@ void dg_read_trigger(FILE *fp, void *proto, int type)
if (rnum == NOTHING) { if (rnum == NOTHING) {
switch(type) { switch(type) {
case MOB_TRIGGER: case MOB_TRIGGER:
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (mob: %s - %d)", "SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (mob: %s - %d)",
vnum, GET_NAME((char_data *)proto), GET_MOB_VNUM((char_data *)proto)); vnum, GET_NAME((char_data *)proto), GET_MOB_VNUM((char_data *)proto));
break; break;
case WLD_TRIGGER: case WLD_TRIGGER:
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (room:%d)", "SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (room:%d)",
vnum, GET_ROOM_VNUM( ((room_data *)proto)->number )); vnum, GET_ROOM_VNUM( ((room_data *)proto)->number ));
break; break;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (?)", vnum); "SYSERR: dg_read_trigger: Trigger vnum #%d asked for but non-existant! (?)", vnum);
break; break;
} }
@ -203,13 +203,13 @@ void dg_read_trigger(FILE *fp, void *proto, int type)
CREATE(room->script, struct script_data, 1); CREATE(room->script, struct script_data, 1);
add_trigger(SCRIPT(room), read_trigger(rnum), -1); add_trigger(SCRIPT(room), read_trigger(rnum), -1);
} else { } else {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: non-existant trigger #%d assigned to room #%d", "SYSERR: non-existant trigger #%d assigned to room #%d",
vnum, room->number); vnum, room->number);
} }
break; break;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: Trigger vnum #%d assigned to non-mob/obj/room", vnum); "SYSERR: Trigger vnum #%d assigned to non-mob/obj/room", vnum);
} }
} }
@ -223,14 +223,14 @@ void dg_obj_trigger(char *line, struct obj_data *obj)
count = sscanf(line,"%s %d",junk,&vnum); count = sscanf(line,"%s %d",junk,&vnum);
if (count != 2) { if (count != 2) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: dg_obj_trigger() : Error assigning trigger! - Line was:\n %s", line); "SYSERR: dg_obj_trigger() : Error assigning trigger! - Line was:\n %s", line);
return; return;
} }
rnum = real_trigger(vnum); rnum = real_trigger(vnum);
if (rnum==NOTHING) { if (rnum==NOTHING) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: Trigger vnum #%d asked for but non-existant! (Object: %s - %d)", "SYSERR: Trigger vnum #%d asked for but non-existant! (Object: %s - %d)",
vnum, obj->short_description, GET_OBJ_VNUM(obj)); vnum, obj->short_description, GET_OBJ_VNUM(obj));
return; return;
@ -265,7 +265,7 @@ void assign_triggers(void *i, int type)
while (trg_proto) { while (trg_proto) {
rnum = real_trigger(trg_proto->vnum); rnum = real_trigger(trg_proto->vnum);
if (rnum==NOTHING) { if (rnum==NOTHING) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: trigger #%d non-existant, for mob #%d", "SYSERR: trigger #%d non-existant, for mob #%d",
trg_proto->vnum, mob_index[mob->nr].vnum); trg_proto->vnum, mob_index[mob->nr].vnum);
} else { } else {
@ -298,7 +298,7 @@ void assign_triggers(void *i, int type)
while (trg_proto) { while (trg_proto) {
rnum = real_trigger(trg_proto->vnum); rnum = real_trigger(trg_proto->vnum);
if (rnum==NOTHING) { if (rnum==NOTHING) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: trigger #%d non-existant, for room #%d", "SYSERR: trigger #%d non-existant, for room #%d",
trg_proto->vnum, room->number); trg_proto->vnum, room->number);
} else { } else {
@ -310,7 +310,7 @@ void assign_triggers(void *i, int type)
} }
break; break;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: unknown type for assign_triggers()"); "SYSERR: unknown type for assign_triggers()");
break; break;
} }

View file

@ -278,10 +278,10 @@ int valid_dg_target(struct char_data *ch, int bitvector)
return TRUE; /* all npcs are allowed as targets */ return TRUE; /* all npcs are allowed as targets */
else if (ch->desc && (STATE(ch->desc) != CON_PLAYING)) else if (ch->desc && (STATE(ch->desc) != CON_PLAYING))
return FALSE; /* Only PC's who are playing can be targetted */ return FALSE; /* Only PC's who are playing can be targetted */
else if (!IS_ADMIN(ch, ADMLVL_IMMORT)) else if (GET_LEVEL(ch) < LVL_IMMORT)
return TRUE; /* as well as all mortals */ return TRUE; /* as well as all mortals */
else if (!IS_SET(bitvector, DG_ALLOW_GODS) && else if (!IS_SET(bitvector, DG_ALLOW_GODS) &&
IS_ADMIN(ch, ADMLVL_GOD)) /* ADMLVL_GOD has the advance command. Can't allow them to be forced. */ GET_LEVEL(ch) >= LVL_GRGOD) /* LVL_GOD has the advance command. Can't allow them to be forced. */
return FALSE; /* but not always the highest gods */ return FALSE; /* but not always the highest gods */
else if (!PRF_FLAGGED(ch, PRF_NOHASSLE)) else if (!PRF_FLAGGED(ch, PRF_NOHASSLE))
return TRUE; /* the ones in between as allowed as long as they have no-hassle off. */ return TRUE; /* the ones in between as allowed as long as they have no-hassle off. */
@ -291,7 +291,7 @@ int valid_dg_target(struct char_data *ch, int bitvector)
void script_damage(struct char_data *vict, int dam) void script_damage(struct char_data *vict, int dam)
{ {
if (IS_ADMIN(vict, ADMLVL_IMMORT) && (dam > 0)) { if (GET_LEVEL(vict)>=LVL_IMMORT && (dam > 0)) {
send_to_char(vict, "Being the cool immortal you are, you sidestep a trap, " send_to_char(vict, "Being the cool immortal you are, you sidestep a trap, "
"obviously placed to kill you.\r\n"); "obviously placed to kill you.\r\n");
return; return;

View file

@ -22,13 +22,14 @@
#include "genzon.h" /* for real_zone_by_thing */ #include "genzon.h" /* for real_zone_by_thing */
#include "act.h" #include "act.h"
#include "fight.h" #include "fight.h"
#include "mail.h"
/* Local file scope functions. */ /* Local file scope functions. */
static void mob_log(char_data *mob, const char *format, ...);
/* attaches mob's name and vnum to msg and sends it to script_log */ /* attaches mob's name and vnum to msg and sends it to script_log */
void mob_log(char_data *mob, const char *format, ...) static void mob_log(char_data *mob, const char *format, ...)
{ {
va_list args; va_list args;
char output[MAX_STRING_LENGTH]; char output[MAX_STRING_LENGTH];
@ -43,7 +44,7 @@ void mob_log(char_data *mob, const char *format, ...)
/* Macro to determine if a mob is permitted to use these commands. */ /* Macro to determine if a mob is permitted to use these commands. */
#define MOB_OR_IMPL(ch) \ #define MOB_OR_IMPL(ch) \
((IS_NPC(ch) && (!(ch)->desc || GET_ADMLEVEL((ch)->desc->original) >= ADMLVL_IMPL)) || (SCRIPT(ch) && TRIGGERS(SCRIPT(ch)))) ((IS_NPC(ch) && (!(ch)->desc || GET_LEVEL((ch)->desc->original) >= LVL_IMPL)) || (SCRIPT(ch) && TRIGGERS(SCRIPT(ch))))
#define MOB_OR_PLAYER(ch) (GET_LEVEL(ch) > 0) #define MOB_OR_PLAYER(ch) (GET_LEVEL(ch) > 0)
/* mob commands */ /* mob commands */
@ -136,8 +137,8 @@ ACMD(do_mkill)
return; return;
} }
/* Lets the mobile destroy an object in its inventory it can also destroy a /* Lets the mobile destroy an object in its inventory it can also destroy a
* worn object and it can destroy items using all.xxxxx or just plain all of * worn object and it can destroy items using all.xxxxx or just plain all of
* them. */ * them. */
ACMD(do_mjunk) ACMD(do_mjunk)
{ {
@ -286,7 +287,7 @@ ACMD(do_mzoneecho)
{ {
int zone; int zone;
char room_number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], *msg; char room_number[MAX_INPUT_LENGTH], buf[MAX_INPUT_LENGTH], *msg;
if (!MOB_OR_IMPL(ch)) if (!MOB_OR_IMPL(ch))
{ {
send_to_char(ch, "Huh?!?\r\n"); send_to_char(ch, "Huh?!?\r\n");
@ -307,7 +308,7 @@ ACMD(do_mzoneecho)
} }
} }
/* Lets the mobile load an item or mobile. All items are loaded into /* Lets the mobile load an item or mobile. All items are loaded into
* inventory, unless it is NO-TAKE. */ * inventory, unless it is NO-TAKE. */
ACMD(do_mload) ACMD(do_mload)
{ {
@ -328,7 +329,7 @@ ACMD(do_mload)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if (ch->desc && (!IS_ADMIN(ch->desc->original, ADMLVL_IMPL))) if( ch->desc && GET_LEVEL(ch->desc->original) < LVL_IMPL)
return; return;
target = two_arguments(argument, arg1, arg2); target = two_arguments(argument, arg1, arg2);
@ -412,8 +413,8 @@ ACMD(do_mload)
mob_log(ch, "mload: bad type"); mob_log(ch, "mload: bad type");
} }
/* Lets the mobile purge all objects and other npcs in the room, or purge a /* Lets the mobile purge all objects and other npcs in the room, or purge a
* specified object or mob in the room. It can purge itself, but this will * specified object or mob in the room. It can purge itself, but this will
* be the last command it does. */ * be the last command it does. */
ACMD(do_mpurge) ACMD(do_mpurge)
{ {
@ -429,7 +430,7 @@ ACMD(do_mpurge)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if( ch->desc && !IS_ADMIN(ch->desc->original, ADMLVL_IMPL)) if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return; return;
one_argument(argument, arg); one_argument(argument, arg);
@ -554,7 +555,7 @@ ACMD(do_mat)
} }
} }
/* Lets the mobile transfer people. The all argument transfers everyone in the /* Lets the mobile transfer people. The all argument transfers everyone in the
* current room to the specified location. */ * current room to the specified location. */
ACMD(do_mteleport) ACMD(do_mteleport)
{ {
@ -652,7 +653,7 @@ ACMD(do_mdamage) {
script_damage(vict, dam); script_damage(vict, dam);
} }
/* Lets the mobile force someone to do something. must be mortal level and the /* Lets the mobile force someone to do something. must be mortal level and the
* all argument only affects those in the room with the mobile. */ * all argument only affects those in the room with the mobile. */
ACMD(do_mforce) ACMD(do_mforce)
{ {
@ -666,7 +667,7 @@ ACMD(do_mforce)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if (ch->desc && (!IS_ADMIN(ch->desc->original, ADMLVL_IMPL))) if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return; return;
argument = one_argument(argument, arg); argument = one_argument(argument, arg);
@ -727,7 +728,7 @@ ACMD(do_mhunt)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if (ch->desc && (!IS_ADMIN(ch->desc->original, ADMLVL_IMPL))) if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return; return;
one_argument(argument, arg); one_argument(argument, arg);
@ -769,7 +770,7 @@ ACMD(do_mremember)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if (ch->desc && (!IS_ADMIN(ch->desc->original, ADMLVL_IMPL))) if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return; return;
argument = one_argument(argument, arg); argument = one_argument(argument, arg);
@ -820,7 +821,7 @@ ACMD(do_mforget)
if (AFF_FLAGGED(ch, AFF_CHARM)) if (AFF_FLAGGED(ch, AFF_CHARM))
return; return;
if (ch->desc && (!IS_ADMIN(ch->desc->original, ADMLVL_IMPL))) if (ch->desc && (GET_LEVEL(ch->desc->original) < LVL_IMPL))
return; return;
one_argument(argument, arg); one_argument(argument, arg);
@ -1135,7 +1136,7 @@ ACMD(do_mfollow)
leader->followers = k; leader->followers = k;
} }
/* Prints the message to everyone in the range of numbers. Thanks to Jamie /* Prints the message to everyone in the range of numbers. Thanks to Jamie
* Nelson of 4D for this contribution */ * Nelson of 4D for this contribution */
ACMD(do_mrecho) ACMD(do_mrecho)
{ {
@ -1154,101 +1155,3 @@ ACMD(do_mrecho)
else else
send_to_range(atoi(start), atoi(finish), "%s\r\n", msg); send_to_range(atoi(start), atoi(finish), "%s\r\n", msg);
} }
/* Mailing functions */
ACMD(do_mmail)
{
char arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH], *arg3;
char buf[MAX_STRING_LENGTH];
char_data *victim;
long recipient = MAIL_TO_NOBODY;
obj_vnum o_num;
struct obj_data *obj;
if (!MOB_OR_IMPL(ch)) {
send_to_char(ch, "Huh?!?\r\n");
return;
}
arg3 = two_arguments(argument, arg, arg2);
if (!*arg) {
mob_log(ch, "mmail called with no argument");
return;
} else if (!strcmp(arg, "recipient")) {
create_mob_mail(ch);
if (*arg2 == UID_CHAR) {
if (!(victim = get_char(arg2))) {
mob_log(ch, "mmail: recipient (%s) not found",arg2);
return;
}
} else if (!(victim = get_char_vis(ch, arg2, NULL, FIND_CHAR_WORLD))) {
/* Check special cases and mail groups */
if ((recipient = get_mail_group_by_name(arg2)) == MAIL_TO_NOBODY) {
mob_log(ch,"mmail: victim (%s) does not exist", arg2);
return;
}
} else if (victim == ch) {
mob_log(ch, "mmail: victim is self");
return;
} else if (IS_NPC(victim)) {
mob_log(ch, "mmail: victim is another mob");
return;
} else {
/* all name checks passed - get the recipient ID */
recipient = GET_ID(victim);
}
if (!add_recipient(MOB_MAIL(ch), recipient)) {
mob_log(ch, "mmail failed to add recipient");
return;
}
} else if (!strcmp(arg, "object")) {
create_mob_mail(ch);
o_num = atoi(arg2);
if (!real_object(o_num)) {
mob_log(ch, "mmail: invalid object vnum");
return;
}
if ((obj = read_object(o_num, VIRTUAL)) == NULL) {
mob_log(ch, "mmail: invalid object to load");
return;
}
obj_to_mail(obj, MOB_MAIL(ch)->mail);
} else if (!strcmp(arg, "subject")) {
create_mob_mail(ch);
sprintf(buf, "%s%s", arg2, arg3);
if ((MOB_MAIL(ch)->mail)->subject)
free((MOB_MAIL(ch)->mail)->subject);
(MOB_MAIL(ch)->mail)->subject = strdup(buf);
} else if (!strcmp(arg, "body")) {
create_mob_mail(ch);
if ((MOB_MAIL(ch)->mail)->body)
free((MOB_MAIL(ch)->mail)->body);
(MOB_MAIL(ch)->mail)->body = strdup(buf);
} else if (!strcmp(arg, "gold")) {
create_mob_mail(ch);
(MOB_MAIL(ch)->mail)->coins = atol(arg2);
} else if (!strcmp(arg, "urgent")) {
create_mob_mail(ch);
TOGGLE_BIT_AR((MOB_MAIL(ch)->mail)->mail_flags, MAIL_URGENT);
} else if (!strcmp(arg, "cod")) {
create_mob_mail(ch);
TOGGLE_BIT_AR((MOB_MAIL(ch)->mail)->mail_flags, MAIL_COD);
} else if (!strcmp(arg, "send")) {
if (mail_from_mobile(ch)== FALSE)
mob_log(ch, "mmail: send failed.");
} else if (!strcmp(arg, "new")) {
create_mob_mail(ch);
clear_mail_data(MOB_MAIL(ch)->mail);
} else if ((!strcmp(arg, "view")) ||
(!strcmp(arg, "show")) ||
(!strcmp(arg, "echo")) ||
(!strcmp(arg, "list")) ) {
create_mob_mail(ch);
send_to_room(IN_ROOM(ch), "%s\r\n", get_mail_text(MOB_MAIL(ch)->mail) );
send_to_room(IN_ROOM(ch), "Recipients: %s\r\n", recipient_list(MOB_MAIL(ch)) );
} else {
mob_log(ch, "mmail: unknown %mail% command (%s).", arg);
}
return;
}

View file

@ -144,10 +144,10 @@ static OCMD(do_oecho)
else if ((room = obj_room(obj)) != NOWHERE) else if ((room = obj_room(obj)) != NOWHERE)
{ {
if (world[room].people) { if (world[room].people) {
sub_write(argument, world[room].people, TRUE, TO_ROOM); sub_write(argument, world[room].people, TRUE, TO_ROOM);
sub_write(argument, world[room].people, TRUE, TO_CHAR); sub_write(argument, world[room].people, TRUE, TO_CHAR);
} }
} }
else else
@ -253,7 +253,7 @@ static OCMD(do_osend)
obj_log(obj, "no target found for osend"); obj_log(obj, "no target found for osend");
} }
/* Prints the message to everyone in the range of numbers. Thanks to Jamie /* Prints the message to everyone in the range of numbers. Thanks to Jamie
* Nelson of 4D for this contribution. */ * Nelson of 4D for this contribution. */
static OCMD(do_orecho) static OCMD(do_orecho)
{ {
@ -285,7 +285,7 @@ static OCMD(do_otimer)
GET_OBJ_TIMER(obj) = atoi(arg); GET_OBJ_TIMER(obj) = atoi(arg);
} }
/* Transform into a different object. Note: this shouldn't be used with /* Transform into a different object. Note: this shouldn't be used with
* containers unless both objects are containers! */ * containers unless both objects are containers! */
static OCMD(do_otransform) static OCMD(do_otransform)
{ {
@ -582,8 +582,8 @@ static OCMD(do_oasound)
(world[room].dir_option[door])->to_room != NOWHERE && (world[room].dir_option[door])->to_room != NOWHERE &&
(world[room].dir_option[door])->to_room != room && (world[room].dir_option[door])->to_room != room &&
world[(world[room].dir_option[door])->to_room].people) { world[(world[room].dir_option[door])->to_room].people) {
sub_write(argument, world[(world[room].dir_option[door])->to_room].people, TRUE, TO_ROOM); sub_write(argument, world[(world[room].dir_option[door])->to_room].people, TRUE, TO_ROOM);
sub_write(argument, world[(world[room].dir_option[door])->to_room].people, TRUE, TO_CHAR); sub_write(argument, world[(world[room].dir_option[door])->to_room].people, TRUE, TO_CHAR);
} }
} }
} }
@ -735,7 +735,7 @@ static OCMD(do_oat)
} }
if (isdigit(*arg)) loc = real_room(atoi(arg)); if (isdigit(*arg)) loc = real_room(atoi(arg));
else if ((ch = get_char_by_obj(obj, arg))) loc = IN_ROOM(ch); else if ((ch = get_char_by_obj(obj, arg))) loc = IN_ROOM(ch);
if (loc == NOWHERE) { if (loc == NOWHERE) {
obj_log(obj, "oat: location not found (%s)", arg); obj_log(obj, "oat: location not found (%s)", arg);
@ -748,7 +748,7 @@ static OCMD(do_oat)
obj_to_room(object, loc); obj_to_room(object, loc);
obj_command_interpreter(object, command); obj_command_interpreter(object, command);
if (object->in_room == loc) if (object->in_room == loc)
extract_obj(object); extract_obj(object);
} }

View file

@ -62,7 +62,7 @@ ACMD(do_oasis_trigedit)
d = ch->desc; d = ch->desc;
/* Give descriptor an OLC structure. */ /* Give descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis_trigedit: Player already had olc structure."); "SYSERR: do_oasis_trigedit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -86,7 +86,7 @@ ACMD(do_oasis_trigedit)
} }
OLC_NUM(d) = number; OLC_NUM(d) = number;
/* If this is a new trigger, setup a new one, otherwise, setup the a copy of /* If this is a new trigger, setup a new one, otherwise, setup the a copy of
* the existing trigger. */ * the existing trigger. */
if ((real_num = real_trigger(number)) == NOTHING) if ((real_num = real_trigger(number)) == NOTHING)
trigedit_setup_new(d); trigedit_setup_new(d);
@ -99,11 +99,11 @@ ACMD(do_oasis_trigedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE,"OLC: %s starts editing zone %d [trigger](allowed zone %d)", mudlog(CMP, LVL_IMMORT, TRUE,"OLC: %s starts editing zone %d [trigger](allowed zone %d)",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
/* Called when a mob or object is being saved to disk, so its script can be /* Called when a mob or object is being saved to disk, so its script can be
* saved. */ * saved. */
void script_save_to_disk(FILE *fp, void *item, int type) void script_save_to_disk(FILE *fp, void *item, int type)
{ {
@ -170,7 +170,7 @@ void trigedit_setup_existing(struct descriptor_data *d, int rtrg_num)
strcat(OLC_STORAGE(d), "\r\n"); strcat(OLC_STORAGE(d), "\r\n");
c = c->next; c = c->next;
} }
/* Now trig->cmdlist is something to pass to the text editor it will be /* Now trig->cmdlist is something to pass to the text editor it will be
* converted back to a real cmdlist_element list later. */ * converted back to a real cmdlist_element list later. */
OLC_TRIG(d) = trig; OLC_TRIG(d) = trig;
@ -321,7 +321,7 @@ void trigedit_parse(struct descriptor_data *d, char *arg)
switch(tolower(*arg)) { switch(tolower(*arg)) {
case 'y': case 'y':
trigedit_save(d); trigedit_save(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE,
"OLC: %s edits trigger %d", GET_NAME(d->character), "OLC: %s edits trigger %d", GET_NAME(d->character),
OLC_NUM(d)); OLC_NUM(d));
/* fall through */ /* fall through */
@ -565,9 +565,9 @@ void trigedit_save(struct descriptor_data *d)
} }
/* now write the trigger out to disk, along with the rest of the triggers for /* now write the trigger out to disk, along with the rest of the triggers for
* this zone. We write this to disk NOW instead of letting the builder have * this zone. We write this to disk NOW instead of letting the builder have
* control because if we lose this after having assigned a new trigger to an * control because if we lose this after having assigned a new trigger to an
* item, we will get SYSERR's upton reboot that could make things hard to * item, we will get SYSERR's upton reboot that could make things hard to
* debug. */ * debug. */
zone = zone_table[OLC_ZNUM(d)].number; zone = zone_table[OLC_ZNUM(d)].number;
top = zone_table[OLC_ZNUM(d)].top; top = zone_table[OLC_ZNUM(d)].top;
@ -579,7 +579,7 @@ void trigedit_save(struct descriptor_data *d)
#endif #endif
if (!(trig_file = fopen(fname, "w"))) { if (!(trig_file = fopen(fname, "w"))) {
mudlog(BRF, MAX(ADMLVL_GOD, GET_INVIS_LEV(d->character)), TRUE, mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE,
"SYSERR: OLC: Can't open trig file \"%s\"", fname); "SYSERR: OLC: Can't open trig file \"%s\"", fname);
return; return;
} }
@ -589,7 +589,7 @@ void trigedit_save(struct descriptor_data *d)
trig = trig_index[rnum]->proto; trig = trig_index[rnum]->proto;
if (fprintf(trig_file, "#%d\n", i) < 0) { if (fprintf(trig_file, "#%d\n", i) < 0) {
mudlog(BRF, MAX(ADMLVL_GOD, GET_INVIS_LEV(d->character)), TRUE, mudlog(BRF, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE,
"SYSERR: OLC: Can't write trig file!"); "SYSERR: OLC: Can't write trig file!");
fclose(trig_file); fclose(trig_file);
return; return;
@ -647,10 +647,10 @@ static void trigedit_create_index(int znum, char *type)
snprintf(new_name, sizeof(new_name), "%s/newindex", prefix); snprintf(new_name, sizeof(new_name), "%s/newindex", prefix);
if (!(oldfile = fopen(old_name, "r"))) { if (!(oldfile = fopen(old_name, "r"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: DG_OLC: Failed to open %s", old_name); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: DG_OLC: Failed to open %s", old_name);
return; return;
} else if (!(newfile = fopen(new_name, "w"))) { } else if (!(newfile = fopen(new_name, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: DG_OLC: Failed to open %s", new_name); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: DG_OLC: Failed to open %s", new_name);
return; return;
} }
@ -752,20 +752,20 @@ int dg_script_edit_parse(struct descriptor_data *d, char *arg)
switch(tolower(*arg)) { switch(tolower(*arg)) {
case 'q': case 'q':
/* This was buggy. First we created a copy of a thing, but maintained /* This was buggy. First we created a copy of a thing, but maintained
* pointers to scripts, then if we altered the scripts, we freed the * pointers to scripts, then if we altered the scripts, we freed the
* pointers and added new ones to the OLC_THING. If we then choose NOT * pointers and added new ones to the OLC_THING. If we then choose NOT
* to save the changes, the pointers in the original pointed to * to save the changes, the pointers in the original pointed to
* garbage. If we saved changes the pointers were updated correctly. * garbage. If we saved changes the pointers were updated correctly.
* Solution: Here we just point the working copies to the new * Solution: Here we just point the working copies to the new
* proto_scripts. We only update the original when choosing to save * proto_scripts. We only update the original when choosing to save
* internally, then free the unused memory there. -Welcor * internally, then free the unused memory there. -Welcor
* Thanks to Jeremy Stanley and Torgny Bjers for the bug report. * Thanks to Jeremy Stanley and Torgny Bjers for the bug report.
* After updating to OasisOLC 2.0.3 I discovered some malfunctions * After updating to OasisOLC 2.0.3 I discovered some malfunctions
* in this code, so I restructured it a bit. Now things work like * in this code, so I restructured it a bit. Now things work like
* this: OLC_SCRIPT(d) is assigned a copy of the edited things' * this: OLC_SCRIPT(d) is assigned a copy of the edited things'
* proto_script. OLC_OBJ(d), etc.. are initalized with proto_script = * proto_script. OLC_OBJ(d), etc.. are initalized with proto_script =
* NULL; On save, the saved copy is updated with OLC_SCRIPT(d) as new * NULL; On save, the saved copy is updated with OLC_SCRIPT(d) as new
* proto_script (freeing the old one). On quit/nosave, OLC_SCRIPT is * proto_script (freeing the old one). On quit/nosave, OLC_SCRIPT is
* free()'d, and the prototype not touched. */ * free()'d, and the prototype not touched. */
return 0; return 0;
case 'n': case 'n':

View file

@ -1,15 +1,15 @@
/** /**
* @file dg_scripts.c * @file dg_scripts.c
* Contains the main script driver interface. * Contains the main script driver interface.
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
* This source code, which was not part of the CircleMUD legacy code, * This source code, which was not part of the CircleMUD legacy code,
* was created by the following people: * was created by the following people:
* $Author: Mark A. Heilpern/egreen/Welcor $ * $Author: Mark A. Heilpern/egreen/Welcor $
* $Date: 2004/10/11 12:07:00$ * $Date: 2004/10/11 12:07:00$
* $Revision: 1.0.14 $ * $Revision: 1.0.14 $
*/ */
#include "conf.h" #include "conf.h"
@ -76,8 +76,8 @@ static struct obj_data *find_obj_by_uid_in_lookup_table(long uid);
static EVENTFUNC(trig_wait_event); static EVENTFUNC(trig_wait_event);
/* Return pointer to first occurrence of string ct in cs, or NULL if not /* Return pointer to first occurrence of string ct in cs, or NULL if not
* present. Case insensitive. All of ct must be found in cs for it to be * present. Case insensitive. All of ct must be found in cs for it to be
* a match. * a match.
* @todo Move this function to string util library. * @todo Move this function to string util library.
* @param cs The string to search. * @param cs The string to search.
@ -117,7 +117,7 @@ char *str_str(char *cs, char *ct)
* @param vnum The virtual number of a room. * @param vnum The virtual number of a room.
* @retval int Returns -1 if the room does not exist, or the total number of * @retval int Returns -1 if the room does not exist, or the total number of
* PCs and NPCs in the room. */ * PCs and NPCs in the room. */
int trgvar_in_room(room_vnum vnum) int trgvar_in_room(room_vnum vnum)
{ {
room_rnum rnum = real_room(vnum); room_rnum rnum = real_room(vnum);
int i = 0; int i = 0;
@ -139,8 +139,8 @@ int trgvar_in_room(room_vnum vnum)
* @param name Either the unique id of an object or a string identifying the * @param name Either the unique id of an object or a string identifying the
* object. Note the unique id must be prefixed with UID_CHAR. * object. Note the unique id must be prefixed with UID_CHAR.
* @param list The list of objects to look through. * @param list The list of objects to look through.
* @retval obj_data * Pointer to the object if it is found in the list of * @retval obj_data * Pointer to the object if it is found in the list of
* objects, NULL if the object is not found in the list. * objects, NULL if the object is not found in the list.
*/ */
obj_data *get_obj_in_list(char *name, obj_data *list) obj_data *get_obj_in_list(char *name, obj_data *list)
{ {
@ -153,7 +153,7 @@ obj_data *get_obj_in_list(char *name, obj_data *list)
for (i = list; i; i = i->next_content) for (i = list; i; i = i->next_content)
if (id == GET_ID(i)) if (id == GET_ID(i))
return i; return i;
} else { } else {
for (i = list; i; i = i->next_content) for (i = list; i; i = i->next_content)
if (isname(name, i->name)) if (isname(name, i->name))
@ -207,8 +207,8 @@ obj_data *get_object_in_equip(char_data * ch, char *name)
} }
/** Figures out if the argument is a valid location to 'wear' equipment. /** Figures out if the argument is a valid location to 'wear' equipment.
* Handles 'held', 'light' and 'wield' positions - Welcor. After idea from * Handles 'held', 'light' and 'wield' positions - Welcor. After idea from
* Byron Ellacott. * Byron Ellacott.
* @param arg Either the name of the position, or the number of a wear * @param arg Either the name of the position, or the number of a wear
* location definition to check for. * location definition to check for.
* @retval int If arg is not a valid wear location name or number, return * @retval int If arg is not a valid wear location name or number, return
@ -330,8 +330,8 @@ static room_data *find_room(long n)
} }
/* Generic searches based only on name. */ /* Generic searches based only on name. */
/** Search the entire world for an NPC or PC by name. /** Search the entire world for an NPC or PC by name.
* @param name String describing the name or the unique id of the char. * @param name String describing the name or the unique id of the char.
* Note the unique id must be prefixed with UID_CHAR. * Note the unique id must be prefixed with UID_CHAR.
* @retval char_data * Pointer to the char or NULL if char is not found. */ * @retval char_data * Pointer to the char or NULL if char is not found. */
char_data *get_char(char *name) char_data *get_char(char *name)
@ -355,11 +355,11 @@ char_data *get_char(char *name)
/** Find a character by name in the same room as a known object. /** Find a character by name in the same room as a known object.
* @todo Should this function not be constrained to the same room as an object * @todo Should this function not be constrained to the same room as an object
* if 'name' is a unique id? * if 'name' is a unique id?
* @param obj An object that will constrain the search to the location that * @param obj An object that will constrain the search to the location that
* the object is in *if* the name argument is not a unique id. * the object is in *if* the name argument is not a unique id.
* @param name Character name keyword to search for, or unique ID. Unique * @param name Character name keyword to search for, or unique ID. Unique
* id must be prefixed with UID_CHAR. * id must be prefixed with UID_CHAR.
* @retval char_data * Pointer to the the char if found, NULL if not. Will * @retval char_data * Pointer to the the char if found, NULL if not. Will
* only find god characters if DG_ALLOW_GODS is on. */ * only find god characters if DG_ALLOW_GODS is on. */
char_data *get_char_near_obj(obj_data *obj, char *name) char_data *get_char_near_obj(obj_data *obj, char *name)
@ -384,12 +384,12 @@ char_data *get_char_near_obj(obj_data *obj, char *name)
} }
/** Find a character by name in a specific room. /** Find a character by name in a specific room.
* @todo Should this function not be constrained to the room * @todo Should this function not be constrained to the room
* if 'name' is a unique id? * if 'name' is a unique id?
* @param room A room that will constrain the search to that location * @param room A room that will constrain the search to that location
* *if* the name argument is not a unique id. * *if* the name argument is not a unique id.
* @param name Character name keyword to search for, or unique ID. Unique * @param name Character name keyword to search for, or unique ID. Unique
* id must be prefixed with UID_CHAR. * id must be prefixed with UID_CHAR.
* @retval char_data * Pointer to the the char if found, NULL if not. Will * @retval char_data * Pointer to the the char if found, NULL if not. Will
* only find god characters if DG_ALLOW_GODS is on. */ * only find god characters if DG_ALLOW_GODS is on. */
char_data *get_char_in_room(room_data *room, char *name) char_data *get_char_in_room(room_data *room, char *name)
@ -491,7 +491,7 @@ room_data *get_room(char *name)
return &world[nr]; return &world[nr];
} }
/* Returns a pointer to the first character in world by name name, or NULL if /* Returns a pointer to the first character in world by name name, or NULL if
* none found. Starts searching with the person owing the object. */ * none found. Starts searching with the person owing the object. */
char_data *get_char_by_obj(obj_data *obj, char *name) char_data *get_char_by_obj(obj_data *obj, char *name)
{ {
@ -522,7 +522,7 @@ char_data *get_char_by_obj(obj_data *obj, char *name)
return NULL; return NULL;
} }
/* Returns a pointer to the first character in world by name name, or NULL if /* Returns a pointer to the first character in world by name name, or NULL if
* none found. Starts searching in room room first. */ * none found. Starts searching in room room first. */
char_data *get_char_by_room(room_data *room, char *name) char_data *get_char_by_room(room_data *room, char *name)
{ {
@ -548,7 +548,7 @@ char_data *get_char_by_room(room_data *room, char *name)
return NULL; return NULL;
} }
/* Returns the object in the world with name name, or NULL if not found search /* Returns the object in the world with name name, or NULL if not found search
* based on obj. */ * based on obj. */
obj_data *get_obj_by_obj(obj_data *obj, char *name) obj_data *get_obj_by_obj(obj_data *obj, char *name)
{ {
@ -909,7 +909,7 @@ void do_sstat_character(char_data *ch, char_data *k)
script_stat(ch, SCRIPT(k)); script_stat(ch, SCRIPT(k));
} }
/* Adds the trigger t to script sc in in location loc. loc = -1 means add to /* Adds the trigger t to script sc in in location loc. loc = -1 means add to
* the end, loc = 0 means add before all other triggers. */ * the end, loc = 0 means add before all other triggers. */
void add_trigger(struct script_data *sc, trig_data *t, int loc) void add_trigger(struct script_data *sc, trig_data *t, int loc)
{ {
@ -991,8 +991,8 @@ ACMD(do_attach)
if (IS_NPC(victim)) if (IS_NPC(victim))
send_to_char(ch, "Trigger %d (%s) attached to %s [%d].\r\n", send_to_char(ch, "Trigger %d (%s) attached to %s [%d].\r\n",
tn, GET_TRIG_NAME(trig), GET_SHORT(victim), GET_MOB_VNUM(victim)); tn, GET_TRIG_NAME(trig), GET_SHORT(victim), GET_MOB_VNUM(victim));
else else
send_to_char(ch, "Trigger %d (%s) attached to player named %s.\r\n", send_to_char(ch, "Trigger %d (%s) attached to player named %s.\r\n",
tn, GET_TRIG_NAME(trig), GET_NAME(victim)); tn, GET_TRIG_NAME(trig), GET_NAME(victim));
} }
@ -1076,10 +1076,10 @@ ACMD(do_attach)
} }
/* Removes the trigger specified by name, and the script of o if it removes the /* Removes the trigger specified by name, and the script of o if it removes the
* last trigger. name can either be a number, or a 'silly' name for the * last trigger. name can either be a number, or a 'silly' name for the
* trigger, including things like 2.beggar-death. Returns 0 if did not find the * trigger, including things like 2.beggar-death. Returns 0 if did not find the
* trigger, otherwise 1. If it matters, you might need to check to see if all * trigger, otherwise 1. If it matters, you might need to check to see if all
* the triggers were removed after this function returns, in order to remove * the triggers were removed after this function returns, in order to remove
* the script. */ * the script. */
static int remove_trigger(struct script_data *sc, char *name) static int remove_trigger(struct script_data *sc, char *name)
{ {
@ -1108,7 +1108,7 @@ static int remove_trigger(struct script_data *sc, char *name)
break; break;
} }
/* This isn't clean. A numeric value will match if it's position OR vnum /* This isn't clean. A numeric value will match if it's position OR vnum
* is found. originally the number was position-only. */ * is found. originally the number was position-only. */
else if (++n >= num) else if (++n >= num)
break; break;
@ -1244,8 +1244,8 @@ ACMD(do_detach)
return; return;
} }
if (!SCRIPT(victim)) if (!SCRIPT(victim))
send_to_char(ch, "That %s doesn't have any triggers.\r\n", IS_NPC(victim) ? "mob" : "player"); send_to_char(ch, "That %s doesn't have any triggers.\r\n", IS_NPC(victim) ? "mob" : "player");
else if (!can_edit_zone(ch, real_zone_by_thing(GET_MOB_VNUM(victim))) && IS_NPC(victim)) { else if (!can_edit_zone(ch, real_zone_by_thing(GET_MOB_VNUM(victim))) && IS_NPC(victim)) {
send_to_char(ch, "You can only detach triggers in your own zone\r\n"); send_to_char(ch, "You can only detach triggers in your own zone\r\n");
return; return;
@ -1290,31 +1290,31 @@ ACMD(do_detach)
} }
} }
/* Logs any errors caused by scripts to the system log. Will eventually allow /* Logs any errors caused by scripts to the system log. Will eventually allow
* on-line view of script errors. */ * on-line view of script errors. */
void script_vlog(const char *format, va_list args) void script_vlog(const char *format, va_list args)
{ {
char output[MAX_STRING_LENGTH]; char output[MAX_STRING_LENGTH];
struct descriptor_data *i; struct descriptor_data *i;
/* parse the args, making the error message */ /* parse the args, making the error message */
vsnprintf(output, sizeof(output) - 2, format, args); vsnprintf(output, sizeof(output) - 2, format, args);
/* Save to the syslog file */ /* Save to the syslog file */
basic_mud_log("SCRIPT ERROR: %s", output); basic_mud_log("SCRIPT ERROR: %s", output);
/* And send to imms */ /* And send to imms */
for (i = descriptor_list; i; i = i->next) { for (i = descriptor_list; i; i = i->next) {
if (STATE(i) != CON_PLAYING || IS_NPC(i->character)) /* switch */ if (STATE(i) != CON_PLAYING || IS_NPC(i->character)) /* switch */
continue; continue;
if (!IS_ADMIN((i->character), ADMLVL_BUILDER)) if (GET_LEVEL(i->character) < LVL_BUILDER)
continue; continue;
if (PLR_FLAGGED(i->character, PLR_WRITING)) if (PLR_FLAGGED(i->character, PLR_WRITING))
continue; continue;
if (NRM > (PRF_FLAGGED(i->character, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(i->character, PRF_LOG2) ? 2 : 0)) if (NRM > (PRF_FLAGGED(i->character, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(i->character, PRF_LOG2) ? 2 : 0))
continue; continue;
send_to_char(i->character, "%s[ %s ]%s\r\n", CCGRN(i->character, C_NRM), output, CCNRM(i->character, C_NRM)); send_to_char(i->character, "%s[ %s ]%s\r\n", CCGRN(i->character, C_NRM), output, CCNRM(i->character, C_NRM));
} }
} }
@ -1327,7 +1327,7 @@ void script_log(const char *format, ...)
va_end(args); va_end(args);
} }
/* Returns 1 if string is all digits, else 0. Bugfixed - would have returned /* Returns 1 if string is all digits, else 0. Bugfixed - would have returned
* true on num="------". */ * true on num="------". */
static int is_num(char *arg) static int is_num(char *arg)
{ {
@ -1445,7 +1445,7 @@ static void eval_op(char *op, char *lhs, char *rhs, char *result, void *go,
} }
} }
/* p points to the first quote, returns the matching end quote, or the last /* p points to the first quote, returns the matching end quote, or the last
* non-null char in p.*/ * non-null char in p.*/
char *matching_quote(char *p) char *matching_quote(char *p)
{ {
@ -1460,7 +1460,7 @@ char *matching_quote(char *p)
return p; return p;
} }
/* p points to the first paren. returns a pointer to the matching closing /* p points to the first paren. returns a pointer to the matching closing
* paren, or the last non-null char in p. */ * paren, or the last non-null char in p. */
static char *matching_paren(char *p) static char *matching_paren(char *p)
{ {
@ -1533,7 +1533,7 @@ static int eval_lhs_op_rhs(char *expr, char *result, void *go, struct script_dat
p = strcpy(line, expr); p = strcpy(line, expr);
/* Initialize tokens, an array of pointers to locations in line where the /* Initialize tokens, an array of pointers to locations in line where the
* ops could possibly occur. */ * ops could possibly occur. */
for (j = 0; *p; j++) { for (j = 0; *p; j++) {
tokens[j] = p; tokens[j] = p;
@ -1613,7 +1613,7 @@ static struct cmdlist_element *find_end(trig_data *trig, struct cmdlist_element
return c; return c;
} }
/* Searches for valid elseif, else, or end to continue execution at. Returns /* Searches for valid elseif, else, or end to continue execution at. Returns
* line of elseif, else, or end if found, or last line of trigger. */ * line of elseif, else, or end if found, or last line of trigger. */
static struct cmdlist_element *find_else_end(trig_data *trig, static struct cmdlist_element *find_else_end(trig_data *trig,
struct cmdlist_element *cl, void *go, struct script_data *sc, int type) struct cmdlist_element *cl, void *go, struct script_data *sc, int type)
@ -2034,7 +2034,7 @@ static void makeuid_var(void *go, struct script_data *sc, trig_data *trig,
add_var(&GET_TRIG_VARS(trig), varname, uid, sc ? sc->context : 0); add_var(&GET_TRIG_VARS(trig), varname, uid, sc ? sc->context : 0);
} }
/* Processes a script return command. Returns the new value for the script to /* Processes a script return command. Returns the new value for the script to
* return. */ * return. */
static int process_return(trig_data *trig, char *cmd) static int process_return(trig_data *trig, char *cmd)
{ {
@ -2052,7 +2052,7 @@ static int process_return(trig_data *trig, char *cmd)
return atoi(arg2); return atoi(arg2);
} }
/* Removes a variable from the global vars of sc, or the local vars of trig if /* Removes a variable from the global vars of sc, or the local vars of trig if
* not found in global list. */ * not found in global list. */
static void process_unset(struct script_data *sc, trig_data *trig, char *cmd) static void process_unset(struct script_data *sc, trig_data *trig, char *cmd)
{ {
@ -2123,7 +2123,7 @@ static void process_remote(struct script_data *sc, trig_data *trig, char *cmd)
return; return;
} }
/* For all but PC's, context comes from the existing context. For PC's, /* For all but PC's, context comes from the existing context. For PC's,
* context is 0 (global) */ * context is 0 (global) */
context = vd->context; context = vd->context;
@ -2145,7 +2145,7 @@ static void process_remote(struct script_data *sc, trig_data *trig, char *cmd)
add_var(&(sc_remote->global_vars), vd->name, vd->value, context); add_var(&(sc_remote->global_vars), vd->name, vd->value, context);
} }
/* Command-line interface to rdelete. Named vdelete so people didn't think it /* Command-line interface to rdelete. Named vdelete so people didn't think it
* was to delete rooms. */ * was to delete rooms. */
ACMD(do_vdelete) ACMD(do_vdelete)
{ {
@ -2234,7 +2234,7 @@ ACMD(do_vdelete)
send_to_char(ch, "Deleted.\r\n"); send_to_char(ch, "Deleted.\r\n");
} }
/* Called from do_set - return 0 for failure, 1 for success. ch and vict are /* Called from do_set - return 0 for failure, 1 for success. ch and vict are
* verified. */ * verified. */
int perform_set_dg_var(struct char_data *ch, struct char_data *vict, char *val_arg) int perform_set_dg_var(struct char_data *ch, struct char_data *vict, char *val_arg)
{ {
@ -2398,7 +2398,7 @@ static void extract_value(struct script_data *sc, trig_data *trig, char *cmd)
/* Thanks to Jamie Nelson for 4 dimensions for this addition. /* Thanks to Jamie Nelson for 4 dimensions for this addition.
* Syntax : * Syntax :
* dg_letter <new varname> <letter position> <string to get from>. * dg_letter <new varname> <letter position> <string to get from>.
* set string L337-String * set string L337-String
* dg_letter var1 4 %string% * dg_letter var1 4 %string%
* dg_letter var2 11 %string% * dg_letter var2 11 %string%
@ -2441,7 +2441,7 @@ static void dg_letter_value(struct script_data *sc, trig_data *trig, char *cmd)
/* This is the core driver for scripts. /* This is the core driver for scripts.
* Arguments: * Arguments:
* void *go_adress * void *go_adress
* A pointer to a pointer to the entity running the script. The reason for * A pointer to a pointer to the entity running the script. The reason for
* this approcah is that we want to be able to see from the calling function, * this approcah is that we want to be able to see from the calling function,
* if the entity has been free'd. * if the entity has been free'd.
* *
@ -2502,9 +2502,9 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
extract_script(go, type); extract_script(go, type);
/* extract_script() works on rooms, but on mobiles and objects, it will be /* extract_script() works on rooms, but on mobiles and objects, it will be
* called again if the caller is load_mtrigger or load_otrigger if it is * called again if the caller is load_mtrigger or load_otrigger if it is
* one of these, we must make sure the script is not just reloaded on the * one of these, we must make sure the script is not just reloaded on the
* next mob. We make the calling code decide how to handle it, so it does * next mob. We make the calling code decide how to handle it, so it does
* not get totally removed unless it's a load_xtrigger(). */ * not get totally removed unless it's a load_xtrigger(). */
return SCRIPT_ERROR_CODE; return SCRIPT_ERROR_CODE;
@ -2736,7 +2736,7 @@ ACMD(do_tstat)
send_to_char(ch, "Usage: tstat <vnum>\r\n"); send_to_char(ch, "Usage: tstat <vnum>\r\n");
} }
/* Scans for a case/default instance. Returns the line containg the correct /* Scans for a case/default instance. Returns the line containg the correct
* case instance, or the last line of the trigger if not found. */ * case instance, or the last line of the trigger if not found. */
static struct cmdlist_element * static struct cmdlist_element *
find_case(struct trig_data *trig, struct cmdlist_element *cl, find_case(struct trig_data *trig, struct cmdlist_element *cl,
@ -2772,8 +2772,8 @@ find_case(struct trig_data *trig, struct cmdlist_element *cl,
return c; return c;
} }
/* Scans for end of while/switch-blocks. Returns the line containg 'end', or /* Scans for end of while/switch-blocks. Returns the line containg 'end', or
* the last line of the trigger if not found. Malformed scripts may cause NULL * the last line of the trigger if not found. Malformed scripts may cause NULL
* to be returned. */ * to be returned. */
static struct cmdlist_element *find_done(struct cmdlist_element *cl) static struct cmdlist_element *find_done(struct cmdlist_element *cl)
{ {
@ -2806,13 +2806,13 @@ void read_saved_vars(struct char_data *ch)
char varname[32]; char varname[32];
char context_str[16]; char context_str[16];
/* If getting to the menu from inside the game, the vars aren't removed. So /* If getting to the menu from inside the game, the vars aren't removed. So
* let's not allocate them again. */ * let's not allocate them again. */
if (SCRIPT(ch)) if (SCRIPT(ch))
return; return;
/* Create the space for the script structure which holds the vars. We need to /* Create the space for the script structure which holds the vars. We need to
* do this first, because later calls to 'remote' will need. A script already * do this first, because later calls to 'remote' will need. A script already
* assigned. */ * assigned. */
CREATE(SCRIPT(ch), struct script_data, 1); CREATE(SCRIPT(ch), struct script_data, 1);
@ -2850,7 +2850,7 @@ void save_char_vars(struct char_data *ch)
char fn[127]; char fn[127];
struct trig_var_data *vars; struct trig_var_data *vars;
/* Immediate return if no script (and therefore no variables) structure has /* Immediate return if no script (and therefore no variables) structure has
* been created. this will happen when the player is logging in */ * been created. this will happen when the player is logging in */
if (SCRIPT(ch) == NULL) return; if (SCRIPT(ch) == NULL) return;
@ -2866,12 +2866,12 @@ void save_char_vars(struct char_data *ch)
file = fopen(fn,"wt"); file = fopen(fn,"wt");
if (!file) { if (!file) {
mudlog( NRM, ADMLVL_GOD, TRUE, mudlog( NRM, LVL_GOD, TRUE,
"SYSERR: Could not open player variable file %s for writing.:%s", "SYSERR: Could not open player variable file %s for writing.:%s",
fn, strerror(errno)); fn, strerror(errno));
return; return;
} }
/* Note that currently, context will always be zero. This may change in the /* Note that currently, context will always be zero. This may change in the
* future. */ * future. */
while (vars) { while (vars) {
if (*vars->name != '-') /* don't save if it begins with - */ if (*vars->name != '-') /* don't save if it begins with - */
@ -2891,7 +2891,7 @@ void read_saved_vars_ascii(FILE *file, struct char_data *ch, int count)
char context_str[READ_SIZE]; char context_str[READ_SIZE];
int i; int i;
/* If getting to the menu from inside the game, the vars aren't removed. So /* If getting to the menu from inside the game, the vars aren't removed. So
* let's not allocate them again. */ * let's not allocate them again. */
if (SCRIPT(ch)) if (SCRIPT(ch))
return; return;
@ -2922,7 +2922,7 @@ void save_char_vars_ascii(FILE *file, struct char_data *ch)
{ {
struct trig_var_data *vars; struct trig_var_data *vars;
int count = 0; int count = 0;
/* Immediate return if no script (and therefore no variables) structure has /* Immediate return if no script (and therefore no variables) structure has
* been created. this will happen when the player is logging in */ * been created. this will happen when the player is logging in */
if (SCRIPT(ch) == NULL) return; if (SCRIPT(ch) == NULL) return;
@ -2932,7 +2932,7 @@ void save_char_vars_ascii(FILE *file, struct char_data *ch)
/* make sure this char has global variables to save */ /* make sure this char has global variables to save */
if (ch->script->global_vars == NULL) return; if (ch->script->global_vars == NULL) return;
/* Note that currently, context will always be zero. This may change in the /* Note that currently, context will always be zero. This may change in the
* future */ * future */
for (vars = ch->script->global_vars;vars;vars = vars->next) for (vars = ch->script->global_vars;vars;vars = vars->next)
if (*vars->name != '-') if (*vars->name != '-')
@ -3019,7 +3019,7 @@ void remove_from_lookup_table(long uid)
int bucket = (int) (uid & (BUCKET_COUNT - 1)); int bucket = (int) (uid & (BUCKET_COUNT - 1));
struct lookup_table_t *lt = &lookup_table[bucket], *flt = NULL; struct lookup_table_t *lt = &lookup_table[bucket], *flt = NULL;
/* This is not supposed to happen. UID 0 is not used. However, while I'm /* This is not supposed to happen. UID 0 is not used. However, while I'm
* debugging the issue, let's just return right away. - Welcor */ * debugging the issue, let's just return right away. - Welcor */
if (uid == 0) if (uid == 0)
return; return;
@ -3039,29 +3039,29 @@ void remove_from_lookup_table(long uid)
log("remove_from_lookup. UID %ld not found.", uid); log("remove_from_lookup. UID %ld not found.", uid);
} }
bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *namelist[]) bool check_flags_by_name_ar(int *array, int numflags, char *search, const char *namelist[])
{ {
int i, item=-1; int i, item=-1;
for (i=0; i<numflags && item < 0; i++) for (i=0; i<numflags && item < 0; i++)
if (!strcmp(search, namelist[i])) item = i; if (!strcmp(search, namelist[i])) item = i;
if (item < 0) return FALSE; if (item < 0) return FALSE;
if (IS_SET_AR(array, item)) return TRUE; if (IS_SET_AR(array, item)) return TRUE;
return FALSE; return FALSE;
} }
int trig_is_attached(struct script_data *sc, int trig_num) int trig_is_attached(struct script_data *sc, int trig_num)
{ {
trig_data *t; trig_data *t;
if (!sc || !TRIGGERS(sc)) return 0; if (!sc || !TRIGGERS(sc)) return 0;
for (t = TRIGGERS(sc); t; t = t->next) for (t = TRIGGERS(sc); t; t = t->next)
if (GET_TRIG_VNUM(t) == trig_num) if (GET_TRIG_VNUM(t) == trig_num)
return 1; return 1;
return 0; return 0;
} }

View file

@ -363,7 +363,6 @@ int valid_dg_target(char_data *ch, int bitvector);
void script_damage(char_data *vict, int dam); void script_damage(char_data *vict, int dam);
/* from dg_mobcmd.c */ /* from dg_mobcmd.c */
void mob_log(char_data *mob, const char *format, ...);
ACMD(do_masound); ACMD(do_masound);
ACMD(do_mat); ACMD(do_mat);
ACMD(do_mdamage); ACMD(do_mdamage);
@ -378,7 +377,6 @@ ACMD(do_mhunt);
ACMD(do_mjunk); ACMD(do_mjunk);
ACMD(do_mkill); ACMD(do_mkill);
ACMD(do_mload); ACMD(do_mload);
ACMD(do_mmail);
ACMD(do_mpurge); ACMD(do_mpurge);
ACMD(do_mrecho); ACMD(do_mrecho);
ACMD(do_mremember); ACMD(do_mremember);

View file

@ -310,7 +310,7 @@ int command_mtrigger(char_data *actor, char *cmd, char *argument)
continue; continue;
if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) { if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: Command Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: Command Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }
@ -350,7 +350,7 @@ void speech_mtrigger(char_data *actor, char *str)
continue; continue;
if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) { if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: Speech Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: Speech Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }
@ -380,7 +380,7 @@ void act_mtrigger(const char_data *ch, char *str, char_data *actor,
continue; continue;
if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) { if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: Act Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: Act Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }
@ -700,7 +700,7 @@ int cmd_otrig(obj_data *obj, char_data *actor, char *cmd,
if (IS_SET(GET_TRIG_NARG(t), type) && if (IS_SET(GET_TRIG_NARG(t), type) &&
(!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t))) { (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t))) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: O-Command Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: O-Command Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }
@ -1060,7 +1060,7 @@ int command_wtrigger(char_data *actor, char *cmd, char *argument)
continue; continue;
if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) { if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: W-Command Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: W-Command Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }
@ -1095,7 +1095,7 @@ void speech_wtrigger(char_data *actor, char *str)
continue; continue;
if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) { if (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t)) {
mudlog(NRM, ADMLVL_BUILDER, TRUE, "SYSERR: W-Speech Trigger #%d has no text argument!", mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: W-Speech Trigger #%d has no text argument!",
GET_TRIG_VNUM(t)); GET_TRIG_VNUM(t));
continue; continue;
} }

View file

@ -232,7 +232,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
char *recho[] = {"mrecho ", "orecho ", "wrecho " }; char *recho[] = {"mrecho ", "orecho ", "wrecho " };
/* there is no such thing as mmove, thus the mecho below */ /* there is no such thing as mmove, thus the mecho below */
char *omove[] = {"mecho ", "omove ", "wmove " }; char *omove[] = {"mecho ", "omove ", "wmove " };
char *mail[] = {"mmail ", "oecho ", "wecho " };
*str = '\0'; *str = '\0';
@ -301,8 +300,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
snprintf(str, slen, "%s", recho[type]); snprintf(str, slen, "%s", recho[type]);
else if (!str_cmp(var, "move")) else if (!str_cmp(var, "move"))
snprintf(str, slen, "%s", omove[type]); snprintf(str, slen, "%s", omove[type]);
else if (!str_cmp(var, "mail"))
snprintf(str, slen, "%s", mail[type]);
else else
*str = '\0'; *str = '\0';
} }
@ -397,7 +394,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "gold") && IS_HAPPYHOUR) else if (!str_cmp(field, "gold") && IS_HAPPYHOUR)
snprintf(str, slen, "%d", HAPPY_GOLD); snprintf(str, slen, "%d", HAPPY_GOLD);
else snprintf(str, slen, "%d", HAPPY_TIME); else snprintf(str, slen, "%d", HAPPY_TIME);
return; return;
} }
else if (!str_cmp(var, "time")) { else if (!str_cmp(var, "time")) {
if (!str_cmp(field, "hour")) if (!str_cmp(field, "hour"))
@ -520,7 +517,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
} else { } else {
doors = 0; doors = 0;
room = &world[in_room]; room = &world[in_room];
for (i = 0; i < DIR_COUNT ; i++) for (i = 0; i < DIR_COUNT; i++)
if (R_EXIT(room, i)) if (R_EXIT(room, i))
doors++; doors++;
@ -555,19 +552,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
switch (LOWER(*field)) { switch (LOWER(*field)) {
case 'a': case 'a':
if (!str_cmp(field, "admlevel")) {
if (subfield && *subfield) {
int al;
if ((al = get_admin_level_by_string(subfield)) >= ADMLVL_MORTAL) {
if (IS_ADMIN(c, al))
strcpy(str, "1");
else
strcpy(str, "0");
} else
strcpy(str, "0");
} else
snprintf(str, slen, "%d", GET_ADMLEVEL(c));
}
if (!str_cmp(field, "affect")) { if (!str_cmp(field, "affect")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int spell = find_skill_num(subfield); int spell = find_skill_num(subfield);
@ -601,7 +585,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "cha")) { else if (!str_cmp(field, "cha")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
GET_CHA(c) += addition; GET_CHA(c) += addition;
if (GET_CHA(c) > max) GET_CHA(c) = max; if (GET_CHA(c) > max) GET_CHA(c) = max;
if (GET_CHA(c) < 3) GET_CHA(c) = 3; if (GET_CHA(c) < 3) GET_CHA(c) = 3;
@ -623,7 +607,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "con")) { else if (!str_cmp(field, "con")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
GET_CON(c) += addition; GET_CON(c) += addition;
if (GET_CON(c) > max) GET_CON(c) = max; if (GET_CON(c) > max) GET_CON(c) = max;
if (GET_CON(c) < 3) GET_CON(c) = 3; if (GET_CON(c) < 3) GET_CON(c) = 3;
@ -636,17 +620,16 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
GET_DAMROLL(c) = MAX(1, GET_DAMROLL(c) + addition); GET_DAMROLL(c) = MAX(1, GET_DAMROLL(c) + addition);
} }
snprintf(str, slen, "%d", GET_DAMROLL(c)); snprintf(str, slen, "%d", GET_DAMROLL(c));
} } else if (!str_cmp(field, "dex")) {
else if (!str_cmp(field, "dex")) { if (subfield && *subfield) {
if (subfield && *subfield) { int addition = atoi(subfield);
int addition = atoi(subfield); int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; GET_DEX(c) += addition;
GET_DEX(c) += addition; if (GET_DEX(c) > max) GET_DEX(c) = max;
if (GET_DEX(c) > max) GET_DEX(c) = max; if (GET_DEX(c) < 3) GET_DEX(c) = 3;
if (GET_DEX(c) < 3) GET_DEX(c) = 3; }
}
snprintf(str, slen, "%d", GET_DEX(c)); snprintf(str, slen, "%d", GET_DEX(c));
} }
else if (!str_cmp(field, "drunk")) { else if (!str_cmp(field, "drunk")) {
@ -739,12 +722,12 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
snprintf(str, slen, "%d", GET_HIT(c)); snprintf(str, slen, "%d", GET_HIT(c));
} }
else if (!str_cmp(field, "hitroll")) { else if (!str_cmp(field, "hitroll")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
GET_HITROLL(c) = MAX(1, GET_HITROLL(c) + addition); GET_HITROLL(c) = MAX(1, GET_HITROLL(c) + addition);
} }
snprintf(str, slen, "%d", GET_HITROLL(c)); snprintf(str, slen, "%d", GET_HITROLL(c));
} }
else if (!str_cmp(field, "hunger")) { else if (!str_cmp(field, "hunger")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
@ -766,7 +749,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "int")) { else if (!str_cmp(field, "int")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
GET_INT(c) += addition; GET_INT(c) += addition;
if (GET_INT(c) > max) GET_INT(c) = max; if (GET_INT(c) > max) GET_INT(c) = max;
if (GET_INT(c) < 3) GET_INT(c) = 3; if (GET_INT(c) < 3) GET_INT(c) = 3;
@ -820,7 +803,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
if (!str_cmp(field, "level")) { if (!str_cmp(field, "level")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int lev = atoi(subfield); int lev = atoi(subfield);
GET_LEVEL(c) = MIN(MAX(lev, 1), CONFIG_MAX_LEVEL); GET_LEVEL(c) = MIN(MAX(lev, 0), LVL_IMMORT-1);
} else } else
snprintf(str, slen, "%d", GET_LEVEL(c)); snprintf(str, slen, "%d", GET_LEVEL(c));
} }
@ -1011,7 +994,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "str")) { else if (!str_cmp(field, "str")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
GET_STR(c) += addition; GET_STR(c) += addition;
if (GET_STR(c) > max) GET_STR(c) = max; if (GET_STR(c) > max) GET_STR(c) = max;
if (GET_STR(c) < 3) GET_STR(c) = 3; if (GET_STR(c) < 3) GET_STR(c) = 3;
@ -1079,7 +1062,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
else if (!str_cmp(field, "wis")) { else if (!str_cmp(field, "wis")) {
if (subfield && *subfield) { if (subfield && *subfield) {
int addition = atoi(subfield); int addition = atoi(subfield);
int max = (IS_NPC(c) || IS_ADMIN(c, ADMLVL_GRGOD)) ? 25 : 18; int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
GET_WIS(c) += addition; GET_WIS(c) += addition;
if (GET_WIS(c) > max) GET_WIS(c) = max; if (GET_WIS(c) > max) GET_WIS(c) = max;
if (GET_WIS(c) < 3) GET_WIS(c) = 3; if (GET_WIS(c) < 3) GET_WIS(c) = 3;

View file

@ -74,8 +74,8 @@ void act_to_room(char *str, room_data *room)
if (!room->people) if (!room->people)
return; return;
/* Since you can't use act(..., TO_ROOM) for an room, send it TO_ROOM and /* Since you can't use act(..., TO_ROOM) for an room, send it TO_ROOM and
* TO_CHAR for some char in the room. (just dont use $n or you might get * TO_CHAR for some char in the room. (just dont use $n or you might get
* strange results). */ * strange results). */
act(str, FALSE, room->people, 0, 0, TO_ROOM); act(str, FALSE, room->people, 0, 0, TO_ROOM);
act(str, FALSE, room->people, 0, 0, TO_CHAR); act(str, FALSE, room->people, 0, 0, TO_CHAR);
@ -533,20 +533,20 @@ WCMD(do_wdamage) {
script_damage(ch, dam); script_damage(ch, dam);
} }
WCMD(do_wat) WCMD(do_wat)
{ {
room_rnum loc = NOWHERE; room_rnum loc = NOWHERE;
struct char_data *ch; struct char_data *ch;
char arg[MAX_INPUT_LENGTH], *command; char arg[MAX_INPUT_LENGTH], *command;
command = any_one_arg(argument, arg); command = any_one_arg(argument, arg);
if (!*arg) { if (!*arg) {
wld_log(room, "wat called with no args"); wld_log(room, "wat called with no args");
return; return;
} }
skip_spaces(&command); skip_spaces(&command);
if (!*command) { if (!*command) {
wld_log(room, "wat called without a command"); wld_log(room, "wat called without a command");
@ -555,7 +555,7 @@ WCMD(do_wat)
if (isdigit(*arg)) loc = real_room(atoi(arg)); if (isdigit(*arg)) loc = real_room(atoi(arg));
else if ((ch = get_char_by_room(room, arg))) loc = IN_ROOM(ch); else if ((ch = get_char_by_room(room, arg))) loc = IN_ROOM(ch);
if (loc == NOWHERE) { if (loc == NOWHERE) {
wld_log(room, "wat: location not found (%s)", arg); wld_log(room, "wat: location not found (%s)", arg);
return; return;

View file

@ -78,7 +78,7 @@ void appear(struct char_data *ch)
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_INVISIBLE); REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_INVISIBLE);
REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE); REMOVE_BIT_AR(AFF_FLAGS(ch), AFF_HIDE);
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) if (GET_LEVEL(ch) < LVL_IMMORT)
act("$n slowly fades into existence.", FALSE, ch, 0, 0, TO_ROOM); act("$n slowly fades into existence.", FALSE, ch, 0, 0, TO_ROOM);
else else
act("You feel a strange presence as $n appears, seemingly from nowhere.", act("You feel a strange presence as $n appears, seemingly from nowhere.",
@ -203,7 +203,7 @@ void check_killer(struct char_data *ch, struct char_data *vict)
SET_BIT_AR(PLR_FLAGS(ch), PLR_KILLER); SET_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
send_to_char(ch, "If you want to be a PLAYER KILLER, so be it...\r\n"); send_to_char(ch, "If you want to be a PLAYER KILLER, so be it...\r\n");
mudlog(BRF, ADMLVL_IMMORT, TRUE, "PC Killer bit set on %s for initiating attack on %s at %s.", mudlog(BRF, LVL_IMMORT, TRUE, "PC Killer bit set on %s for initiating attack on %s at %s.",
GET_NAME(ch), GET_NAME(vict), world[IN_ROOM(vict)].name); GET_NAME(ch), GET_NAME(vict), world[IN_ROOM(vict)].name);
} }
@ -579,7 +579,7 @@ static void dam_message(int dam, struct char_data *ch, struct char_data *victim,
act(buf, FALSE, ch, NULL, victim, TO_NOTVICT); act(buf, FALSE, ch, NULL, victim, TO_NOTVICT);
/* damage message to damager */ /* damage message to damager */
if (IS_ADMIN(ch, ADMLVL_IMMORT)) if (GET_LEVEL(ch) >= LVL_IMMORT)
send_to_char(ch, "(%d) ", dam); send_to_char(ch, "(%d) ", dam);
buf = replace_string(dam_weapons[msgnum].to_char, buf = replace_string(dam_weapons[msgnum].to_char,
attack_hit_text[w_type].singular, attack_hit_text[w_type].plural); attack_hit_text[w_type].singular, attack_hit_text[w_type].plural);
@ -587,7 +587,7 @@ static void dam_message(int dam, struct char_data *ch, struct char_data *victim,
send_to_char(ch, CCNRM(ch, C_CMP)); send_to_char(ch, CCNRM(ch, C_CMP));
/* damage message to damagee */ /* damage message to damagee */
if (IS_ADMIN(victim, ADMLVL_IMMORT)) if (GET_LEVEL(victim) >= LVL_IMMORT)
send_to_char(victim, "@R(%d)", dam); send_to_char(victim, "@R(%d)", dam);
buf = replace_string(dam_weapons[msgnum].to_victim, buf = replace_string(dam_weapons[msgnum].to_victim,
attack_hit_text[w_type].singular, attack_hit_text[w_type].plural); attack_hit_text[w_type].singular, attack_hit_text[w_type].plural);
@ -609,54 +609,54 @@ int skill_message(int dam, struct char_data *ch, struct char_data *vict,
if (fight_messages[i].a_type == attacktype) { if (fight_messages[i].a_type == attacktype) {
nr = dice(1, fight_messages[i].number_of_attacks); nr = dice(1, fight_messages[i].number_of_attacks);
for (j = 1, msg = fight_messages[i].msg; (j < nr) && msg; j++) for (j = 1, msg = fight_messages[i].msg; (j < nr) && msg; j++)
msg = msg->next; msg = msg->next;
if (IS_ADMIN(vict, ADMLVL_IMPL)) { if (!IS_NPC(vict) && (GET_LEVEL(vict) >= LVL_IMPL)) {
act(msg->god_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); act(msg->god_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);
act(msg->god_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT); act(msg->god_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT);
act(msg->god_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); act(msg->god_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT);
} else if (dam != 0) { } else if (dam != 0) {
/* /*
* Don't send redundant color codes for TYPE_SUFFERING & other types * Don't send redundant color codes for TYPE_SUFFERING & other types
* of damage without attacker_msg. * of damage without attacker_msg.
*/ */
if (GET_POS(vict) == POS_DEAD) { if (GET_POS(vict) == POS_DEAD) {
if (msg->die_msg.attacker_msg) { if (msg->die_msg.attacker_msg) {
send_to_char(ch, CCYEL(ch, C_CMP)); send_to_char(ch, CCYEL(ch, C_CMP));
act(msg->die_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); act(msg->die_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);
send_to_char(ch, CCNRM(ch, C_CMP)); send_to_char(ch, CCNRM(ch, C_CMP));
} }
send_to_char(vict, CCRED(vict, C_CMP)); send_to_char(vict, CCRED(vict, C_CMP));
act(msg->die_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); act(msg->die_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP);
send_to_char(vict, CCNRM(vict, C_CMP)); send_to_char(vict, CCNRM(vict, C_CMP));
act(msg->die_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); act(msg->die_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT);
} else { } else {
if (msg->hit_msg.attacker_msg) { if (msg->hit_msg.attacker_msg) {
send_to_char(ch, CCYEL(ch, C_CMP)); send_to_char(ch, CCYEL(ch, C_CMP));
act(msg->hit_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); act(msg->hit_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);
send_to_char(ch, CCNRM(ch, C_CMP)); send_to_char(ch, CCNRM(ch, C_CMP));
} }
send_to_char(vict, CCRED(vict, C_CMP)); send_to_char(vict, CCRED(vict, C_CMP));
act(msg->hit_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); act(msg->hit_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP);
send_to_char(vict, CCNRM(vict, C_CMP)); send_to_char(vict, CCNRM(vict, C_CMP));
act(msg->hit_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); act(msg->hit_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT);
} }
} else if (ch != vict) { /* Dam == 0 */ } else if (ch != vict) { /* Dam == 0 */
if (msg->miss_msg.attacker_msg) { if (msg->miss_msg.attacker_msg) {
send_to_char(ch, CCYEL(ch, C_CMP)); send_to_char(ch, CCYEL(ch, C_CMP));
act(msg->miss_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR); act(msg->miss_msg.attacker_msg, FALSE, ch, weap, vict, TO_CHAR);
send_to_char(ch, CCNRM(ch, C_CMP)); send_to_char(ch, CCNRM(ch, C_CMP));
} }
send_to_char(vict, CCRED(vict, C_CMP)); send_to_char(vict, CCRED(vict, C_CMP));
act(msg->miss_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP); act(msg->miss_msg.victim_msg, FALSE, ch, weap, vict, TO_VICT | TO_SLEEP);
send_to_char(vict, CCNRM(vict, C_CMP)); send_to_char(vict, CCNRM(vict, C_CMP));
act(msg->miss_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT); act(msg->miss_msg.room_msg, FALSE, ch, weap, vict, TO_NOTVICT);
} }
return (1); return (1);
} }
@ -700,7 +700,7 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
} }
/* You can't damage an immortal! */ /* You can't damage an immortal! */
if (!IS_NPC(victim) && (IS_ADMIN(victim, ADMLVL_IMPL) || ADM_FLAGGED(victim, ADM_NODAMAGE)) ) if (!IS_NPC(victim) && ((GET_LEVEL(victim) >= LVL_IMMORT) && PRF_FLAGGED(victim, PRF_NOHASSLE)))
dam = 0; dam = 0;
if (victim != ch) { if (victim != ch) {
@ -712,7 +712,7 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
if (GET_POS(victim) > POS_STUNNED && (FIGHTING(victim) == NULL)) { if (GET_POS(victim) > POS_STUNNED && (FIGHTING(victim) == NULL)) {
set_fighting(victim, ch); set_fighting(victim, ch);
if (MOB_FLAGGED(victim, MOB_MEMORY) && !IS_NPC(ch)) if (MOB_FLAGGED(victim, MOB_MEMORY) && !IS_NPC(ch))
remember(victim, ch); remember(victim, ch);
} }
} }
@ -792,7 +792,7 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
send_to_char(victim, "%sYou wish that your wounds would stop BLEEDING so much!%s\r\n", send_to_char(victim, "%sYou wish that your wounds would stop BLEEDING so much!%s\r\n",
CCRED(victim, C_SPR), CCNRM(victim, C_SPR)); CCRED(victim, C_SPR), CCNRM(victim, C_SPR));
if (ch != victim && MOB_FLAGGED(victim, MOB_WIMPY)) if (ch != victim && MOB_FLAGGED(victim, MOB_WIMPY))
do_flee(victim, NULL, 0, 0); do_flee(victim, NULL, 0, 0);
} }
if (!IS_NPC(victim) && GET_WIMP_LEV(victim) && (victim != ch) && if (!IS_NPC(victim) && GET_WIMP_LEV(victim) && (victim != ch) &&
GET_HIT(victim) < GET_WIMP_LEV(victim) && GET_HIT(victim) > 0) { GET_HIT(victim) < GET_WIMP_LEV(victim) && GET_HIT(victim) > 0) {
@ -821,15 +821,15 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
if (GET_POS(victim) == POS_DEAD) { if (GET_POS(victim) == POS_DEAD) {
if (ch != victim && (IS_NPC(victim) || victim->desc)) { if (ch != victim && (IS_NPC(victim) || victim->desc)) {
if (AFF_FLAGGED(ch, AFF_GROUP)) if (AFF_FLAGGED(ch, AFF_GROUP))
group_gain(ch, victim); group_gain(ch, victim);
else else
solo_gain(ch, victim); solo_gain(ch, victim);
} }
if (!IS_NPC(victim)) { if (!IS_NPC(victim)) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name); mudlog(BRF, LVL_IMMORT, TRUE, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch), world[IN_ROOM(victim)].name);
if (MOB_FLAGGED(ch, MOB_MEMORY)) if (MOB_FLAGGED(ch, MOB_MEMORY))
forget(ch, victim); forget(ch, victim);
} }
/* Cant determine GET_GOLD on corpse, so do now and store */ /* Cant determine GET_GOLD on corpse, so do now and store */
if (IS_NPC(victim)) { if (IS_NPC(victim)) {
@ -949,9 +949,9 @@ void hit(struct char_data *ch, struct char_data *victim, int type)
} else { } else {
/* If no weapon, add bare hand damage instead */ /* If no weapon, add bare hand damage instead */
if (IS_NPC(ch)) if (IS_NPC(ch))
dam += dice(ch->mob_specials.damnodice, ch->mob_specials.damsizedice); dam += dice(ch->mob_specials.damnodice, ch->mob_specials.damsizedice);
else else
dam += rand_number(0, 2); /* Max 2 bare hand damage for players */ dam += rand_number(0, 2); /* Max 2 bare hand damage for players */
} }
/* Include a damage multiplier if victim isn't ready to fight: /* Include a damage multiplier if victim isn't ready to fight:
@ -995,13 +995,13 @@ void perform_violence(void)
if (IS_NPC(ch)) { if (IS_NPC(ch)) {
if (GET_MOB_WAIT(ch) > 0) { if (GET_MOB_WAIT(ch) > 0) {
GET_MOB_WAIT(ch) -= PULSE_VIOLENCE; GET_MOB_WAIT(ch) -= PULSE_VIOLENCE;
continue; continue;
} }
GET_MOB_WAIT(ch) = 0; GET_MOB_WAIT(ch) = 0;
if (GET_POS(ch) < POS_FIGHTING) { if (GET_POS(ch) < POS_FIGHTING) {
GET_POS(ch) = POS_FIGHTING; GET_POS(ch) = POS_FIGHTING;
act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM); act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM);
} }
} }

View file

@ -269,7 +269,7 @@ int save_mobiles(zone_rnum rznum)
vznum = zone_table[rznum].number; vznum = zone_table[rznum].number;
snprintf(mobfname, sizeof(mobfname), "%s%d.new", MOB_PREFIX, vznum); snprintf(mobfname, sizeof(mobfname), "%s%d.new", MOB_PREFIX, vznum);
if ((mobfd = fopen(mobfname, "w")) == NULL) { if ((mobfd = fopen(mobfname, "w")) == NULL) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: GenOLC: Cannot open mob file for writing."); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: GenOLC: Cannot open mob file for writing.");
return FALSE; return FALSE;
} }
@ -392,7 +392,7 @@ void check_mobile_string(mob_vnum i, char **string, const char *desc)
if (*string == NULL || **string == '\0') { if (*string == NULL || **string == '\0') {
char smbuf[128]; char smbuf[128];
sprintf(smbuf, "GenOLC: Mob #%d has an invalid %s.", i, desc); sprintf(smbuf, "GenOLC: Mob #%d has an invalid %s.", i, desc);
mudlog(BRF, ADMLVL_GOD, TRUE, "%s", smbuf); mudlog(BRF, LVL_GOD, TRUE, "%s", smbuf);
if (*string) if (*string)
free(*string); free(*string);
*string = strdup("An undefined string.\n"); *string = strdup("An undefined string.\n");

View file

@ -196,7 +196,7 @@ int save_objects(zone_rnum zone_num)
snprintf(filename, sizeof(filename), "%s/%d.new", OBJ_PREFIX, zone_table[zone_num].number); snprintf(filename, sizeof(filename), "%s/%d.new", OBJ_PREFIX, zone_table[zone_num].number);
if (!(fp = fopen(filename, "w+"))) { if (!(fp = fopen(filename, "w+"))) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: OLC: Cannot open objects file %s!", filename); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: OLC: Cannot open objects file %s!", filename);
return FALSE; return FALSE;
} }
/* Start running through all objects in this zone. */ /* Start running through all objects in this zone. */
@ -256,7 +256,7 @@ int save_objects(zone_rnum zone_num)
for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) { for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
/* Sanity check to prevent nasty protection faults. */ /* Sanity check to prevent nasty protection faults. */
if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) { if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: OLC: oedit_save_to_disk: Corrupt ex_desc!"); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: OLC: oedit_save_to_disk: Corrupt ex_desc!");
continue; continue;
} }
strncpy(buf, ex_desc->description, sizeof(buf) - 1); strncpy(buf, ex_desc->description, sizeof(buf) - 1);

View file

@ -277,111 +277,111 @@ int sprintascii(char *out, bitvector_t bits)
return j; return j;
} }
/* converts illegal filename chars into appropriate equivalents */ /* converts illegal filename chars into appropriate equivalents */
char *fix_filename(char *str) char *fix_filename(char *str)
{ {
static char good_file_name[MAX_STRING_LENGTH]; static char good_file_name[MAX_STRING_LENGTH];
char *cindex = good_file_name; char *cindex = good_file_name;
while(*str) { while(*str) {
switch(*str) { switch(*str) {
case ' ': *cindex = '_'; cindex++; break; case ' ': *cindex = '_'; cindex++; break;
case '(': *cindex = '{'; cindex++; break; case '(': *cindex = '{'; cindex++; break;
case ')': *cindex = '}'; cindex++; break; case ')': *cindex = '}'; cindex++; break;
/* skip the following */ /* skip the following */
case '\'': break; case '\'': break;
case '"': break; case '"': break;
/* Legal character */ /* Legal character */
default: *cindex = *str; cindex++;break; default: *cindex = *str; cindex++;break;
} }
str++; str++;
} }
*cindex = '\0'; *cindex = '\0';
return good_file_name; return good_file_name;
} }
/* Export command by Kyle */ /* Export command by Kyle */
ACMD(do_export_zone) ACMD(do_export_zone)
{ {
zone_rnum zrnum; zone_rnum zrnum;
zone_vnum zvnum; zone_vnum zvnum;
char sysbuf[MAX_INPUT_LENGTH]; char sysbuf[MAX_INPUT_LENGTH];
char zone_name[MAX_INPUT_LENGTH], *f; char zone_name[MAX_INPUT_LENGTH], *f;
int success, i; int success, i;
/* system command locations are relative to /* system command locations are relative to
* where the binary IS, not where it was run * where the binary IS, not where it was run
* from, thus we act like we are in the bin * from, thus we act like we are in the bin
* folder, because we are*/ * folder, because we are*/
char *path = "../lib/world/export/"; char *path = "../lib/world/export/";
if (!IS_ADMIN(ch, ADMLVL_IMPL)) if (IS_NPC(ch) || GET_LEVEL(ch) < LVL_IMPL)
return; return;
skip_spaces(&argument); skip_spaces(&argument);
if (!*argument){ if (!*argument){
send_to_char(ch, "Syntax: export <zone vnum>"); send_to_char(ch, "Syntax: export <zone vnum>");
return; return;
}
zvnum = atoi(argument);
zrnum = real_zone(zvnum);
if (zrnum == NOWHERE) {
send_to_char(ch, "Export which zone?\r\n");
return;
}
/* If we fail, it might just be because the
* directory didn't exist. Can't hurt to try
* again. Do it silently though ( no logs ). */
if (!export_info_file(zrnum)) {
sprintf(sysbuf, "mkdir %s", path);
i = system(sysbuf);
}
if (!(success = export_info_file(zrnum)))
send_to_char(ch, "Info file not saved!\r\n");
if (!(success = export_save_shops(zrnum)))
send_to_char(ch, "Shops not saved!\r\n");
if (!(success = export_save_mobiles(zrnum)))
send_to_char(ch, "Mobiles not saved!\r\n");
if (!(success = export_save_objects(zrnum)))
send_to_char(ch, "Objects not saved!\r\n");
if (!(success = export_save_zone(zrnum)))
send_to_char(ch, "Zone info not saved!\r\n");
if (!(success = export_save_rooms(zrnum)))
send_to_char(ch, "Rooms not saved!\r\n");
if (!(success = export_save_triggers(zrnum)))
send_to_char(ch, "Triggers not saved!\r\n");
/* If anything went wrong, don't try to tar the files. */
if (success) {
send_to_char(ch, "Individual files saved to /lib/world/export.\r\n");
snprintf(zone_name, sizeof(zone_name), "%s", zone_table[zrnum].name);
} else {
send_to_char(ch, "Ran into problems writing to files.\r\n");
return;
} }
/* Make sure the name of the zone doesn't make the filename illegal. */
f = fix_filename(zone_name);
zvnum = atoi(argument); /* Remove the old copy. */
zrnum = real_zone(zvnum); sprintf(sysbuf, "rm %s%s.tar.gz", path, f);
i = system(sysbuf);
if (zrnum == NOWHERE) { /* Tar the new copy. */
send_to_char(ch, "Export which zone?\r\n");
return;
}
/* If we fail, it might just be because the
* directory didn't exist. Can't hurt to try
* again. Do it silently though ( no logs ). */
if (!export_info_file(zrnum)) {
sprintf(sysbuf, "mkdir %s", path);
i = system(sysbuf);
}
if (!(success = export_info_file(zrnum)))
send_to_char(ch, "Info file not saved!\r\n");
if (!(success = export_save_shops(zrnum)))
send_to_char(ch, "Shops not saved!\r\n");
if (!(success = export_save_mobiles(zrnum)))
send_to_char(ch, "Mobiles not saved!\r\n");
if (!(success = export_save_objects(zrnum)))
send_to_char(ch, "Objects not saved!\r\n");
if (!(success = export_save_zone(zrnum)))
send_to_char(ch, "Zone info not saved!\r\n");
if (!(success = export_save_rooms(zrnum)))
send_to_char(ch, "Rooms not saved!\r\n");
if (!(success = export_save_triggers(zrnum)))
send_to_char(ch, "Triggers not saved!\r\n");
/* If anything went wrong, don't try to tar the files. */
if (success) {
send_to_char(ch, "Individual files saved to /lib/world/export.\r\n");
snprintf(zone_name, sizeof(zone_name), "%s", zone_table[zrnum].name);
} else {
send_to_char(ch, "Ran into problems writing to files.\r\n");
return;
}
/* Make sure the name of the zone doesn't make the filename illegal. */
f = fix_filename(zone_name);
/* Remove the old copy. */
sprintf(sysbuf, "rm %s%s.tar.gz", path, f);
i = system(sysbuf);
/* Tar the new copy. */
sprintf(sysbuf, "tar -cf %s%s.tar %sqq.info %sqq.wld %sqq.zon %sqq.mob %sqq.obj %sqq.trg %sqq.shp", path, f, path, path, path, path, path, path, path); sprintf(sysbuf, "tar -cf %s%s.tar %sqq.info %sqq.wld %sqq.zon %sqq.mob %sqq.obj %sqq.trg %sqq.shp", path, f, path, path, path, path, path, path, path);
i = system(sysbuf); i = system(sysbuf);
/* Gzip it. */ /* Gzip it. */
sprintf(sysbuf, "gzip %s%s.tar", path, f); sprintf(sysbuf, "gzip %s%s.tar", path, f);
i = system(sysbuf); i = system(sysbuf);
send_to_char(ch, "Files tar'ed to \"%s%s.tar.gz\"\r\n", path, f); send_to_char(ch, "Files tar'ed to \"%s%s.tar.gz\"\r\n", path, f);
} }
static int export_info_file(zone_rnum zrnum) static int export_info_file(zone_rnum zrnum)
@ -390,10 +390,10 @@ static int export_info_file(zone_rnum zrnum)
FILE *info_file; FILE *info_file;
if (!(info_file = fopen("world/export/qq.info", "w"))) { if (!(info_file = fopen("world/export/qq.info", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_info_file : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_info_file : Cannot open file!");
return FALSE; return FALSE;
} else if (fprintf(info_file, "tbaMUD Area file.\n") < 0) { } else if (fprintf(info_file, "tbaMUD Area file.\n") < 0) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_info_file: Cannot write to file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_info_file: Cannot write to file!");
fclose(info_file); fclose(info_file);
return FALSE; return FALSE;
} }
@ -463,10 +463,10 @@ static int export_save_shops(zone_rnum zrnum)
struct shop_data *shop; struct shop_data *shop;
if (!(shop_file = fopen("world/export/qq.shp", "w"))) { if (!(shop_file = fopen("world/export/qq.shp", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_shops : Cannot open shop file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_shops : Cannot open shop file!");
return FALSE; return FALSE;
} else if (fprintf(shop_file, "CircleMUD v3.0 Shop File~\n") < 0) { } else if (fprintf(shop_file, "CircleMUD v3.0 Shop File~\n") < 0) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_shops: Cannot write to shop file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_shops: Cannot write to shop file!");
fclose(shop_file); fclose(shop_file);
return FALSE; return FALSE;
} }
@ -553,7 +553,7 @@ static int export_save_mobiles(zone_rnum rznum)
mob_rnum rmob; mob_rnum rmob;
if (!(mob_file = fopen("world/export/qq.mob", "w"))) { if (!(mob_file = fopen("world/export/qq.mob", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_mobiles : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_mobiles : Cannot open file!");
return FALSE; return FALSE;
} }
@ -624,7 +624,7 @@ static int export_save_zone(zone_rnum zrnum)
FILE *zone_file; FILE *zone_file;
if (!(zone_file = fopen("world/export/qq.zon", "w"))) { if (!(zone_file = fopen("world/export/qq.zon", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_zone : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_zone : Cannot open file!");
return FALSE; return FALSE;
} }
@ -735,7 +735,7 @@ static int export_save_zone(zone_rnum zrnum)
/* Invalid commands are replaced with '*' - Ignore them. */ /* Invalid commands are replaced with '*' - Ignore them. */
continue; continue;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: export_save_zone(): Unknown cmd '%c' - NOT saving", ZCMD(zrnum, subcmd).command); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: export_save_zone(): Unknown cmd '%c' - NOT saving", ZCMD(zrnum, subcmd).command);
continue; continue;
} }
} }
@ -759,7 +759,7 @@ static int export_save_objects(zone_rnum zrnum)
struct extra_descr_data *ex_desc; struct extra_descr_data *ex_desc;
if (!(obj_file = fopen("world/export/qq.obj", "w"))) { if (!(obj_file = fopen("world/export/qq.obj", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_objects : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_objects : Cannot open file!");
return FALSE; return FALSE;
} }
/* Start running through all objects in this zone. */ /* Start running through all objects in this zone. */
@ -829,7 +829,7 @@ static int export_save_objects(zone_rnum zrnum)
for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) { for (ex_desc = obj->ex_description; ex_desc; ex_desc = ex_desc->next) {
/* Sanity check to prevent nasty protection faults. */ /* Sanity check to prevent nasty protection faults. */
if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) { if (!ex_desc->keyword || !ex_desc->description || !*ex_desc->keyword || !*ex_desc->description) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: OLC: export_save_objects: Corrupt ex_desc!"); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: OLC: export_save_objects: Corrupt ex_desc!");
continue; continue;
} }
strncpy(buf, ex_desc->description, sizeof(buf) - 1); strncpy(buf, ex_desc->description, sizeof(buf) - 1);
@ -865,7 +865,7 @@ static int export_save_rooms(zone_rnum zrnum)
char buf1[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH];
if (!(room_file = fopen("world/export/qq.wld", "w"))) { if (!(room_file = fopen("world/export/qq.wld", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_rooms : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_rooms : Cannot open file!");
return FALSE; return FALSE;
} }
@ -1003,7 +1003,7 @@ static int export_save_triggers(zone_rnum zrnum)
char bitBuf[MAX_INPUT_LENGTH]; char bitBuf[MAX_INPUT_LENGTH];
if (!(trig_file = fopen("world/export/qq.trg", "w"))) { if (!(trig_file = fopen("world/export/qq.trg", "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: export_save_triggers : Cannot open file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: export_save_triggers : Cannot open file!");
return FALSE; return FALSE;
} }

View file

@ -111,14 +111,14 @@ int add_quest(struct aq_data *nqst)
if (qmrnum != NOBODY && mob_index[qmrnum].func && if (qmrnum != NOBODY && mob_index[qmrnum].func &&
mob_index[qmrnum].func != questmaster) mob_index[qmrnum].func != questmaster)
QST_FUNC(rnum) = mob_index[qmrnum].func; QST_FUNC(rnum) = mob_index[qmrnum].func;
if(qmrnum != NOBODY) if(qmrnum != NOBODY)
mob_index[qmrnum].func = questmaster; mob_index[qmrnum].func = questmaster;
/* And make sure we save the updated quest information to disk */ /* And make sure we save the updated quest information to disk */
if (rznum != NOWHERE) if (rznum != NOWHERE)
add_to_save_list(zone_table[rznum].number, SL_QST); add_to_save_list(zone_table[rznum].number, SL_QST);
else else
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: GenOLC: Cannot determine quest zone."); "SYSERR: GenOLC: Cannot determine quest zone.");
return rnum; return rnum;
@ -136,7 +136,7 @@ int delete_quest(qst_rnum rnum)
if (rnum >= total_quests) if (rnum >= total_quests)
return FALSE; return FALSE;
rznum = real_zone_by_thing(QST_NUM(rnum)); rznum = real_zone_by_thing(QST_NUM(rnum));
log("GenOLC: delete_quest: Deleting quest #%d (%s).", log("GenOLC: delete_quest: Deleting quest #%d (%s).",
QST_NUM(rnum), QST_NAME(rnum)); QST_NUM(rnum), QST_NAME(rnum));
/* make a note of the quest master's secondary spec proc */ /* make a note of the quest master's secondary spec proc */
@ -152,12 +152,12 @@ int delete_quest(qst_rnum rnum)
RECREATE(aquest_table, struct aq_data, total_quests); RECREATE(aquest_table, struct aq_data, total_quests);
else { else {
free(aquest_table); free(aquest_table);
aquest_table = NULL; aquest_table = NULL;
} }
if (rznum != NOWHERE) if (rznum != NOWHERE)
add_to_save_list(zone_table[rznum].number, SL_QST); add_to_save_list(zone_table[rznum].number, SL_QST);
else else
mudlog(BRF, ADMLVL_BUILDER, TRUE, mudlog(BRF, LVL_BUILDER, TRUE,
"SYSERR: GenOLC: Cannot determine quest zone."); "SYSERR: GenOLC: Cannot determine quest zone.");
/* does the questmaster mob have any quests left? */ /* does the questmaster mob have any quests left? */
if (qm != NOBODY) { if (qm != NOBODY) {

View file

@ -302,7 +302,7 @@ int add_shop(struct shop_data *nshp)
if (rznum != NOWHERE) if (rznum != NOWHERE)
add_to_save_list(zone_table[rznum].number, SL_SHP); add_to_save_list(zone_table[rznum].number, SL_SHP);
else else
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: GenOLC: Cannot determine shop zone."); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: GenOLC: Cannot determine shop zone.");
return rshop; return rshop;
} }
@ -336,7 +336,7 @@ int add_shop(struct shop_data *nshp)
if (rznum != NOWHERE) if (rznum != NOWHERE)
add_to_save_list(zone_table[rznum].number, SL_SHP); add_to_save_list(zone_table[rznum].number, SL_SHP);
else else
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: GenOLC: Cannot determine shop zone."); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: GenOLC: Cannot determine shop zone.");
return rshop; return rshop;
} }
@ -359,10 +359,10 @@ int save_shops(zone_rnum zone_num)
snprintf(fname, sizeof(fname), "%s/%d.new", SHP_PREFIX, zone_table[zone_num].number); snprintf(fname, sizeof(fname), "%s/%d.new", SHP_PREFIX, zone_table[zone_num].number);
if (!(shop_file = fopen(fname, "w"))) { if (!(shop_file = fopen(fname, "w"))) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: OLC: Cannot open shop file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: OLC: Cannot open shop file!");
return FALSE; return FALSE;
} else if (fprintf(shop_file, "CircleMUD v3.0 Shop File~\n") < 0) { } else if (fprintf(shop_file, "CircleMUD v3.0 Shop File~\n") < 0) {
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: OLC: Cannot write to shop file!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: OLC: Cannot write to shop file!");
fclose(shop_file); fclose(shop_file);
return FALSE; return FALSE;
} }

View file

@ -19,7 +19,7 @@
#include "dg_olc.h" #include "dg_olc.h"
/* This function will copy the strings so be sure you free your own copies of /* This function will copy the strings so be sure you free your own copies of
* the description, title, and such. */ * the description, title, and such. */
room_rnum add_room(struct room_data *room) room_rnum add_room(struct room_data *room)
{ {
@ -95,7 +95,7 @@ room_rnum add_room(struct room_data *room)
/* Known zone entries we don't care about. */ /* Known zone entries we don't care about. */
break; break;
default: default:
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: GenOLC: add_room: Unknown zone entry found!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: GenOLC: add_room: Unknown zone entry found!");
} }
/* Update the loadroom table. Adds 1 or 0. */ /* Update the loadroom table. Adds 1 or 0. */
@ -149,7 +149,7 @@ int delete_room(room_rnum rnum)
r_frozen_start_room = 0; /* The Void */ r_frozen_start_room = 0; /* The Void */
} }
/* Dump the contents of this room into the Void. We could also just extract /* Dump the contents of this room into the Void. We could also just extract
* the people, mobs, and objects here. */ * the people, mobs, and objects here. */
for (obj = world[rnum].contents; obj; obj = next_obj) { for (obj = world[rnum].contents; obj; obj = next_obj) {
next_obj = obj->next_content; next_obj = obj->next_content;
@ -167,12 +167,12 @@ int delete_room(room_rnum rnum)
extract_script(room, WLD_TRIGGER); extract_script(room, WLD_TRIGGER);
free_proto_script(room, WLD_TRIGGER); free_proto_script(room, WLD_TRIGGER);
/* Change any exit going to this room to go the void. Also fix all the exits /* Change any exit going to this room to go the void. Also fix all the exits
* pointing to rooms above this. */ * pointing to rooms above this. */
i = top_of_world + 1; i = top_of_world + 1;
do { do {
i--; i--;
for (j = 0; j < NUM_OF_DIRS; j++) { /* NUM_OF_DIRS, not DIR_COUNT */ for (j = 0; j < DIR_COUNT; j++) {
if (W_EXIT(i, j) == NULL) if (W_EXIT(i, j) == NULL)
continue; continue;
else if (W_EXIT(i, j)->to_room > rnum) else if (W_EXIT(i, j)->to_room > rnum)
@ -221,7 +221,7 @@ int delete_room(room_rnum rnum)
/* Known zone entries we don't care about. */ /* Known zone entries we don't care about. */
break; break;
default: default:
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: GenOLC: delete_room: Unknown zone entry found!"); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: GenOLC: delete_room: Unknown zone entry found!");
} }
/* Remove this room from all shop lists. */ /* Remove this room from all shop lists. */
@ -296,8 +296,8 @@ int save_rooms(zone_rnum rzone)
room->number, room->number,
room->name ? room->name : "Untitled", STRING_TERMINATOR, room->name ? room->name : "Untitled", STRING_TERMINATOR,
buf, STRING_TERMINATOR, buf, STRING_TERMINATOR,
zone_table[room->zone].number, room->room_flags[0], room->room_flags[1], room->room_flags[2], zone_table[room->zone].number, room->room_flags[0], room->room_flags[1], room->room_flags[2],
room->room_flags[3], room->sector_type room->room_flags[3], room->sector_type
); );
/* Now you write out the exits for the room. */ /* Now you write out the exits for the room. */
@ -316,9 +316,10 @@ int save_rooms(zone_rnum rzone)
dflag = 2; dflag = 2;
else else
dflag = 1; dflag = 1;
if (IS_SET(R_EXIT(room, j)->exit_info, EX_HIDDEN)) if (IS_SET(R_EXIT(room, j)->exit_info, EX_HIDDEN))
dflag += 2; dflag += 2;
} else } else
dflag = 0; dflag = 0;
@ -382,8 +383,8 @@ int copy_room(struct room_data *to, struct room_data *from)
return TRUE; return TRUE;
} }
/* Copy strings over so bad things don't happen. We do not free the existing /* Copy strings over so bad things don't happen. We do not free the existing
* strings here because copy_room() did a shallow copy previously and we'd be * strings here because copy_room() did a shallow copy previously and we'd be
* freeing the very strings we're copying. If this function is used elsewhere, * freeing the very strings we're copying. If this function is used elsewhere,
* be sure to free_room_strings() the 'dest' room first. */ * be sure to free_room_strings() the 'dest' room first. */
int copy_room_strings(struct room_data *dest, struct room_data *source) int copy_room_strings(struct room_data *dest, struct room_data *source)
@ -429,7 +430,7 @@ int free_room_strings(struct room_data *room)
free_ex_descriptions(room->ex_description); free_ex_descriptions(room->ex_description);
/* Free exits. */ /* Free exits. */
for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */ for (i = 0; i < DIR_COUNT; i++) {
if (room->dir_option[i]) { if (room->dir_option[i]) {
if (room->dir_option[i]->general_description) if (room->dir_option[i]->general_description)
free(room->dir_option[i]->general_description); free(room->dir_option[i]->general_description);

View file

@ -85,7 +85,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the zone file. */ /* Create the zone file. */
snprintf(buf, sizeof(buf), "%s/%d.zon", ZON_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.zon", ZON_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new zone file."); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new zone file.");
*error = "Could not write zone file.\r\n"; *error = "Could not write zone file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -95,7 +95,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the room file. */ /* Create the room file. */
snprintf(buf, sizeof(buf), "%s/%d.wld", WLD_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.wld", WLD_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new world file."); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new world file.");
*error = "Could not write world file.\r\n"; *error = "Could not write world file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -105,7 +105,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the mobile file. */ /* Create the mobile file. */
snprintf(buf, sizeof(buf), "%s/%d.mob", MOB_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.mob", MOB_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new mob file."); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new mob file.");
*error = "Could not write mobile file.\r\n"; *error = "Could not write mobile file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -115,7 +115,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the object file. */ /* Create the object file. */
snprintf(buf, sizeof(buf), "%s/%d.obj", OBJ_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.obj", OBJ_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new obj file."); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new obj file.");
*error = "Could not write object file.\r\n"; *error = "Could not write object file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -125,7 +125,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the shop file. */ /* Create the shop file. */
snprintf(buf, sizeof(buf), "%s/%d.shp", SHP_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.shp", SHP_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new shop file."); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new shop file.");
*error = "Could not write shop file.\r\n"; *error = "Could not write shop file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -135,7 +135,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the quests file */ /* Create the quests file */
snprintf(buf, sizeof(buf), "%s/%d.qst", QST_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.qst", QST_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new quest file"); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new quest file");
*error = "Could not write quest file.\r\n"; *error = "Could not write quest file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -145,7 +145,7 @@ zone_rnum create_new_zone(zone_vnum vzone_num, room_vnum bottom, room_vnum top,
/* Create the trigger file. */ /* Create the trigger file. */
snprintf(buf, sizeof(buf), "%s/%d.trg", TRG_PREFIX, vzone_num); snprintf(buf, sizeof(buf), "%s/%d.trg", TRG_PREFIX, vzone_num);
if (!(fp = fopen(buf, "w"))) { if (!(fp = fopen(buf, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Can't write new trigger file"); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Can't write new trigger file");
*error = "Could not write trigger file.\r\n"; *error = "Could not write trigger file.\r\n";
return NOWHERE; return NOWHERE;
} }
@ -248,10 +248,10 @@ void create_world_index(int znum, const char *type)
snprintf(new_name, sizeof(new_name), "%s/newindex", prefix); snprintf(new_name, sizeof(new_name), "%s/newindex", prefix);
if (!(oldfile = fopen(old_name, "r"))) { if (!(oldfile = fopen(old_name, "r"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Failed to open %s.", old_name); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Failed to open %s.", old_name);
return; return;
} else if (!(newfile = fopen(new_name, "w"))) { } else if (!(newfile = fopen(new_name, "w"))) {
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: OLC: Failed to open %s.", new_name); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: OLC: Failed to open %s.", new_name);
fclose(oldfile); fclose(oldfile);
return; return;
} }
@ -338,7 +338,7 @@ int save_zone(zone_rnum zone_num)
snprintf(fname, sizeof(fname), "%s/%d.new", ZON_PREFIX, zone_table[zone_num].number); snprintf(fname, sizeof(fname), "%s/%d.new", ZON_PREFIX, zone_table[zone_num].number);
if (!(zfile = fopen(fname, "w"))) { if (!(zfile = fopen(fname, "w"))) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: save_zones: Can't write zone %d.", zone_table[zone_num].number); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: save_zones: Can't write zone %d.", zone_table[zone_num].number);
return FALSE; return FALSE;
} }
@ -463,7 +463,7 @@ int save_zone(zone_rnum zone_num)
/* Invalid commands are replaced with '*' - Ignore them. */ /* Invalid commands are replaced with '*' - Ignore them. */
continue; continue;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: z_save_to_disk(): Unknown cmd '%c' - NOT saving", ZCMD(zone_num, subcmd).command); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: z_save_to_disk(): Unknown cmd '%c' - NOT saving", ZCMD(zone_num, subcmd).command);
continue; continue;
} }
if (ZCMD(zone_num, subcmd).command != 'V') if (ZCMD(zone_num, subcmd).command != 'V')

View file

@ -89,8 +89,8 @@ static void bfs_clear_queue(void)
bfs_dequeue(); bfs_dequeue();
} }
/* find_first_step: given a source room and a target room, find the first step /* find_first_step: given a source room and a target room, find the first step
* on the shortest path from the source to the target. Intended usage: in * on the shortest path from the source to the target. Intended usage: in
* mobile_activity, give a mob a dir to go if they're tracking another mob or a * mobile_activity, give a mob a dir to go if they're tracking another mob or a
* PC. Or, a 'track' skill for PCs. */ * PC. Or, a 'track' skill for PCs. */
static int find_first_step(room_rnum src, room_rnum target) static int find_first_step(room_rnum src, room_rnum target)

View file

@ -22,7 +22,6 @@
#include "class.h" #include "class.h"
#include "fight.h" #include "fight.h"
#include "quest.h" #include "quest.h"
#include "mail.h"
/* local file scope variables */ /* local file scope variables */
static int extractions_pending = 0; static int extractions_pending = 0;
@ -255,7 +254,7 @@ void affect_total(struct char_data *ch)
affect_modify_ar(ch, af->location, af->modifier, af->bitvector, TRUE); affect_modify_ar(ch, af->location, af->modifier, af->bitvector, TRUE);
/* Make certain values are between 0..25, not < 0 and not > 25! */ /* Make certain values are between 0..25, not < 0 and not > 25! */
i = (IS_NPC(ch) || IS_ADMIN(ch, ADMLVL_GRGOD)) ? 25 : 18; i = (IS_NPC(ch) || GET_LEVEL(ch) >= LVL_GRGOD) ? 25 : 18;
GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i)); GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i));
GET_INT(ch) = MAX(0, MIN(GET_INT(ch), i)); GET_INT(ch) = MAX(0, MIN(GET_INT(ch), i));
@ -766,37 +765,6 @@ void obj_from_obj(struct obj_data *obj)
obj->next_content = NULL; obj->next_content = NULL;
} }
/* Attach an object into a mudmail */
void obj_to_mail(struct obj_data *object, struct mail_data *mail)
{
if (!object || !mail)
log("SYSERR: Illegal value(s) passed to obj_to_mail. (Mail ID %ld, obj %p)", mail ? mail->mail_id : 0, object);
else {
object->next_content = mail->attachment;
mail->attachment = object;
IN_MAIL(object) = mail;
IN_ROOM(object) = NOWHERE;
object->carried_by = NULL;
}
}
/* Take an object from a mudmail */
void obj_from_mail(struct obj_data *object)
{
struct obj_data *temp;
if (!object || IN_ROOM(object) != NOWHERE || object->carried_by) {
log("SYSERR: NULL object (%p) or obj not attached to a mail passed to obj_from_mail", object);
return;
}
REMOVE_FROM_LIST(object, (IN_MAIL(object))->attachment, next_content);
IN_MAIL(object) = NULL;
IN_ROOM(object) = NOWHERE;
object->next_content = NULL;
}
/* Set all carried_by to point to new owner */ /* Set all carried_by to point to new owner */
void object_list_new_owner(struct obj_data *list, struct char_data *ch) void object_list_new_owner(struct obj_data *list, struct char_data *ch)
{ {

View file

@ -1,13 +1,13 @@
/** /**
* @file handler.h * @file handler.h
* Prototypes of handling and utility functions. * Prototypes of handling and utility functions.
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
* All rights reserved. See license for complete information. * All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
*/ */
#ifndef _HANDLER_H_ #ifndef _HANDLER_H_
#define _HANDLER_H_ #define _HANDLER_H_
@ -41,8 +41,6 @@ void obj_to_room(struct obj_data *object, room_rnum room);
void obj_from_room(struct obj_data *object); void obj_from_room(struct obj_data *object);
void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to); void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to);
void obj_from_obj(struct obj_data *obj); void obj_from_obj(struct obj_data *obj);
void obj_to_mail(struct obj_data *object, struct mail_data *mail);
void obj_from_mail(struct obj_data *object);
void object_list_new_owner(struct obj_data *list, struct char_data *ch); void object_list_new_owner(struct obj_data *list, struct char_data *ch);
void extract_obj(struct obj_data *obj); void extract_obj(struct obj_data *obj);

View file

@ -64,7 +64,7 @@ ACMD(do_oasis_hedit)
d = ch->desc; d = ch->desc;
if (!str_cmp("save", argument)) { if (!str_cmp("save", argument)) {
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves help files.", mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves help files.",
GET_NAME(ch)); GET_NAME(ch));
hedit_save_to_disk(d); hedit_save_to_disk(d);
send_to_char(ch, "Saving help files.\r\n"); send_to_char(ch, "Saving help files.\r\n");
@ -73,14 +73,14 @@ ACMD(do_oasis_hedit)
/* Give descriptor an OLC structure. */ /* Give descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
CREATE(d->olc, struct oasis_olc_data, 1); CREATE(d->olc, struct oasis_olc_data, 1);
OLC_NUM(d) = 0; OLC_NUM(d) = 0;
OLC_STORAGE(d) = strdup(arg); OLC_STORAGE(d) = strdup(arg);
OLC_ZNUM(d) = search_help(OLC_STORAGE(d), ADMLVL_IMPL); OLC_ZNUM(d) = search_help(OLC_STORAGE(d), LVL_IMPL);
if (OLC_ZNUM(d) == NOWHERE) { if (OLC_ZNUM(d) == NOWHERE) {
send_to_char(ch, "Do you wish to add the '%s' help file? ", OLC_STORAGE(d)); send_to_char(ch, "Do you wish to add the '%s' help file? ", OLC_STORAGE(d));
@ -93,7 +93,7 @@ ACMD(do_oasis_hedit)
STATE(d) = CON_HEDIT; STATE(d) = CON_HEDIT;
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character)); mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing help files.", GET_NAME(d->character));
} }
static void hedit_setup_new(struct descriptor_data *d) static void hedit_setup_new(struct descriptor_data *d)
@ -170,7 +170,7 @@ static void hedit_save_to_disk(struct descriptor_data *d)
remove_from_save_list(HEDIT_PERMISSION, SL_HLP); remove_from_save_list(HEDIT_PERMISSION, SL_HLP);
/* Reboot the help files. */ /* Reboot the help files. */
free_help_table(); free_help_table();
index_boot(DB_BOOT_HLP); index_boot(DB_BOOT_HLP);
} }
@ -206,7 +206,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
case 'Y': case 'Y':
snprintf(buf, sizeof(buf), "OLC: %s edits help for %s.", GET_NAME(d->character), snprintf(buf, sizeof(buf), "OLC: %s edits help for %s.", GET_NAME(d->character),
OLC_HELP(d)->keywords); OLC_HELP(d)->keywords);
mudlog(TRUE, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), CMP, "%s", buf); mudlog(TRUE, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), CMP, "%s", buf);
write_to_output(d, "Help saved to disk.\r\n"); write_to_output(d, "Help saved to disk.\r\n");
hedit_save_internally(d); hedit_save_internally(d);
@ -229,9 +229,9 @@ void hedit_parse(struct descriptor_data *d, char *arg)
case 'y': case 'Y': case 'y': case 'Y':
hedit_setup_existing(d, OLC_ZNUM(d)); hedit_setup_existing(d, OLC_ZNUM(d));
break; break;
case 'q': case 'Q': case 'q': case 'Q':
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
break; break;
case 'n': case 'N': case 'n': case 'N':
OLC_ZNUM(d)++; OLC_ZNUM(d)++;
for (; OLC_ZNUM(d) < top_of_helpt; OLC_ZNUM(d)++) for (; OLC_ZNUM(d) < top_of_helpt; OLC_ZNUM(d)++)
@ -248,7 +248,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
write_to_output(d, "Do you wish to edit the '%s' help file? ", write_to_output(d, "Do you wish to edit the '%s' help file? ",
help_table[OLC_ZNUM(d)].keywords); help_table[OLC_ZNUM(d)].keywords);
OLC_MODE(d) = HEDIT_CONFIRM_EDIT; OLC_MODE(d) = HEDIT_CONFIRM_EDIT;
} }
break; break;
default: default:
write_to_output(d, "Invalid choice!\r\n" write_to_output(d, "Invalid choice!\r\n"
@ -300,7 +300,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
OLC_VAL(d) = 1; OLC_VAL(d) = 1;
break; break;
case '2': case '2':
write_to_output(d, "Enter min admin level : "); write_to_output(d, "Enter min level : ");
OLC_MODE(d) = HEDIT_MIN_LEVEL; OLC_MODE(d) = HEDIT_MIN_LEVEL;
break; break;
default: default:
@ -321,13 +321,13 @@ void hedit_parse(struct descriptor_data *d, char *arg)
case HEDIT_ENTRY: case HEDIT_ENTRY:
/* We will NEVER get here, we hope. */ /* We will NEVER get here, we hope. */
mudlog(TRUE, ADMLVL_BUILDER, BRF, "SYSERR: Reached HEDIT_ENTRY case in parse_hedit"); mudlog(TRUE, LVL_BUILDER, BRF, "SYSERR: Reached HEDIT_ENTRY case in parse_hedit");
break; break;
case HEDIT_MIN_LEVEL: case HEDIT_MIN_LEVEL:
number = atoi(arg); number = atoi(arg);
if ((number < ADMLVL_MORTAL) || (number > ADMLVL_IMPL)) if ((number < 0) || (number > LVL_IMPL))
write_to_output(d, "That is not a valid choice!\r\nEnter min admin level:-\r\n] "); write_to_output(d, "That is not a valid choice!\r\nEnter min level:-\r\n] ");
else { else {
OLC_HELP(d)->min_level = number; OLC_HELP(d)->min_level = number;
break; break;
@ -336,7 +336,7 @@ void hedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here. */ /* We should never get here. */
mudlog(TRUE, ADMLVL_BUILDER, BRF, "SYSERR: Reached default case in parse_hedit"); mudlog(TRUE, LVL_BUILDER, BRF, "SYSERR: Reached default case in parse_hedit");
break; break;
} }
@ -361,10 +361,9 @@ ACMD(do_helpcheck)
int i, count = 0; int i, count = 0;
size_t len = 0, nlen; size_t len = 0, nlen;
for (i = 1; *(complete_cmd_info[i].command) != '\n'; i++) { for (i = 1; *(complete_cmd_info[i].command) != '\n'; i++) {
if (complete_cmd_info[i].command_pointer != do_action && complete_cmd_info[i].minimum_level >= 0) { if (complete_cmd_info[i].command_pointer != do_action && complete_cmd_info[i].minimum_level >= 0) {
if (search_help(complete_cmd_info[i].command, ADMLVL_IMPL) == NOWHERE) { if (search_help(complete_cmd_info[i].command, LVL_IMPL) == NOWHERE) {
nlen = snprintf(buf + len, sizeof(buf) - len, "%-20.20s%s", complete_cmd_info[i].command, nlen = snprintf(buf + len, sizeof(buf) - len, "%-20.20s%s", complete_cmd_info[i].command,
(++count % 3 ? "" : "\r\n")); (++count % 3 ? "" : "\r\n"));
if (len + nlen >= sizeof(buf)) if (len + nlen >= sizeof(buf))
@ -377,12 +376,12 @@ ACMD(do_helpcheck)
nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n"); nlen = snprintf(buf + len, sizeof(buf) - len, "\r\n");
if (ch->desc) { if (ch->desc) {
if (len == 0) if (len == 0)
send_to_char(ch, "All commands have help entries.\r\n"); send_to_char(ch, "All commands have help entries.\r\n");
else { else {
send_to_char(ch, "Commands without help entries:\r\n"); send_to_char(ch, "Commands without help entries:\r\n");
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -1,72 +1,40 @@
/** /**
* @file house.h * @file house.h
* Player house structures, prototypes and defines. * Player house structures, prototypes and defines.
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
* All rights reserved. See license for complete information. * All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
*/ */
#ifndef _HOUSE_H_ #ifndef _HOUSE_H_
#define _HOUSE_H_ #define _HOUSE_H_
#define MAX_HOUSES 100 /* Maximum number of houses in the MUD */ #define MAX_HOUSES 100
#define MAX_GUESTS 10 /* Maximum number of guests per house */ #define MAX_GUESTS 10
/* House modes/types */ #define HOUSE_PRIVATE 0
#define HOUSE_PRIVATE 0 /* A Normal Player-Owned House */
#define HOUSE_GOD 1 /* Imm owned house */
#define HOUSE_SHOP 2 /* Player-Owned Shop */
#define NUM_HOUSE_TYPES 3 struct house_control_rec {
room_vnum vnum; /* vnum of this house */
/* House Flags - also see string constants, in constants.c */ room_vnum atrium; /* vnum of atrium */
#define HOUSE_NOGUESTS 0 /* Owner cannot add guests */ sh_int exit_num; /* direction of house's exit */
#define HOUSE_FREE 1 /* House does not require payments */ time_t built_on; /* date this house was built */
#define HOUSE_NOIMMS 2 /* Imms below level 2 cannot enter */ int mode; /* mode of ownership */
#define HOUSE_IMPONLY 3 /* Imms below level 4 cannot enter */ long owner; /* idnum of house's owner */
#define HOUSE_RENTFREE 4 /* No rent is charged on items left here */ int num_of_guests; /* how many guests for house */
#define HOUSE_SAVENORENT 5 /* NORENT items are crashsaved too */ long guests[MAX_GUESTS]; /* idnums of house's guests */
#define HOUSE_NOSAVE 6 /* Do not crash save this room - private only */ time_t last_payment; /* date of last house payment */
#define HOUSE_NOSPEC 7 /* Don't use 'standard' spec proc for house type */ long spare0;
long spare1;
#define HOUSE_NUM_FLAGS 8 long spare2;
long spare3;
/** House flags. long spare4;
* @param loc The house_control_data structure. */ long spare5;
#define HOUSE_FLAGS(loc) ((loc)->house_flags) long spare6;
long spare7;
/** House flagged.
* @param loc The house_control_data structure. *
* flag The house flag (see above) */
#define HOUSE_FLAGGED(loc, flag) ((loc) && IS_SET_AR(HOUSE_FLAGS(loc), (flag)))
#define TOROOM(room, dir) (world[room].dir_option[dir] ? \
world[room].dir_option[dir]->to_room : NOWHERE)
/* List structure for house guests */
struct guest_data {
long id; /**< The ID number of this guest */
struct guest_data *next; /**< pointer to next guest in list */
};
/* List structure for houses */
struct house_control_data {
room_vnum vnum; /**< vnum of this house */
room_vnum atrium; /**< vnum of atrium */
sh_int exit_num; /**< direction of house's exit */
time_t built_on; /**< date this house was built */
long built_by; /**< The ID of the builder (hsedit) */
long owner; /**< idnum of house's owner */
int mode; /**< mode of ownership */
struct guest_data *guests; /**< idnums of house's guests */
time_t last_payment; /**< date of last house payment */
int house_flags[HS_ARRAY_MAX]; /**< House Flags (hsedit) */
mob_vnum receptionist; /**< The Receptionist/Shopkeeper */
struct house_control_data *next; /**< pointer to next house in list */
}; };
#define TOROOM(room, dir) (world[room].dir_option[dir] ? \ #define TOROOM(room, dir) (world[room].dir_option[dir] ? \
@ -74,36 +42,16 @@ struct house_control_data {
/* Functions in house.c made externally available */ /* Functions in house.c made externally available */
/* Utility Functions */ /* Utility Functions */
void House_boot(void); void House_boot(void);
void House_save_all(void); void House_save_all(void);
int House_can_enter(struct char_data *ch, room_vnum house); int House_can_enter(struct char_data *ch, room_vnum house);
void House_crashsave(room_vnum vnum); void House_crashsave(room_vnum vnum);
void House_list_guests(struct char_data *ch, struct house_control_data *h, int quiet); void House_list_guests(struct char_data *ch, int i, int quiet);
int House_save(struct obj_data *obj, FILE *fp); int House_save(struct obj_data *obj, FILE *fp);
void House_save_control(void);
void House_delete_file(room_vnum vnum);
void hcontrol_list_houses(struct char_data *ch, char *arg); void hcontrol_list_houses(struct char_data *ch, char *arg);
void set_house(struct house_control_data *h);
void free_house_guests(struct house_control_data *h);
void clear_house_control_data(struct house_control_data *h);
void add_house_guest(struct house_control_data *h_data, long guest_id);
int count_house_guests(struct house_control_data *h);
bool is_house_guest(struct house_control_data *h, long id_num);
bool remove_house_guest(struct house_control_data *h, long id_num);
int count_houses(void);
void free_house(struct house_control_data *h);
void free_house_list(void);
bool delete_house_control(struct house_control_data *to_del);
struct house_control_data *new_house(void);
struct house_control_data *add_house(struct house_control_data *h_data);
struct house_control_data *find_house(room_vnum vnum);
/* In game Commands */ /* In game Commands */
ACMD(do_hcontrol); ACMD(do_hcontrol);
ACMD(do_house); ACMD(do_house);
/* Spec-procs in house.c */
SPECIAL(house_shopkeeper);
SPECIAL(house_receptionist);
#endif /* _HOUSE_H_ */ #endif /* _HOUSE_H_ */

View file

@ -443,7 +443,7 @@ ACMD(do_ibt)
int i, num_res, num_unres; int i, num_res, num_unres;
IBT_DATA *ibtData, *first_ibt, *last_ibt; IBT_DATA *ibtData, *first_ibt, *last_ibt;
int ano=0; int ano=0;
if (IS_NPC(ch)) if (IS_NPC(ch))
return; return;
@ -454,7 +454,7 @@ ACMD(do_ibt)
last_ibt = get_last_ibt(subcmd); last_ibt = get_last_ibt(subcmd);
if ((!*arg)){ if ((!*arg)){
if (ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) >= LVL_GRGOD){
send_to_char(ch, "Usage: %s%s submit <header>%s\r\n" send_to_char(ch, "Usage: %s%s submit <header>%s\r\n"
" %s%s list%s\r\n" " %s%s list%s\r\n"
" %s%s show <num>%s\r\n" " %s%s show <num>%s\r\n"
@ -468,7 +468,7 @@ ACMD(do_ibt)
QYEL, CMD_NAME, QNRM, QYEL, CMD_NAME, QNRM,
QYEL, CMD_NAME, QNRM); QYEL, CMD_NAME, QNRM);
return; return;
} else if (IS_ADMIN(ch, ADMLVL_IMMORT)) { } else if (GET_LEVEL(ch) >= LVL_IMMORT) {
send_to_char(ch, "Usage: %s%s submit <header>%s\r\n" send_to_char(ch, "Usage: %s%s submit <header>%s\r\n"
" %s%s list%s\r\n" " %s%s list%s\r\n"
" %s%s show <num>%s\r\n", " %s%s show <num>%s\r\n",
@ -499,12 +499,12 @@ ACMD(do_ibt)
send_to_char(ch, "That %s doesn't exist.\r\n", CMD_NAME); send_to_char(ch, "That %s doesn't exist.\r\n", CMD_NAME);
return; return;
} else { } else {
if ((!IS_ADMIN(ch, ADMLVL_IMMORT)) && (!is_ibt_logger(ibtData, ch))) { if ((GET_LEVEL(ch) < LVL_IMMORT) && (!is_ibt_logger(ibtData, ch))) {
send_to_char(ch, "Sorry but you may only view %ss you have posted yourself.\n\r", ibt_types[subcmd]); send_to_char(ch, "Sorry but you may only view %ss you have posted yourself.\n\r", ibt_types[subcmd]);
} else { } else {
send_to_char(ch, "%s%s by %s%s\r\n",QCYN, ibt_types[subcmd], QYEL, ibtData->name); send_to_char(ch, "%s%s by %s%s\r\n",QCYN, ibt_types[subcmd], QYEL, ibtData->name);
if (IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) >= LVL_IMMORT) {
send_to_char(ch, "%sLevel: %s%d\r\n",QCYN, QYEL, ibtData->level); send_to_char(ch, "%sLevel: %s%d\r\n",QCYN, QYEL, ibtData->level);
send_to_char(ch, "%sRoom : %s%d\r\n",QCYN, QYEL, ibtData->room); send_to_char(ch, "%sRoom : %s%d\r\n",QCYN, QYEL, ibtData->room);
} }
@ -527,7 +527,7 @@ ACMD(do_ibt)
if (first_ibt) if (first_ibt)
{ {
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch,"%s No %s|%s Description\r\n", QCYN, QGRN, QCYN); send_to_char(ch,"%s No %s|%s Description\r\n", QCYN, QGRN, QCYN);
send_to_char(ch,"%s ---|--------------------------------------------------%s\r\n", QGRN, QNRM); send_to_char(ch,"%s ---|--------------------------------------------------%s\r\n", QGRN, QNRM);
} else { } else {
@ -539,7 +539,7 @@ ACMD(do_ibt)
i++; i++;
/* For mortals, skip IBT's that they didn't log */ /* For mortals, skip IBT's that they didn't log */
if ((!IS_ADMIN(ch, ADMLVL_IMMORT)) && !is_ibt_logger(ibtData,ch)) if ((GET_LEVEL(ch) < LVL_IMMORT) && !is_ibt_logger(ibtData,ch))
continue; continue;
/* Set up the 'important' flag */ /* Set up the 'important' flag */
@ -549,7 +549,7 @@ ACMD(do_ibt)
sprintf(imp, "%c", ' '); sprintf(imp, "%c", ' ');
if (IBT_FLAGGED(ibtData, IBT_RESOLVED)) { if (IBT_FLAGGED(ibtData, IBT_RESOLVED)) {
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "%s%s%3d|%s%s\r\n", send_to_char(ch, "%s%s%3d|%s%s\r\n",
imp, QGRN, i, ibtData->text, QNRM); imp, QGRN, i, ibtData->text, QNRM);
} else { } else {
@ -562,7 +562,7 @@ ACMD(do_ibt)
} }
num_res++; num_res++;
} else if (IBT_FLAGGED(ibtData, IBT_INPROGRESS)) { } else if (IBT_FLAGGED(ibtData, IBT_INPROGRESS)) {
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "%s%s%3d%s|%s%s%s\r\n", send_to_char(ch, "%s%s%3d%s|%s%s%s\r\n",
imp, QYEL, i, QGRN, imp, QYEL, i, QGRN,
QYEL, ibtData->text, QNRM); QYEL, ibtData->text, QNRM);
@ -576,7 +576,7 @@ ACMD(do_ibt)
} }
num_unres++; num_unres++;
} else { } else {
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "%s%s%3d%s|%s%s%s\r\n", send_to_char(ch, "%s%s%3d%s|%s%s%s\r\n",
imp, QRED, i, QGRN, imp, QRED, i, QGRN,
QRED, ibtData->text, QNRM); QRED, ibtData->text, QNRM);
@ -599,7 +599,7 @@ ACMD(do_ibt)
} else { } else {
send_to_char(ch,"No %ss have been found that were reported by you!\r\n", CMD_NAME); send_to_char(ch,"No %ss have been found that were reported by you!\r\n", CMD_NAME);
} }
if (ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) >= LVL_GRGOD) {
send_to_char(ch,"%sYou may use %s remove, resolve or edit to change the list..%s\r\n", QCYN, CMD_NAME, QNRM); send_to_char(ch,"%sYou may use %s remove, resolve or edit to change the list..%s\r\n", QCYN, CMD_NAME, QNRM);
} }
send_to_char(ch,"%sYou may use %s%s show <number>%s to see more indepth about the %s.%s\r\n", QCYN, QYEL, CMD_NAME, QCYN, CMD_NAME, QNRM); send_to_char(ch,"%sYou may use %s%s show <number>%s to see more indepth about the %s.%s\r\n", QCYN, QYEL, CMD_NAME, QCYN, CMD_NAME, QNRM);
@ -635,7 +635,6 @@ ACMD(do_ibt)
string_write(ch->desc, &(ibtData->body),MAX_IBT_LENGTH, 0, NULL); string_write(ch->desc, &(ibtData->body),MAX_IBT_LENGTH, 0, NULL);
ibtData->room = GET_ROOM_VNUM(IN_ROOM(ch)); ibtData->room = GET_ROOM_VNUM(IN_ROOM(ch));
ibtData->level = GET_LEVEL(ch); ibtData->level = GET_LEVEL(ch);
ibtData->text = STRALLOC(arg_text); ibtData->text = STRALLOC(arg_text);
@ -649,12 +648,12 @@ ACMD(do_ibt)
case SCMD_TYPO: LINK( ibtData, first_typo, last_typo, next, prev ); case SCMD_TYPO: LINK( ibtData, first_typo, last_typo, next, prev );
break; break;
} }
mudlog(NRM,ADMLVL_IMMORT, FALSE, "%s has posted %s %s!", GET_NAME(ch), TANA(CMD_NAME), CMD_NAME); mudlog(NRM,LVL_IMMORT, FALSE, "%s has posted %s %s!", GET_NAME(ch), TANA(CMD_NAME), CMD_NAME);
return; return;
} }
else if (is_abbrev(arg,"resolve")) else if (is_abbrev(arg,"resolve"))
{ {
if (!ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) < LVL_GRGOD){
send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]); send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]);
return; return;
} }
@ -675,13 +674,13 @@ ACMD(do_ibt)
send_to_char(ch,"%s %d resolved!\r\n", ibt_types[subcmd], ano); send_to_char(ch,"%s %d resolved!\r\n", ibt_types[subcmd], ano);
SET_BIT_AR(IBT_FLAGS(ibtData), IBT_RESOLVED); SET_BIT_AR(IBT_FLAGS(ibtData), IBT_RESOLVED);
if (CONFIG_IBT_AUTOSAVE) { if (CONFIG_IBT_AUTOSAVE) {
save_ibt_file(subcmd); save_ibt_file(subcmd);
} }
} }
} }
return; return;
} else if (is_abbrev(arg,"remove")) { } else if (is_abbrev(arg,"remove")) {
if (!ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) < LVL_GRGOD){
send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]); send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]);
return; return;
} }
@ -699,29 +698,29 @@ ACMD(do_ibt)
if (free_ibt(subcmd, ibtData)) { if (free_ibt(subcmd, ibtData)) {
send_to_char(ch,"%s%s Number %d removed.%s\r\n", QCYN, ibt_types[subcmd], ano, QNRM); send_to_char(ch,"%s%s Number %d removed.%s\r\n", QCYN, ibt_types[subcmd], ano, QNRM);
if (CONFIG_IBT_AUTOSAVE) { if (CONFIG_IBT_AUTOSAVE) {
save_ibt_file(subcmd); save_ibt_file(subcmd);
} }
} else { } else {
send_to_char(ch,"%sUnable to remove %s %d!%s\r\n", QRED, CMD_NAME, ano, QNRM); send_to_char(ch,"%sUnable to remove %s %d!%s\r\n", QRED, CMD_NAME, ano, QNRM);
} }
} }
return; return;
} else if (is_abbrev(arg,"save")) { } else if (is_abbrev(arg,"save")) {
if (!ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) < LVL_GRGOD){
send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]); send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]);
return; return;
} }
save_ibt_file(subcmd); save_ibt_file(subcmd);
send_to_char(ch,"%s list saved.\r\n", ibt_types[subcmd]); send_to_char(ch,"%s list saved.\r\n", ibt_types[subcmd]);
} else if (is_abbrev(arg,"edit")) { } else if (is_abbrev(arg,"edit")) {
if (!ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) < LVL_GRGOD){
send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]); send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]);
return; return;
} }
/* Pass control to the OLC without the 'edit' arg */ /* Pass control to the OLC without the 'edit' arg */
do_oasis_ibtedit(ch, arg_text, cmd, subcmd); do_oasis_ibtedit(ch, arg_text, cmd, subcmd);
} else { } else {
if (!ADM_FLAGGED(ch, ADM_ADVIBT)) { if (GET_LEVEL(ch) < LVL_GRGOD){
send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]); send_to_char(ch, "%s what?\r\n", ibt_types[subcmd]);
send_to_char(ch, "Usage: %s submit <text>\r\n", ibt_types[subcmd]); send_to_char(ch, "Usage: %s submit <text>\r\n", ibt_types[subcmd]);
return; return;
@ -782,7 +781,7 @@ ACMD(do_oasis_ibtedit)
/* Give descriptor an OLC structure. */ /* Give descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis_ibtedit: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_ibtedit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -805,7 +804,7 @@ ACMD(do_oasis_ibtedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE,"OLC: %s starts editing %s %d", mudlog(CMP, LVL_IMMORT, TRUE,"OLC: %s starts editing %s %d",
GET_NAME(ch), IBT_TYPE, OLC_NUM(d)); GET_NAME(ch), IBT_TYPE, OLC_NUM(d));
} }
@ -885,23 +884,29 @@ static void ibtedit_save(struct descriptor_data *d)
} }
void free_olc_ibt(IBT_DATA *toFree) { void free_olc_ibt(IBT_DATA *toFree) {
if (!toFree)
return; if (!toFree)
return;
if (toFree->text) {
STRFREE(toFree->text); if (toFree->text) {
} STRFREE(toFree->text);
if (toFree->body) { }
STRFREE(toFree->body);
} if (toFree->body) {
if (toFree->name) { STRFREE(toFree->body);
STRFREE(toFree->name); }
}
if (toFree->notes) { if (toFree->name) {
STRFREE(toFree->notes); STRFREE(toFree->name);
} }
free(toFree);
if (toFree->notes) {
STRFREE(toFree->notes);
}
free(toFree);
} }
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
/* main ibtedit menu function... */ /* main ibtedit menu function... */
static void ibtedit_disp_main_menu(struct descriptor_data *d) static void ibtedit_disp_main_menu(struct descriptor_data *d)
@ -967,7 +972,7 @@ void ibtedit_parse(struct descriptor_data *d, char *arg)
case 'Y': case 'Y':
/* Save the IBT in memory and to disk. */ /* Save the IBT in memory and to disk. */
ibtedit_save(d); ibtedit_save(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits %s %d", GET_NAME(d->character), IBT_TYPE, OLC_NUM(d)); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits %s %d", GET_NAME(d->character), IBT_TYPE, OLC_NUM(d));
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
return; return;
case 'n': case 'n':
@ -1082,21 +1087,21 @@ void ibtedit_parse(struct descriptor_data *d, char *arg)
case IBTEDIT_BODY: case IBTEDIT_BODY:
/* We should never get here, modify.c throws user through ibtedit_string_cleanup. */ /* We should never get here, modify.c throws user through ibtedit_string_cleanup. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached BODY case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached BODY case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
case IBTEDIT_NOTES: case IBTEDIT_NOTES:
/* We should never get here, modify.c throws user through ibtedit_string_cleanup. */ /* We should never get here, modify.c throws user through ibtedit_string_cleanup. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached NOTES case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached NOTES case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
default: default:
/* We should never get here. */ /* We should never get here. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached default case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: ibtedit_parse(): Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }

View file

@ -446,7 +446,7 @@ void parse_edit_action(int command, char *string, struct descriptor_data *d)
strcat(buf, buf2); strcat(buf, buf2);
if ((s = strchr(s, '\n')) != NULL) { if ((s = strchr(s, '\n')) != NULL) {
/* This means that we are at the END of the line, we want out of there, /* This means that we are at the END of the line, we want out of there,
* but we want s to point to the beginning of the line. AFTER the line * but we want s to point to the beginning of the line. AFTER the line
* we want edited. */ * we want edited. */
s++; s++;
/* Now put the last 'good' half of buffer into storage. */ /* Now put the last 'good' half of buffer into storage. */
@ -468,12 +468,12 @@ void parse_edit_action(int command, char *string, struct descriptor_data *d)
break; break;
default: default:
write_to_output(d, "Invalid option.\r\n"); write_to_output(d, "Invalid option.\r\n");
mudlog(BRF, ADMLVL_IMPL, TRUE, "SYSERR: invalid command passed to parse_edit_action"); mudlog(BRF, LVL_IMPL, TRUE, "SYSERR: invalid command passed to parse_edit_action");
return; return;
} }
} }
/* Re-formats message type formatted char *. (for strings edited with d->str) /* Re-formats message type formatted char *. (for strings edited with d->str)
* (mostly olc and mail). */ * (mostly olc and mail). */
int format_text(char **ptr_string, int mode, struct descriptor_data *d, unsigned int maxlen, int low, int high) int format_text(char **ptr_string, int mode, struct descriptor_data *d, unsigned int maxlen, int low, int high)
{ {
@ -540,7 +540,7 @@ int format_text(char **ptr_string, int mode, struct descriptor_data *d, unsigned
cap_next = TRUE; cap_next = TRUE;
} }
/* This is so that if we stopped on a sentence, we move off the sentence /* This is so that if we stopped on a sentence, we move off the sentence
* delimiter. */ * delimiter. */
while (strchr(".!?", *flow)) { while (strchr(".!?", *flow)) {
cap_next_next = TRUE; cap_next_next = TRUE;
@ -549,8 +549,8 @@ int format_text(char **ptr_string, int mode, struct descriptor_data *d, unsigned
/* Special case: if we're at the end of the last line, and the last /* Special case: if we're at the end of the last line, and the last
* character is a delimiter, the flow++ above will have *flow pointing * character is a delimiter, the flow++ above will have *flow pointing
* to the \r (or \n) character after the delimiter. Thus *flow will be * to the \r (or \n) character after the delimiter. Thus *flow will be
* non-null, and an extra (blank) line might be added erroneously. We * non-null, and an extra (blank) line might be added erroneously. We
* fix it by skipping the newline characters in between. - Welcor */ * fix it by skipping the newline characters in between. - Welcor */
if (strchr("\n\r", *flow)) { if (strchr("\n\r", *flow)) {
*flow = '\0'; /* terminate 'start' string */ *flow = '\0'; /* terminate 'start' string */

File diff suppressed because it is too large Load diff

View file

@ -42,7 +42,7 @@ int perform_alias(struct descriptor_data *d, char *orig, size_t maxlen);
int enter_player_game (struct descriptor_data *d); int enter_player_game (struct descriptor_data *d);
/* ACMDs available through interpreter.c */ /* ACMDs available through interpreter.c */
ACMD(do_alias); ACMD(do_alias);
ACMD(do_cmdinfo);
/* for compatibility with 2.20: */ /* for compatibility with 2.20: */
#define argument_interpreter(a, b, c) two_arguments(a, b, c) #define argument_interpreter(a, b, c) two_arguments(a, b, c)
@ -60,8 +60,6 @@ struct command_info {
void (*command_pointer) void (*command_pointer)
(struct char_data *ch, char *argument, int cmd, int subcmd); (struct char_data *ch, char *argument, int cmd, int subcmd);
sh_int minimum_level; sh_int minimum_level;
sh_int minimum_admlevel;
int admin_flag;
int subcmd; int subcmd;
}; };

View file

@ -201,15 +201,15 @@ void run_autowiz(void)
#if defined(CIRCLE_UNIX) #if defined(CIRCLE_UNIX)
res = snprintf(buf, sizeof(buf), "nice ../bin/autowiz %d %s %d %s %d &", res = snprintf(buf, sizeof(buf), "nice ../bin/autowiz %d %s %d %s %d &",
CONFIG_MIN_WIZLIST_LEV, WIZLIST_FILE, ADMLVL_IMMORT, IMMLIST_FILE, (int) getpid()); CONFIG_MIN_WIZLIST_LEV, WIZLIST_FILE, LVL_IMMORT, IMMLIST_FILE, (int) getpid());
#elif defined(CIRCLE_WINDOWS) #elif defined(CIRCLE_WINDOWS)
res = snprintf(buf, sizeof(buf), "autowiz %d %s %d %s", res = snprintf(buf, sizeof(buf), "autowiz %d %s %d %s",
CONFIG_MIN_WIZLIST_LEV, WIZLIST_FILE, ADMLVL_IMMORT, IMMLIST_FILE); CONFIG_MIN_WIZLIST_LEV, WIZLIST_FILE, LVL_IMMORT, IMMLIST_FILE);
#endif /* CIRCLE_WINDOWS */ #endif /* CIRCLE_WINDOWS */
/* Abusing signed -> unsigned conversion to avoid '-1' check. */ /* Abusing signed -> unsigned conversion to avoid '-1' check. */
if (res < sizeof(buf)) { if (res < sizeof(buf)) {
mudlog(CMP, ADMLVL_IMMORT, FALSE, "Initiating autowiz."); mudlog(CMP, LVL_IMMORT, FALSE, "Initiating autowiz.");
i = system(buf); i = system(buf);
reboot_wizlists(); reboot_wizlists();
} else } else
@ -223,7 +223,7 @@ void gain_exp(struct char_data *ch, int gain)
int is_altered = FALSE; int is_altered = FALSE;
int num_levels = 0; int num_levels = 0;
if (!IS_NPC(ch) && ((GET_LEVEL(ch) < 1 || GET_LEVEL(ch) >= CONFIG_MAX_LEVEL))) if (!IS_NPC(ch) && ((GET_LEVEL(ch) < 1 || GET_LEVEL(ch) >= LVL_IMMORT)))
return; return;
if (IS_NPC(ch)) { if (IS_NPC(ch)) {
@ -236,7 +236,7 @@ void gain_exp(struct char_data *ch, int gain)
gain = MIN(CONFIG_MAX_EXP_GAIN, gain); /* put a cap on the max gain per kill */ gain = MIN(CONFIG_MAX_EXP_GAIN, gain); /* put a cap on the max gain per kill */
GET_EXP(ch) += gain; GET_EXP(ch) += gain;
while (GET_LEVEL(ch) < CONFIG_MAX_LEVEL && while (GET_LEVEL(ch) < LVL_IMMORT - CONFIG_NO_MORT_TO_IMMORT &&
GET_EXP(ch) >= level_exp(GET_CLASS(ch), GET_LEVEL(ch) + 1)) { GET_EXP(ch) >= level_exp(GET_CLASS(ch), GET_LEVEL(ch) + 1)) {
GET_LEVEL(ch) += 1; GET_LEVEL(ch) += 1;
num_levels++; num_levels++;
@ -245,20 +245,15 @@ void gain_exp(struct char_data *ch, int gain)
} }
if (is_altered) { if (is_altered) {
mudlog(BRF, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s advanced %d level%s to level %d.", mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s advanced %d level%s to level %d.",
GET_NAME(ch), num_levels, num_levels == 1 ? "" : "s", GET_LEVEL(ch)); GET_NAME(ch), num_levels, num_levels == 1 ? "" : "s", GET_LEVEL(ch));
if (num_levels == 1) if (num_levels == 1)
send_to_char(ch, "You rise a level!\r\n"); send_to_char(ch, "You rise a level!\r\n");
else else
send_to_char(ch, "You rise %d levels!\r\n", num_levels); send_to_char(ch, "You rise %d levels!\r\n", num_levels);
set_title(ch, NULL); set_title(ch, NULL);
if (GET_LEVEL(ch) >= CONFIG_MAX_LEVEL) { if (GET_LEVEL(ch) >= LVL_IMMORT && !PLR_FLAGGED(ch, PLR_NOWIZLIST))
if (!IS_ADMIN(ch, ADMLVL_IMMORT) && !CONFIG_NO_MORT_TO_IMMORT) { run_autowiz();
set_admin_level(ch, ADMLVL_IMMORT);
send_to_char(ch, "You have reached the maximum level and become immortal!\r\n");
mudlog(NRM, ADMLVL_GOD, TRUE, "%s advanced to Immortal!", GET_NAME(ch));
}
}
} }
} else if (gain < 0) { } else if (gain < 0) {
gain = MAX(-CONFIG_MAX_EXP_LOSS, gain); /* Cap max exp lost per death */ gain = MAX(-CONFIG_MAX_EXP_LOSS, gain); /* Cap max exp lost per death */
@ -266,7 +261,9 @@ void gain_exp(struct char_data *ch, int gain)
if (GET_EXP(ch) < 0) if (GET_EXP(ch) < 0)
GET_EXP(ch) = 0; GET_EXP(ch) = 0;
} }
} if (GET_LEVEL(ch) >= LVL_IMMORT && !PLR_FLAGGED(ch, PLR_NOWIZLIST))
run_autowiz();
}
void gain_exp_regardless(struct char_data *ch, int gain) void gain_exp_regardless(struct char_data *ch, int gain)
{ {
@ -281,7 +278,7 @@ void gain_exp_regardless(struct char_data *ch, int gain)
GET_EXP(ch) = 0; GET_EXP(ch) = 0;
if (!IS_NPC(ch)) { if (!IS_NPC(ch)) {
while ((GET_LEVEL(ch) < CONFIG_MAX_LEVEL) && while (GET_LEVEL(ch) < LVL_IMPL &&
GET_EXP(ch) >= level_exp(GET_CLASS(ch), GET_LEVEL(ch) + 1)) { GET_EXP(ch) >= level_exp(GET_CLASS(ch), GET_LEVEL(ch) + 1)) {
GET_LEVEL(ch) += 1; GET_LEVEL(ch) += 1;
num_levels++; num_levels++;
@ -290,22 +287,17 @@ void gain_exp_regardless(struct char_data *ch, int gain)
} }
if (is_altered) { if (is_altered) {
mudlog(BRF, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s advanced %d level%s to level %d.", mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s advanced %d level%s to level %d.",
GET_NAME(ch), num_levels, num_levels == 1 ? "" : "s", GET_LEVEL(ch)); GET_NAME(ch), num_levels, num_levels == 1 ? "" : "s", GET_LEVEL(ch));
if (num_levels == 1) if (num_levels == 1)
send_to_char(ch, "You rise a level!\r\n"); send_to_char(ch, "You rise a level!\r\n");
else else
send_to_char(ch, "You rise %d levels!\r\n", num_levels); send_to_char(ch, "You rise %d levels!\r\n", num_levels);
set_title(ch, NULL); set_title(ch, NULL);
if (GET_LEVEL(ch) >= CONFIG_MAX_LEVEL) {
if (!IS_ADMIN(ch, ADMLVL_IMMORT) && !CONFIG_NO_MORT_TO_IMMORT) {
set_admin_level(ch, ADMLVL_IMMORT);
send_to_char(ch, "You have reached the maximum level and become immortal!\r\n");
mudlog(NRM, ADMLVL_GOD, TRUE, "%s advanced to Immortal!", GET_NAME(ch));
}
}
} }
} }
if (GET_LEVEL(ch) >= LVL_IMMORT && !PLR_FLAGGED(ch, PLR_NOWIZLIST))
run_autowiz();
} }
void gain_condition(struct char_data *ch, int condition, int value) void gain_condition(struct char_data *ch, int condition, int value)
@ -374,7 +366,7 @@ static void check_idling(struct char_data *ch)
Crash_rentsave(ch, 0); Crash_rentsave(ch, 0);
else else
Crash_idlesave(ch); Crash_idlesave(ch);
mudlog(CMP, ADMLVL_GOD, TRUE, "%s force-rented and extracted (idle).", GET_NAME(ch)); mudlog(CMP, LVL_GOD, TRUE, "%s force-rented and extracted (idle).", GET_NAME(ch));
add_llog_entry(ch, LAST_IDLEOUT); add_llog_entry(ch, LAST_IDLEOUT);
extract_char(ch); extract_char(ch);
} }
@ -403,19 +395,19 @@ void point_update(void)
if (damage(i, i, 2, SPELL_POISON) == -1) if (damage(i, i, 2, SPELL_POISON) == -1)
continue; /* Oops, they died. -gg 6/24/98 */ continue; /* Oops, they died. -gg 6/24/98 */
if (GET_POS(i) <= POS_STUNNED) if (GET_POS(i) <= POS_STUNNED)
update_pos(i); update_pos(i);
} else if (GET_POS(i) == POS_INCAP) { } else if (GET_POS(i) == POS_INCAP) {
if (damage(i, i, 1, TYPE_SUFFERING) == -1) if (damage(i, i, 1, TYPE_SUFFERING) == -1)
continue; continue;
} else if (GET_POS(i) == POS_MORTALLYW) { } else if (GET_POS(i) == POS_MORTALLYW) {
if (damage(i, i, 2, TYPE_SUFFERING) == -1) if (damage(i, i, 2, TYPE_SUFFERING) == -1)
continue; continue;
} }
if (!IS_NPC(i)) { if (!IS_NPC(i)) {
update_char_objects(i); update_char_objects(i);
(i->char_specials.timer)++; (i->char_specials.timer)++;
if (GET_ADMLEVEL(i) < CONFIG_IDLE_MAX_LEVEL) if (GET_LEVEL(i) < CONFIG_IDLE_MAX_LEVEL)
check_idling(i); check_idling(i);
} }
} }
@ -427,32 +419,32 @@ void point_update(void)
if (IS_CORPSE(j)) { if (IS_CORPSE(j)) {
/* timer count down */ /* timer count down */
if (GET_OBJ_TIMER(j) > 0) if (GET_OBJ_TIMER(j) > 0)
GET_OBJ_TIMER(j)--; GET_OBJ_TIMER(j)--;
if (!GET_OBJ_TIMER(j)) { if (!GET_OBJ_TIMER(j)) {
if (j->carried_by) if (j->carried_by)
act("$p decays in your hands.", FALSE, j->carried_by, j, 0, TO_CHAR); act("$p decays in your hands.", FALSE, j->carried_by, j, 0, TO_CHAR);
else if ((IN_ROOM(j) != NOWHERE) && (world[IN_ROOM(j)].people)) { else if ((IN_ROOM(j) != NOWHERE) && (world[IN_ROOM(j)].people)) {
act("A quivering horde of maggots consumes $p.", act("A quivering horde of maggots consumes $p.",
TRUE, world[IN_ROOM(j)].people, j, 0, TO_ROOM); TRUE, world[IN_ROOM(j)].people, j, 0, TO_ROOM);
act("A quivering horde of maggots consumes $p.", act("A quivering horde of maggots consumes $p.",
TRUE, world[IN_ROOM(j)].people, j, 0, TO_CHAR); TRUE, world[IN_ROOM(j)].people, j, 0, TO_CHAR);
} }
for (jj = j->contains; jj; jj = next_thing2) { for (jj = j->contains; jj; jj = next_thing2) {
next_thing2 = jj->next_content; /* Next in inventory */ next_thing2 = jj->next_content; /* Next in inventory */
obj_from_obj(jj); obj_from_obj(jj);
if (j->in_obj) if (j->in_obj)
obj_to_obj(jj, j->in_obj); obj_to_obj(jj, j->in_obj);
else if (j->carried_by) else if (j->carried_by)
obj_to_room(jj, IN_ROOM(j->carried_by)); obj_to_room(jj, IN_ROOM(j->carried_by));
else if (IN_ROOM(j) != NOWHERE) else if (IN_ROOM(j) != NOWHERE)
obj_to_room(jj, IN_ROOM(j)); obj_to_room(jj, IN_ROOM(j));
else else
core_dump(); core_dump();
} }
extract_obj(j); extract_obj(j);
} }
} }
/* If the timer is set, count it down and at 0, try the trigger /* If the timer is set, count it down and at 0, try the trigger
@ -472,7 +464,7 @@ void point_update(void)
HAPPY_EXP = 0; HAPPY_EXP = 0;
HAPPY_GOLD = 0; HAPPY_GOLD = 0;
HAPPY_TIME = 0; HAPPY_TIME = 0;
game_info("Happy hour has ended!"); game_info("Happy hour has ended!");
} }
} }

View file

@ -199,11 +199,6 @@ int mag_damage(int level, struct char_data *ch, struct char_data *victim,
if (victim == NULL || ch == NULL) if (victim == NULL || ch == NULL)
return (0); return (0);
if (ADM_FLAGGED(victim, ADM_NODAMAGE)) {
send_to_char(ch, "Your spell is harmless to %s.\r\n", GET_NAME(victim));
return 0;
}
switch (spellnum) { switch (spellnum) {
/* Mostly mages */ /* Mostly mages */
case SPELL_MAGIC_MISSILE: case SPELL_MAGIC_MISSILE:
@ -356,7 +351,7 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
break; break;
case SPELL_BLINDNESS: case SPELL_BLINDNESS:
if (MOB_FLAGGED(victim, MOB_NOBLIND) || IS_ADMIN(victim, ADMLVL_IMMORT) || mag_savingthrow(victim, savetype, 0)) { if (MOB_FLAGGED(victim, MOB_NOBLIND) || GET_LEVEL(victim) >= LVL_IMMORT || mag_savingthrow(victim, savetype, 0)) {
send_to_char(ch, "You fail.\r\n"); send_to_char(ch, "You fail.\r\n");
return; return;
} }
@ -447,7 +442,7 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
break; break;
case SPELL_POISON: case SPELL_POISON:
if (mag_savingthrow(victim, savetype, 0) || ADM_FLAGGED(victim, ADM_NOPOISON)) { if (mag_savingthrow(victim, savetype, 0)) {
send_to_char(ch, "%s", CONFIG_NOEFFECT); send_to_char(ch, "%s", CONFIG_NOEFFECT);
return; return;
} }
@ -658,13 +653,11 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
* 2: immortals * 2: immortals
* 3: if no pk on this mud, skips over all players * 3: if no pk on this mud, skips over all players
* 4: pets (charmed NPCs) * 4: pets (charmed NPCs)
* 5: other players in the same group (if the spell is 'violent') * 5: other players in the same group (if the spell is 'violent')
* 6: Flying people if earthquake is the spell */ * 6: Flying people if earthquake is the spell */
if (tch == ch) if (tch == ch)
continue; continue;
if (IS_ADMIN(tch, ADMLVL_IMMORT)) if (!IS_NPC(tch) && GET_LEVEL(tch) >= LVL_IMMORT)
continue;
if (ADM_FLAGGED(tch, ADM_NODAMAGE))
continue; continue;
if (!CONFIG_PK_ALLOWED && !IS_NPC(ch) && !IS_NPC(tch)) if (!CONFIG_PK_ALLOWED && !IS_NPC(ch) && !IS_NPC(tch))
continue; continue;
@ -673,9 +666,8 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
if (!IS_NPC(tch) && spell_info[spellnum].violent && AFF_FLAGGED(tch, AFF_GROUP) && AFF_FLAGGED(ch, AFF_GROUP) && if (!IS_NPC(tch) && spell_info[spellnum].violent && AFF_FLAGGED(tch, AFF_GROUP) && AFF_FLAGGED(ch, AFF_GROUP) &&
( ((ch->master == NULL) ? ch : ch->master) == ((tch->master == NULL) ? tch : tch->master) ) ) ( ((ch->master == NULL) ? ch : ch->master) == ((tch->master == NULL) ? tch : tch->master) ) )
continue; continue;
if ((spellnum == SPELL_EARTHQUAKE) && AFF_FLAGGED(tch, AFF_FLYING)) if ((spellnum == SPELL_EARTHQUAKE) && AFF_FLAGGED(tch, AFF_FLYING))
continue; continue;
/* Doesn't matter if they die here so we don't check. -gg 6/24/98 */ /* Doesn't matter if they die here so we don't check. -gg 6/24/98 */
mag_damage(level, ch, tch, spellnum, 1); mag_damage(level, ch, tch, spellnum, 1);
} }

2445
src/mail.c

File diff suppressed because it is too large Load diff

View file

@ -1,212 +1,108 @@
/*************************************************************************** /**
* @file mail.h * * @file mail.h
* Public procs, macro defs, subcommand defines mudmail system. * * Public procs, macro defs, subcommand defines mudmail system.
* * *
* Part of the core tbaMUD source code distribution, which is a derivative * * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * * of, and continuation of, CircleMUD.
* * *
* All rights reserved. See license for complete information. * * All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
* By Jeremy Elson. * * By Jeremy Elson.
**************************************************************************/ */
#ifndef _MAIL_H_
/* A handy 'flag' define - probably better in utils.h? */ #define _MAIL_H_
#define FLAG(n) (1 << (n))
/* You can modify the following constants to fit your own MUD. */
/* Maximum size of mail in bytes (arbitrary) */
#define MAX_MAIL_SIZE 8192 /* minimum level a player must be to send mail */
#define MAX_MAIL_ID 2000000000 #define MIN_MAIL_LEVEL 1
/* For mail anywhere to work, we need to know which room to find the immortal mailman in */ /* # of gold coins required to send mail */
#define MAIL_IMMORTAL_ROOM 1205 #define STAMP_PRICE 150
/* Mail index flags - mostly essential info that should be known before reading mails */ /* Maximum size of mail in bytes (arbitrary) */
#define MINDEX_DELETED FLAG(0) /* Mail has been marked for deletion */ #define MAX_MAIL_SIZE 8192
#define MINDEX_URGENT FLAG(1) /* Mail is flagged as urgent by sender */
#define MINDEX_HAS_OBJ FLAG(2) /* Mail has an attached object */ /* size of mail file allocation blocks */
#define MINDEX_HAS_GOLD FLAG(3) /* Mail contains some gold coins */ #define BLOCK_SIZE 100
#define MINDEX_IS_COD FLAG(4) /* Mail requires some gold coins */
#define MINDEX_FROM_MOB FLAG(5) /* Mail has been sent by using scripts */ /* General, publicly available functions */
#define MINDEX_READ FLAG(6) /* Mail has been viewed but not received */ SPECIAL(postmaster);
#define MINDEX_DRAFT FLAG(7) /* Mail is an unsent draft copy */
/* NOTE: Make sure that your block size is big enough. If not, HEADER_BLOCK_
/* Mail Flags */ * DATASIZE will end up negative. This is a bad thing. Check the define below
#define MAIL_DELETED 1 /* Marks mail for deletion with next purge */ * to make sure it is >0 when choosing values for NAME_SIZE and BLOCK_SIZE.
#define MAIL_URGENT 2 /* This mail is flagged as urgent? */ * 100 is a nice round number for BLOCK_SIZE and is the default. The mail system
#define MAIL_COD 3 /* Means coins amount is required payment */ * will always allocate disk space in chunks of size BLOCK_SIZE. */
#define MAIL_FROM_MOB 4 /* Specifies that 'sender' is a mob vnum */
#define MAIL_READ 5 /* Mail has been read by recipient */ /* DON'T TOUCH DEFINES BELOW. */
#define MAIL_DRAFT 6 /* Mail is a draft (not yet sent) */ int scan_file(void);
int has_mail(long recipient);
#define IS_MAIL_DELETED(i) (IS_SET(mail_table[(i)].flags, MINDEX_DELETED)) void store_mail(long to, long from, char *message_pointer);
#define IS_MAIL_URGENT(i) (IS_SET(mail_table[(i)].flags, MINDEX_URGENT)) char *read_delete(long recipient);
#define IS_MAIL_DRAFT(i) (IS_SET(mail_table[(i)].flags, MINDEX_DRAFT)) void notify_if_playing(struct char_data *from, int recipient_id);
#define IS_MAIL_READ(i) (IS_SET(mail_table[(i)].flags, MINDEX_READ))
#define IS_MAIL_COD(i) (IS_SET(mail_table[(i)].flags, MINDEX_IS_COD)) struct mail_t {
#define MAIL_HAS_OBJECT(i) (IS_SET(mail_table[(i)].flags, MINDEX_HAS_OBJ)) long recipient;
#define MAIL_HAS_GOLD(i) (IS_SET(mail_table[(i)].flags, MINDEX_HAS_GOLD)) long sender;
time_t sent_time;
#define MAIL_URGENT_COLOR(i) (IS_MAIL_URGENT(i) ? QBRED : QNRM) char *body;
};
/* Mail editor submodes */
#define MAILEDIT_INBOX 0 /* old stuff below */
#define MAILEDIT_OUTBOX 1 #define HEADER_BLOCK (-1)
#define MAILEDIT_MAILEDIT 2 #define LAST_BLOCK (-2)
#define MAILEDIT_VIEW 3 #define DELETED_BLOCK (-3)
#define MAILEDIT_REPLY 4
#define MAILEDIT_FORWARD 5 /* Note: next_block is part of header_blk in a data block; we can't combine them
#define MAILEDIT_RECEIVE 6 * here because we have to be able to differentiate a data block from a header
#define MAILEDIT_DELETE 7 * block when booting mail system. */
#define MAILEDIT_BACK_TO_MENU 8 struct header_data_type {
#define MAILEDIT_ATTACHMENTS 9 long next_block; /* if header block, link to next block */
#define MAILEDIT_ASK_DRAFT 10 long from; /* idnum of the mail's sender */
#define MAILEDIT_ASK_QUIT 11 long to; /* idnum of mail's recipient */
#define MAILEDIT_OUTEDIT 12 time_t mail_time; /* when was the letter mailed? */
#define MAILEDIT_OUTVIEW 13 };
#define MAILEDIT_OUTDELETE 14
#define MAILEDIT_RECIP_MENU 15 /* size of the data part of a header block */
#define MAILEDIT_ADD_RECIP 16 #define HEADER_BLOCK_DATASIZE \
#define MAILEDIT_DEL_RECIP 17 (BLOCK_SIZE - sizeof(long) - sizeof(struct header_data_type) - sizeof(char))
#define MAILEDIT_CLR_RECIP 18
#define MAILEDIT_ATTACH_MENU 19 /* size of the data part of a data block */
#define MAILEDIT_ADD_ATTACH 20 #define DATA_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(char))
#define MAILEDIT_DEL_ATTACH 21
#define MAILEDIT_CLR_ATTACH 22 /* note that an extra space is allowed in all string fields for the
#define MAILEDIT_GET_SUBJECT 23 terminating null character. */
#define MAILEDIT_GET_GOLD 24
#define MAILEDIT_GET_BODYTEXT 25 struct header_block_type_d {
#define MAILEDIT_PURGE_N_QUIT 26 long block_type; /* is this a header or data block? */
struct header_data_type header_data; /* other header data */
/* Mail Editor handy defines */ char txt[HEADER_BLOCK_DATASIZE+1]; /* actual text plus 1 for null */
#define MAILEDIT_SUBJECT ((OLC_MAIL(d)->mail)->subject) };
#define MAILEDIT_BODYTEXT ((OLC_MAIL(d)->mail)->body)
#define MAILEDIT_GOLD ((OLC_MAIL(d)->mail)->coins) struct data_block_type_d {
#define MAILEDIT_URGENT (IS_SET_AR((OLC_MAIL(d)->mail)->mail_flags, MAIL_URGENT)) long block_type; /* -1 if header block, -2 if last data block
#define MAILEDIT_COD (IS_SET_AR((OLC_MAIL(d)->mail)->mail_flags, MAIL_COD)) in mail, otherwise a link to the next */
char txt[DATA_BLOCK_DATASIZE+1]; /* actual text plus 1 for null */
/* Copy modes for mail_copy */ };
#define MAIL_COPY_NORMAL 0
#define MAIL_COPY_FORWARD 1 typedef struct header_block_type_d header_block_type;
#define MAIL_COPY_REPLY 2 typedef struct data_block_type_d data_block_type;
/* Special-case sender/recipient ID's for get_sender_name, should be below zero (above zero = player id) */ struct position_list_type_d {
#define MAIL_TO_NOBODY 0 /* Used internally - do not change this one! */ long position;
#define MAIL_FROM_MAIL -1 /* (sender) Mail from the tbaMUD mail system */ struct position_list_type_d *next;
#define MAIL_TO_IMMS -2 /* (recipient) Mail to all the MUD's immortals */ };
#define MAIL_TO_ALL -3 /* (recipient) Mail to all players (usually Imp-only) */
/* Note - changing the list above needs changing the list at the top of mail.c too */ typedef struct position_list_type_d position_list_type;
/* This number should match the mail_groups list at the top of mail.c */ struct mail_index_type_d {
#define NUM_MAIL_GROUPS 2 long recipient; /* who is this mail for? */
position_list_type *list_start; /* list of mail positions */
#define ML_ARRAY_MAX 4 struct mail_index_type_d *next; /* link to next one */
#define NO_MAIL -1 };
struct recipient_list { typedef struct mail_index_type_d mail_index_type;
long recipient;
struct recipient_list *next; #endif /* _MAIL_H_ */
};
struct mail_data {
long mail_id;
long recipient;
long sender;
time_t sent_time;
char *subject;
char *body;
struct obj_data *attachment;
int coins;
int mail_flags[ML_ARRAY_MAX];
};
struct mail_edit_data {
struct mail_data *mail;
struct recipient_list *recipients;
};
struct mail_index {
long mail_id;
long recipient;
long sender;
time_t sent_time;
char *subject;
int flags;
};
struct mail_group {
char name[MAX_NAME_LENGTH+1]; /* name entered by player */
long recipient; /* The special recipient ID (below zero) */
};
/* Functions in mail.c (in the order they appear) */
bool build_mail_index(void); /* Load the mudmail index file on MUD startup */
long new_mail_id(void); /* Get a unique ID for a new mudmail */
void free_mail_index(void); /* Erase the entire mudmail index from memory */
void free_mail(struct mail_data *mail); /* Free memory used by one mail_data structure */
void extract_mail(struct mail_data *mail); /* Free memory used by one mail_data structure */
int find_mail_by_id(long mail_id); /* Get the mail index rnum from the mail id */
void copy_mail_index_entry(struct mail_index *to, struct mail_index *from); /* Make a copy of an index entry */
void copy_mail(struct mail_data *to, struct mail_data *from, int copy_mode); /* Copy the mail data to a new mail */
int create_mail_index_entry(struct mail_data *mail); /* Add a mail to the mudmail index list */
bool delete_mail_index_entry(int mail_id); /* Delete one mudmail from the index (by id) */
bool save_mail_index(void); /* Save the mail index, returns TRUE on success */
int handle_mail_obj(struct obj_data *temp, struct mail_data *ml);/* Put loaded objects into the actual mail */
bool check_mail_dir(long mail_id); /* Check that a mail folder exists or create it */
bool save_as_draft(struct char_data *ch, struct mail_data *ml); /* Save mail as a draft for sending later */
bool save_mail(struct mail_data *ml); /* Save the actual mail for the mudmail file */
bool load_mail(long mail_id, struct mail_data *ml); /* Load mail by id - put data into ml */
void draft_timeout(void); /* Perform a timeout on old draft mails */
bool mail_recip_ok(const char *name); /* Validate a player name for recipients */
struct char_data *find_mailman(struct char_data *ch); /* returns a mailman in the same room as player */
struct char_data *find_immortal_mailman(void); /* returns a mailman in immortal mail room */
int show_inbox_to_char(struct char_data *ch); /* Displays the player's inbox */
int show_outbox_to_char(struct char_data *ch); /* Displays the player's outbox */
void give_mail_attachments(struct char_data *ch, struct mail_data *ml); /* give all mail attachments to a player */
int count_recipients(struct mail_edit_data *ml_list); /* Count the number of recipients in edited mail */
void clear_mail_data(struct mail_data *ml); /* Set all values in struct to zero or NULL */
int purge_marked_mail(struct char_data *ch); /* purges all marked mail for one player */
struct mail_data *create_mail(void); /* Create a new blank mail_data structure */
bool add_recipient(struct mail_edit_data *ml, long player_id); /* Add a recipient to list for mailing */
bool remove_recipient(struct mail_edit_data *ml, long player_id); /* Remove a recipient from the list for mailing */
void clear_recipients(struct mail_edit_data *ml); /* Clear a whole recipient list */
char *recipient_list(struct mail_edit_data *ml); /* Get a list of all recipients */
long get_mail_group_by_name(char *name); /* Get the recipient id from the group name */
void list_attachments_numbered(struct obj_data *list, struct char_data *ch); /* Stacked list of attachments */
struct obj_data *get_attachment_numbered(struct char_data *ch, struct obj_data *list, int find_num); /* Return obj by stacked list line */
bool mail_from_player(long to, long from, char *message_pointer); /* Send a mail from a player to another player */
bool mail_from_mobile(struct char_data *mob); /* Send a mail from a mob using scripts */
void make_cod_payment_mail(struct mail_data *orig); /* Send an auto-COD reply back to mail sender */
bool perform_send_edited(struct char_data *ch, struct mail_edit_data *ml_list); /* Send to multiple recipients */
bool perform_mob_send_edited(struct char_data *mob); /* Send a scripted mob mudmail */
void create_mob_mail(struct char_data *mob); /* Create a blank mail structure if needed */
bool has_mail(struct char_data *ch); /* returns TRUE is player has mail waiting */
int count_deleted(struct char_data *ch); /* Returns the number of mails marked as deleted */
void notify_if_playing(struct char_data *from, int recipient_id); /* Inform a player of a new mail arrival */
void notify_on_login(struct char_data *ch); /* Tell player how many new mails they have */
char *get_sender_name(struct mail_data *ml); /* Get the name of the mail sender by mail_data */
char *get_sender_name_by_id(long mail_id); /* Get the name of the mail sender by mail_id */
char *get_recipient_name(struct mail_data *ml); /* Get the name of the mail recip by mail_data */
char *get_recipient_name_by_id(long mail_id); /* Get the name of the mail recipient by mail_id */
int attachment_count(struct mail_data *ml); /* Count the number of mail attachments */
char *get_mail_text(struct mail_data *ml); /* Create the text string thats shown to players */
void show_mail_to_char(struct char_data *ch, struct mail_data *ml); /* Display full mail details to player */
void mail_view(struct char_data *ch, long mail_id); /* Show a mail to a player (by mail id) */
bool mail_receive(struct char_data *ch, long mail_id); /* Convert a mail into an actual object in inv */
bool mail_delmark(struct char_data *ch, long mail_id); /* Mark a mail for deletion at next purge */
bool mail_forward(struct char_data *ch, long mail_id, long recipient); /* Forward a mail without changing any text */
long get_id_by_inbox_num(struct char_data *ch, int num); /* Work out which mail_id player wants to use */
long get_id_by_outbox_num(struct char_data *ch, int num); /* Work out which mail_id player wants to use */
void mail_view_by_num(struct char_data *ch, int num); /* Show a mail to player by inbox entry number */
bool mail_receive_by_num(struct char_data *ch, int num); /* Receive a mail by inbox entry number */
bool mail_delmark_by_num(struct char_data *ch, int num); /* Mark as deleted by inbox entry number */
ACMD(do_mail);
/* Functions in mailedit.c */
ACMD(do_mailedit); /* The mail edit command, called from do_mail */
void mailedit_setup(struct descriptor_data *d); /* Setup a blank structure ready for editing */
void mailedit_cleanup(struct descriptor_data *d); /* Free up the actual OLC structure for exiting */
void mailedit_disp_menu(struct descriptor_data *d); /* Display inbox menu view */
void mailedit_disp_mail(struct descriptor_data *d); /* Display main mail editor (for edit/reply/etc) */
void mailedit_parse(struct descriptor_data *d, char *arg); /* The mail mailedit parser */

View file

@ -103,7 +103,7 @@ ACMD(do_oasis_medit)
/* Give descriptor an OLC structure. */ /* Give descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis_medit: Player already had olc structure."); "SYSERR: do_oasis_medit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -132,7 +132,7 @@ ACMD(do_oasis_medit)
if (save) { if (save) {
send_to_char(ch, "Saving all mobiles in zone %d.\r\n", send_to_char(ch, "Saving all mobiles in zone %d.\r\n",
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves mobile info for zone %d.", "OLC: %s saves mobile info for zone %d.",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number);
@ -162,7 +162,7 @@ ACMD(do_oasis_medit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE,"OLC: %s starts editing zone %d allowed zone %d", mudlog(CMP, LVL_IMMORT, TRUE,"OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -545,7 +545,7 @@ void medit_parse(struct descriptor_data *d, char *arg)
case 'Y': case 'Y':
/* Save the mob in memory and to disk. */ /* Save the mob in memory and to disk. */
medit_save_internally(d); medit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits mob %d", GET_NAME(d->character), OLC_NUM(d)); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits mob %d", GET_NAME(d->character), OLC_NUM(d));
if (CONFIG_OLC_SAVE) { if (CONFIG_OLC_SAVE) {
medit_save_to_disk(zone_table[real_zone_by_thing(OLC_NUM(d))].number); medit_save_to_disk(zone_table[real_zone_by_thing(OLC_NUM(d))].number);
write_to_output(d, "Mobile saved to disk.\r\n"); write_to_output(d, "Mobile saved to disk.\r\n");
@ -875,7 +875,7 @@ void medit_parse(struct descriptor_data *d, char *arg)
* We should never get here. * We should never get here.
*/ */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: medit_parse(): Reached D_DESC case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: medit_parse(): Reached D_DESC case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
@ -1051,7 +1051,7 @@ void medit_parse(struct descriptor_data *d, char *arg)
break; break;
case MEDIT_LEVEL: case MEDIT_LEVEL:
GET_LEVEL(OLC_MOB(d)) = LIMIT(i, 1, CONFIG_MAX_LEVEL); GET_LEVEL(OLC_MOB(d)) = LIMIT(i, 1, LVL_IMPL);
OLC_VAL(d) = TRUE; OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d); medit_disp_stats_menu(d);
return; return;
@ -1089,7 +1089,7 @@ void medit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here. */ /* We should never get here. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: medit_parse(): Reached default case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: medit_parse(): Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }
@ -1117,7 +1117,7 @@ void medit_autoroll_stats(struct descriptor_data *d)
int mob_lev; int mob_lev;
mob_lev = GET_LEVEL(OLC_MOB(d)); mob_lev = GET_LEVEL(OLC_MOB(d));
mob_lev = GET_LEVEL(OLC_MOB(d)) = LIMIT(mob_lev, 1, CONFIG_MAX_LEVEL); mob_lev = GET_LEVEL(OLC_MOB(d)) = LIMIT(mob_lev, 1, LVL_IMPL);
GET_MOVE(OLC_MOB(d)) = mob_lev*10; /* hit point bonus (mobs don't use movement points */ GET_MOVE(OLC_MOB(d)) = mob_lev*10; /* hit point bonus (mobs don't use movement points */
GET_HIT(OLC_MOB(d)) = mob_lev/5; /* number of hitpoint dice */ GET_HIT(OLC_MOB(d)) = mob_lev/5; /* number of hitpoint dice */

View file

@ -82,7 +82,7 @@ void mobile_activity(void)
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_NOMOB) && !ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_NOMOB) &&
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_DEATH) && !ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_DEATH) &&
(!MOB_FLAGGED(ch, MOB_STAY_ZONE) || (!MOB_FLAGGED(ch, MOB_STAY_ZONE) ||
(world[EXIT(ch, door)->to_room].zone == world[IN_ROOM(ch)].zone))) (world[EXIT(ch, door)->to_room].zone == world[IN_ROOM(ch)].zone)))
{ {
/* If the mob is charmed, do not move the mob. */ /* If the mob is charmed, do not move the mob. */
if (ch->master == NULL) if (ch->master == NULL)
@ -136,7 +136,7 @@ void mobile_activity(void)
} }
} }
/* Charmed Mob Rebellion: In order to rebel, there need to be more charmed /* Charmed Mob Rebellion: In order to rebel, there need to be more charmed
* monsters than the person can feasibly control at a time. Then the * monsters than the person can feasibly control at a time. Then the
* mobiles have a chance based on the charisma of their leader. * mobiles have a chance based on the charisma of their leader.
* 1-4 = 0, 5-7 = 1, 8-10 = 2, 11-13 = 3, 14-16 = 4, 17-19 = 5, etc. */ * 1-4 = 0, 5-7 = 1, 8-10 = 2, 11-13 = 3, 14-16 = 4, 17-19 = 5, etc. */
@ -149,13 +149,13 @@ void mobile_activity(void)
} }
/* Helper Mobs */ /* Helper Mobs */
if (MOB_FLAGGED(ch, MOB_HELPER) && (!AFF_FLAGGED(ch, AFF_BLIND) || !AFF_FLAGGED(ch, AFF_CHARM))) if (MOB_FLAGGED(ch, MOB_HELPER) && (!AFF_FLAGGED(ch, AFF_BLIND) || !AFF_FLAGGED(ch, AFF_CHARM)))
{ {
found = FALSE; found = FALSE;
for (vict = world[IN_ROOM(ch)].people; vict && !found; vict = vict->next_in_room) for (vict = world[IN_ROOM(ch)].people; vict && !found; vict = vict->next_in_room)
{ {
if (ch == vict || !IS_NPC(vict) || !FIGHTING(vict)) if (ch == vict || !IS_NPC(vict) || !FIGHTING(vict))
continue; continue;
if (IS_NPC(FIGHTING(vict)) || ch == FIGHTING(vict)) if (IS_NPC(FIGHTING(vict)) || ch == FIGHTING(vict))
continue; continue;
@ -232,8 +232,8 @@ void clearMemory(struct char_data *ch)
MEMORY(ch) = NULL; MEMORY(ch) = NULL;
} }
/* An aggressive mobile wants to attack something. If they're under the /* An aggressive mobile wants to attack something. If they're under the
* influence of mind altering PC, then see if their master can talk them out * influence of mind altering PC, then see if their master can talk them out
* of it, eye them down, or otherwise intimidate the slave. */ * of it, eye them down, or otherwise intimidate the slave. */
static bool aggressive_mob_on_a_leash(struct char_data *slave, struct char_data *master, struct char_data *attack) static bool aggressive_mob_on_a_leash(struct char_data *slave, struct char_data *master, struct char_data *attack)
{ {

View file

@ -155,10 +155,10 @@ void string_add(struct descriptor_data *d, char *str)
case CON_HEDIT: case CON_HEDIT:
case CON_QEDIT: case CON_QEDIT:
case CON_IBTEDIT: case CON_IBTEDIT:
free(*d->str); free(*d->str);
*d->str = d->backstr; *d->str = d->backstr;
d->backstr = NULL; d->backstr = NULL;
d->str = NULL; d->str = NULL;
break; break;
default: default:
log("SYSERR: string_add: Aborting write from unknown origin."); log("SYSERR: string_add: Aborting write from unknown origin.");
@ -196,7 +196,6 @@ void string_add(struct descriptor_data *d, char *str)
{ CON_HEDIT, hedit_string_cleanup }, { CON_HEDIT, hedit_string_cleanup },
{ CON_QEDIT , qedit_string_cleanup }, { CON_QEDIT , qedit_string_cleanup },
{ CON_IBTEDIT, ibtedit_string_cleanup }, { CON_IBTEDIT, ibtedit_string_cleanup },
{ CON_MAILEDIT , mailedit_string_cleanup },
{ -1, NULL } { -1, NULL }
}; };
@ -223,12 +222,9 @@ static void playing_string_cleanup(struct descriptor_data *d, int action)
{ {
if (PLR_FLAGGED(d->character, PLR_MAILING)) { if (PLR_FLAGGED(d->character, PLR_MAILING)) {
if (action == STRINGADD_SAVE && *d->str) { if (action == STRINGADD_SAVE && *d->str) {
if (mail_from_player(d->mail_to, GET_IDNUM(d->character), *d->str)) { store_mail(d->mail_to, GET_IDNUM(d->character), *d->str);
write_to_output(d, "Message sent!\r\n"); write_to_output(d, "Message sent!\r\n");
notify_if_playing(d->character, d->mail_to); notify_if_playing(d->character, d->mail_to);
} else {
write_to_output(d, "Error: Mail could not be sent. Please tell an Imm\r\n");
}
} else } else
write_to_output(d, "Mail aborted.\r\n"); write_to_output(d, "Mail aborted.\r\n");
free(*d->str); free(*d->str);
@ -354,7 +350,7 @@ ACMD(do_skillset)
send_to_char(ch, "You can't set NPC skills.\r\n"); send_to_char(ch, "You can't set NPC skills.\r\n");
return; return;
} }
if ((spell_info[skill].min_level[(pc)] > CONFIG_MAX_LEVEL) && (!IS_ADMIN(vict, ADMLVL_IMMORT))) { if ((spell_info[skill].min_level[(pc)] >= LVL_IMMORT) && (pl < LVL_IMMORT)) {
send_to_char(ch, "%s cannot be learned by mortals.\r\n", spell_info[skill].name); send_to_char(ch, "%s cannot be learned by mortals.\r\n", spell_info[skill].name);
return; return;
} else if (spell_info[skill].min_level[(pc)] > pl) { } else if (spell_info[skill].min_level[(pc)] > pl) {
@ -365,7 +361,7 @@ ACMD(do_skillset)
/* find_skill_num() guarantees a valid spell_info[] index, or -1, and we /* find_skill_num() guarantees a valid spell_info[] index, or -1, and we
* checked for the -1 above so we are safe here. */ * checked for the -1 above so we are safe here. */
SET_SKILL(vict, skill, value); SET_SKILL(vict, skill, value);
mudlog(BRF, ADMLVL_IMMORT, TRUE, "%s changed %s's %s to %d.", GET_NAME(ch), GET_NAME(vict), spell_info[skill].name, value); mudlog(BRF, LVL_IMMORT, TRUE, "%s changed %s's %s to %d.", GET_NAME(ch), GET_NAME(vict), spell_info[skill].name, value);
send_to_char(ch, "You change %s's %s to %d.\r\n", GET_NAME(vict), spell_info[skill].name, value); send_to_char(ch, "You change %s's %s to %d.\r\n", GET_NAME(vict), spell_info[skill].name, value);
} }

View file

@ -27,7 +27,6 @@
#include "quest.h" #include "quest.h"
#include "ibt.h" #include "ibt.h"
/* Internal Data Structures */ /* Internal Data Structures */
/** @deprecated olc_scmd_info appears to be deprecated. Commented out for now. /** @deprecated olc_scmd_info appears to be deprecated. Commented out for now.
static struct olc_scmd_info_t { static struct olc_scmd_info_t {
@ -49,7 +48,7 @@ static struct olc_scmd_info_t {
*/ */
/* Global variables defined here, used elsewhere */ /* Global variables defined here, used elsewhere */
const char *nrm, *grn, *cyn, *yel, *gry; const char *nrm, *grn, *cyn, *yel;
/* Internal Function prototypes */ /* Internal Function prototypes */
static void free_config(struct config_data *data); static void free_config(struct config_data *data);
@ -71,7 +70,6 @@ void get_char_colors(struct char_data *ch)
grn = CCGRN(ch, C_NRM); grn = CCGRN(ch, C_NRM);
cyn = CCCYN(ch, C_NRM); cyn = CCCYN(ch, C_NRM);
yel = CCYEL(ch, C_NRM); yel = CCYEL(ch, C_NRM);
gry = CBBLK(ch, C_NRM);
} }
/* This procedure frees up the strings and/or the structures attatched to a /* This procedure frees up the strings and/or the structures attatched to a
@ -175,11 +173,11 @@ void cleanup_olc(struct descriptor_data *d, byte cleanup_type)
} }
} }
if (OLC_IBT(d)) { if (OLC_IBT(d)) {
free_olc_ibt(OLC_IBT(d)); free_olc_ibt(OLC_IBT(d));
OLC_IBT(d) = NULL; OLC_IBT(d) = NULL;
} }
/* Free storage if allocated (tedit, aedit, and trigedit). This is the command /* Free storage if allocated (tedit, aedit, and trigedit). This is the command
* list - it's been copied to disk already, so just free it -Welcor. */ * list - it's been copied to disk already, so just free it -Welcor. */
if (OLC_STORAGE(d)) { if (OLC_STORAGE(d)) {
@ -212,13 +210,13 @@ void cleanup_olc(struct descriptor_data *d, byte cleanup_type)
act("$n stops using OLC.", TRUE, d->character, NULL, NULL, TO_ROOM); act("$n stops using OLC.", TRUE, d->character, NULL, NULL, TO_ROOM);
if (cleanup_type == CLEANUP_CONFIG) if (cleanup_type == CLEANUP_CONFIG)
mudlog(BRF, ADMLVL_IMMORT, TRUE, "OLC: %s stops editing the game configuration", GET_NAME(d->character)); mudlog(BRF, LVL_IMMORT, TRUE, "OLC: %s stops editing the game configuration", GET_NAME(d->character));
else if (STATE(d) == CON_TEDIT) else if (STATE(d) == CON_TEDIT)
mudlog(BRF, ADMLVL_IMMORT, TRUE, "OLC: %s stops editing text files.", GET_NAME(d->character)); mudlog(BRF, LVL_IMMORT, TRUE, "OLC: %s stops editing text files.", GET_NAME(d->character));
else if (STATE(d) == CON_HEDIT) else if (STATE(d) == CON_HEDIT)
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s stops editing help files.", GET_NAME(d->character)); mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s stops editing help files.", GET_NAME(d->character));
else else
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s stops editing zone %d allowed zone %d", GET_NAME(d->character), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(d->character)); mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s stops editing zone %d allowed zone %d", GET_NAME(d->character), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(d->character));
STATE(d) = CON_PLAYING; STATE(d) = CON_PLAYING;
} }
@ -282,8 +280,8 @@ int can_edit_zone(struct char_data *ch, zone_rnum rnum)
if (GET_OLC_ZONE(ch) == AEDIT_PERMISSION && rnum == AEDIT_PERMISSION) if (GET_OLC_ZONE(ch) == AEDIT_PERMISSION && rnum == AEDIT_PERMISSION)
return TRUE; return TRUE;
/* always access if ch is high enough level (Imps don't need ADM_BUILD) */ /* always access if ch is high enough level */
if (IS_ADMIN(ch, ADMLVL_IMPL)) if (GET_LEVEL(ch) >= LVL_GRGOD)
return (TRUE); return (TRUE);
/* always access if a player helped build the zone in the first place */ /* always access if a player helped build the zone in the first place */
@ -296,11 +294,9 @@ int can_edit_zone(struct char_data *ch, zone_rnum rnum)
return FALSE; return FALSE;
} }
/* no access if you're not at least LVL_BUILDER, or don't have any builder privs */ /* no access if you're not at least LVL_BUILDER */
if (GET_ADMLEVEL(ch) < ADMLVL_BUILDER) { if (GET_LEVEL(ch) < LVL_BUILDER)
if (!ADM_FLAGGED(ch, ADM_BUILD) && !ADM_FLAGGED(ch, ADM_ADVBUILD)) return FALSE;
return FALSE;
}
/* always access if you're assigned to this zone */ /* always access if you're assigned to this zone */
if (real_zone(GET_OLC_ZONE(ch)) == rnum) if (real_zone(GET_OLC_ZONE(ch)) == rnum)
@ -320,6 +316,6 @@ void send_cannot_edit(struct char_data *ch, zone_vnum zone)
send_to_char(ch, "You do not have permission to edit zone %d.\r\n", zone); send_to_char(ch, "You do not have permission to edit zone %d.\r\n", zone);
sprintf(buf, "OLC: %s tried to edit zone %d.", GET_NAME(ch), zone); sprintf(buf, "OLC: %s tried to edit zone %d.", GET_NAME(ch), zone);
} }
mudlog(BRF, ADMLVL_IMPL, TRUE, "%s", buf); mudlog(BRF, LVL_IMPL, TRUE, "%s", buf);
} }

View file

@ -80,25 +80,23 @@ void send_cannot_edit(struct char_data *ch, zone_vnum zone);
/* NO and YES are defined in utils.h. Removed from here. */ /* NO and YES are defined in utils.h. Removed from here. */
struct oasis_olc_data { struct oasis_olc_data {
int mode; /* how to parse input */ int mode; /* how to parse input */
zone_rnum zone_num; /* current zone */ zone_rnum zone_num; /* current zone */
room_vnum number; /* vnum of subject */ room_vnum number; /* vnum of subject */
int value; /* mostly 'has changed' flag*/ int value; /* mostly 'has changed' flag*/
char *storage; /* used for 'tedit' */ char *storage; /* used for 'tedit' */
struct char_data *mob; /* used for 'medit' */ struct char_data *mob; /* used for 'medit' */
struct room_data *room; /* used for 'redit' */ struct room_data *room; /* used for 'redit' */
struct obj_data *obj; /* used for 'oedit' */ struct obj_data *obj; /* used for 'oedit' */
struct zone_data *zone; /* used for 'zedit' */ struct zone_data *zone; /* used for 'zedit' */
struct shop_data *shop; /* used for 'sedit' */ struct shop_data *shop; /* used for 'sedit' */
struct config_data *config; /* used for 'cedit' */ struct config_data *config; /* used for 'cedit' */
struct aq_data *quest; /* used for 'qedit' */ struct aq_data *quest; /* used for 'qedit' */
struct extra_descr_data *desc; /* used in '[r|o|m]edit' */ struct extra_descr_data *desc; /* used in '[r|o|m]edit' */
struct social_messg *action; /* Aedit uses this one */ struct social_messg *action; /* Aedit uses this one */
struct trig_data *trig; struct trig_data *trig;
struct prefs_data *prefs; /* used for 'prefedit' */ struct prefs_data *prefs; /* used for 'prefedit' */
struct ibt_data *ibt; /* used for 'ibtedit' */ struct ibt_data *ibt; /* used for 'ibtedit' */
struct house_control_data *house; /* used for 'hsedit' */
struct mail_edit_data *mail; /* used for Mudmail editor */
int script_mode; int script_mode;
int trigger_position; int trigger_position;
int item_type; int item_type;
@ -107,7 +105,7 @@ struct oasis_olc_data {
}; };
/* Exported globals. */ /* Exported globals. */
extern const char *nrm, *grn, *cyn, *yel, *gry; extern const char *nrm, *grn, *cyn, *yel;
/* Descriptor access macros. */ /* Descriptor access macros. */
#define OLC(d) ((d)->olc) #define OLC(d) ((d)->olc)
@ -131,8 +129,6 @@ extern const char *nrm, *grn, *cyn, *yel, *gry;
#define OLC_HELP(d) (OLC(d)->help) /**< Hedit structure */ #define OLC_HELP(d) (OLC(d)->help) /**< Hedit structure */
#define OLC_PREFS(d) (OLC(d)->prefs) /**< Preferences structure */ #define OLC_PREFS(d) (OLC(d)->prefs) /**< Preferences structure */
#define OLC_IBT(d) (OLC(d)->ibt) /**< IBT (idea/bug/typo) structure */ #define OLC_IBT(d) (OLC(d)->ibt) /**< IBT (idea/bug/typo) structure */
#define OLC_HOUSE(d) (OLC(d)->house) /**< Player-Owned House/Shop structure */
#define OLC_MAIL(d) (OLC(d)->mail) /**< Mudmail structure. */
/* Other macros. */ /* Other macros. */
#define OLC_EXIT(d) (OLC_ROOM(d)->dir_option[OLC_VAL(d)]) #define OLC_EXIT(d) (OLC_ROOM(d)->dir_option[OLC_VAL(d)])
@ -335,54 +331,45 @@ extern const char *nrm, *grn, *cyn, *yel, *gry;
#define CEDIT_MENU 14 #define CEDIT_MENU 14
#define CEDIT_WELC_MESSG 15 #define CEDIT_WELC_MESSG 15
#define CEDIT_START_MESSG 16 #define CEDIT_START_MESSG 16
#define CEDIT_MUDMAIL_OPTIONS_MENU 17
/* Numerical responses. */ /* Numerical responses. */
#define CEDIT_NUMERICAL_RESPONSE 20 #define CEDIT_NUMERICAL_RESPONSE 20
#define CEDIT_LEVEL_CAN_SHOUT 21 #define CEDIT_LEVEL_CAN_SHOUT 21
#define CEDIT_HOLLER_MOVE_COST 22 #define CEDIT_HOLLER_MOVE_COST 22
#define CEDIT_TUNNEL_SIZE 23 #define CEDIT_TUNNEL_SIZE 23
#define CEDIT_MAX_EXP_GAIN 24 #define CEDIT_MAX_EXP_GAIN 24
#define CEDIT_MAX_EXP_LOSS 25 #define CEDIT_MAX_EXP_LOSS 25
#define CEDIT_MAX_NPC_CORPSE_TIME 26 #define CEDIT_MAX_NPC_CORPSE_TIME 26
#define CEDIT_MAX_PC_CORPSE_TIME 27 #define CEDIT_MAX_PC_CORPSE_TIME 27
#define CEDIT_MAX_LEVEL 28 #define CEDIT_IDLE_VOID 28
#define CEDIT_IDLE_VOID 29 #define CEDIT_IDLE_RENT_TIME 29
#define CEDIT_IDLE_RENT_TIME 30 #define CEDIT_IDLE_MAX_LEVEL 30
#define CEDIT_IDLE_MAX_LEVEL 31 #define CEDIT_DTS_ARE_DUMPS 31
#define CEDIT_DTS_ARE_DUMPS 32 #define CEDIT_LOAD_INTO_INVENTORY 32
#define CEDIT_LOAD_INTO_INVENTORY 33 #define CEDIT_TRACK_THROUGH_DOORS 33
#define CEDIT_TRACK_THROUGH_DOORS 34 #define CEDIT_NO_MORT_TO_IMMORT 34
#define CEDIT_NO_MORT_TO_IMMORT 35 #define CEDIT_MAX_OBJ_SAVE 35
#define CEDIT_MAX_OBJ_SAVE 36 #define CEDIT_MIN_RENT_COST 36
#define CEDIT_MIN_RENT_COST 37 #define CEDIT_AUTOSAVE_TIME 37
#define CEDIT_AUTOSAVE_TIME 38 #define CEDIT_CRASH_FILE_TIMEOUT 38
#define CEDIT_CRASH_FILE_TIMEOUT 39 #define CEDIT_RENT_FILE_TIMEOUT 39
#define CEDIT_RENT_FILE_TIMEOUT 40 #define CEDIT_MORTAL_START_ROOM 40
#define CEDIT_MORTAL_START_ROOM 41 #define CEDIT_IMMORT_START_ROOM 41
#define CEDIT_IMMORT_START_ROOM 42 #define CEDIT_FROZEN_START_ROOM 42
#define CEDIT_FROZEN_START_ROOM 43 #define CEDIT_DONATION_ROOM_1 43
#define CEDIT_DONATION_ROOM_1 44 #define CEDIT_DONATION_ROOM_2 44
#define CEDIT_DONATION_ROOM_2 45 #define CEDIT_DONATION_ROOM_3 45
#define CEDIT_DONATION_ROOM_3 46 #define CEDIT_DFLT_PORT 46
#define CEDIT_DFLT_PORT 47 #define CEDIT_MAX_PLAYING 47
#define CEDIT_MAX_PLAYING 48 #define CEDIT_MAX_FILESIZE 48
#define CEDIT_MAX_FILESIZE 49 #define CEDIT_MAX_BAD_PWS 49
#define CEDIT_MAX_BAD_PWS 50 #define CEDIT_SITEOK_EVERYONE 50
#define CEDIT_SITEOK_EVERYONE 51 #define CEDIT_NAMESERVER_IS_SLOW 51
#define CEDIT_NAMESERVER_IS_SLOW 52 #define CEDIT_USE_AUTOWIZ 52
#define CEDIT_USE_AUTOWIZ 53 #define CEDIT_MIN_WIZLIST_LEV 53
#define CEDIT_MIN_WIZLIST_LEV 54 #define CEDIT_MAP_OPTION 54
#define CEDIT_MAP_OPTION 55 #define CEDIT_MAP_SIZE 55
#define CEDIT_MAP_SIZE 56 #define CEDIT_MINIMAP_SIZE 56
#define CEDIT_MINIMAP_SIZE 57
#define CEDIT_STAMP_COST 58
#define CEDIT_OBJECT_COST 59
#define CEDIT_DRAFT_TIMEOUT 60
#define CEDIT_MIN_MAIL_LEVEL 61
#define CEDIT_MIN_FREE_LEVEL 62
#define CEDIT_MAIL_ANYWHERE 63
#define CEDIT_MAIL_ALL_PLAYERS 64
/* Hedit Submodes of connectedness. */ /* Hedit Submodes of connectedness. */
#define HEDIT_CONFIRM_SAVESTRING 0 #define HEDIT_CONFIRM_SAVESTRING 0
@ -393,32 +380,6 @@ extern const char *nrm, *grn, *cyn, *yel, *gry;
#define HEDIT_KEYWORDS 5 #define HEDIT_KEYWORDS 5
#define HEDIT_MIN_LEVEL 6 #define HEDIT_MIN_LEVEL 6
/*. House editor - Submodes of HSEDIT connectedness. */
#define HSEDIT_MAIN_MENU 0
#define HSEDIT_CONFIRM_SAVESTRING 1
#define HSEDIT_OWNER_MENU 2
#define HSEDIT_OWNER_NAME 3
#define HSEDIT_OWNER_ID 4
#define HSEDIT_ROOM 5
#define HSEDIT_ATRIUM 6
#define HSEDIT_DIR_MENU 7
#define HSEDIT_GUEST_MENU 8
#define HSEDIT_GUEST_ADD 9
#define HSEDIT_GUEST_DELETE 10
#define HSEDIT_GUEST_CLEAR 11
#define HSEDIT_FLAGS 12
#define HSEDIT_BUILD_DATE 13
#define HSEDIT_PAYMENT 14
#define HSEDIT_TYPE 15
#define HSEDIT_DELETE 16
#define HSEDIT_VALUE_0 17
#define HSEDIT_VALUE_1 18
#define HSEDIT_VALUE_2 19
#define HSEDIT_VALUE_3 20
#define HSEDIT_NOVNUM 21
#define HSEDIT_BUILDER 22
#define HSEDIT_RECEP 23
int save_config( IDXTYPE nowhere ); int save_config( IDXTYPE nowhere );
/* Prototypes to keep. */ /* Prototypes to keep. */
@ -426,12 +387,6 @@ void clear_screen(struct descriptor_data *);
int can_edit_zone(struct char_data *ch, zone_rnum rnum); int can_edit_zone(struct char_data *ch, zone_rnum rnum);
ACMD(do_oasis); ACMD(do_oasis);
/* public functions from mailedit.c */
ACMD(do_mail);
ACMD(do_mailedit);
void mailedit_string_cleanup(struct descriptor_data *d, int terminator);
void mailedit_parse(struct descriptor_data *d, char *arg);
/* public functions from medit.c */ /* public functions from medit.c */
void medit_setup_existing(struct descriptor_data *d, int rnum); void medit_setup_existing(struct descriptor_data *d, int rnum);
void medit_save_internally(struct descriptor_data *d); void medit_save_internally(struct descriptor_data *d);
@ -494,12 +449,6 @@ ACMD(do_tedit);
/* public functions from qedit.c */ /* public functions from qedit.c */
ACMD(do_oasis_qedit); ACMD(do_oasis_qedit);
/* public functions from hsedit.c */
void hsedit_parse(struct descriptor_data * d, char *arg);
void hsedit_string_cleanup(struct descriptor_data *d, int terminator);
ACMD(do_oasis_hsedit);
/* public functions from oasis_copy.c */ /* public functions from oasis_copy.c */
int buildwalk(struct char_data *ch, int dir); int buildwalk(struct char_data *ch, int dir);
ACMD(do_dig); ACMD(do_dig);

View file

@ -67,7 +67,7 @@ ACMD(do_oasis_copy)
return; return;
/* No copying as a mob or while being forced. */ /* No copying as a mob or while being forced. */
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
return; return;
/* We need two arguments. */ /* We need two arguments. */
@ -112,7 +112,7 @@ ACMD(do_oasis_copy)
/* Give the descriptor an OLC structure. */ /* Give the descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis_copy: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_copy: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -187,7 +187,7 @@ ACMD(do_dig)
send_to_char(ch, "You do not have permission to edit this zone.\r\n"); send_to_char(ch, "You do not have permission to edit this zone.\r\n");
return; return;
} }
/* Lets not allow digging to limbo. After all, it'd just get us more errors /* Lets not allow digging to limbo. After all, it'd just get us more errors
* on 'show errors.' */ * on 'show errors.' */
if (rvnum == 0) { if (rvnum == 0) {
send_to_char(ch, "The target exists, but you can't dig to limbo!\r\n"); send_to_char(ch, "The target exists, but you can't dig to limbo!\r\n");
@ -230,10 +230,10 @@ ACMD(do_dig)
/* Now we know the builder is allowed to make the link. */ /* Now we know the builder is allowed to make the link. */
/* If the room doesn't exist, create it.*/ /* If the room doesn't exist, create it.*/
if (rrnum == NOWHERE) { if (rrnum == NOWHERE) {
/* Give the descriptor an olc struct. This way we can let /* Give the descriptor an olc struct. This way we can let
* redit_save_internally handle the room adding. */ * redit_save_internally handle the room adding. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_dig: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_dig: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
CREATE(d->olc, struct oasis_olc_data, 1); CREATE(d->olc, struct oasis_olc_data, 1);
@ -253,7 +253,7 @@ ACMD(do_dig)
OLC_ROOM(d)->zone = OLC_ZNUM(d); OLC_ROOM(d)->zone = OLC_ZNUM(d);
OLC_ROOM(d)->number = NOWHERE; OLC_ROOM(d)->number = NOWHERE;
/* Save the new room to memory. redit_save_internally handles adding the /* Save the new room to memory. redit_save_internally handles adding the
* room in the right place, etc. */ * room in the right place, etc. */
redit_save_internally(d); redit_save_internally(d);
OLC_VAL(d) = 0; OLC_VAL(d) = 0;
@ -315,7 +315,7 @@ int buildwalk(struct char_data *ch, int dir)
room_rnum rnum; room_rnum rnum;
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_BUILDWALK) && if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_BUILDWALK) &&
ADM_FLAGGED(ch, ADM_BUILD)) { GET_LEVEL(ch) >= LVL_BUILDER) {
get_char_colors(ch); get_char_colors(ch);
@ -325,10 +325,10 @@ int buildwalk(struct char_data *ch, int dir)
send_to_char(ch, "No free vnums are available in this zone!\r\n"); send_to_char(ch, "No free vnums are available in this zone!\r\n");
} else { } else {
struct descriptor_data *d = ch->desc; struct descriptor_data *d = ch->desc;
/* Give the descriptor an olc struct. This way we can let /* Give the descriptor an olc struct. This way we can let
* redit_save_internally handle the room adding. */ * redit_save_internally handle the room adding. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: buildwalk(): Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: buildwalk(): Player already had olc structure.");
free(d->olc); free(d->olc);
} }
CREATE(d->olc, struct oasis_olc_data, 1); CREATE(d->olc, struct oasis_olc_data, 1);
@ -342,9 +342,9 @@ int buildwalk(struct char_data *ch, int dir)
OLC_ROOM(d)->description = strdup(buf); OLC_ROOM(d)->description = strdup(buf);
OLC_ROOM(d)->zone = OLC_ZNUM(d); OLC_ROOM(d)->zone = OLC_ZNUM(d);
OLC_ROOM(d)->number = NOWHERE; OLC_ROOM(d)->number = NOWHERE;
OLC_ROOM(d)->sector_type = GET_BUILDWALK_SECTOR(ch); OLC_ROOM(d)->sector_type = GET_BUILDWALK_SECTOR(ch);
/* Save the new room to memory. redit_save_internally handles adding the /* Save the new room to memory. redit_save_internally handles adding the
* room in the right place, etc. */ * room in the right place, etc. */
redit_save_internally(d); redit_save_internally(d);
OLC_VAL(d) = 0; OLC_VAL(d) = 0;

View file

@ -19,7 +19,7 @@
#include "improved-edit.h" #include "improved-edit.h"
/* Free's strings from any object, room, mobiles, or player. TRUE if successful, /* Free's strings from any object, room, mobiles, or player. TRUE if successful,
* otherwise, it returns FALSE. Type - The OLC type constant relating to the * otherwise, it returns FALSE. Type - The OLC type constant relating to the
* data type of data. */ * data type of data. */
int free_strings(void *data, int type) int free_strings(void *data, int type)
{ {
@ -47,7 +47,7 @@ int free_strings(void *data, int type)
case OASIS_EXI: case OASIS_EXI:
room = (struct room_data *) data; room = (struct room_data *) data;
for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */ for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */
if (room->dir_option[i]) { if (room->dir_option[i]) {
if (room->dir_option[i]->general_description) { if (room->dir_option[i]->general_description) {
free(room->dir_option[i]->general_description); free(room->dir_option[i]->general_description);
@ -101,7 +101,7 @@ int free_strings(void *data, int type)
return (TRUE); return (TRUE);
default: default:
mudlog(BRF, ADMLVL_GOD, TRUE, "SYSERR: oasis_delete.c: free_strings: Invalid type handled (Type %d).", type); mudlog(BRF, LVL_GOD, TRUE, "SYSERR: oasis_delete.c: free_strings: Invalid type handled (Type %d).", type);
return (FALSE); return (FALSE);
} }
} }

View file

@ -24,14 +24,13 @@
#include "quest.h" #include "quest.h"
#include "modify.h" #include "modify.h"
#include "spells.h" #include "spells.h"
#define MAX_OBJ_LIST 100 #define MAX_OBJ_LIST 100
struct obj_list_item { struct obj_list_item {
obj_vnum vobj; obj_vnum vobj;
int val; int val;
}; };
/* local functions */ /* local functions */
static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, trig_vnum vmax); static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, trig_vnum vmax);
static void list_rooms(struct char_data *ch , zone_rnum rnum, room_vnum vmin, room_vnum vmax); static void list_rooms(struct char_data *ch , zone_rnum rnum, room_vnum vmin, room_vnum vmax);
@ -42,7 +41,7 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon
void perform_mob_flag_list(struct char_data * ch, char *arg) void perform_mob_flag_list(struct char_data * ch, char *arg)
{ {
int num, mob_flag, found = 0, len=0, tmp_len=0; int num, mob_flag, found = 0, len;
struct char_data *mob; struct char_data *mob;
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@ -60,11 +59,12 @@ void perform_mob_flag_list(struct char_data * ch, char *arg)
if ((mob = read_mobile(num, REAL)) != NULL) { if ((mob = read_mobile(num, REAL)) != NULL) {
char_to_room(mob, 0); char_to_room(mob, 0);
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%5d%s]%s Level %s%-3d%s %s%s\r\n", len += snprintf(buf + len, sizeof(buf) - len, "%s%3d. %s[%s%5d%s]%s Level %s%-3d%s %s%s\r\n", CCNRM(ch, C_NRM),++found,
QNRM, ++found, QCYN, QYEL, GET_MOB_VNUM(mob), QCYN, QNRM, CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_MOB_VNUM(mob), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM),
QYEL, GET_LEVEL(mob), QNRM, GET_NAME(mob), QNRM); CCYEL(ch, C_NRM), GET_LEVEL(mob), CCNRM(ch, C_NRM), GET_NAME(mob), CCNRM(ch, C_NRM));
len += tmp_len;
extract_char(mob); /* Finished with the mob - remove it from the MUD */ extract_char(mob); /* Finished with the mob - remove it from the MUD */
if (len > sizeof(buf))
break;
} }
} }
} }
@ -72,11 +72,12 @@ void perform_mob_flag_list(struct char_data * ch, char *arg)
send_to_char(ch,"None Found!\r\n"); send_to_char(ch,"None Found!\r\n");
else else
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
return;
} }
void perform_mob_level_list(struct char_data * ch, char *arg) void perform_mob_level_list(struct char_data * ch, char *arg)
{ {
int num, mob_level, found = 0, len, tmp_len; int num, mob_level, found = 0, len;
struct char_data *mob; struct char_data *mob;
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
@ -93,11 +94,12 @@ void perform_mob_level_list(struct char_data * ch, char *arg)
if ((mob = read_mobile(num, REAL)) != NULL) { if ((mob = read_mobile(num, REAL)) != NULL) {
char_to_room(mob, 0); char_to_room(mob, 0);
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%5d%s]%s %s%s\r\n", len += snprintf(buf + len, sizeof(buf) - len, "%s%3d. %s[%s%5d%s]%s %s%s\r\n", CCNRM(ch, C_NRM),++found,
QNRM, ++found, QCYN, QYEL, GET_MOB_VNUM(mob), CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_MOB_VNUM(mob), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM),
QCYN, QNRM, GET_NAME(mob), QNRM); GET_NAME(mob), CCNRM(ch, C_NRM));
len += tmp_len;
extract_char(mob); /* Finished with the mob - remove it from the MUD */ extract_char(mob); /* Finished with the mob - remove it from the MUD */
if (len > sizeof(buf))
break;
} }
} }
} }
@ -105,6 +107,8 @@ void perform_mob_level_list(struct char_data * ch, char *arg)
send_to_char(ch,"None Found!\r\n"); send_to_char(ch,"None Found!\r\n");
else else
page_string(ch->desc, buf, TRUE); page_string(ch->desc, buf, TRUE);
return;
} }
void add_to_obj_list(struct obj_list_item *lst, int num_items, obj_vnum nvo, int nval) void add_to_obj_list(struct obj_list_item *lst, int num_items, obj_vnum nvo, int nval)
@ -360,7 +364,7 @@ ACMD(do_oasis_list)
if ((rzone == NOWHERE || rzone == 0) && subcmd == SCMD_OASIS_ZLIST && !isdigit(*smin)) { if ((rzone == NOWHERE || rzone == 0) && subcmd == SCMD_OASIS_ZLIST && !isdigit(*smin)) {
/* Must be zlist, with builder name as arg */ /* Must be zlist, with builder name as arg */
use_name = TRUE; use_name = TRUE;
} else if (rzone == NOWHERE) { } else if (rzone == NOWHERE) {
send_to_char(ch, "Sorry, there's no zone with that number\r\n"); send_to_char(ch, "Sorry, there's no zone with that number\r\n");
return; return;
} }
@ -384,10 +388,10 @@ ACMD(do_oasis_list)
send_to_char(ch, "Usage: %smlist <zone>%s - List mobiles in a zone\r\n", QYEL, QNRM); send_to_char(ch, "Usage: %smlist <zone>%s - List mobiles in a zone\r\n", QYEL, QNRM);
send_to_char(ch, " %smlist <vnum> <vnum>%s - List a range of mobiles by vnum\r\n", QYEL, QNRM); send_to_char(ch, " %smlist <vnum> <vnum>%s - List a range of mobiles by vnum\r\n", QYEL, QNRM);
send_to_char(ch, " %smlist level <num>%s - List all mobiles of a specified level\r\n", QYEL, QNRM); send_to_char(ch, " %smlist level <num>%s - List all mobiles of a specified level\r\n", QYEL, QNRM);
send_to_char(ch, " %smlist flags <num>%s - List all mobiles with flag set\r\n", QYEL, QNRM); send_to_char(ch, " %smlist flags <num>%s - List all mobiles with flag set\r\n", QYEL, QNRM);
send_to_char(ch, "Just type %smlist flags%s to view available options.\r\n", QYEL, QNRM); send_to_char(ch, "Just type %smlist flags%s to view available options.\r\n", QYEL, QNRM);
return; return;
} }
else if (is_abbrev(arg, "level") || is_abbrev(arg, "flags")) { else if (is_abbrev(arg, "level") || is_abbrev(arg, "flags")) {
int i; int i;
@ -423,7 +427,7 @@ ACMD(do_oasis_list)
send_to_char(ch, " %solist affect <num>%s - List top %d objects with affect\r\n", QYEL, QNRM, MAX_OBJ_LIST); send_to_char(ch, " %solist affect <num>%s - List top %d objects with affect\r\n", QYEL, QNRM, MAX_OBJ_LIST);
send_to_char(ch, "Just type %solist affect%s or %solist type%s to view available options\r\n", QYEL, QNRM, QYEL, QNRM); send_to_char(ch, "Just type %solist affect%s or %solist type%s to view available options\r\n", QYEL, QNRM, QYEL, QNRM);
return; return;
} }
else if (is_abbrev(arg, "type") || is_abbrev(arg, "affect")) { else if (is_abbrev(arg, "type") || is_abbrev(arg, "affect")) {
if (is_abbrev(arg, "type")) { if (is_abbrev(arg, "type")) {
if (!*arg2) { if (!*arg2) {
@ -480,7 +484,7 @@ ACMD(do_oasis_list)
break; break;
default: default:
send_to_char(ch, "You can't list that!\r\n"); send_to_char(ch, "You can't list that!\r\n");
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis_list: Unknown list option: %d", subcmd); "SYSERR: do_oasis_list: Unknown list option: %d", subcmd);
} }
} }
@ -542,7 +546,8 @@ static void list_rooms(struct char_data *ch, zone_rnum rnum, room_vnum vmin, roo
{ {
room_rnum i; room_rnum i;
room_vnum bottom, top; room_vnum bottom, top;
int j, counter = 0; int j, counter = 0, len;
char buf[MAX_STRING_LENGTH];
/* Expect a minimum / maximum number if the rnum for the zone is NOWHERE. */ /* Expect a minimum / maximum number if the rnum for the zone is NOWHERE. */
if (rnum != NOWHERE) { if (rnum != NOWHERE) {
@ -553,9 +558,10 @@ static void list_rooms(struct char_data *ch, zone_rnum rnum, room_vnum vmin, roo
top = vmax; top = vmax;
} }
send_to_char (ch, len = strlcpy(buf,
"Index VNum Room Name Exits\r\n" "Index VNum Room Name Exits\r\n"
"----- ------- -------------------------------------------- -----\r\n"); "----- ------- -------------------------------------------- -----\r\n",
sizeof(buf));
if (!top_of_world) if (!top_of_world)
return; return;
@ -566,7 +572,7 @@ static void list_rooms(struct char_data *ch, zone_rnum rnum, room_vnum vmin, roo
if ((world[i].number >= bottom) && (world[i].number <= top)) { if ((world[i].number >= bottom) && (world[i].number <= top)) {
counter++; counter++;
send_to_char(ch, "%4d) [%s%-5d%s] %s%-*s%s %s", len += snprintf(buf + len, sizeof(buf) - len, "%4d) [%s%-5d%s] %s%-*s%s %s",
counter, QGRN, world[i].number, QNRM, counter, QGRN, world[i].number, QNRM,
QCYN, count_color_chars(world[i].name)+44, world[i].name, QNRM, QCYN, count_color_chars(world[i].name)+44, world[i].name, QNRM,
world[i].proto_script ? "[TRIG] " : "" world[i].proto_script ? "[TRIG] " : ""
@ -579,16 +585,21 @@ static void list_rooms(struct char_data *ch, zone_rnum rnum, room_vnum vmin, roo
continue; continue;
if (world[W_EXIT(i, j)->to_room].zone != world[i].zone) if (world[W_EXIT(i, j)->to_room].zone != world[i].zone)
send_to_char(ch, "(%s%d%s)", QYEL, world[W_EXIT(i, j)->to_room].number, QNRM); len += snprintf(buf + len, sizeof(buf) - len, "(%s%d%s)", QYEL, world[W_EXIT(i, j)->to_room].number, QNRM);
} }
send_to_char(ch, "\r\n"); len += snprintf(buf + len, sizeof(buf) - len, "\r\n");
if (len > sizeof(buf))
break;
} }
} }
if (counter == 0) if (counter == 0)
send_to_char(ch, "No rooms found for zone/range specified.\r\n"); send_to_char(ch, "No rooms found for zone/range specified.\r\n");
else
page_string(ch->desc, buf, TRUE);
} }
/* List all mobiles in a zone. */ /* List all mobiles in a zone. */
@ -596,7 +607,8 @@ static void list_mobiles(struct char_data *ch, zone_rnum rnum, mob_vnum vmin, mo
{ {
mob_rnum i; mob_rnum i;
mob_vnum bottom, top; mob_vnum bottom, top;
int counter = 0; int counter = 0, len;
char buf[MAX_STRING_LENGTH];
if (rnum != NOWHERE) { if (rnum != NOWHERE) {
bottom = zone_table[rnum].bot; bottom = zone_table[rnum].bot;
@ -606,9 +618,10 @@ static void list_mobiles(struct char_data *ch, zone_rnum rnum, mob_vnum vmin, mo
top = vmax; top = vmax;
} }
send_to_char(ch, len = strlcpy(buf,
"Index VNum Mobile Name Level\r\n" "Index VNum Mobile Name Level\r\n"
"----- ------- -------------------------------------------- -----\r\n"); "----- ------- -------------------------------------------- -----\r\n",
sizeof(buf));
if (!top_of_mobt) if (!top_of_mobt)
return; return;
@ -617,17 +630,21 @@ static void list_mobiles(struct char_data *ch, zone_rnum rnum, mob_vnum vmin, mo
if (mob_index[i].vnum >= bottom && mob_index[i].vnum <= top) { if (mob_index[i].vnum >= bottom && mob_index[i].vnum <= top) {
counter++; counter++;
send_to_char(ch, "%s%4d%s) [%s%-5d%s] %s%-*s %s[%4d]%s%s\r\n", len += snprintf(buf + len, sizeof(buf) - len, "%s%4d%s) [%s%-5d%s] %s%-*s %s[%4d]%s%s\r\n",
QGRN, counter, QNRM, QGRN, mob_index[i].vnum, QNRM, QGRN, counter, QNRM, QGRN, mob_index[i].vnum, QNRM,
QCYN, count_color_chars(mob_proto[i].player.short_descr)+44, mob_proto[i].player.short_descr, QCYN, count_color_chars(mob_proto[i].player.short_descr)+44, mob_proto[i].player.short_descr,
QYEL, mob_proto[i].player.level, QNRM, QYEL, mob_proto[i].player.level, QNRM,
mob_proto[i].proto_script ? " [TRIG]" : "" mob_proto[i].proto_script ? " [TRIG]" : ""
); );
if (len > sizeof(buf))
break;
} }
} }
if (counter == 0) if (counter == 0)
send_to_char(ch, "None found.\r\n"); send_to_char(ch, "None found.\r\n");
else
page_string(ch->desc, buf, TRUE);
} }
/* List all objects in a zone. */ /* List all objects in a zone. */
@ -635,7 +652,9 @@ static void list_objects(struct char_data *ch, zone_rnum rnum, obj_vnum vmin, ob
{ {
obj_rnum i; obj_rnum i;
obj_vnum bottom, top; obj_vnum bottom, top;
char buf[MAX_STRING_LENGTH];
int counter = 0; int counter = 0;
int len;
if (rnum != NOWHERE) { if (rnum != NOWHERE) {
bottom = zone_table[rnum].bot; bottom = zone_table[rnum].bot;
@ -645,9 +664,10 @@ static void list_objects(struct char_data *ch, zone_rnum rnum, obj_vnum vmin, ob
top = vmax; top = vmax;
} }
send_to_char(ch, len = strlcpy(buf,
"Index VNum Object Name Object Type\r\n" "Index VNum Object Name Object Type\r\n"
"----- ------- -------------------------------------------- ----------------\r\n"); "----- ------- -------------------------------------------- ----------------\r\n",
sizeof(buf));
if (!top_of_objt) if (!top_of_objt)
return; return;
@ -656,18 +676,22 @@ static void list_objects(struct char_data *ch, zone_rnum rnum, obj_vnum vmin, ob
if (obj_index[i].vnum >= bottom && obj_index[i].vnum <= top) { if (obj_index[i].vnum >= bottom && obj_index[i].vnum <= top) {
counter++; counter++;
send_to_char(ch, "%s%4d%s) [%s%-5d%s] %s%-*s %s[%s]%s%s\r\n", len += snprintf(buf + len, sizeof(buf) - len, "%s%4d%s) [%s%-5d%s] %s%-*s %s[%s]%s%s\r\n",
QGRN, counter, QNRM, QGRN, obj_index[i].vnum, QNRM, QGRN, counter, QNRM, QGRN, obj_index[i].vnum, QNRM,
QCYN, count_color_chars(obj_proto[i].short_description)+44, obj_proto[i].short_description, QYEL, QCYN, count_color_chars(obj_proto[i].short_description)+44, obj_proto[i].short_description, QYEL,
item_types[obj_proto[i].obj_flags.type_flag], QNRM, item_types[obj_proto[i].obj_flags.type_flag], QNRM,
obj_proto[i].proto_script ? " [TRIG]" : "" obj_proto[i].proto_script ? " [TRIG]" : ""
); );
if (len > sizeof(buf))
break;
} }
} }
if (counter == 0) if (counter == 0)
send_to_char(ch, "None found.\r\n"); send_to_char(ch, "None found.\r\n");
else
page_string(ch->desc, buf, TRUE);
} }
/* List all shops in a zone. */ /* List all shops in a zone. */
@ -847,8 +871,8 @@ void print_zone(struct char_data *ch, zone_vnum vnum)
QGRN, QCYN, zone_table[rnum].top, QGRN, QCYN, zone_table[rnum].top,
QGRN, QCYN, zone_table[rnum].reset_mode ? ((zone_table[rnum].reset_mode == 1) ? QGRN, QCYN, zone_table[rnum].reset_mode ? ((zone_table[rnum].reset_mode == 1) ?
"Reset when no players are in zone." : "Normal reset.") : "Never reset", "Reset when no players are in zone." : "Normal reset.") : "Never reset",
QGRN, QCYN, buf, QGRN, QCYN, buf,
QGRN, QCYN, zone_table[rnum].min_level, QGRN, QCYN, zone_table[rnum].min_level,
QGRN, QCYN, zone_table[rnum].max_level, QGRN, QCYN, zone_table[rnum].max_level,
QGRN, QGRN,
QGRN, QCYN, size_rooms, QGRN, QCYN, size_rooms,

View file

@ -22,7 +22,6 @@
#include "config.h" #include "config.h"
#include "modify.h" #include "modify.h"
#include "genolc.h" /* for strip_cr and sprintascii */ #include "genolc.h" /* for strip_cr and sprintascii */
#include "constants.h"
/* these factors should be unique integers */ /* these factors should be unique integers */
#define RENT_FACTOR 1 #define RENT_FACTOR 1
@ -249,7 +248,7 @@ static void auto_equip(struct char_data *ch, struct obj_data *obj, int location)
else else
equip_char(ch, obj, j); equip_char(ch, obj, j);
} else { /* Oops, saved a player with double equipment? */ } else { /* Oops, saved a player with double equipment? */
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: autoeq: '%s' already equipped in position %d.", GET_NAME(ch), location); "SYSERR: autoeq: '%s' already equipped in position %d.", GET_NAME(ch), location);
location = LOC_INVENTORY; location = LOC_INVENTORY;
} }
@ -928,7 +927,7 @@ static int gen_receptionist(struct char_data *ch, struct char_data *recep, int c
if (mode == RENT_FACTOR) { if (mode == RENT_FACTOR) {
act("$n stores your belongings and helps you into your private chamber.", FALSE, recep, 0, ch, TO_VICT); act("$n stores your belongings and helps you into your private chamber.", FALSE, recep, 0, ch, TO_VICT);
Crash_rentsave(ch, cost); Crash_rentsave(ch, cost);
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has rented (%d/day, %d tot.)", mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has rented (%d/day, %d tot.)",
GET_NAME(ch), cost, GET_GOLD(ch) + GET_BANK_GOLD(ch)); GET_NAME(ch), cost, GET_GOLD(ch) + GET_BANK_GOLD(ch));
} else { /* cryo */ } else { /* cryo */
act("$n stores your belongings and helps you into your private chamber.\r\n" act("$n stores your belongings and helps you into your private chamber.\r\n"
@ -936,7 +935,7 @@ static int gen_receptionist(struct char_data *ch, struct char_data *recep, int c
"You begin to lose consciousness...", "You begin to lose consciousness...",
FALSE, recep, 0, ch, TO_VICT); FALSE, recep, 0, ch, TO_VICT);
Crash_cryosave(ch, cost); Crash_cryosave(ch, cost);
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has cryo-rented.", GET_NAME(ch)); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s has cryo-rented.", GET_NAME(ch));
SET_BIT_AR(PLR_FLAGS(ch), PLR_CRYO); SET_BIT_AR(PLR_FLAGS(ch), PLR_CRYO);
} }
@ -1190,7 +1189,7 @@ static int Crash_load_objs(struct char_data *ch) {
"There was a problem loading your objects from disk.\r\n" "There was a problem loading your objects from disk.\r\n"
"Contact a God for assistance.\r\n"); "Contact a God for assistance.\r\n");
} }
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s entering game with no equipment.", GET_NAME(ch)); mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "%s entering game with no equipment.", GET_NAME(ch));
return 1; return 1;
} }
if (get_line(fl, line)) if (get_line(fl, line))
@ -1203,7 +1202,7 @@ static int Crash_load_objs(struct char_data *ch) {
cost = (unsigned int) (netcost * num_of_days); cost = (unsigned int) (netcost * num_of_days);
if (cost > (unsigned int)GET_GOLD(ch) + (unsigned int)GET_BANK_GOLD(ch)) { if (cost > (unsigned int)GET_GOLD(ch) + (unsigned int)GET_BANK_GOLD(ch)) {
fclose(fl); fclose(fl);
mudlog(BRF, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"%s entering game, rented equipment lost (no $).", GET_NAME(ch)); "%s entering game, rented equipment lost (no $).", GET_NAME(ch));
Crash_crashsave(ch); Crash_crashsave(ch);
return 2; return 2;
@ -1215,25 +1214,25 @@ static int Crash_load_objs(struct char_data *ch) {
} }
switch (orig_rent_code = rentcode) { switch (orig_rent_code = rentcode) {
case RENT_RENTED: case RENT_RENTED:
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"%s un-renting and entering game.", GET_NAME(ch)); "%s un-renting and entering game.", GET_NAME(ch));
break; break;
case RENT_CRASH: case RENT_CRASH:
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"%s retrieving crash-saved items and entering game.", GET_NAME(ch)); "%s retrieving crash-saved items and entering game.", GET_NAME(ch));
break; break;
case RENT_CRYO: case RENT_CRYO:
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"%s un-cryo'ing and entering game.", GET_NAME(ch)); "%s un-cryo'ing and entering game.", GET_NAME(ch));
break; break;
case RENT_FORCED: case RENT_FORCED:
case RENT_TIMEDOUT: case RENT_TIMEDOUT:
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"%s retrieving force-saved items and entering game.", GET_NAME(ch)); "%s retrieving force-saved items and entering game.", GET_NAME(ch));
break; break;
default: default:
mudlog(NRM, MAX(ADMLVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
"WARNING: %s entering game with undefined rent code.", GET_NAME(ch)); "WARNING: %s entering game with undefined rent code.", GET_NAME(ch));
break; break;
} }
@ -1251,8 +1250,8 @@ static int Crash_load_objs(struct char_data *ch) {
} }
/* Little hoarding check. -gg 3/1/98 */ /* Little hoarding check. -gg 3/1/98 */
mudlog(NRM, MAX(ADMLVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s (level %d %s) has %d %s (max %d).", mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s (level %d) has %d %s (max %d).",
GET_NAME(ch), GET_LEVEL(ch), admin_level_names[(GET_ADMLEVEL(ch))], num_objs, num_objs > 1 ? "objects" : "object", CONFIG_MAX_OBJ_SAVE); GET_NAME(ch), GET_LEVEL(ch), num_objs, num_objs > 1 ? "objects" : "object", CONFIG_MAX_OBJ_SAVE);
fclose(fl); fclose(fl);

View file

@ -113,7 +113,7 @@ ACMD(do_oasis_oedit)
/* Give the descriptor an OLC structure. */ /* Give the descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis: Player already had olc structure."); "SYSERR: do_oasis: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -144,7 +144,7 @@ ACMD(do_oasis_oedit)
if (save) { if (save) {
send_to_char(ch, "Saving all objects in zone %d.\r\n", send_to_char(ch, "Saving all objects in zone %d.\r\n",
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves object info for zone %d.", GET_NAME(ch), "OLC: %s saves object info for zone %d.", GET_NAME(ch),
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
@ -173,7 +173,7 @@ ACMD(do_oasis_oedit)
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
/* Log the OLC message. */ /* Log the OLC message. */
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d", mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -448,7 +448,7 @@ static void oedit_disp_val1_menu(struct descriptor_data *d)
oedit_disp_menu(d); oedit_disp_menu(d);
break; break;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: Reached default case in oedit_disp_val1_menu()!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: Reached default case in oedit_disp_val1_menu()!");
break; break;
} }
} }
@ -678,7 +678,7 @@ static void oedit_disp_menu(struct descriptor_data *d)
grn, nrm, cyn, buf2, grn, nrm, cyn, buf2,
grn, nrm, cyn, OLC_SCRIPT(d) ? "Set." : "Not Set.", grn, nrm, cyn, OLC_SCRIPT(d) ? "Set." : "Not Set.",
grn, nrm, grn, nrm,
grn, nrm, grn, nrm,
grn, nrm grn, nrm
); );
OLC_MODE(d) = OEDIT_MAIN_MENU; OLC_MODE(d) = OEDIT_MAIN_MENU;
@ -697,7 +697,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
oedit_save_internally(d); oedit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE,
"OLC: %s edits obj %d", GET_NAME(d->character), OLC_NUM(d)); "OLC: %s edits obj %d", GET_NAME(d->character), OLC_NUM(d));
if (CONFIG_OLC_SAVE) { if (CONFIG_OLC_SAVE) {
oedit_save_to_disk(real_zone_by_thing(OLC_NUM(d))); oedit_save_to_disk(real_zone_by_thing(OLC_NUM(d)));
@ -926,7 +926,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
break; break;
case OEDIT_LEVEL: case OEDIT_LEVEL:
GET_OBJ_LEVEL(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, CONFIG_MAX_LEVEL); GET_OBJ_LEVEL(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, LVL_IMPL);
break; break;
case OEDIT_PERM: case OEDIT_PERM:
@ -1093,7 +1093,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
int counter; int counter;
/* add in check here if already applied.. deny builders another */ /* add in check here if already applied.. deny builders another */
if (!IS_ADMIN(d->character, ADMLVL_IMPL)) { if (GET_LEVEL(d->character) < LVL_IMPL) {
for (counter = 0; counter < MAX_OBJ_AFFECT; counter++) { for (counter = 0; counter < MAX_OBJ_AFFECT; counter++) {
if (OLC_OBJ(d)->affected[counter].location == number) { if (OLC_OBJ(d)->affected[counter].location == number) {
write_to_output(d, "Object already has that apply."); write_to_output(d, "Object already has that apply.");
@ -1199,7 +1199,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
write_to_output(d, "Please answer 'Y' or 'N': "); write_to_output(d, "Please answer 'Y' or 'N': ");
return; return;
default: default:
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: Reached default case in oedit_parse()!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: Reached default case in oedit_parse()!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }

View file

@ -1,7 +1,7 @@
/** /**
* @file pfdefaults.h * @file pfdefaults.h
* ASCII player file defaults. * ASCII player file defaults.
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
@ -10,13 +10,12 @@
#ifndef _PFDEFAULTS_H_ #ifndef _PFDEFAULTS_H_
#define _PFDEFAULTS_H_ #define _PFDEFAULTS_H_
/* WARNING: Do not change the values below if you have existing ascii player /* WARNING: Do not change the values below if you have existing ascii player
* files you don't want to screw up. */ * files you don't want to screw up. */
#define PFDEF_SEX 0 #define PFDEF_SEX 0
#define PFDEF_CLASS 0 #define PFDEF_CLASS 0
#define PFDEF_LEVEL 0 #define PFDEF_LEVEL 0
#define PFDEF_ADMLEVEL ADMLVL_MORTAL
#define PFDEF_HEIGHT 0 #define PFDEF_HEIGHT 0
#define PFDEF_WEIGHT 0 #define PFDEF_WEIGHT 0
#define PFDEF_ALIGNMENT 0 #define PFDEF_ALIGNMENT 0
@ -53,14 +52,14 @@
#define PFDEF_HUNGER 0 #define PFDEF_HUNGER 0
#define PFDEF_THIRST 0 #define PFDEF_THIRST 0
#define PFDEF_DRUNK 0 #define PFDEF_DRUNK 0
#define PFDEF_OLC NOWHERE #define PFDEF_OLC NOWHERE
#define PFDEF_PAGELENGTH 22 #define PFDEF_PAGELENGTH 22
#define PFDEF_SCREENWIDTH 80 #define PFDEF_SCREENWIDTH 80
#define PFDEF_QUESTPOINTS 0 #define PFDEF_QUESTPOINTS 0
#define PFDEF_QUESTCOUNT 0 #define PFDEF_QUESTCOUNT 0
#define PFDEF_COMPQUESTS 0 #define PFDEF_COMPQUESTS 0
#define PFDEF_CURRQUEST NOTHING #define PFDEF_CURRQUEST NOTHING
#define PFDEF_LASTMOTD 0 #define PFDEF_LASTMOTD 0
#define PFDEF_LASTNEWS 0 #define PFDEF_LASTNEWS 0
#endif /* _PFDEFAULTS_H_ */ #endif /* _PFDEFAULTS_H_ */

View file

@ -28,12 +28,11 @@
#define LOAD_MOVE 2 #define LOAD_MOVE 2
#define LOAD_STRENGTH 3 #define LOAD_STRENGTH 3
#define PT_PNAME(i) (player_table[(i)].name) #define PT_PNAME(i) (player_table[(i)].name)
#define PT_IDNUM(i) (player_table[(i)].id) #define PT_IDNUM(i) (player_table[(i)].id)
#define PT_LEVEL(i) (player_table[(i)].level) #define PT_LEVEL(i) (player_table[(i)].level)
#define PT_ADMLEVEL(i) (player_table[(i)].admlevel) #define PT_FLAGS(i) (player_table[(i)].flags)
#define PT_FLAGS(i) (player_table[(i)].flags) #define PT_LLAST(i) (player_table[(i)].last)
#define PT_LLAST(i) (player_table[(i)].last)
/* 'global' vars defined here and used externally */ /* 'global' vars defined here and used externally */
/** @deprecated Since this file really is basically a functional extension /** @deprecated Since this file really is basically a functional extension
@ -84,20 +83,11 @@ void build_player_index(void)
CREATE(player_table, struct player_index_element, rec_count); CREATE(player_table, struct player_index_element, rec_count);
for (i = 0; i < rec_count; i++) { for (i = 0; i < rec_count; i++) {
get_line(plr_index, line); get_line(plr_index, line);
/* Load both old-style (5 vars) or new style with admin level (6 vars) */ sscanf(line, "%ld %s %d %s %ld", &player_table[i].id, arg2,
if (sscanf(line, "%ld %s %d %d %s %ld", &PT_IDNUM(i), arg2, &player_table[i].level, bits, (long *)&player_table[i].last);
&PT_LEVEL(i), &PT_ADMLEVEL(i), bits, (long *)&PT_LLAST(i)) != 6) {
if (sscanf(line, "%ld %s %d %s %ld", &PT_IDNUM(i), arg2,
&PT_LEVEL(i), bits, (long *)&PT_LLAST(i)) != 5) {
log("SYSERR: Invalid line in player index (%s, line %d)", index_name, (i+1));
}
/* Convert old level to new seperate admin and mortal levels */
PT_ADMLEVEL(i) = (PT_LEVEL(i) > CONFIG_MAX_LEVEL) ? MIN((PT_LEVEL(i) - CONFIG_MAX_LEVEL), ADMLVL_IMPL) : ADMLVL_MORTAL;
PT_LEVEL(i) = MIN(PT_LEVEL(i), CONFIG_MAX_LEVEL);
}
CREATE(player_table[i].name, char, strlen(arg2) + 1); CREATE(player_table[i].name, char, strlen(arg2) + 1);
strcpy(player_table[i].name, arg2); strcpy(player_table[i].name, arg2);
PT_FLAGS(i) = asciiflag_conv(bits); player_table[i].flags = asciiflag_conv(bits);
top_idnum = MAX(top_idnum, player_table[i].id); top_idnum = MAX(top_idnum, player_table[i].id);
} }
@ -129,7 +119,7 @@ int create_entry(char *name)
/* Nothing */; /* Nothing */;
/* clear the bitflag in case we have garbage data */ /* clear the bitflag in case we have garbage data */
PT_FLAGS(pos) = 0; player_table[pos].flags = 0;
return (pos); return (pos);
} }
@ -152,7 +142,6 @@ void remove_player_from_index(int pos)
PT_PNAME(i-1) = PT_PNAME(i); PT_PNAME(i-1) = PT_PNAME(i);
PT_IDNUM(i-1) = PT_IDNUM(i); PT_IDNUM(i-1) = PT_IDNUM(i);
PT_LEVEL(i-1) = PT_LEVEL(i); PT_LEVEL(i-1) = PT_LEVEL(i);
PT_ADMLEVEL(i-1) = PT_ADMLEVEL(i);
PT_FLAGS(i-1) = PT_FLAGS(i); PT_FLAGS(i-1) = PT_FLAGS(i);
PT_LLAST(i-1) = PT_LLAST(i); PT_LLAST(i-1) = PT_LLAST(i);
} }
@ -185,9 +174,10 @@ void save_player_index(void)
for (i = 0; i <= top_of_p_table; i++) for (i = 0; i <= top_of_p_table; i++)
if (*player_table[i].name) { if (*player_table[i].name) {
sprintascii(bits, PT_FLAGS(i)); sprintascii(bits, player_table[i].flags);
fprintf(index_file, "%ld %s %d %d %s %ld\n", PT_IDNUM(i), PT_PNAME(i), fprintf(index_file, "%ld %s %d %s %ld\n", player_table[i].id,
PT_LEVEL(i), PT_ADMLEVEL(i), *bits ? bits : "0", (long)PT_LLAST(i)); player_table[i].name, player_table[i].level, *bits ? bits : "0",
(long)player_table[i].last);
} }
fprintf(index_file, "~\n"); fprintf(index_file, "~\n");
@ -202,8 +192,8 @@ void free_player_index(void)
return; return;
for (tp = 0; tp <= top_of_p_table; tp++) for (tp = 0; tp <= top_of_p_table; tp++)
if (PT_PNAME(tp)) if (player_table[tp].name)
free(PT_PNAME(tp)); free(player_table[tp].name);
free(player_table); free(player_table);
player_table = NULL; player_table = NULL;
@ -259,10 +249,10 @@ int load_char(const char *name, struct char_data *ch)
if ((id = get_ptable_by_name(name)) < 0) if ((id = get_ptable_by_name(name)) < 0)
return (-1); return (-1);
else { else {
if (!get_filename(filename, sizeof(filename), PLR_FILE, PT_PNAME(id))) if (!get_filename(filename, sizeof(filename), PLR_FILE, player_table[id].name))
return (-1); return (-1);
if (!(fl = fopen(filename, "r"))) { if (!(fl = fopen(filename, "r"))) {
mudlog(NRM, ADMLVL_GOD, TRUE, "SYSERR: Couldn't open player file %s", filename); mudlog(NRM, LVL_GOD, TRUE, "SYSERR: Couldn't open player file %s", filename);
return (-1); return (-1);
} }
@ -273,7 +263,6 @@ int load_char(const char *name, struct char_data *ch)
GET_SEX(ch) = PFDEF_SEX; GET_SEX(ch) = PFDEF_SEX;
GET_CLASS(ch) = PFDEF_CLASS; GET_CLASS(ch) = PFDEF_CLASS;
GET_LEVEL(ch) = PFDEF_LEVEL; GET_LEVEL(ch) = PFDEF_LEVEL;
GET_ADMLEVEL(ch) = PFDEF_ADMLEVEL;
GET_HEIGHT(ch) = PFDEF_HEIGHT; GET_HEIGHT(ch) = PFDEF_HEIGHT;
GET_WEIGHT(ch) = PFDEF_WEIGHT; GET_WEIGHT(ch) = PFDEF_WEIGHT;
GET_ALIGNMENT(ch) = PFDEF_ALIGNMENT; GET_ALIGNMENT(ch) = PFDEF_ALIGNMENT;
@ -332,17 +321,16 @@ int load_char(const char *name, struct char_data *ch)
switch (*tag) { switch (*tag) {
case 'A': case 'A':
if (!strcmp(tag, "Ac ")) GET_AC(ch) = atoi(line); if (!strcmp(tag, "Ac ")) GET_AC(ch) = atoi(line);
else if (!strcmp(tag, "Act ")) { else if (!strcmp(tag, "Act ")) {
if (sscanf(line, "%s %s %s %s", f1, f2, f3, f4) == 4) { if (sscanf(line, "%s %s %s %s", f1, f2, f3, f4) == 4) {
PLR_FLAGS(ch)[0] = asciiflag_conv(f1); PLR_FLAGS(ch)[0] = asciiflag_conv(f1);
PLR_FLAGS(ch)[1] = asciiflag_conv(f2); PLR_FLAGS(ch)[1] = asciiflag_conv(f2);
PLR_FLAGS(ch)[2] = asciiflag_conv(f3); PLR_FLAGS(ch)[2] = asciiflag_conv(f3);
PLR_FLAGS(ch)[3] = asciiflag_conv(f4); PLR_FLAGS(ch)[3] = asciiflag_conv(f4);
} else } else
PLR_FLAGS(ch)[0] = asciiflag_conv(line); PLR_FLAGS(ch)[0] = asciiflag_conv(line);
} } else if (!strcmp(tag, "Aff ")) {
else if (!strcmp(tag, "Aff ")) {
if (sscanf(line, "%s %s %s %s", f1, f2, f3, f4) == 4) { if (sscanf(line, "%s %s %s %s", f1, f2, f3, f4) == 4) {
AFF_FLAGS(ch)[0] = asciiflag_conv(f1); AFF_FLAGS(ch)[0] = asciiflag_conv(f1);
AFF_FLAGS(ch)[1] = asciiflag_conv(f2); AFF_FLAGS(ch)[1] = asciiflag_conv(f2);
@ -351,19 +339,9 @@ int load_char(const char *name, struct char_data *ch)
} else } else
AFF_FLAGS(ch)[0] = asciiflag_conv(line); AFF_FLAGS(ch)[0] = asciiflag_conv(line);
} }
else if (!strcmp(tag, "Affs")) load_affects(fl, ch); if (!strcmp(tag, "Affs")) load_affects(fl, ch);
else if (!strcmp(tag, "Alin")) GET_ALIGNMENT(ch) = atoi(line); else if (!strcmp(tag, "Alin")) GET_ALIGNMENT(ch) = atoi(line);
else if (!strcmp(tag, "Alis")) read_aliases_ascii(fl, ch, atoi(line)); else if (!strcmp(tag, "Alis")) read_aliases_ascii(fl, ch, atoi(line));
else if (!strcmp(tag, "Admn")) GET_ADMLEVEL(ch) = atoi(line);
else if (!strcmp(tag, "Admf")) {
if (sscanf(line, "%s %s %s %s", f1, f2, f3, f4) == 4) {
ADM_FLAGS(ch)[0] = asciiflag_conv(f1);
ADM_FLAGS(ch)[1] = asciiflag_conv(f2);
ADM_FLAGS(ch)[2] = asciiflag_conv(f3);
ADM_FLAGS(ch)[3] = asciiflag_conv(f4);
} else
ADM_FLAGS(ch)[0] = asciiflag_conv(f1);
}
break; break;
case 'B': case 'B':
@ -508,15 +486,8 @@ int load_char(const char *name, struct char_data *ch)
affect_total(ch); affect_total(ch);
/* Sort old-style admin levels (one-time only code for codebase upgrades to tbaMUD 4.0) */
if (GET_LEVEL(ch) > CONFIG_MAX_LEVEL) {
/* For no converson to new admin levels, skip next line */
GET_ADMLEVEL(ch) = MIN((GET_LEVEL(ch) - CONFIG_MAX_LEVEL), ADMLVL_IMPL);
GET_LEVEL(ch) = CONFIG_MAX_LEVEL;
}
/* initialization for imms */ /* initialization for imms */
if (IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) >= LVL_IMMORT) {
for (i = 1; i <= MAX_SKILLS; i++) for (i = 1; i <= MAX_SKILLS; i++)
GET_SKILL(ch, i) = 100; GET_SKILL(ch, i) = 100;
GET_COND(ch, HUNGER) = -1; GET_COND(ch, HUNGER) = -1;
@ -562,7 +533,7 @@ void save_char(struct char_data * ch)
if (!get_filename(filename, sizeof(filename), PLR_FILE, GET_NAME(ch))) if (!get_filename(filename, sizeof(filename), PLR_FILE, GET_NAME(ch)))
return; return;
if (!(fl = fopen(filename, "w"))) { if (!(fl = fopen(filename, "w"))) {
mudlog(NRM, ADMLVL_GOD, TRUE, "SYSERR: Couldn't open player file %s for write", filename); mudlog(NRM, LVL_GOD, TRUE, "SYSERR: Couldn't open player file %s for write", filename);
return; return;
} }
@ -616,7 +587,6 @@ void save_char(struct char_data * ch)
if (GET_SEX(ch) != PFDEF_SEX) fprintf(fl, "Sex : %d\n", GET_SEX(ch)); if (GET_SEX(ch) != PFDEF_SEX) fprintf(fl, "Sex : %d\n", GET_SEX(ch));
if (GET_CLASS(ch) != PFDEF_CLASS) fprintf(fl, "Clas: %d\n", GET_CLASS(ch)); if (GET_CLASS(ch) != PFDEF_CLASS) fprintf(fl, "Clas: %d\n", GET_CLASS(ch));
if (GET_LEVEL(ch) != PFDEF_LEVEL) fprintf(fl, "Levl: %d\n", GET_LEVEL(ch)); if (GET_LEVEL(ch) != PFDEF_LEVEL) fprintf(fl, "Levl: %d\n", GET_LEVEL(ch));
if (GET_ADMLEVEL(ch) != PFDEF_ADMLEVEL) fprintf(fl, "Admn: %d\n", GET_ADMLEVEL(ch));
fprintf(fl, "Id : %ld\n", GET_IDNUM(ch)); fprintf(fl, "Id : %ld\n", GET_IDNUM(ch));
fprintf(fl, "Brth: %ld\n", (long)ch->player.time.birth); fprintf(fl, "Brth: %ld\n", (long)ch->player.time.birth);
@ -652,13 +622,7 @@ void save_char(struct char_data * ch)
sprintascii(bits4, PRF_FLAGS(ch)[3]); sprintascii(bits4, PRF_FLAGS(ch)[3]);
fprintf(fl, "Pref: %s %s %s %s\n", bits, bits2, bits3, bits4); fprintf(fl, "Pref: %s %s %s %s\n", bits, bits2, bits3, bits4);
sprintascii(bits, ADM_FLAGS(ch)[0]); if (GET_SAVE(ch, 0) != PFDEF_SAVETHROW) fprintf(fl, "Thr1: %d\n", GET_SAVE(ch, 0));
sprintascii(bits2, ADM_FLAGS(ch)[1]);
sprintascii(bits3, ADM_FLAGS(ch)[2]);
sprintascii(bits4, ADM_FLAGS(ch)[3]);
fprintf(fl, "Admf: %s %s %s %s\n", bits, bits2, bits3, bits4);
if (GET_SAVE(ch, 0) != PFDEF_SAVETHROW) fprintf(fl, "Thr1: %d\n", GET_SAVE(ch, 0));
if (GET_SAVE(ch, 1) != PFDEF_SAVETHROW) fprintf(fl, "Thr2: %d\n", GET_SAVE(ch, 1)); if (GET_SAVE(ch, 1) != PFDEF_SAVETHROW) fprintf(fl, "Thr2: %d\n", GET_SAVE(ch, 1));
if (GET_SAVE(ch, 2) != PFDEF_SAVETHROW) fprintf(fl, "Thr3: %d\n", GET_SAVE(ch, 2)); if (GET_SAVE(ch, 2) != PFDEF_SAVETHROW) fprintf(fl, "Thr3: %d\n", GET_SAVE(ch, 2));
if (GET_SAVE(ch, 3) != PFDEF_SAVETHROW) fprintf(fl, "Thr4: %d\n", GET_SAVE(ch, 3)); if (GET_SAVE(ch, 3) != PFDEF_SAVETHROW) fprintf(fl, "Thr4: %d\n", GET_SAVE(ch, 3));
@ -672,9 +636,9 @@ void save_char(struct char_data * ch)
if (GET_BAD_PWS(ch) != PFDEF_BADPWS) fprintf(fl, "Badp: %d\n", GET_BAD_PWS(ch)); if (GET_BAD_PWS(ch) != PFDEF_BADPWS) fprintf(fl, "Badp: %d\n", GET_BAD_PWS(ch));
if (GET_PRACTICES(ch) != PFDEF_PRACTICES) fprintf(fl, "Lern: %d\n", GET_PRACTICES(ch)); if (GET_PRACTICES(ch) != PFDEF_PRACTICES) fprintf(fl, "Lern: %d\n", GET_PRACTICES(ch));
if (GET_COND(ch, HUNGER) != PFDEF_HUNGER && !IS_ADMIN(ch, ADMLVL_IMMORT)) fprintf(fl, "Hung: %d\n", GET_COND(ch, HUNGER)); if (GET_COND(ch, HUNGER) != PFDEF_HUNGER && GET_LEVEL(ch) < LVL_IMMORT) fprintf(fl, "Hung: %d\n", GET_COND(ch, HUNGER));
if (GET_COND(ch, THIRST) != PFDEF_THIRST && !IS_ADMIN(ch, ADMLVL_IMMORT)) fprintf(fl, "Thir: %d\n", GET_COND(ch, THIRST)); if (GET_COND(ch, THIRST) != PFDEF_THIRST && GET_LEVEL(ch) < LVL_IMMORT) fprintf(fl, "Thir: %d\n", GET_COND(ch, THIRST));
if (GET_COND(ch, DRUNK) != PFDEF_DRUNK && !IS_ADMIN(ch, ADMLVL_IMMORT)) fprintf(fl, "Drnk: %d\n", GET_COND(ch, DRUNK)); if (GET_COND(ch, DRUNK) != PFDEF_DRUNK && GET_LEVEL(ch) < LVL_IMMORT) fprintf(fl, "Drnk: %d\n", GET_COND(ch, DRUNK));
if (GET_HIT(ch) != PFDEF_HIT || GET_MAX_HIT(ch) != PFDEF_MAXHIT) fprintf(fl, "Hit : %d/%d\n", GET_HIT(ch), GET_MAX_HIT(ch)); if (GET_HIT(ch) != PFDEF_HIT || GET_MAX_HIT(ch) != PFDEF_MAXHIT) fprintf(fl, "Hit : %d/%d\n", GET_HIT(ch), GET_MAX_HIT(ch));
if (GET_MANA(ch) != PFDEF_MANA || GET_MAX_MANA(ch) != PFDEF_MAXMANA) fprintf(fl, "Mana: %d/%d\n", GET_MANA(ch), GET_MAX_MANA(ch)); if (GET_MANA(ch) != PFDEF_MANA || GET_MAX_MANA(ch) != PFDEF_MAXMANA) fprintf(fl, "Mana: %d/%d\n", GET_MANA(ch), GET_MAX_MANA(ch));
@ -714,7 +678,7 @@ void save_char(struct char_data * ch)
} }
/* Save skills */ /* Save skills */
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) { if (GET_LEVEL(ch) < LVL_IMMORT) {
fprintf(fl, "Skil:\n"); fprintf(fl, "Skil:\n");
for (i = 1; i <= MAX_SKILLS; i++) { for (i = 1; i <= MAX_SKILLS; i++) {
if (GET_SKILL(ch, i)) if (GET_SKILL(ch, i))
@ -729,7 +693,7 @@ void save_char(struct char_data * ch)
for (i = 0; i < MAX_AFFECT; i++) { for (i = 0; i < MAX_AFFECT; i++) {
aff = &tmp_aff[i]; aff = &tmp_aff[i];
if (aff->spell) if (aff->spell)
fprintf(fl, "%d %d %d %d %d %d %d %d\n", aff->spell, aff->duration, fprintf(fl, "%d %d %d %d %d %d %d %d\n", aff->spell, aff->duration,
aff->modifier, aff->location, aff->bitvector[0], aff->bitvector[1], aff->bitvector[2], aff->bitvector[3]); aff->modifier, aff->location, aff->bitvector[0], aff->bitvector[1], aff->bitvector[2], aff->bitvector[3]);
} }
fprintf(fl, "0 0 0 0 0 0 0 0\n"); fprintf(fl, "0 0 0 0 0 0 0 0\n");
@ -767,10 +731,6 @@ void save_char(struct char_data * ch)
save_index = TRUE; save_index = TRUE;
player_table[id].level = GET_LEVEL(ch); player_table[id].level = GET_LEVEL(ch);
} }
if (player_table[id].admlevel != GET_ADMLEVEL(ch)) {
save_index = TRUE;
player_table[id].admlevel = GET_ADMLEVEL(ch);
}
if (player_table[id].last != ch->player.time.logon) { if (player_table[id].last != ch->player.time.logon) {
save_index = TRUE; save_index = TRUE;
player_table[id].last = ch->player.time.logon; player_table[id].last = ch->player.time.logon;
@ -780,7 +740,6 @@ void save_char(struct char_data * ch)
SET_BIT(player_table[id].flags, PINDEX_DELETED); SET_BIT(player_table[id].flags, PINDEX_DELETED);
else else
REMOVE_BIT(player_table[id].flags, PINDEX_DELETED); REMOVE_BIT(player_table[id].flags, PINDEX_DELETED);
if (PLR_FLAGGED(ch, PLR_NODELETE) || PLR_FLAGGED(ch, PLR_CRYO)) if (PLR_FLAGGED(ch, PLR_NODELETE) || PLR_FLAGGED(ch, PLR_CRYO))
SET_BIT(player_table[id].flags, PINDEX_NODELETE); SET_BIT(player_table[id].flags, PINDEX_NODELETE);
else else
@ -791,11 +750,6 @@ void save_char(struct char_data * ch)
else else
REMOVE_BIT(player_table[id].flags, PINDEX_NOWIZLIST); REMOVE_BIT(player_table[id].flags, PINDEX_NOWIZLIST);
if (PRF_FLAGGED(ch, PRF_MORTAL))
SET_BIT(player_table[id].flags, PINDEX_MORTAL);
else
REMOVE_BIT(player_table[id].flags, PINDEX_MORTAL);
if (player_table[id].flags != i || save_index) if (player_table[id].flags != i || save_index)
save_player_index(); save_player_index();
} }
@ -836,9 +790,8 @@ void remove_player(int pfilepos)
unlink(filename); unlink(filename);
} }
log("PCLEAN: %s Lev: %d AdmLev: %d Last: %s", log("PCLEAN: %s Lev: %d Last: %s",
player_table[pfilepos].name, player_table[pfilepos].level, player_table[pfilepos].name, player_table[pfilepos].level,
player_table[pfilepos].admlevel,
asctime(localtime(&player_table[pfilepos].last))); asctime(localtime(&player_table[pfilepos].last)));
player_table[pfilepos].name[0] = '\0'; player_table[pfilepos].name[0] = '\0';
@ -853,10 +806,6 @@ void clean_pfiles(void)
int i, ci; int i, ci;
for (i = 0; i <= top_of_p_table; i++) { for (i = 0; i <= top_of_p_table; i++) {
/* Skip Imms */
if (PT_ADMLEVEL(i) > ADMLVL_IMMORT)
continue;
/* We only want to go further if the player isn't protected from deletion /* We only want to go further if the player isn't protected from deletion
* and hasn't already been deleted. */ * and hasn't already been deleted. */
if (!IS_SET(player_table[i].flags, PINDEX_NODELETE) && if (!IS_SET(player_table[i].flags, PINDEX_NODELETE) &&

View file

@ -79,16 +79,16 @@ static void prefedit_save_to_char(struct descriptor_data *d)
else else
{ {
if (!vict) { if (!vict) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict)"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict)");
send_to_char(d->character, "Unable to save toggles (no vict)"); send_to_char(d->character, "Unable to save toggles (no vict)");
} else if (!vict->desc) { } else if (!vict->desc) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict descriptor)"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (no vict descriptor)");
send_to_char(d->character, "Unable to save toggles (no vict descriptor)"); send_to_char(d->character, "Unable to save toggles (no vict descriptor)");
} else if (!IS_PLAYING(vict->desc)) { } else if (!IS_PLAYING(vict->desc)) {
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (vict not playing)"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (vict not playing)");
send_to_char(d->character, "Unable to save toggles (vict not playing)"); send_to_char(d->character, "Unable to save toggles (vict not playing)");
} else { } else {
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (unknown reason)"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Unable to save toggles (unknown reason)");
send_to_char(d->character, "Unable to save toggles (unknown reason)"); send_to_char(d->character, "Unable to save toggles (unknown reason)");
} }
} }
@ -138,7 +138,7 @@ static void prefedit_disp_main_menu(struct descriptor_data *d)
CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) ); CBYEL(d->character, C_NRM), CCNRM(d->character, C_NRM) );
/* Imm Prefs */ /* Imm Prefs */
if (IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) >= LVL_IMMORT)
{ {
sprintf(syslog_string, "%s", multi_types[((PREFEDIT_FLAGGED(PRF_LOG1) ? 1 : 0)+ (PREFEDIT_FLAGGED(PRF_LOG2) ? 2 : 0))] ); sprintf(syslog_string, "%s", multi_types[((PREFEDIT_FLAGGED(PRF_LOG1) ? 1 : 0)+ (PREFEDIT_FLAGGED(PRF_LOG2) ? 2 : 0))] );
@ -334,7 +334,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
prefedit_save_to_char(d); prefedit_save_to_char(d);
mudlog(CMP, ADMLVL_BUILDER, TRUE, "OLC: %s edits toggles for %s", GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch)); mudlog(CMP, LVL_BUILDER, TRUE, "OLC: %s edits toggles for %s", GET_NAME(d->character), GET_NAME(OLC_PREFS(d)->ch));
/*. No strings to save - cleanup all .*/ /*. No strings to save - cleanup all .*/
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
break; break;
@ -402,7 +402,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
/* Below this point are Imm-only toggles */ /* Below this point are Imm-only toggles */
case '1': case '1':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -415,7 +415,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
break; break;
case '2': case '2':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -427,7 +427,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
break; break;
case '3': case '3':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -439,7 +439,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
break; break;
case '4': case '4':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -451,7 +451,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
break; break;
case '5': case '5':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -463,7 +463,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
break; break;
case '6': case '6':
if (!IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_IMMORT)) if (GET_LEVEL(PREFEDIT_GET_CHAR) < LVL_IMMORT)
{ {
send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM)); send_to_char(d->character, "%sInvalid choice!%s\r\n", CBRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
prefedit_disp_main_menu(d); prefedit_disp_main_menu(d);
@ -671,7 +671,7 @@ void prefedit_parse(struct descriptor_data * d, char *arg)
default: default:
/* we should never get here */ /* we should never get here */
mudlog(BRF,ADMLVL_BUILDER,TRUE,"SYSERR: Reached default case in parse_prefedit"); mudlog(BRF,LVL_BUILDER,TRUE,"SYSERR: Reached default case in parse_prefedit");
break; break;
} }
/*. If we get this far, something has be changed .*/ /*. If we get this far, something has be changed .*/
@ -715,7 +715,7 @@ void prefedit_Restore_Defaults(struct descriptor_data *d)
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOEXIT);
/* PRF_NOHASSLE - On for Imms */ /* PRF_NOHASSLE - On for Imms */
if (!PREFEDIT_FLAGGED(PRF_NOHASSLE) && IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_BUILDER)) if (!PREFEDIT_FLAGGED(PRF_NOHASSLE) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT)
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE);
else else
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOHASSLE);
@ -733,7 +733,7 @@ void prefedit_Restore_Defaults(struct descriptor_data *d)
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOREPEAT);
/* PRF_HOLYLIGHT - On for Imms */ /* PRF_HOLYLIGHT - On for Imms */
if (!PREFEDIT_FLAGGED(PRF_HOLYLIGHT) && IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_BUILDER)) if (!PREFEDIT_FLAGGED(PRF_HOLYLIGHT) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT)
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT);
else else
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_HOLYLIGHT);
@ -769,7 +769,7 @@ void prefedit_Restore_Defaults(struct descriptor_data *d)
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_NOGRATZ);
/* PRF_SHOWVNUMS - On for Imms */ /* PRF_SHOWVNUMS - On for Imms */
if (!PREFEDIT_FLAGGED(PRF_SHOWVNUMS) && IS_ADMIN(PREFEDIT_GET_CHAR, ADMLVL_BUILDER)) if (!PREFEDIT_FLAGGED(PRF_SHOWVNUMS) && GET_LEVEL(PREFEDIT_GET_CHAR) > LVL_IMMORT)
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS);
else else
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_SHOWVNUMS);
@ -807,15 +807,15 @@ void prefedit_Restore_Defaults(struct descriptor_data *d)
REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST); REMOVE_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOASSIST);
/* PRF_AUTOMAP - On */ /* PRF_AUTOMAP - On */
if (!PREFEDIT_FLAGGED(PRF_AUTOMAP)) if (PREFEDIT_FLAGGED(PRF_AUTOMAP))
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOMAP);
/* PRF_AUTOKEY - On */ /* PRF_AUTOKEY - On */
if (!PREFEDIT_FLAGGED(PRF_AUTOKEY)) if (PREFEDIT_FLAGGED(PRF_AUTOKEY))
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTOKEY);
/* PRF_AUTODOOR - On */ /* PRF_AUTODOOR - On */
if (!PREFEDIT_FLAGGED(PRF_AUTODOOR)) if (PREFEDIT_FLAGGED(PRF_AUTODOOR))
SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR); SET_BIT_AR(PREFEDIT_GET_FLAGS, PRF_AUTODOOR);
/* Other (non-toggle) options */ /* Other (non-toggle) options */
@ -844,7 +844,7 @@ ACMD(do_oasis_prefedit)
if (!*buf1) { if (!*buf1) {
vict = ch; vict = ch;
} }
else if (IS_ADMIN(ch, ADMLVL_IMPL)) else if (GET_LEVEL(ch) >= LVL_IMPL)
{ {
if ((vict = get_player_vis(ch, buf1, NULL, FIND_CHAR_WORLD)) == NULL) if ((vict = get_player_vis(ch, buf1, NULL, FIND_CHAR_WORLD)) == NULL)
{ {
@ -888,7 +888,7 @@ ACMD(do_oasis_prefedit)
/** Give the descriptor an OLC structure. **/ /** Give the descriptor an OLC structure. **/
/****************************************************************************/ /****************************************************************************/
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis_prefedit: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_prefedit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }

View file

@ -121,7 +121,7 @@ ACMD(do_oasis_qedit)
/** Give the descriptor an OLC structure. **/ /** Give the descriptor an OLC structure. **/
/****************************************************************************/ /****************************************************************************/
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis_quest: Player already had olc structure."); "SYSERR: do_oasis_quest: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -155,7 +155,7 @@ ACMD(do_oasis_qedit)
if (save) { if (save) {
send_to_char(ch, "Saving all quests in zone %d.\r\n", send_to_char(ch, "Saving all quests in zone %d.\r\n",
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves quest info for zone %d.", "OLC: %s saves quest info for zone %d.",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number);
@ -184,7 +184,7 @@ ACMD(do_oasis_qedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"OLC: %s starts editing zone %d allowed zone %d", "OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -205,7 +205,7 @@ static void qedit_setup_new(struct descriptor_data *d)
quest->value[0] = 0; /* Points for completing */ quest->value[0] = 0; /* Points for completing */
quest->value[1] = 0; /* Points for abandoning */ quest->value[1] = 0; /* Points for abandoning */
quest->value[2] = 0; /* Minimum level */ quest->value[2] = 0; /* Minimum level */
quest->value[3] = CONFIG_MAX_LEVEL;/*Maximim level */ quest->value[3] = LVL_IMPL; /* Maximim level */
quest->value[4] = -1; /* Time limit */ quest->value[4] = -1; /* Time limit */
quest->value[5] = NOBODY; /* Mob to return object */ quest->value[5] = NOBODY; /* Mob to return object */
quest->value[6] = 1; /* Quantity of targets */ quest->value[6] = 1; /* Quantity of targets */
@ -385,7 +385,7 @@ void qedit_parse(struct descriptor_data *d, char *arg)
case 'Y': case 'Y':
send_to_char(d->character, "Saving Quest to memory.\r\n"); send_to_char(d->character, "Saving Quest to memory.\r\n");
qedit_save_internally(d); qedit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE,
"OLC: %s edits quest %d", GET_NAME(d->character), OLC_NUM(d)); "OLC: %s edits quest %d", GET_NAME(d->character), OLC_NUM(d));
if (CONFIG_OLC_SAVE) { if (CONFIG_OLC_SAVE) {
qedit_save_to_disk(real_zone_by_thing(OLC_NUM(d))); qedit_save_to_disk(real_zone_by_thing(OLC_NUM(d)));
@ -645,26 +645,26 @@ void qedit_parse(struct descriptor_data *d, char *arg)
OLC_QUEST(d)->prereq = number; OLC_QUEST(d)->prereq = number;
break; break;
case QEDIT_LEVELMIN: case QEDIT_LEVELMIN:
if (number < 0 || number > CONFIG_MAX_LEVEL) { if (number < 0 || number > LVL_IMPL) {
write_to_output(d, "Level must be between 0 and %d!\r\n", CONFIG_MAX_LEVEL); write_to_output(d, "Level must be between 0 and %d!\r\n", LVL_IMPL);
write_to_output(d, "Enter minimum level to accept the quest : " ); write_to_output(d, "Enter minimum level to accept the quest : " );
return; return;
} else if (number > OLC_QUEST(d)->value[3]) { } else if (number > OLC_QUEST(d)->value[3]) {
write_to_output(d, "Minimum level can't be above maximum level!\r\n"); write_to_output(d, "Minimum level can't be above maximum level!\r\n");
write_to_output(d, "Enter minimum level to accept the quest : " ); write_to_output(d, "Enter minimum level to accept the quest : " );
return; return;
} else { } else {
OLC_QUEST(d)->value[2] = number; OLC_QUEST(d)->value[2] = number;
break; break;
} }
case QEDIT_LEVELMAX: case QEDIT_LEVELMAX:
if (number < 0 || number > CONFIG_MAX_LEVEL) { if (number < 0 || number > LVL_IMPL) {
write_to_output(d, "Level must be between 0 and %d!\r\n", CONFIG_MAX_LEVEL); write_to_output(d, "Level must be between 0 and %d!\r\n", LVL_IMPL);
write_to_output(d, "Enter maximum level to accept the quest : " ); write_to_output(d, "Enter maximum level to accept the quest : " );
return; return;
} else if (number < OLC_QUEST(d)->value[2]) { } else if (number < OLC_QUEST(d)->value[2]) {
write_to_output(d, "Maximum level can't be below minimum level!\r\n"); write_to_output(d, "Maximum level can't be below minimum level!\r\n");
write_to_output(d, "Enter maximum level to accept the quest : " ); write_to_output(d, "Enter maximum level to accept the quest : " );
return; return;
} else { } else {
OLC_QUEST(d)->value[3] = number; OLC_QUEST(d)->value[3] = number;
@ -719,7 +719,7 @@ void qedit_parse(struct descriptor_data *d, char *arg)
default: default:
/*. We should never get here . */ /*. We should never get here . */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: qedit_parse(): " mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: qedit_parse(): "
"Reached default case!"); "Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;

View file

@ -658,7 +658,7 @@ void quest_stat(struct char_data *ch, char argument[MAX_STRING_LENGTH])
char buf[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH];
char targetname[MAX_STRING_LENGTH]; char targetname[MAX_STRING_LENGTH];
if (!ADM_FLAGGED(ch, ADM_BUILD)) if (GET_LEVEL(ch) < LVL_IMMORT)
send_to_char(ch, "Huh!?!\r\n"); send_to_char(ch, "Huh!?!\r\n");
else if (!*argument) else if (!*argument)
send_to_char(ch, "%s\r\n", quest_imm_usage); send_to_char(ch, "%s\r\n", quest_imm_usage);
@ -697,41 +697,43 @@ void quest_stat(struct char_data *ch, char argument[MAX_STRING_LENGTH])
send_to_char(ch, send_to_char(ch,
"VNum : [@y%5d@n], RNum: [@y%5d@n] -- Questmaster: [@y%5d@n] @y%s@n\r\n" "VNum : [@y%5d@n], RNum: [@y%5d@n] -- Questmaster: [@y%5d@n] @y%s@n\r\n"
"Name : @y%s@n\r\n" "Name : @y%s@n\r\n"
"Desc : @y%s@n\r\n" "Desc : @y%s@n\r\n"
"Accept Message:\r\n@c%s@n" "Accept Message:\r\n@c%s@n"
"Completion Message:\r\n@c%s@n" "Completion Message:\r\n@c%s@n"
"Quit Message:\r\n@c%s@n" "Quit Message:\r\n@c%s@n"
"Type : @y%s@n\r\n" "Type : @y%s@n\r\n"
"Target: @y%d@n @y%s@n, Quantity: @y%d@n\r\n" "Target: @y%d@n @y%s@n, Quantity: @y%d@n\r\n"
"Value : @y%d@n, Penalty: @y%d@n, Min Level: @y%2d@n, Max Level: @y%2d@n\r\n" "Value : @y%d@n, Penalty: @y%d@n, Min Level: @y%2d@n, Max Level: @y%2d@n\r\n"
"Flags : @c%s@n\r\n", "Flags : @c%s@n\r\n",
QST_NUM(rnum), rnum, QST_NUM(rnum), rnum,
QST_MASTER(rnum) == NOBODY ? -1 : QST_MASTER(rnum), QST_MASTER(rnum) == NOBODY ? -1 : QST_MASTER(rnum),
(qmrnum == NOBODY) ? "(Invalid vnum)" : GET_NAME(&mob_proto[(qmrnum)]), (qmrnum == NOBODY) ? "(Invalid vnum)" : GET_NAME(&mob_proto[(qmrnum)]),
QST_NAME(rnum), QST_DESC(rnum), QST_NAME(rnum), QST_DESC(rnum),
QST_INFO(rnum), QST_DONE(rnum), QST_INFO(rnum), QST_DONE(rnum),
(QST_QUIT(rnum) && (str_cmp(QST_QUIT(rnum), "undefined") != 0) ? QST_QUIT(rnum) : "Nothing\r\n"), (QST_QUIT(rnum) &&
quest_types[QST_TYPE(rnum)], (str_cmp(QST_QUIT(rnum), "undefined") != 0)
QST_TARGET(rnum) == NOBODY ? -1 : QST_TARGET(rnum), ? QST_QUIT(rnum) : "Nothing\r\n"),
targetname, quest_types[QST_TYPE(rnum)],
QST_QUANTITY(rnum), QST_TARGET(rnum) == NOBODY ? -1 : QST_TARGET(rnum),
QST_POINTS(rnum), QST_PENALTY(rnum), QST_MINLEVEL(rnum), targetname,
QST_MAXLEVEL(rnum), buf); QST_QUANTITY(rnum),
QST_POINTS(rnum), QST_PENALTY(rnum), QST_MINLEVEL(rnum),
QST_MAXLEVEL(rnum), buf);
if (QST_PREREQ(rnum) != NOTHING) if (QST_PREREQ(rnum) != NOTHING)
send_to_char(ch, "Preq : [@y%5d@n] @y%s@n\r\n", send_to_char(ch, "Preq : [@y%5d@n] @y%s@n\r\n",
QST_PREREQ(rnum) == NOTHING ? -1 : QST_PREREQ(rnum), QST_PREREQ(rnum) == NOTHING ? -1 : QST_PREREQ(rnum),
QST_PREREQ(rnum) == NOTHING ? "" : QST_PREREQ(rnum) == NOTHING ? "" :
real_object(QST_PREREQ(rnum)) == NOTHING ? "an unknown object" : real_object(QST_PREREQ(rnum)) == NOTHING ? "an unknown object" :
obj_proto[real_object(QST_PREREQ(rnum))].short_description); obj_proto[real_object(QST_PREREQ(rnum))].short_description);
if (QST_TYPE(rnum) == AQ_OBJ_RETURN) if (QST_TYPE(rnum) == AQ_OBJ_RETURN)
send_to_char(ch, "Mob : [@y%5d@n] @y%s@n\r\n", send_to_char(ch, "Mob : [@y%5d@n] @y%s@n\r\n",
QST_RETURNMOB(rnum), QST_RETURNMOB(rnum),
real_mobile(QST_RETURNMOB(rnum)) == NOBODY ? "an unknown mob" : real_mobile(QST_RETURNMOB(rnum)) == NOBODY ? "an unknown mob" :
mob_proto[real_mobile(QST_RETURNMOB(rnum))].player.short_descr); mob_proto[real_mobile(QST_RETURNMOB(rnum))].player.short_descr);
if (QST_TIME(rnum) != -1) if (QST_TIME(rnum) != -1)
send_to_char(ch, "Limit : There is a time limit of %d turn%s to complete.\r\n", send_to_char(ch, "Limit : There is a time limit of %d turn%s to complete.\r\n",
QST_TIME(rnum), QST_TIME(rnum),
QST_TIME(rnum) == 1 ? "" : "s"); QST_TIME(rnum) == 1 ? "" : "s");
else else
send_to_char(ch, "Limit : There is no time limit on this quest.\r\n"); send_to_char(ch, "Limit : There is no time limit on this quest.\r\n");
send_to_char(ch, "Prior :"); send_to_char(ch, "Prior :");
@ -760,11 +762,11 @@ ACMD(do_quest)
two_arguments(argument, arg1, arg2); two_arguments(argument, arg1, arg2);
if (!*arg1) if (!*arg1)
send_to_char(ch, "%s\r\n", IS_ADMIN(ch, ADMLVL_IMMORT) ? send_to_char(ch, "%s\r\n", GET_LEVEL(ch) < LVL_IMMORT ?
quest_imm_usage : quest_mort_usage); quest_mort_usage : quest_imm_usage);
else if (((tp = search_block(arg1, quest_cmd, FALSE)) == -1)) else if (((tp = search_block(arg1, quest_cmd, FALSE)) == -1))
send_to_char(ch, "%s\r\n", IS_ADMIN(ch, ADMLVL_IMMORT) ? send_to_char(ch, "%s\r\n", GET_LEVEL(ch) < LVL_IMMORT ?
quest_imm_usage : quest_mort_usage); quest_mort_usage : quest_imm_usage);
else { else {
switch (tp) { switch (tp) {
case SCMD_QUEST_LIST: case SCMD_QUEST_LIST:
@ -779,18 +781,18 @@ ACMD(do_quest)
quest_quit(ch); quest_quit(ch);
break; break;
case SCMD_QUEST_PROGRESS: case SCMD_QUEST_PROGRESS:
quest_progress(ch); quest_progress(ch);
break; break;
case SCMD_QUEST_STATUS: case SCMD_QUEST_STATUS:
if (!IS_ADMIN(ch, ADMLVL_IMMORT)) if (GET_LEVEL(ch) < LVL_IMMORT)
send_to_char(ch, "%s\r\n", quest_mort_usage); send_to_char(ch, "%s\r\n", quest_mort_usage);
else else
quest_stat(ch, arg2); quest_stat(ch, arg2);
break; break;
default: /* Whe should never get here, but... */ default: /* Whe should never get here, but... */
send_to_char(ch, "%s\r\n", IS_ADMIN(ch, ADMLVL_IMMORT) ? send_to_char(ch, "%s\r\n", GET_LEVEL(ch) < LVL_IMMORT ?
quest_imm_usage : quest_mort_usage); quest_mort_usage : quest_imm_usage);
break; break;
} /* switch on subcmd number */ } /* switch on subcmd number */
} }
} }
@ -821,13 +823,13 @@ SPECIAL(questmaster)
if (!*arg2) if (!*arg2)
quest_show(ch, GET_MOB_VNUM(qm)); quest_show(ch, GET_MOB_VNUM(qm));
else else
quest_list(ch, qm, arg2); quest_list(ch, qm, arg2);
break; break;
case SCMD_QUEST_JOIN: case SCMD_QUEST_JOIN:
quest_join(ch, qm, arg2); quest_join(ch, qm, arg2);
break; break;
default: default:
return FALSE; /* fall through to the do_quest command processor */ return FALSE; /* fall through to the do_quest command processor */
} /* switch on subcmd number */ } /* switch on subcmd number */
return TRUE; return TRUE;
} }

View file

@ -94,7 +94,7 @@ ACMD(do_oasis_redit)
/* Give the descriptor an OLC structure. */ /* Give the descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis_redit: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_redit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -121,7 +121,7 @@ ACMD(do_oasis_redit)
if (save) { if (save) {
send_to_char(ch, "Saving all rooms in zone %d.\r\n", zone_table[OLC_ZNUM(d)].number); send_to_char(ch, "Saving all rooms in zone %d.\r\n", zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves room info for zone %d.", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s saves room info for zone %d.", GET_NAME(ch), zone_table[OLC_ZNUM(d)].number);
/* Save the rooms. */ /* Save the rooms. */
save_rooms(OLC_ZNUM(d)); save_rooms(OLC_ZNUM(d));
@ -144,7 +144,7 @@ ACMD(do_oasis_redit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d", mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -170,12 +170,12 @@ void redit_setup_existing(struct descriptor_data *d, int real_num)
CREATE(room, struct room_data, 1); CREATE(room, struct room_data, 1);
*room = world[real_num]; *room = world[real_num];
/* Make new room people list be empty. */ /* Make new room people list be empty. */
/* Fixes bug where copying a room from within that room creates */ /* Fixes bug where copying a room from within that room creates */
/* an infinite loop when you next act() in the new room (goto?) */ /* an infinite loop when you next act() in the new room (goto?) */
/* and you are your next_in_room -- anderyu (10-05-22) */ /* and you are your next_in_room -- anderyu (10-05-22) */
room->people = NULL; room->people = NULL;
/* Allocate space for all strings. */ /* Allocate space for all strings. */
room->name = str_udup(world[real_num].name); room->name = str_udup(world[real_num].name);
@ -232,7 +232,7 @@ void redit_save_internally(struct descriptor_data *d)
if (OLC_ROOM(d)->number == NOWHERE) if (OLC_ROOM(d)->number == NOWHERE)
new_room = TRUE; new_room = TRUE;
OLC_ROOM(d)->number = OLC_NUM(d); OLC_ROOM(d)->number = OLC_NUM(d);
/* FIXME: Why is this not set elsewhere? */ /* FIXME: Why is this not set elsewhere? */
OLC_ROOM(d)->zone = OLC_ZNUM(d); OLC_ROOM(d)->zone = OLC_ZNUM(d);
@ -334,6 +334,7 @@ static void redit_disp_exit_menu(struct descriptor_data *d)
CREATE(OLC_EXIT(d), struct room_direction_data, 1); CREATE(OLC_EXIT(d), struct room_direction_data, 1);
OLC_EXIT(d)->to_room = NOWHERE; OLC_EXIT(d)->to_room = NOWHERE;
} }
/* Weird door handling! */ /* Weird door handling! */
if (IS_SET(OLC_EXIT(d)->exit_info, EX_ISDOOR)) { if (IS_SET(OLC_EXIT(d)->exit_info, EX_ISDOOR)) {
if (IS_SET(OLC_EXIT(d)->exit_info, EX_PICKPROOF) && IS_SET(OLC_EXIT(d)->exit_info, EX_HIDDEN)) if (IS_SET(OLC_EXIT(d)->exit_info, EX_PICKPROOF) && IS_SET(OLC_EXIT(d)->exit_info, EX_HIDDEN))
@ -374,8 +375,8 @@ static void redit_disp_exit_flag_menu(struct descriptor_data *d)
get_char_colors(d->character); get_char_colors(d->character);
write_to_output(d, "%s0%s) No door\r\n" write_to_output(d, "%s0%s) No door\r\n"
"%s1%s) Closeable door\r\n" "%s1%s) Closeable door\r\n"
"%s2%s) Pickproof Door\r\n" "%s2%s) Pickproof Door\r\n"
"%s3%s) Hidden Door\r\n" "%s3%s) Hidden Door\r\n"
"%s4%s) Hidden, Pickproof Door\r\n" "%s4%s) Hidden, Pickproof Door\r\n"
"Enter choice : ", grn, nrm, grn, nrm, grn, nrm, grn, nrm, grn, nrm); "Enter choice : ", grn, nrm, grn, nrm, grn, nrm, grn, nrm, grn, nrm);
} }
@ -418,90 +419,90 @@ static void redit_disp_menu(struct descriptor_data *d)
sprintbitarray(room->room_flags, room_bits, RF_ARRAY_MAX, buf1); sprintbitarray(room->room_flags, room_bits, RF_ARRAY_MAX, buf1);
sprinttype(room->sector_type, sector_types, buf2, sizeof(buf2)); sprinttype(room->sector_type, sector_types, buf2, sizeof(buf2));
write_to_output(d, write_to_output(d,
"-- Room number : [%s%d%s] Room zone: [%s%d%s]\r\n" "-- Room number : [%s%d%s] Room zone: [%s%d%s]\r\n"
"%s1%s) Name : %s%s\r\n" "%s1%s) Name : %s%s\r\n"
"%s2%s) Description :\r\n%s%s" "%s2%s) Description :\r\n%s%s"
"%s3%s) Room flags : %s%s\r\n" "%s3%s) Room flags : %s%s\r\n"
"%s4%s) Sector type : %s%s\r\n", "%s4%s) Sector type : %s%s\r\n",
cyn, OLC_NUM(d), nrm, cyn, OLC_NUM(d), nrm,
cyn, zone_table[OLC_ZNUM(d)].number, nrm, cyn, zone_table[OLC_ZNUM(d)].number, nrm,
grn, nrm, yel, room->name, grn, nrm, yel, room->name,
grn, nrm, yel, room->description, grn, nrm, yel, room->description,
grn, nrm, cyn, buf1, grn, nrm, cyn, buf1,
grn, nrm, cyn, buf2); grn, nrm, cyn, buf2);
if (!CONFIG_DIAGONAL_DIRS) if (!CONFIG_DIAGONAL_DIRS)
{ {
write_to_output(d, write_to_output(d,
"%s5%s) Exit north : %s%d\r\n" "%s5%s) Exit north : %s%d\r\n"
"%s6%s) Exit east : %s%d\r\n" "%s6%s) Exit east : %s%d\r\n"
"%s7%s) Exit south : %s%d\r\n" "%s7%s) Exit south : %s%d\r\n"
"%s8%s) Exit west : %s%d\r\n", "%s8%s) Exit west : %s%d\r\n",
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ? room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ?
world[room->dir_option[NORTH]->to_room].number : -1, world[room->dir_option[NORTH]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[EAST] && room->dir_option[EAST]->to_room != NOWHERE ? room->dir_option[EAST] && room->dir_option[EAST]->to_room != NOWHERE ?
world[room->dir_option[EAST]->to_room].number : -1, world[room->dir_option[EAST]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[SOUTH] && room->dir_option[SOUTH]->to_room != NOWHERE ? room->dir_option[SOUTH] && room->dir_option[SOUTH]->to_room != NOWHERE ?
world[room->dir_option[SOUTH]->to_room].number : -1, world[room->dir_option[SOUTH]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ? room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ?
world[room->dir_option[WEST]->to_room].number : -1); world[room->dir_option[WEST]->to_room].number : -1);
} else { } else {
write_to_output(d, write_to_output(d,
"%s5%s) Exit north : %s%d%s, %sB%s) Exit northwest : %s%d\r\n" "%s5%s) Exit north : %s%-6d%s, %sB%s) Exit northwest : %s%d\r\n"
"%s6%s) Exit east : %s%d%s, %sC%s) Exit northeast : %s%d\r\n" "%s6%s) Exit east : %s%-6d%s, %sC%s) Exit northeast : %s%d\r\n"
"%s7%s) Exit south : %s%d%s, %sD%s) Exit southeast : %s%d\r\n" "%s7%s) Exit south : %s%-6d%s, %sD%s) Exit southeast : %s%d\r\n"
"%s8%s) Exit west : %s%d%s, %sE%s) Exit southwest : %s%d\r\n", "%s8%s) Exit west : %s%-6d%s, %sE%s) Exit southwest : %s%d\r\n",
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ? room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ?
world[room->dir_option[NORTH]->to_room].number : -1, nrm, world[room->dir_option[NORTH]->to_room].number : -1, nrm,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[NORTHWEST] && room->dir_option[NORTHWEST]->to_room != NOWHERE ? room->dir_option[NORTHWEST] && room->dir_option[NORTHWEST]->to_room != NOWHERE ?
world[room->dir_option[NORTHWEST]->to_room].number : -1, world[room->dir_option[NORTHWEST]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[EAST] && room->dir_option[EAST]->to_room != NOWHERE ? room->dir_option[EAST] && room->dir_option[EAST]->to_room != NOWHERE ?
world[room->dir_option[EAST]->to_room].number : -1, nrm, world[room->dir_option[EAST]->to_room].number : -1, nrm,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[NORTHEAST] && room->dir_option[NORTHEAST]->to_room != NOWHERE ? room->dir_option[NORTHEAST] && room->dir_option[NORTHEAST]->to_room != NOWHERE ?
world[room->dir_option[NORTHEAST]->to_room].number : -1, world[room->dir_option[NORTHEAST]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[SOUTH] && room->dir_option[SOUTH]->to_room != NOWHERE ? room->dir_option[SOUTH] && room->dir_option[SOUTH]->to_room != NOWHERE ?
world[room->dir_option[SOUTH]->to_room].number : -1, nrm, world[room->dir_option[SOUTH]->to_room].number : -1, nrm,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[SOUTHEAST] && room->dir_option[SOUTHEAST]->to_room != NOWHERE ? room->dir_option[SOUTHEAST] && room->dir_option[SOUTHEAST]->to_room != NOWHERE ?
world[room->dir_option[SOUTHEAST]->to_room].number : -1, world[room->dir_option[SOUTHEAST]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ? room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ?
world[room->dir_option[WEST]->to_room].number : -1, nrm, world[room->dir_option[WEST]->to_room].number : -1, nrm,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[SOUTHWEST] && room->dir_option[SOUTHWEST]->to_room != NOWHERE ? room->dir_option[SOUTHWEST] && room->dir_option[SOUTHWEST]->to_room != NOWHERE ?
world[room->dir_option[SOUTHWEST]->to_room].number : -1 world[room->dir_option[SOUTHWEST]->to_room].number : -1
); );
} }
write_to_output(d, write_to_output(d,
"%s9%s) Exit up : %s%d\r\n" "%s9%s) Exit up : %s%d\r\n"
"%sA%s) Exit down : %s%d\r\n" "%sA%s) Exit down : %s%d\r\n"
"%sF%s) Extra descriptions menu\r\n" "%sF%s) Extra descriptions menu\r\n"
"%sS%s) Script : %s%s\r\n" "%sS%s) Script : %s%s\r\n"
"%sW%s) Copy Room\r\n" "%sW%s) Copy Room\r\n"
"%sX%s) Delete Room\r\n" "%sX%s) Delete Room\r\n"
"%sQ%s) Quit\r\n" "%sQ%s) Quit\r\n"
"Enter choice : ", "Enter choice : ",
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[UP] && room->dir_option[UP]->to_room != NOWHERE ? room->dir_option[UP] && room->dir_option[UP]->to_room != NOWHERE ?
world[room->dir_option[UP]->to_room].number : -1, world[room->dir_option[UP]->to_room].number : -1,
grn, nrm, cyn, grn, nrm, cyn,
room->dir_option[DOWN] && room->dir_option[DOWN]->to_room != NOWHERE ? room->dir_option[DOWN] && room->dir_option[DOWN]->to_room != NOWHERE ?
world[room->dir_option[DOWN]->to_room].number : -1, world[room->dir_option[DOWN]->to_room].number : -1,
grn, nrm, grn, nrm,
grn, nrm, cyn, OLC_SCRIPT(d) ? "Set." : "Not Set.", grn, nrm, cyn, OLC_SCRIPT(d) ? "Set." : "Not Set.",
grn, nrm, grn, nrm,
grn, nrm, grn, nrm,
grn, nrm grn, nrm
); );
OLC_MODE(d) = REDIT_MAIN_MENU; OLC_MODE(d) = REDIT_MAIN_MENU;
} }
@ -518,7 +519,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
redit_save_internally(d); redit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits room %d.", GET_NAME(d->character), OLC_NUM(d)); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits room %d.", GET_NAME(d->character), OLC_NUM(d));
if (CONFIG_OLC_SAVE) { if (CONFIG_OLC_SAVE) {
redit_save_to_disk(real_zone_by_thing(OLC_NUM(d))); redit_save_to_disk(real_zone_by_thing(OLC_NUM(d)));
write_to_output(d, "Room saved to disk.\r\n"); write_to_output(d, "Room saved to disk.\r\n");
@ -529,8 +530,8 @@ void redit_parse(struct descriptor_data *d, char *arg)
break; break;
case 'n': case 'n':
case 'N': case 'N':
/* If not saving, we must free the script_proto list. We do so by /* If not saving, we must free the script_proto list. We do so by
* assigning it to the edited room and letting free_room in * assigning it to the edited room and letting free_room in
* cleanup_olc handle it. */ * cleanup_olc handle it. */
OLC_ROOM(d)->proto_script = OLC_SCRIPT(d); OLC_ROOM(d)->proto_script = OLC_SCRIPT(d);
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
@ -601,7 +602,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
break; break;
case 'b': case 'b':
case 'B': case 'B':
if (CONFIG_DIAGONAL_DIRS) { if (!CONFIG_DIAGONAL_DIRS) {
write_to_output(d, "Invalid choice!"); write_to_output(d, "Invalid choice!");
redit_disp_menu(d); redit_disp_menu(d);
} else { } else {
@ -611,7 +612,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
break; break;
case 'c': case 'c':
case 'C': case 'C':
if (CONFIG_DIAGONAL_DIRS) { if (!CONFIG_DIAGONAL_DIRS) {
write_to_output(d, "Invalid choice!"); write_to_output(d, "Invalid choice!");
redit_disp_menu(d); redit_disp_menu(d);
} else { } else {
@ -621,7 +622,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
break; break;
case 'd': case 'd':
case 'D': case 'D':
if (CONFIG_DIAGONAL_DIRS) { if (!CONFIG_DIAGONAL_DIRS) {
write_to_output(d, "Invalid choice!"); write_to_output(d, "Invalid choice!");
redit_disp_menu(d); redit_disp_menu(d);
} else { } else {
@ -631,7 +632,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
break; break;
case 'e': case 'e':
case 'E': case 'E':
if (CONFIG_DIAGONAL_DIRS) { if (!CONFIG_DIAGONAL_DIRS) {
write_to_output(d, "Invalid choice!"); write_to_output(d, "Invalid choice!");
redit_disp_menu(d); redit_disp_menu(d);
} else { } else {
@ -687,7 +688,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
case REDIT_DESC: case REDIT_DESC:
/* We will NEVER get here, we hope. */ /* We will NEVER get here, we hope. */
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Reached REDIT_DESC case in parse_redit()."); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Reached REDIT_DESC case in parse_redit().");
write_to_output(d, "Oops, in REDIT_DESC.\r\n"); write_to_output(d, "Oops, in REDIT_DESC.\r\n");
break; break;
@ -775,7 +776,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
case REDIT_EXIT_DESCRIPTION: case REDIT_EXIT_DESCRIPTION:
/* We should NEVER get here, hopefully. */ /* We should NEVER get here, hopefully. */
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Reached REDIT_EXIT_DESC case in parse_redit"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Reached REDIT_EXIT_DESC case in parse_redit");
write_to_output(d, "Oops, in REDIT_EXIT_DESCRIPTION.\r\n"); write_to_output(d, "Oops, in REDIT_EXIT_DESCRIPTION.\r\n");
break; break;
@ -803,10 +804,10 @@ void redit_parse(struct descriptor_data *d, char *arg)
} else { } else {
/* Doors are a bit idiotic, don't you think? :) -- I agree. -gg */ /* Doors are a bit idiotic, don't you think? :) -- I agree. -gg */
OLC_EXIT(d)->exit_info = (number == 0 ? 0 : OLC_EXIT(d)->exit_info = (number == 0 ? 0 :
(number == 1 ? EX_ISDOOR : (number == 1 ? EX_ISDOOR :
(number == 2 ? EX_ISDOOR | EX_PICKPROOF : (number == 2 ? EX_ISDOOR | EX_PICKPROOF :
(number == 3 ? EX_ISDOOR | EX_HIDDEN : (number == 3 ? EX_ISDOOR | EX_HIDDEN :
(number == 4 ? EX_ISDOOR | EX_PICKPROOF | EX_HIDDEN : 0))))); (number == 4 ? EX_ISDOOR | EX_PICKPROOF | EX_HIDDEN : 0)))));
/* Jump back to the menu system. */ /* Jump back to the menu system. */
redit_disp_exit_menu(d); redit_disp_exit_menu(d);
} }
@ -824,7 +825,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
case REDIT_EXTRADESC_MENU: case REDIT_EXTRADESC_MENU:
switch ((number = atoi(arg))) { switch ((number = atoi(arg))) {
case 0: case 0:
/* If something got left out, delete the extra description when backing /* If something got left out, delete the extra description when backing
out to the menu. */ out to the menu. */
if (OLC_DESC(d)->keyword == NULL || OLC_DESC(d)->description == NULL) { if (OLC_DESC(d)->keyword == NULL || OLC_DESC(d)->description == NULL) {
struct extra_descr_data *temp; struct extra_descr_data *temp;
@ -879,7 +880,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
} else } else
write_to_output(d, "That room does not exist.\r\n"); write_to_output(d, "That room does not exist.\r\n");
break; break;
case REDIT_DELETE: case REDIT_DELETE:
if (*arg == 'y' || *arg == 'Y') { if (*arg == 'y' || *arg == 'Y') {
if (delete_room(real_room(OLC_ROOM(d)->number))) if (delete_room(real_room(OLC_ROOM(d)->number)))
@ -900,7 +901,7 @@ void redit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here. */ /* We should never get here. */
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: Reached default case in parse_redit"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: Reached default case in parse_redit");
break; break;
} }
/* If we get this far, something has been changed. */ /* If we get this far, something has been changed. */

View file

@ -57,7 +57,7 @@ ACMD(do_oasis_sedit)
/* No building as a mob or while being forced. */ /* No building as a mob or while being forced. */
if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING) if (IS_NPC(ch) || !ch->desc || STATE(ch->desc) != CON_PLAYING)
return; return;
/* Parse any arguments. */ /* Parse any arguments. */
buf3 = two_arguments(argument, buf1, buf2); buf3 = two_arguments(argument, buf1, buf2);
@ -109,7 +109,7 @@ ACMD(do_oasis_sedit)
/* Give the descriptor an OLC structure. */ /* Give the descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, mudlog(BRF, LVL_IMMORT, TRUE,
"SYSERR: do_oasis_sedit: Player already had olc structure."); "SYSERR: do_oasis_sedit: Player already had olc structure.");
free(d->olc); free(d->olc);
} }
@ -137,7 +137,7 @@ ACMD(do_oasis_sedit)
if (save) { if (save) {
send_to_char(ch, "Saving all shops in zone %d.\r\n", send_to_char(ch, "Saving all shops in zone %d.\r\n",
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves shop info for zone %d.", "OLC: %s saves shop info for zone %d.",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number);
@ -163,7 +163,7 @@ ACMD(do_oasis_sedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d", mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -445,7 +445,7 @@ void sedit_parse(struct descriptor_data *d, char *arg)
case 'y': case 'y':
case 'Y': case 'Y':
sedit_save_internally(d); sedit_save_internally(d);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE,
"OLC: %s edits shop %d", GET_NAME(d->character), "OLC: %s edits shop %d", GET_NAME(d->character),
OLC_NUM(d)); OLC_NUM(d));
if (CONFIG_OLC_SAVE) { if (CONFIG_OLC_SAVE) {
@ -772,12 +772,12 @@ void sedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here. */ /* We should never get here. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: sedit_parse(): Reached default case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: sedit_parse(): Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }
/* If we get here, we have probably changed something, and now want to return /* If we get here, we have probably changed something, and now want to return
to main menu. Use OLC_VAL as a 'has changed' flag. */ to main menu. Use OLC_VAL as a 'has changed' flag. */
OLC_VAL(d) = 1; OLC_VAL(d) = 1;
sedit_disp_menu(d); sedit_disp_menu(d);

View file

@ -514,7 +514,7 @@ static void shopping_buy(char *arg, struct char_data *ch, struct char_data *keep
return; return;
} }
} else { /*has the player got enough gold? */ } else { /*has the player got enough gold? */
if (buy_price(obj, shop_nr, keeper, ch) > GET_GOLD(ch) && !ADM_FLAGGED(ch, ADM_MONEY)) { if (buy_price(obj, shop_nr, keeper, ch) > GET_GOLD(ch) && !IS_GOD(ch)) {
char actbuf[MAX_INPUT_LENGTH]; char actbuf[MAX_INPUT_LENGTH];
snprintf(actbuf, sizeof(actbuf), shop_index[shop_nr].missing_cash2, GET_NAME(ch)); snprintf(actbuf, sizeof(actbuf), shop_index[shop_nr].missing_cash2, GET_NAME(ch));
@ -566,7 +566,7 @@ static void shopping_buy(char *arg, struct char_data *ch, struct char_data *keep
break; break;
} }
} else { } else {
while (obj && (GET_GOLD(ch) >= buy_price(obj, shop_nr, keeper, ch) || ADM_FLAGGED(ch, ADM_MONEY)) while (obj && (GET_GOLD(ch) >= buy_price(obj, shop_nr, keeper, ch) || IS_GOD(ch))
&& IS_CARRYING_N(ch) < CAN_CARRY_N(ch) && bought < buynum && IS_CARRYING_N(ch) < CAN_CARRY_N(ch) && bought < buynum
&& IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) <= CAN_CARRY_W(ch)) { && IS_CARRYING_W(ch) + GET_OBJ_WEIGHT(obj) <= CAN_CARRY_W(ch)) {
int charged; int charged;
@ -583,7 +583,7 @@ static void shopping_buy(char *arg, struct char_data *ch, struct char_data *keep
charged = buy_price(obj, shop_nr, keeper, ch); charged = buy_price(obj, shop_nr, keeper, ch);
goldamt += charged; goldamt += charged;
if (!ADM_FLAGGED(ch, ADM_MONEY)) if (!IS_GOD(ch))
decrease_gold(ch, charged); decrease_gold(ch, charged);
last_obj = obj; last_obj = obj;
@ -1573,12 +1573,12 @@ bool shopping_identify(char *arg, struct char_data *ch, struct char_data *keeper
sprinttype(GET_OBJ_TYPE(obj), item_types, buf, sizeof(buf)); sprinttype(GET_OBJ_TYPE(obj), item_types, buf, sizeof(buf));
send_to_char(ch, "Type: %s\r\n", buf); send_to_char(ch, "Type: %s\r\n", buf);
send_to_char(ch, "Weight: %d, Cost to Sell: %s%d%s, Cost to Buy: %s%d%s\r\n", send_to_char(ch, "Weight: %d, Cost to Sell: %s%d%s, Cost to Buy: %s%d%s\r\n",
GET_OBJ_WEIGHT(obj), GET_OBJ_WEIGHT(obj),
QYEL, sell_price(obj, shop_nr, keeper, ch), QNRM, QYEL, sell_price(obj, shop_nr, keeper, ch), QNRM,
QYEL, buy_price(obj, shop_nr, keeper, ch), QNRM); QYEL, buy_price(obj, shop_nr, keeper, ch), QNRM);
sprintbitarray(GET_OBJ_WEAR(obj), wear_bits, TW_ARRAY_MAX, buf); sprintbitarray(GET_OBJ_WEAR(obj), wear_bits, TW_ARRAY_MAX, buf);
send_to_char(ch, "Can be worn on: %s\r\n", buf); send_to_char(ch, "Can be worn on: %s\r\n", buf);
switch (GET_OBJ_TYPE(obj)) { switch (GET_OBJ_TYPE(obj)) {
case ITEM_LIGHT: case ITEM_LIGHT:

View file

@ -1,13 +1,13 @@
/** /**
* @file shop.h * @file shop.h
* Shop file definitions, structures, constants. * Shop file definitions, structures, constants.
* *
* Part of the core tbaMUD source code distribution, which is a derivative * Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD. * of, and continuation of, CircleMUD.
* *
* All rights reserved. See license for complete information. * All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
*/ */
#ifndef _SHOP_H_ #ifndef _SHOP_H_
#define _SHOP_H_ #define _SHOP_H_
@ -59,7 +59,7 @@ struct shop_data {
#define MAX_SHOP_OBJ 100 /* "Soft" maximum for list maximums */ #define MAX_SHOP_OBJ 100 /* "Soft" maximum for list maximums */
/* Pretty general macros that could be used elsewhere */ /* Pretty general macros that could be used elsewhere */
#define IS_GOD(ch) (IS_ADMIN(ch, ADMLVL_GOD)) #define IS_GOD(ch) (!IS_NPC(ch) && (GET_LEVEL(ch) >= LVL_GOD))
#define END_OF(buffer) ((buffer) + strlen((buffer))) #define END_OF(buffer) ((buffer) + strlen((buffer)))
/* Possible states for objects trying to be sold */ /* Possible states for objects trying to be sold */

View file

@ -18,9 +18,8 @@
#include "ban.h" /* for SPECIAL(gen_board) */ #include "ban.h" /* for SPECIAL(gen_board) */
#include "boards.h" #include "boards.h"
#include "mail.h" #include "mail.h"
#include "house.h"
SPECIAL(questmaster); SPECIAL(questmaster);
SPECIAL(shop_keeper); SPECIAL(shop_keeper);
/* local (file scope only) functions */ /* local (file scope only) functions */
@ -109,6 +108,16 @@ void assign_mobiles(void)
ASSIGNMOB(3105, mayor); ASSIGNMOB(3105, mayor);
ASSIGNMOB(110, postmaster);
ASSIGNMOB(1201, postmaster);
ASSIGNMOB(3010, postmaster);
ASSIGNMOB(10412, postmaster);
ASSIGNMOB(10719, postmaster);
ASSIGNMOB(25710, postmaster);
ASSIGNMOB(27164, postmaster);
ASSIGNMOB(30128, postmaster);
ASSIGNMOB(31510, postmaster);
ASSIGNMOB(1200, receptionist); ASSIGNMOB(1200, receptionist);
ASSIGNMOB(3005, receptionist); ASSIGNMOB(3005, receptionist);
ASSIGNMOB(5404, receptionist); ASSIGNMOB(5404, receptionist);
@ -157,41 +166,40 @@ void assign_rooms(void)
world[i].func = dump; world[i].func = dump;
} }
struct spec_func_data { struct spec_func_data {
char *name; char *name;
SPECIAL(*func); SPECIAL(*func);
}; };
struct spec_func_data spec_func_list[] = { struct spec_func_data spec_func_list[] = {
{"Mayor", mayor }, {"Mayor", mayor },
{"Snake", snake }, {"Snake", snake },
{"Thief", thief }, {"Thief", thief },
{"Magic User", magic_user }, {"Magic User", magic_user },
{"Puff", puff }, {"Puff", puff },
{"Fido", fido }, {"Fido", fido },
{"Janitor", janitor }, {"Janitor", janitor },
{"Cityguard", cityguard }, {"Cityguard", cityguard },
{"Receptionist", receptionist }, {"Postmaster", postmaster },
{"Cryogenicist", cryogenicist}, {"Receptionist", receptionist },
{"Bulletin Board", gen_board }, {"Cryogenicist", cryogenicist},
{"Bank", bank }, {"Bulletin Board", gen_board },
{"Pet Shop", pet_shops }, {"Bank", bank },
{"Dump", dump }, {"Pet Shop", pet_shops },
{"Guildmaster", guild }, {"Dump", dump },
{"Guild Guard", guild_guard }, {"Guildmaster", guild },
{"Questmaster", questmaster }, {"Guild Guard", guild_guard },
{"Shopkeeper", shop_keeper }, {"Questmaster", questmaster },
{"House-Receptionist", house_receptionist }, {"Shopkeeper", shop_keeper },
{"House-Shopkeeper", house_shopkeeper }, {"\n", NULL}
{"\n", NULL} };
};
const char *get_spec_func_name(SPECIAL(*func)) const char *get_spec_func_name(SPECIAL(*func))
{ {
int i; int i;
for (i=0; *(spec_func_list[i].name) != '\n'; i++) { for (i=0; *(spec_func_list[i].name) != '\n'; i++) {
if (func == spec_func_list[i].func) return (spec_func_list[i].name); if (func == spec_func_list[i].func) return (spec_func_list[i].name);
} }
return NULL; return NULL;
} }

View file

@ -8,7 +8,7 @@
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
**************************************************************************/ **************************************************************************/
/* For more examples: /* For more examples:
* ftp://ftp.circlemud.org/pub/CircleMUD/contrib/snippets/specials */ * ftp://ftp.circlemud.org/pub/CircleMUD/contrib/snippets/specials */
#include "conf.h" #include "conf.h"
@ -299,7 +299,7 @@ static void npc_steal(struct char_data *ch, struct char_data *victim)
if (IS_NPC(victim)) if (IS_NPC(victim))
return; return;
if (ADM_FLAGGED(victim, ADM_NOSTEAL)) if (GET_LEVEL(victim) >= LVL_IMMORT)
return; return;
if (!CAN_SEE(ch, victim)) if (!CAN_SEE(ch, victim))
return; return;
@ -312,7 +312,7 @@ static void npc_steal(struct char_data *ch, struct char_data *victim)
gold = (GET_GOLD(victim) * rand_number(1, 10)) / 100; gold = (GET_GOLD(victim) * rand_number(1, 10)) / 100;
if (gold > 0) { if (gold > 0) {
increase_gold(ch, gold); increase_gold(ch, gold);
decrease_gold(victim, gold); decrease_gold(victim, gold);
} }
} }
} }
@ -340,7 +340,7 @@ SPECIAL(thief)
return (FALSE); return (FALSE);
for (cons = world[IN_ROOM(ch)].people; cons; cons = cons->next_in_room) for (cons = world[IN_ROOM(ch)].people; cons; cons = cons->next_in_room)
if (!ADM_FLAGGED(cons, ADM_NOSTEAL) && !rand_number(0, 4)) { if (!IS_NPC(cons) && GET_LEVEL(cons) < LVL_IMMORT && !rand_number(0, 4)) {
npc_steal(ch, cons); npc_steal(ch, cons);
return (TRUE); return (TRUE);
} }
@ -419,44 +419,46 @@ SPECIAL(magic_user)
} }
/* Special procedures for mobiles. */ /* Special procedures for mobiles. */
SPECIAL(guild_guard) SPECIAL(guild_guard)
{ {
int i, direction; int i, direction;
struct char_data *guard = (struct char_data *)me; struct char_data *guard = (struct char_data *)me;
const char *buf = "The guard humiliates you, and blocks your way.\r\n"; const char *buf = "The guard humiliates you, and blocks your way.\r\n";
const char *buf2 = "The guard humiliates $n, and blocks $s way."; const char *buf2 = "The guard humiliates $n, and blocks $s way.";
if (!IS_MOVE(cmd) || AFF_FLAGGED(guard, AFF_BLIND)) if (!IS_MOVE(cmd) || AFF_FLAGGED(guard, AFF_BLIND))
return (FALSE); return (FALSE);
if (GET_LEVEL(ch) >= LVL_IMMORT)
return (FALSE);
/* find out what direction they are trying to go */
for (direction = 0; direction < NUM_OF_DIRS; direction++)
if (!strcmp(cmd_info[cmd].command, dirs[direction]))
for (direction = 0; direction < DIR_COUNT; direction++)
if (!strcmp(cmd_info[cmd].command, dirs[direction]) ||
!strcmp(cmd_info[cmd].command, autoexits[direction]))
break;
if (ADM_FLAGGED(ch, ADM_WALKANYWHERE)) for (i = 0; guild_info[i].guild_room != NOWHERE; i++) {
return (FALSE); /* Wrong guild. */
if (GET_ROOM_VNUM(IN_ROOM(ch)) != guild_info[i].guild_room)
continue;
/* find out what direction they are trying to go */ /* Wrong direction. */
for (direction = 0; direction < DIR_COUNT; direction++) if (direction != guild_info[i].direction)
if (!strcmp(cmd_info[cmd].command, dirs[direction]) || continue;
!strcmp(cmd_info[cmd].command, autoexits[direction]))
break;
for (i = 0; guild_info[i].guild_room != NOWHERE; i++) { /* Allow the people of the guild through. */
/* Wrong guild. */ if (!IS_NPC(ch) && GET_CLASS(ch) == guild_info[i].pc_class)
if (GET_ROOM_VNUM(IN_ROOM(ch)) != guild_info[i].guild_room) continue;
continue;
send_to_char(ch, "%s", buf);
/* Wrong direction. */ act(buf2, FALSE, ch, 0, 0, TO_ROOM);
if (direction != guild_info[i].direction) return (TRUE);
continue; }
return (FALSE);
/* Allow the people of the guild through. */ }
if (!IS_NPC(ch) && GET_CLASS(ch) == guild_info[i].pc_class)
continue;
send_to_char(ch, "%s", buf);
act(buf2, FALSE, ch, 0, 0, TO_ROOM);
return (TRUE);
}
return (FALSE);
}
SPECIAL(puff) SPECIAL(puff)
{ {
@ -543,15 +545,13 @@ SPECIAL(cityguard)
continue; continue;
if (!IS_NPC(tch) && PLR_FLAGGED(tch, PLR_KILLER)) { if (!IS_NPC(tch) && PLR_FLAGGED(tch, PLR_KILLER)) {
act("$n screams 'HEY!!! You're one of those PLAYER KILLERS!!!!!!'", FALSE, ch, 0, 0, TO_ROOM); act("$n screams 'HEY!!! You're one of those PLAYER KILLERS!!!!!!'", FALSE, ch, 0, 0, TO_ROOM);
if (!ADM_FLAGGED(tch, ADM_NODAMAGE)) hit(ch, tch, TYPE_UNDEFINED);
hit(ch, tch, TYPE_UNDEFINED);
return (TRUE); return (TRUE);
} }
if (!IS_NPC(tch) && PLR_FLAGGED(tch, PLR_THIEF)) { if (!IS_NPC(tch) && PLR_FLAGGED(tch, PLR_THIEF)) {
act("$n screams 'HEY!!! You're one of those PLAYER THIEVES!!!!!!'", FALSE, ch, 0, 0, TO_ROOM); act("$n screams 'HEY!!! You're one of those PLAYER THIEVES!!!!!!'", FALSE, ch, 0, 0, TO_ROOM);
if (!ADM_FLAGGED(tch, ADM_NODAMAGE)) hit(ch, tch, TYPE_UNDEFINED);
hit(ch, tch, TYPE_UNDEFINED);
return (TRUE); return (TRUE);
} }
@ -675,7 +675,7 @@ SPECIAL(bank)
return (TRUE); return (TRUE);
} }
decrease_gold(ch, amount); decrease_gold(ch, amount);
increase_bank(ch, amount); increase_bank(ch, amount);
send_to_char(ch, "You deposit %d coins.\r\n", amount); send_to_char(ch, "You deposit %d coins.\r\n", amount);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM); act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (TRUE); return (TRUE);
@ -689,7 +689,7 @@ SPECIAL(bank)
return (TRUE); return (TRUE);
} }
increase_gold(ch, amount); increase_gold(ch, amount);
decrease_bank(ch, amount); decrease_bank(ch, amount);
send_to_char(ch, "You withdraw %d coins.\r\n", amount); send_to_char(ch, "You withdraw %d coins.\r\n", amount);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM); act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (TRUE); return (TRUE);

View file

@ -604,7 +604,7 @@ ACMD(do_cast)
return; return;
} }
mana = mag_manacost(ch, spellnum); mana = mag_manacost(ch, spellnum);
if ((mana > 0) && (GET_MANA(ch) < mana) && (!IS_ADMIN(ch, ADMLVL_IMMORT))) { if ((mana > 0) && (GET_MANA(ch) < mana) && (GET_LEVEL(ch) < LVL_IMMORT)) {
send_to_char(ch, "You haven't the energy to cast that spell!\r\n"); send_to_char(ch, "You haven't the energy to cast that spell!\r\n");
return; return;
} }
@ -642,9 +642,9 @@ void spell_level(int spell, int chclass, int level)
bad = 1; bad = 1;
} }
if (level < 1 || level > CONFIG_MAX_LEVEL) { if (level < 1 || level > LVL_IMPL) {
log("SYSERR: assigning '%s' to illegal level %d/%d.", skill_name(spell), log("SYSERR: assigning '%s' to illegal level %d/%d.", skill_name(spell),
level, CONFIG_MAX_LEVEL); level, LVL_IMPL);
bad = 1; bad = 1;
} }
@ -660,7 +660,7 @@ static void spello(int spl, const char *name, int max_mana, int min_mana,
int i; int i;
for (i = 0; i < NUM_CLASSES; i++) for (i = 0; i < NUM_CLASSES; i++)
spell_info[spl].min_level[i] = (CONFIG_MAX_LEVEL + 1); spell_info[spl].min_level[i] = LVL_IMMORT;
spell_info[spl].mana_max = max_mana; spell_info[spl].mana_max = max_mana;
spell_info[spl].mana_min = min_mana; spell_info[spl].mana_min = min_mana;
spell_info[spl].mana_change = mana_change; spell_info[spl].mana_change = mana_change;
@ -677,7 +677,7 @@ void unused_spell(int spl)
int i; int i;
for (i = 0; i < NUM_CLASSES; i++) for (i = 0; i < NUM_CLASSES; i++)
spell_info[spl].min_level[i] = (CONFIG_MAX_LEVEL + 1); spell_info[spl].min_level[i] = LVL_IMPL + 1;
spell_info[spl].mana_max = 0; spell_info[spl].mana_max = 0;
spell_info[spl].mana_min = 0; spell_info[spl].mana_min = 0;
spell_info[spl].mana_change = 0; spell_info[spl].mana_change = 0;

View file

@ -109,7 +109,7 @@ ASPELL(spell_summon)
if (ch == NULL || victim == NULL) if (ch == NULL || victim == NULL)
return; return;
if (GET_LEVEL(victim) > MIN(CONFIG_MAX_LEVEL, level + 3)) { if (GET_LEVEL(victim) > MIN(LVL_IMMORT - 1, level + 3)) {
send_to_char(ch, "%s", SUMMON_FAIL); send_to_char(ch, "%s", SUMMON_FAIL);
return; return;
} }
@ -137,7 +137,7 @@ ASPELL(spell_summon)
(ch->player.sex == SEX_MALE) ? "He" : "She"); (ch->player.sex == SEX_MALE) ? "He" : "She");
send_to_char(ch, "You failed because %s has summon protection on.\r\n", GET_NAME(victim)); send_to_char(ch, "You failed because %s has summon protection on.\r\n", GET_NAME(victim));
mudlog(BRF, ADMLVL_IMMORT, TRUE, "%s failed summoning %s to %s.", GET_NAME(ch), GET_NAME(victim), world[IN_ROOM(ch)].name); mudlog(BRF, LVL_IMMORT, TRUE, "%s failed summoning %s to %s.", GET_NAME(ch), GET_NAME(victim), world[IN_ROOM(ch)].name);
return; return;
} }
} }

View file

@ -12,8 +12,6 @@
#ifndef _STRUCTS_H_ #ifndef _STRUCTS_H_
#define _STRUCTS_H_ #define _STRUCTS_H_
#include "protocol.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() * variety of versions without modifications. For instance, an IS_CORPSE()
* macro was introduced in pl13. Any future code add-ons could take into * macro was introduced in pl13. Any future code add-ons could take into
@ -66,14 +64,15 @@
#define WEST 3 /**< The direction west */ #define WEST 3 /**< The direction west */
#define UP 4 /**< The direction up */ #define UP 4 /**< The direction up */
#define DOWN 5 /**< The direction down */ #define DOWN 5 /**< The direction down */
#define NORTHWEST 6 /**< The direction north-west */ #define NORTHWEST 6 /**< The direction north-west */
#define NORTHEAST 7 /**< The direction north-east */ #define NORTHEAST 7 /**< The direction north-east */
#define SOUTHEAST 8 /**< The direction south-east */ #define SOUTHEAST 8 /**< The direction south-east */
#define SOUTHWEST 9 /**< The direction south-west */ #define SOUTHWEST 9 /**< The direction south-west */
/** Total number of directions available to move in. BEFORE CHANGING THIS, make /** 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 * sure you change every other direction and movement based item that this will
* impact. */ * impact. */
#define NUM_OF_DIRS 10
#define NUM_OF_DIRS 10
/* Room flags: used in room_data.room_flags */ /* Room flags: used in room_data.room_flags */
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
@ -94,9 +93,8 @@
#define ROOM_OLC 14 /**< (R) Modifyable/!compress */ #define ROOM_OLC 14 /**< (R) Modifyable/!compress */
#define ROOM_BFS_MARK 15 /**< (R) breath-first srch mrk */ #define ROOM_BFS_MARK 15 /**< (R) breath-first srch mrk */
#define ROOM_WORLDMAP 16 /**< World-map style maps here */ #define ROOM_WORLDMAP 16 /**< World-map style maps here */
#define ROOM_MAIL 17 /**< Mudmail can be sent from here */
/** The total number of Room Flags */ /** The total number of Room Flags */
#define NUM_ROOM_FLAGS 18 #define NUM_ROOM_FLAGS 17
/* Zone info: Used in zone_data.zone_flags */ /* Zone info: Used in zone_data.zone_flags */
#define ZONE_CLOSED 0 /**< Zone is closed - players cannot enter */ #define ZONE_CLOSED 0 /**< Zone is closed - players cannot enter */
@ -105,16 +103,16 @@
#define ZONE_GRID 3 /**< Zone is 'on the grid', connected, show on 'areas' */ #define ZONE_GRID 3 /**< Zone is 'on the grid', connected, show on 'areas' */
#define ZONE_NOBUILD 4 /**< Building is not allowed in the zone */ #define ZONE_NOBUILD 4 /**< Building is not allowed in the zone */
#define ZONE_NOASTRAL 5 /**< No teleportation magic will work to or from this zone */ #define ZONE_NOASTRAL 5 /**< No teleportation magic will work to or from this zone */
#define ZONE_WORLDMAP 6 /**< Whole zone uses the WORLDMAP by default */ #define ZONE_WORLDMAP 6 /**< Whole zone uses the WORLDMAP by default */
/** The total number of Zone Flags */ /** The total number of Zone Flags */
#define NUM_ZONE_FLAGS 7 #define NUM_ZONE_FLAGS 7
/* Exit info: used in room_data.dir_option.exit_info */ /* Exit info: used in room_data.dir_option.exit_info */
#define EX_ISDOOR (1 << 0) /**< Exit is a door */ #define EX_ISDOOR (1 << 0) /**< Exit is a door */
#define EX_CLOSED (1 << 1) /**< The door is closed */ #define EX_CLOSED (1 << 1) /**< The door is closed */
#define EX_LOCKED (1 << 2) /**< The door is locked */ #define EX_LOCKED (1 << 2) /**< The door is locked */
#define EX_PICKPROOF (1 << 3) /**< Lock can't be picked */ #define EX_PICKPROOF (1 << 3) /**< Lock can't be picked */
#define EX_HIDDEN (1 << 4) /**< Exit is hidden, secret */ #define EX_HIDDEN (1 << 4) /**< Exit is hidden, secret */
/* Sector types: used in room_data.sector_type */ /* Sector types: used in room_data.sector_type */
#define SECT_INSIDE 0 /**< Indoors, connected to SECT macro. */ #define SECT_INSIDE 0 /**< Indoors, connected to SECT macro. */
@ -226,10 +224,9 @@
#define MOB_NOBASH 16 /**< Mob can't be bashed (e.g. trees) */ #define MOB_NOBASH 16 /**< Mob can't be bashed (e.g. trees) */
#define MOB_NOBLIND 17 /**< Mob can't be blinded */ #define MOB_NOBLIND 17 /**< Mob can't be blinded */
#define MOB_NOKILL 18 /**< Mob can't be attacked */ #define MOB_NOKILL 18 /**< Mob can't be attacked */
#define MOB_MAILMAN 19 /**< Mob stands in room with MAIL flag */ #define MOB_NOTDEADYET 19 /**< (R) Mob being extracted */
#define MOB_NOTDEADYET 20 /**< (R) Mob being extracted */
#define NUM_MOB_FLAGS 20 #define NUM_MOB_FLAGS 19
/* Preference flags: used by char_data.player_specials.pref */ /* Preference flags: used by char_data.player_specials.pref */
#define PRF_BRIEF 0 /**< Room descs won't normally be shown */ #define PRF_BRIEF 0 /**< Room descs won't normally be shown */
@ -266,9 +263,8 @@
#define PRF_AUTOMAP 31 /**< Show map at the side of room descs */ #define PRF_AUTOMAP 31 /**< Show map at the side of room descs */
#define PRF_AUTOKEY 32 /**< Automatically unlock locked doors when opening */ #define PRF_AUTOKEY 32 /**< Automatically unlock locked doors when opening */
#define PRF_AUTODOOR 33 /**< Use the next available door */ #define PRF_AUTODOOR 33 /**< Use the next available door */
#define PRF_MORTAL 34 /**< Mortal flag turns off all imm powers */
/** Total number of available PRF flags */ /** Total number of available PRF flags */
#define NUM_PRF_FLAGS 35 #define NUM_PRF_FLAGS 34
/* Affect bits: used in char_data.char_specials.saved.affected_by */ /* Affect bits: used in char_data.char_specials.saved.affected_by */
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */ /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
@ -298,38 +294,6 @@
/** Total number of affect flags not including the don't use flag. */ /** Total number of affect flags not including the don't use flag. */
#define NUM_AFF_FLAGS 22 #define NUM_AFF_FLAGS 22
/*
* ADM flags - define admin privs for chars. Comments show default admin level.
*/
#define ADM_NONE -1 /* Special case used in command list MORTAL */
#define ADM_TELLALL 0 /* Can use 'tell all' to broadcast GOD */
#define ADM_SEEINV 1 /* Sees other chars inventory IMM */
#define ADM_SEESECRET 2 /* Sees secret objects, mobs and doors IMM */
#define ADM_KNOWWEATHER 3 /* Knows details of weather GOD */
#define ADM_FULLWHERE 4 /* Full output of 'where' command IMM */
#define ADM_MONEY 5 /* Char has a bottomless wallet GOD */
#define ADM_EATANYTHING 6 /* Char can eat anything GOD */
#define ADM_NOPOISON 7 /* Char can't be poisoned IMM */
#define ADM_WALKANYWHERE 8 /* Char has unrestricted walking IMM */
#define ADM_NOKEYS 9 /* Char needs no keys for locks GOD */
#define ADM_INSTANTKILL 10 /* "kill" command is instant IMPL */
#define ADM_NOSTEAL 11 /* Char cannot be stolen from IMM */
#define ADM_TRANSALL 12 /* Can use 'trans all' GRGOD */
#define ADM_SWITCHMORTAL 13 /* Can 'switch' to a PC's linkless body IMPL */
#define ADM_FORCEMASS 14 /* Can force rooms or all GRGOD */
#define ADM_ALLHOUSES 15 /* Can enter any house GRGOD */
#define ADM_NODAMAGE 16 /* Cannot be damaged IMM */
#define ADM_ALLSHOPS 17 /* Can use all shops GOD */
#define ADM_CEDIT 18 /* Can use cedit IMPL */
#define ADM_BUILD 19 /* Can use basic building tools BUILDER */
#define ADM_ADVBUILD 20 /* Can use advanced building tools BUILDER */
#define ADM_POOF 21 /* Can use goto and set poof messages IMM */
#define ADM_ADMIN 22 /* Can use the admin command to set privs IMPL */
#define ADM_SETQP 23 /* Can 'set' a player's questpoints GRGOD */
#define ADM_ADVIBT 24 /* Advanced IBT (ideas, bugs, typos) control GRGOD */
#define NUM_ADMFLAGS 25
/* Modes of connectedness: used by descriptor_data.state */ /* Modes of connectedness: used by descriptor_data.state */
#define CON_PLAYING 0 /**< Playing - Nominal state */ #define CON_PLAYING 0 /**< Playing - Nominal state */
#define CON_CLOSE 1 /**< User disconnect, remove character. */ #define CON_CLOSE 1 /**< User disconnect, remove character. */
@ -362,12 +326,10 @@
#define CON_QEDIT 28 /**< OLC mode - quest edit */ #define CON_QEDIT 28 /**< OLC mode - quest edit */
#define CON_PREFEDIT 29 /**< OLC mode - preference edit */ #define CON_PREFEDIT 29 /**< OLC mode - preference edit */
#define CON_IBTEDIT 30 /**< OLC mode - idea/bug/typo edit */ #define CON_IBTEDIT 30 /**< OLC mode - idea/bug/typo edit */
#define CON_HSEDIT 31 /**< OLC mode - house editor */
#define CON_MAILEDIT 32 /**< OLC mode - Mudmail editor */
/* OLC States range - used by IS_IN_OLC and IS_PLAYING */ /* OLC States range - used by IS_IN_OLC and IS_PLAYING */
#define FIRST_OLC_STATE CON_OEDIT /**< The first CON_ state that is an OLC */ #define FIRST_OLC_STATE CON_OEDIT /**< The first CON_ state that is an OLC */
#define LAST_OLC_STATE CON_MAILEDIT /**< The last CON_ state that is an OLC */ #define LAST_OLC_STATE CON_IBTEDIT /**< The last CON_ state that is an OLC */
/* Character equipment positions: used as index for char_data.equipment[] */ /* Character equipment positions: used as index for char_data.equipment[] */
/* NOTE: Don't confuse these constants with the ITEM_ bitvectors /* NOTE: Don't confuse these constants with the ITEM_ bitvectors
@ -392,7 +354,7 @@
#define WEAR_WRIST_L 15 /**< Equipment Location Left Wrist */ #define WEAR_WRIST_L 15 /**< Equipment Location Left Wrist */
#define WEAR_WIELD 16 /**< Equipment Location Weapon */ #define WEAR_WIELD 16 /**< Equipment Location Weapon */
#define WEAR_HOLD 17 /**< Equipment Location held in offhand */ #define WEAR_HOLD 17 /**< Equipment Location held in offhand */
/** Total number of available equipment locations */ /** Total number of available equipment lcoations */
#define NUM_WEARS 18 #define NUM_WEARS 18
/* object-related defines */ /* object-related defines */
@ -420,7 +382,7 @@
#define ITEM_PEN 21 /**< Item is a pen */ #define ITEM_PEN 21 /**< Item is a pen */
#define ITEM_BOAT 22 /**< Item is a boat */ #define ITEM_BOAT 22 /**< Item is a boat */
#define ITEM_FOUNTAIN 23 /**< Item is a fountain */ #define ITEM_FOUNTAIN 23 /**< Item is a fountain */
/* Total number of item types. */ /** Total number of item types.*/
#define NUM_ITEM_TYPES 24 #define NUM_ITEM_TYPES 24
/* Take/Wear flags: used by obj_data.obj_flags.wear_flags */ /* Take/Wear flags: used by obj_data.obj_flags.wear_flags */
@ -556,8 +518,6 @@
#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 */ #define EF_ARRAY_MAX 4 /**< # Bytes in Bit vector - Obj Extra Flags */
#define ZN_ARRAY_MAX 4 /**< # Bytes in Bit vector - Zone Flags */ #define ZN_ARRAY_MAX 4 /**< # Bytes in Bit vector - Zone Flags */
#define AD_ARRAY_MAX 4 /**< # Bytes in Bit vector - Admin Priv Flags */
#define HS_ARRAY_MAX 4 /**< # Bytes in Bit vector - House Flags */
/* other #defined constants */ /* other #defined constants */
/* **DO**NOT** blindly change the number of levels in your MUD merely by /* **DO**NOT** blindly change the number of levels in your MUD merely by
@ -565,16 +525,15 @@
* Other changes throughout the code are required. See coding.doc for details. * Other changes throughout the code are required. See coding.doc for details.
* *
* LVL_IMPL should always be the HIGHEST possible immortal level, and * LVL_IMPL should always be the HIGHEST possible immortal level, and
* LVL_IMMORT should always be the LOWEST immortal level. The only * LVL_IMMORT should always be the LOWEST immortal level. The number of
* mortal level will always be zero, or LVL_IMMORT - 1. */ * mortal levels will always be LVL_IMMORT - 1. */
#define ADMLVL_IMPL 4 /**< Level of Implementors */ #define LVL_IMPL 34 /**< Level of Implementors */
#define ADMLVL_GRGOD 3 /**< Level of Greater Gods */ #define LVL_GRGOD 33 /**< Level of Greater Gods */
#define ADMLVL_GOD 2 /**< Level of Gods */ #define LVL_GOD 32 /**< Level of Gods */
#define ADMLVL_IMMORT 1 /**< Level of Immortals */ #define LVL_IMMORT 31 /**< Level of Immortals */
#define ADMLVL_MORTAL 0 /**< Level of Mortals */
/** Minimum level to build and to run the saveall command */ /** Minimum level to build and to run the saveall command */
#define ADMLVL_BUILDER ADMLVL_IMMORT #define LVL_BUILDER LVL_IMMORT
/** Arbitrary number that won't be in a string */ /** Arbitrary number that won't be in a string */
#define MAGIC_NUMBER (0x06) #define MAGIC_NUMBER (0x06)
@ -649,8 +608,8 @@
#define MAX_HELP_ENTRY MAX_STRING_LENGTH /**< Max size of help entry */ #define MAX_HELP_ENTRY MAX_STRING_LENGTH /**< Max size of help entry */
#define MAX_COMPLETED_QUESTS 1024 /**< Maximum number of completed quests allowed */ #define MAX_COMPLETED_QUESTS 1024 /**< Maximum number of completed quests allowed */
#define MAX_GOLD 2140000000 /**< Maximum possible on hand gold (2.14 Billion) */ #define MAX_GOLD 2140000000 /**< Maximum possible on hand gold (2.14 Billion) */
#define MAX_BANK 2140000000 /**< Maximum possible in bank gold (2.14 Billion) */ #define MAX_BANK 2140000000 /**< Maximum possible in bank gold (2.14 Billion) */
/** 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. */ * 16k should be plenty and then some. */
@ -763,7 +722,6 @@ struct obj_data
struct obj_data *next_content; /**< For 'contains' lists */ struct obj_data *next_content; /**< For 'contains' lists */
struct obj_data *next; /**< For the object list */ struct obj_data *next; /**< For the object list */
struct char_data *sitting_here; /**< For furniture, who is sitting in it */ struct char_data *sitting_here; /**< For furniture, who is sitting in it */
struct mail_data *in_mail; /**< Which mail object is attached to */
}; };
/** Instance info for an object that gets saved to disk. /** Instance info for an object that gets saved to disk.
@ -892,7 +850,7 @@ struct char_player_data
char *title; /**< PC / NPC title */ char *title; /**< PC / NPC title */
byte sex; /**< PC / NPC sex */ byte sex; /**< PC / NPC sex */
byte chclass; /**< PC / NPC class */ byte chclass; /**< PC / NPC class */
ubyte level; /**< PC / NPC level */ byte level; /**< PC / NPC level */
struct time_data time; /**< PC AGE in days */ struct time_data time; /**< PC AGE in days */
ubyte weight; /**< PC / NPC weight */ ubyte weight; /**< PC / NPC weight */
ubyte height; /**< PC / NPC height */ ubyte height; /**< PC / NPC height */
@ -967,9 +925,7 @@ struct char_special_data
/** Data only needed by PCs, and needs to be saved to disk. */ /** Data only needed by PCs, and needs to be saved to disk. */
struct player_special_data_saved struct player_special_data_saved
{ {
byte adm_level; /**< PC Admin level */ byte skills[MAX_SKILLS+1]; /**< Character skills. */
int admflags[AD_ARRAY_MAX]; /**< Admin Priv flags */
byte skills[MAX_SKILLS+1]; /**< Character skills. */
int wimp_level; /**< Below this # of hit points, flee! */ int wimp_level; /**< Below this # of hit points, flee! */
byte freeze_level; /**< Level of god who froze char, if any */ byte freeze_level; /**< Level of god who froze char, if any */
sh_int invis_level; /**< level of invisibility */ sh_int invis_level; /**< level of invisibility */
@ -1002,11 +958,11 @@ struct player_special_data
char *poofin; /**< Description displayed to room on arrival of a god. */ char *poofin; /**< Description displayed to room on arrival of a god. */
char *poofout; /**< Description displayed to room at a god's exit. */ char *poofout; /**< Description displayed to room at a god's exit. */
struct alias_data *aliases; /**< Command aliases */ struct alias_data *aliases; /**< Command aliases */
long last_tell; /**< idnum of PC who last told this PC, used to reply */ long last_tell; /**< idnum of PC who last told this PC, used to reply */
void *last_olc_targ; /**< ? Currently Unused ? */ void *last_olc_targ; /**< ? Currently Unused ? */
int last_olc_mode; /**< ? Currently Unused ? */ int last_olc_mode; /**< ? Currently Unused ? */
char *host; /**< Resolved hostname, or ip, for player. */ char *host; /**< Resolved hostname, or ip, for player. */
int buildwalk_sector;/**< Default sector type for buildwalk */ int buildwalk_sector; /**< Default sector type for buildwalk */
}; };
/** Special data used by NPCs, not PCs */ /** Special data used by NPCs, not PCs */
@ -1017,14 +973,12 @@ struct mob_special_data
byte default_pos; /**< Default position (standing, sleeping, etc.) */ byte default_pos; /**< Default position (standing, sleeping, etc.) */
byte damnodice; /**< The number of dice to roll for damage */ byte damnodice; /**< The number of dice to roll for damage */
byte damsizedice; /**< The size of each die rolled for damage. */ byte damsizedice; /**< The size of each die rolled for damage. */
struct mail_edit_data *ml_list; /**< Mail info for sending from mobs by script */
}; };
/** An affect structure. */ /** An affect structure. */
struct affected_type struct affected_type
{ {
sh_int spell; /**< The spell that caused this */ sh_int spell; /**< The spell that caused this */
sh_int duration; /**< For how long its effects will last */ sh_int duration; /**< For how long its effects will last */
sbyte modifier; /**< Added/subtracted to/from apropriate ability */ sbyte modifier; /**< Added/subtracted to/from apropriate ability */
byte location; /**< Tells which ability to change(APPLY_XXX). */ byte location; /**< Tells which ability to change(APPLY_XXX). */
@ -1131,7 +1085,6 @@ struct descriptor_data
struct descriptor_data *snoop_by; /**< And who is snooping this char */ struct descriptor_data *snoop_by; /**< And who is snooping this char */
struct descriptor_data *next; /**< link to next descriptor */ struct descriptor_data *next; /**< link to next descriptor */
struct oasis_olc_data *olc; /**< OLC info */ struct oasis_olc_data *olc; /**< OLC info */
protocol_t *pProtocol;
}; };
/* other miscellaneous structures */ /* other miscellaneous structures */
@ -1324,7 +1277,6 @@ struct game_data
int max_exp_loss; /**< Maximum experience losable per death.*/ int max_exp_loss; /**< Maximum experience losable per death.*/
int max_npc_corpse_time; /**< Num tics before NPC corpses decompose*/ int max_npc_corpse_time; /**< Num tics before NPC corpses decompose*/
int max_pc_corpse_time; /**< Num tics before PC corpse decomposes.*/ int max_pc_corpse_time; /**< Num tics before PC corpse decomposes.*/
int max_mortal_level; /**< Maximum level that a mortal can obtain.*/
int idle_void; /**< Num tics before PC sent to void(idle)*/ int idle_void; /**< Num tics before PC sent to void(idle)*/
int idle_rent_time; /**< Num tics before PC is autorented. */ int idle_rent_time; /**< Num tics before PC is autorented. */
int idle_max_level; /**< Level of players immune to idle. */ int idle_max_level; /**< Level of players immune to idle. */
@ -1333,7 +1285,7 @@ struct game_data
int track_through_doors; /**< Track through doors while closed? */ int track_through_doors; /**< Track through doors while closed? */
int no_mort_to_immort; /**< Prevent mortals leveling to imms? */ int no_mort_to_immort; /**< Prevent mortals leveling to imms? */
int disp_closed_doors; /**< Display closed doors in autoexit? */ int disp_closed_doors; /**< Display closed doors in autoexit? */
int diagonal_dirs; /**< Are there 6 or 10 directions? */ int diagonal_dirs; /**< Are there 6 or 10 directions? */
int map_option; /**< MAP_ON, MAP_OFF or MAP_IMM_ONLY */ int map_option; /**< MAP_ON, MAP_OFF or MAP_IMM_ONLY */
int map_size; /**< Default size for map command */ int map_size; /**< Default size for map command */
int minimap_size; /**< Default size for mini-map (automap) */ int minimap_size; /**< Default size for mini-map (automap) */
@ -1396,22 +1348,6 @@ struct autowiz_data
int min_wizlist_lev; /**< Minimun level to show on wizlist. */ int min_wizlist_lev; /**< Minimun level to show on wizlist. */
}; };
/** The Mail System options. */
struct mail_config {
int mail_allowed; /* Is mudmail allowed? (to disable whole mudmail system) Yes */
int objects_allowed; /* object mailing allowed Yes */
int gold_allowed; /* gold mailing allowed? Yes */
int stamp_cost; /* Stamp Cost 150 coins */
int object_cost; /* Cost per object for each attachment 30 coins */
int min_level; /* Min level that can mail 1 */
int min_free_level; /* Min level for free mail Immortal */
int allow_drafts; /* Can players save draft mudmails? Yes */
int draft_timeout; /* No. of days a draft mail can stay in the outbox 28 days */
int safe_mailing; /* Can players be attacked or stolen from while mailing? Yes */
int min_mail_anywhere; /* Min level that can send mail from anywhere? Immortal */
int min_send_to_all; /* Min level that can send mail to all players? Implementor */
};
/** /**
Main Game Configuration Structure. 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
@ -1435,8 +1371,6 @@ struct config_data
struct game_operation operation; struct game_operation operation;
/** Autowiz specific settings, like turning it on and minimum level */ /** Autowiz specific settings, like turning it on and minimum level */
struct autowiz_data autowiz; struct autowiz_data autowiz;
/** Mudmail configuration */
struct mail_config mail;
}; };
#ifdef MEMORY_DEBUG #ifdef MEMORY_DEBUG

View file

@ -31,14 +31,14 @@ void tedit_string_cleanup(struct descriptor_data *d, int terminator)
switch (terminator) { switch (terminator) {
case STRINGADD_SAVE: case STRINGADD_SAVE:
if (!(fl = fopen(storage, "w"))) if (!(fl = fopen(storage, "w")))
mudlog(CMP, ADMLVL_IMPL, TRUE, "SYSERR: Can't write file '%s'.", storage); mudlog(CMP, LVL_IMPL, TRUE, "SYSERR: Can't write file '%s'.", storage);
else { else {
if (*d->str) { if (*d->str) {
strip_cr(*d->str); strip_cr(*d->str);
fputs(*d->str, fl); fputs(*d->str, fl);
} }
fclose(fl); fclose(fl);
mudlog(CMP, ADMLVL_GOD, TRUE, "OLC: %s saves '%s'.", GET_NAME(d->character), storage); mudlog(CMP, LVL_GOD, TRUE, "OLC: %s saves '%s'.", GET_NAME(d->character), storage);
write_to_output(d, "Saved.\r\n"); write_to_output(d, "Saved.\r\n");
if (!strcmp(storage, NEWS_FILE)) if (!strcmp(storage, NEWS_FILE))
newsmod = time(0); newsmod = time(0);
@ -74,20 +74,20 @@ ACMD(do_tedit)
char *filename; char *filename;
} fields[] = { } fields[] = {
/* edit the lvls to your own needs */ /* edit the lvls to your own needs */
{ "credits", ADMLVL_IMPL, &credits, 2400, CREDITS_FILE}, { "credits", LVL_IMPL, &credits, 2400, CREDITS_FILE},
{ "news", ADMLVL_GRGOD, &news, 8192, NEWS_FILE}, { "news", LVL_GRGOD, &news, 8192, NEWS_FILE},
{ "motd", ADMLVL_GRGOD, &motd, 2400, MOTD_FILE}, { "motd", LVL_GRGOD, &motd, 2400, MOTD_FILE},
{ "imotd", ADMLVL_IMPL, &imotd, 2400, IMOTD_FILE}, { "imotd", LVL_IMPL, &imotd, 2400, IMOTD_FILE},
{ "greetings", ADMLVL_IMPL, &GREETINGS, 2400, GREETINGS_FILE}, { "greetings", LVL_IMPL, &GREETINGS, 2400, GREETINGS_FILE},
{ "help", ADMLVL_GRGOD, &help, 2400, HELP_PAGE_FILE}, { "help", LVL_GRGOD, &help, 2400, HELP_PAGE_FILE},
{ "ihelp", ADMLVL_GRGOD, &ihelp, 2400, IHELP_PAGE_FILE}, { "ihelp", LVL_GRGOD, &ihelp, 2400, IHELP_PAGE_FILE},
{ "info", ADMLVL_GRGOD, &info, 8192, INFO_FILE}, { "info", LVL_GRGOD, &info, 8192, INFO_FILE},
{ "background", ADMLVL_IMPL, &background, 8192, BACKGROUND_FILE}, { "background", LVL_IMPL, &background, 8192, BACKGROUND_FILE},
{ "handbook", ADMLVL_IMPL, &handbook, 8192, HANDBOOK_FILE}, { "handbook", LVL_IMPL, &handbook, 8192, HANDBOOK_FILE},
{ "policies", ADMLVL_IMPL, &policies, 8192, POLICIES_FILE}, { "policies", LVL_IMPL, &policies, 8192, POLICIES_FILE},
{ "wizlist", ADMLVL_IMPL, &wizlist, 2400, WIZLIST_FILE}, { "wizlist", LVL_IMPL, &wizlist, 2400, WIZLIST_FILE},
{ "immlist", ADMLVL_GRGOD, &immlist, 2400, IMMLIST_FILE}, { "immlist", LVL_GRGOD, &immlist, 2400, IMMLIST_FILE},
{ "\n", ADMLVL_MORTAL, NULL, 0, NULL } { "\n", 0, NULL, 0, NULL }
}; };
if (ch->desc == NULL) if (ch->desc == NULL)
@ -98,10 +98,10 @@ ACMD(do_tedit)
if (!*field) { if (!*field) {
send_to_char(ch, "Files available to be edited:\r\n"); send_to_char(ch, "Files available to be edited:\r\n");
for (l = 0; *fields[l].cmd != '\n'; l++) { for (l = 0; *fields[l].cmd != '\n'; l++) {
if (GET_ADMLEVEL(ch) >= fields[l].level) { if (GET_LEVEL(ch) >= fields[l].level) {
send_to_char(ch, "%-11.11s ", fields[l].cmd); send_to_char(ch, "%-11.11s ", fields[l].cmd);
if (!(++i % 7)) if (!(++i % 7))
send_to_char(ch, "\r\n"); send_to_char(ch, "\r\n");
} }
} }
if (i % 7) if (i % 7)
@ -119,7 +119,7 @@ ACMD(do_tedit)
return; return;
} }
if (GET_ADMLEVEL(ch) < fields[l].level) { if (GET_LEVEL(ch) < fields[l].level) {
send_to_char(ch, "You are not godly enough for that!\r\n"); send_to_char(ch, "You are not godly enough for that!\r\n");
return; return;
} }
@ -130,7 +130,7 @@ ACMD(do_tedit)
send_to_char(ch, "Edit file below:\r\n\r\n"); send_to_char(ch, "Edit file below:\r\n\r\n");
if (ch->desc->olc) { if (ch->desc->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_tedit: Player already had olc structure."); mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_tedit: Player already had olc structure.");
free(ch->desc->olc); free(ch->desc->olc);
} }
CREATE(ch->desc->olc, struct oasis_olc_data, 1); CREATE(ch->desc->olc, struct oasis_olc_data, 1);

View file

@ -16,10 +16,10 @@
#define IMM_LMARG " " #define IMM_LMARG " "
#define IMM_NSIZE 16 #define IMM_NSIZE 16
#define LINE_LEN 64 #define LINE_LEN 64
#define MIN_LEVEL ADMLVL_IMMORT #define MIN_LEVEL LVL_IMMORT
/* max level that should be in columns instead of centered */ /* max level that should be in columns instead of centered */
#define COL_LEVEL ADMLVL_IMMORT #define COL_LEVEL LVL_IMMORT
struct name_rec { struct name_rec {
char name[25]; char name[25];
@ -39,10 +39,10 @@ struct level_rec {
struct control_rec level_params[] = struct control_rec level_params[] =
{ {
{ADMLVL_IMMORT, "Immortals"}, {LVL_IMMORT, "Immortals"},
{ADMLVL_GOD , "Gods"}, {LVL_GOD, "Gods"},
{ADMLVL_GRGOD , "Greater Gods"}, {LVL_GRGOD, "Greater Gods"},
{ADMLVL_IMPL , "Implementors"}, {LVL_IMPL, "Implementors"},
{0, ""} {0, ""}
}; };
@ -70,7 +70,7 @@ void read_file(void)
bitvector_t asciiflag_conv(char *flag); bitvector_t asciiflag_conv(char *flag);
FILE *fl; FILE *fl;
int recs, i, last = 0, level = 0, flags = 0, admlevel = 0; int recs, i, last = 0, level = 0, flags = 0;
char index_name[40], line[256], bits[64]; char index_name[40], line[256], bits[64];
char name[MAX_NAME_LENGTH]; char name[MAX_NAME_LENGTH];
long id = 0; long id = 0;
@ -89,14 +89,13 @@ void read_file(void)
for (i = 0; i < recs; i++) { for (i = 0; i < recs; i++) {
get_line(fl, line); get_line(fl, line);
sscanf(line, "%ld %s %d %d %s %d", &id, name, &level, &admlevel, bits, &last); sscanf(line, "%ld %s %d %s %d", &id, name, &level, bits, &last);
CAP(name); CAP(name);
flags = asciiflag_conv(bits); flags = asciiflag_conv(bits);
if (level >= MIN_LEVEL && if (level >= MIN_LEVEL &&
!(IS_SET(flags, PINDEX_NOWIZLIST)) && !(IS_SET(flags, PINDEX_NOWIZLIST)) &&
!(IS_SET(flags, PINDEX_DELETED)) && !(IS_SET(flags, PINDEX_DELETED)))
!(IS_SET(flags, PINDEX_MORTAL)) ) add_name(level, name);
add_name(admlevel, name);
} }
fclose(fl); fclose(fl);
} }
@ -233,7 +232,7 @@ int main(int argc, char **argv)
sort_names(); sort_names();
fl = fopen(argv[2], "w"); fl = fopen(argv[2], "w");
write_wizlist(fl, wizlevel, ADMLVL_IMPL); write_wizlist(fl, wizlevel, LVL_IMPL);
fclose(fl); fclose(fl);
fl = fopen(argv[4], "w"); fl = fopen(argv[4], "w");
@ -254,9 +253,9 @@ char *CAP(char *txt)
return (txt); return (txt);
} }
/* get_line reads the next non-blank line off of the input stream. The newline /* get_line reads the next non-blank line off of the input stream. The newline
* character is removed from the input. Lines which begin with '*' are * character is removed from the input. Lines which begin with '*' are
* considered to be comments. Returns the number of lines advanced in the * considered to be comments. Returns the number of lines advanced in the
* file. */ * file. */
int get_line(FILE * fl, char *buf) int get_line(FILE * fl, char *buf)
{ {

View file

@ -23,8 +23,6 @@
#define MAX_SKILLS 200 /* Used in char_file_u *DO*NOT*CHANGE* */ #define MAX_SKILLS 200 /* Used in char_file_u *DO*NOT*CHANGE* */
#define MAX_AFFECT 32 /* Used in char_file_u *DO*NOT*CHANGE* */ #define MAX_AFFECT 32 /* Used in char_file_u *DO*NOT*CHANGE* */
#define MAX_LEVEL 30 /* Same as CONFIG_MAX_LEVEL */
/* Char's abilities. Used in char_file_u *DO*NOT*CHANGE* */ /* Char's abilities. Used in char_file_u *DO*NOT*CHANGE* */
struct char_ability_data_plrtoascii { struct char_ability_data_plrtoascii {
sbyte str; sbyte str;
@ -56,7 +54,7 @@ struct char_point_data_plrtoascii {
}; };
/* /*
* char_special_data_saved: specials which both a PC and an NPC have in * char_special_data_saved: specials which both a PC and an NPC have in
* common, but which must be saved to the playerfile for PC's. * common, but which must be saved to the playerfile for PC's.
* *
@ -188,7 +186,7 @@ void convert(char *filename)
exit(1); exit(1);
printf("writing: %s\n", outname); printf("writing: %s\n", outname);
fprintf(index_file, "%ld %s %d 0 %ld\n", fprintf(index_file, "%ld %s %d 0 %ld\n",
player.char_specials_saved.idnum, bits, player.level, player.char_specials_saved.idnum, bits, player.level,
(long)player.last_logon); (long)player.last_logon);
@ -207,13 +205,11 @@ void convert(char *filename)
if (player.description && *player.description) if (player.description && *player.description)
fprintf(outfile, "Desc:\n%s~\n", player.description); fprintf(outfile, "Desc:\n%s~\n", player.description);
if (player.sex != PFDEF_SEX) if (player.sex != PFDEF_SEX)
fprintf(outfile, "Sex : %d\n", (int)player.sex); fprintf(outfile, "Sex : %d\n", (int)player.sex);
if (player.chclass != PFDEF_CLASS) if (player.chclass != PFDEF_CLASS)
fprintf(outfile, "Clas: %d\n", (int)player.chclass); fprintf(outfile, "Clas: %d\n", (int)player.chclass);
if (player.level != PFDEF_LEVEL) if (player.level != PFDEF_LEVEL)
fprintf(outfile, "Levl: %d\n", (int)player.level); fprintf(outfile, "Levl: %d\n", (int)player.level);
if (player.level > MAX_LEVEL)
fprintf(outfile, "Admn: %d\n", (int)(player.level-MAX_LEVEL));
fprintf(outfile, "Brth: %d\n", (int)player.birth); fprintf(outfile, "Brth: %d\n", (int)player.birth);
fprintf(outfile, "Plyd: %d\n", (int)player.played); fprintf(outfile, "Plyd: %d\n", (int)player.played);
fprintf(outfile, "Last: %d\n", (int)player.last_logon); fprintf(outfile, "Last: %d\n", (int)player.last_logon);
@ -247,7 +243,7 @@ void convert(char *filename)
/* player_special_data_saved */ /* player_special_data_saved */
psds = &(player.player_specials_saved); psds = &(player.player_specials_saved);
if (player.level < (ADMLVL_IMMORT+MAX_LEVEL)) { if (player.level < LVL_IMMORT) {
fprintf(outfile, "Skil:\n"); fprintf(outfile, "Skil:\n");
for (i = 1; i <= MAX_SKILLS; i++) { for (i = 1; i <= MAX_SKILLS; i++) {
if (psds->skills[i]) if (psds->skills[i])
@ -267,13 +263,13 @@ void convert(char *filename)
sprintascii(bits, psds->pref); sprintascii(bits, psds->pref);
fprintf(outfile, "Pref: %s\n", bits); fprintf(outfile, "Pref: %s\n", bits);
} }
if (psds->conditions[HUNGER] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) && if (psds->conditions[HUNGER] && player.level < LVL_IMMORT &&
psds->conditions[HUNGER] != PFDEF_HUNGER) psds->conditions[HUNGER] != PFDEF_HUNGER)
fprintf(outfile, "Hung: %d\n", (int)psds->conditions[0]); fprintf(outfile, "Hung: %d\n", (int)psds->conditions[0]);
if (psds->conditions[THIRST] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) && if (psds->conditions[THIRST] && player.level < LVL_IMMORT &&
psds->conditions[THIRST] != PFDEF_THIRST) psds->conditions[THIRST] != PFDEF_THIRST)
fprintf(outfile, "Thir: %d\n", (int)psds->conditions[1]); fprintf(outfile, "Thir: %d\n", (int)psds->conditions[1]);
if (psds->conditions[2] && player.level < (ADMLVL_IMMORT+MAX_LEVEL) && if (psds->conditions[2] && player.level < LVL_IMMORT &&
psds->conditions[DRUNK] != PFDEF_DRUNK) psds->conditions[DRUNK] != PFDEF_DRUNK)
fprintf(outfile, "Drnk: %d\n", (int)psds->conditions[2]); fprintf(outfile, "Drnk: %d\n", (int)psds->conditions[2]);
if (psds->spells_to_learn != PFDEF_PRACTICES) if (psds->spells_to_learn != PFDEF_PRACTICES)

View file

@ -22,7 +22,7 @@
#include "handler.h" #include "handler.h"
#include "interpreter.h" #include "interpreter.h"
#include "class.h" #include "class.h"
#include "act.h"
/** Aportable random number function. /** Aportable random number function.
* @param from The lower bounds of the random number. * @param from The lower bounds of the random number.
@ -286,7 +286,7 @@ void mudlog(int type, int level, int file, const char *str, ...)
for (i = descriptor_list; i; i = i->next) { for (i = descriptor_list; i; i = i->next) {
if (STATE(i) != CON_PLAYING || IS_NPC(i->character)) /* switch */ if (STATE(i) != CON_PLAYING || IS_NPC(i->character)) /* switch */
continue; continue;
if (GET_ADMLEVEL(i->character) < level) if (GET_LEVEL(i->character) < level)
continue; continue;
if (PLR_FLAGGED(i->character, PLR_WRITING)) if (PLR_FLAGGED(i->character, PLR_WRITING))
continue; continue;
@ -1299,7 +1299,6 @@ IDXTYPE atoidx( const char *str_to_conv )
next line will start with the same color. next line will start with the same color.
Ends every line with @n to prevent color bleeds. Ends every line with @n to prevent color bleeds.
*/ */
#define isspace_ignoretabs(c) ((c)!='\t' && isspace(c))
char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad) char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad)
{ {
static char ret[MAX_STRING_LENGTH]; static char ret[MAX_STRING_LENGTH];
@ -1317,17 +1316,17 @@ char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad)
/* Split into lines, including convert \\ into \r\n */ /* Split into lines, including convert \\ into \r\n */
while(*sp) { while(*sp) {
/* eat leading space */ /* eat leading space */
while(*sp && isspace_ignoretabs(*sp)) sp++; while(*sp && isspace(*sp)) sp++;
/* word begins */ /* word begins */
wp = sp; wp = sp;
wlen = 0; wlen = 0;
while(*sp) { /* Find the end of the word */ while(*sp) { /* Find the end of the word */
if(isspace_ignoretabs(*sp)) break; if(isspace(*sp)) break;
if(*sp=='\\' && sp[1] && sp[1]=='\\') { if(*sp=='\\' && sp[1] && sp[1]=='\\') {
if(sp!=wp) if(sp!=wp)
break; /* Finish dealing with the current word */ break; /* Finish dealing with the current word */
sp += 2; /* Eat the marker and any trailing space */ sp += 2; /* Eat the marker and any trailing space */
while(*sp && isspace_ignoretabs(*sp)) sp++; while(*sp && isspace(*sp)) sp++;
wp = sp; wp = sp;
/* Start a new line */ /* Start a new line */
if(hpad) if(hpad)
@ -1346,14 +1345,6 @@ char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad)
if (*sp=='@' && (sp[1]!=*sp)) /* Color code, not @@ */ if (*sp=='@' && (sp[1]!=*sp)) /* Color code, not @@ */
last_color = sp[1]; last_color = sp[1];
sp += 2; /* Eat the whole code regardless */ sp += 2; /* Eat the whole code regardless */
} else if (*sp=='\t'&&sp[1]) {
char MXPcode = sp[1]=='[' ? ']' : sp[1]=='<' ? '>' : '\0';
sp += 2; /* Eat the code */
if (MXPcode)
{
while (*sp!='\0'&&*sp!=MXPcode)
++sp; /* Eat the rest of the code */
}
} else { } else {
wlen++; wlen++;
sp++; sp++;
@ -1490,59 +1481,3 @@ int get_class_by_name(char *classname)
return (-1); return (-1);
} }
bool set_admin_level(struct char_data *ch, int admlvl)
{
int old_lvl, i;
/* Validate the data */
if (!ch || IS_NPC(ch)) return FALSE;
if ((admlvl < ADMLVL_MORTAL) || (admlvl > ADMLVL_IMPL)) return FALSE;
/* Grab the old level */
old_lvl = GET_ADMLEVEL(ch);
/* Set player data */
ch->player_specials->saved.adm_level = admlvl;
/* Set default privs for the new level */
set_default_admin_privs(ch, FALSE);
/* Set player index */
for (i = 0; i <= top_of_p_table; i++) {
if (player_table[i].id == GET_IDNUM(ch)) {
player_table[i].admlevel = admlvl;
}
}
/* Save all the data */
save_char(ch);
save_player_index();
if (!PLR_FLAGGED(ch, PLR_NOWIZLIST) && old_lvl != admlvl) {
run_autowiz();
}
return TRUE;
}
/* add_commas takes a numeric value, and adds commas to it, returning a string */
char *add_commas(long num)
{
int i, j = 0, len;
int negative = (num < 0);
char num_string[MAX_INPUT_LENGTH];
static char commastring[MAX_INPUT_LENGTH];
sprintf(num_string, "%ld", num);
len = strlen(num_string);
for (i = 0; num_string[i]; i++) {
if ((len - i) % 3 == 0 && i && i - negative)
commastring[j++] = ',';
commastring[j++] = num_string[i];
}
commastring[j] = '\0';
return commastring;
}

View file

@ -68,8 +68,6 @@ char *strfrmt(char *str, int w, int h, int justify, int hpad, int vpad);
char *strpaste(char *str1, char *str2, char *joiner); char *strpaste(char *str1, char *str2, char *joiner);
void new_affect(struct affected_type *af); void new_affect(struct affected_type *af);
int get_class_by_name(char *classname); int get_class_by_name(char *classname);
bool set_admin_level(struct char_data *ch, int admlvl);
char *add_commas(long num);
/* Public functions made available form weather.c */ /* Public functions made available form weather.c */
void weather_and_time(int mode); void weather_and_time(int mode);
@ -131,10 +129,10 @@ void gain_condition(struct char_data *ch, int condition, int value);
void point_update(void); void point_update(void);
void update_pos(struct char_data *victim); void update_pos(struct char_data *victim);
void run_autowiz(void); void run_autowiz(void);
int increase_gold(struct char_data *ch, int amt); int increase_gold(struct char_data *ch, int amt);
int decrease_gold(struct char_data *ch, int amt); int decrease_gold(struct char_data *ch, int amt);
int increase_bank(struct char_data *ch, int amt); int increase_bank(struct char_data *ch, int amt);
int decrease_bank(struct char_data *ch, int amt); int decrease_bank(struct char_data *ch, int amt);
/* in class.c */ /* in class.c */
void advance_level(struct char_data *ch); void advance_level(struct char_data *ch);
@ -368,8 +366,6 @@ do \
#define PRF_FLAGS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.pref)) #define PRF_FLAGS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.pref))
/** Affect flags on the NPC or PC. */ /** Affect flags on the NPC or PC. */
#define AFF_FLAGS(ch) ((ch)->char_specials.saved.affected_by) #define AFF_FLAGS(ch) ((ch)->char_specials.saved.affected_by)
/** Admin Priv flags on a player (not to be used on mobs). */
#define ADM_FLAGS(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.admflags))
/** Room flags. /** Room flags.
* @param loc The real room number. */ * @param loc The real room number. */
#define ROOM_FLAGS(loc) (world[(loc)].room_flags) #define ROOM_FLAGS(loc) (world[(loc)].room_flags)
@ -404,9 +400,6 @@ do \
#define AFF_FLAGGED(ch, flag) (IS_SET_AR(AFF_FLAGS(ch), (flag))) #define AFF_FLAGGED(ch, flag) (IS_SET_AR(AFF_FLAGS(ch), (flag)))
/** 1 if flag is set in the preferences bitarray, 0 if not. */ /** 1 if flag is set in the preferences bitarray, 0 if not. */
#define PRF_FLAGGED(ch, flag) (IS_SET_AR(PRF_FLAGS(ch), (flag))) #define PRF_FLAGGED(ch, flag) (IS_SET_AR(PRF_FLAGS(ch), (flag)))
/** 1 if flag is set in the admin privs bitarray, 0 if not. */
#define ADM_FLAGGED(ch, flag) (!IS_NPC(ch) && (!PRF_FLAGGED((ch), PRF_MORTAL)) && \
(IS_SET_AR(ADM_FLAGS(ch), (flag))) )
/** 1 if flag is set in the room of loc, 0 if not. */ /** 1 if flag is set in the room of loc, 0 if not. */
#define ROOM_FLAGGED(loc, flag) (IS_SET_AR(ROOM_FLAGS(loc), (flag))) #define ROOM_FLAGGED(loc, flag) (IS_SET_AR(ROOM_FLAGS(loc), (flag)))
/** 1 if flag is set in the zone of rnum, 0 if not. */ /** 1 if flag is set in the zone of rnum, 0 if not. */
@ -428,10 +421,6 @@ do \
/** IS_AFFECTED for backwards compatibility */ /** IS_AFFECTED for backwards compatibility */
#define IS_AFFECTED(ch, skill) (AFF_FLAGGED((ch), (skill))) #define IS_AFFECTED(ch, skill) (AFF_FLAGGED((ch), (skill)))
/** IS_ADMIN checks admin level and mortal flag */
#define IS_ADMIN(ch, lvl) (!IS_NPC(ch) && (!PRF_FLAGGED((ch), PRF_MORTAL)) && \
(GET_ADMLEVEL(ch) >= (lvl)))
/** Toggle flag in ch PLR_FLAGS' turns on if off, or off if on. */ /** Toggle flag in ch PLR_FLAGS' turns on if off, or off if on. */
#define PLR_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PLR_FLAGS(ch), (flag))) & Q_BIT(flag)) #define PLR_TOG_CHK(ch,flag) ((TOGGLE_BIT_AR(PLR_FLAGS(ch), (flag))) & Q_BIT(flag))
/** Toggle flag in ch PRF_FLAGS; turns on if off, or off if on. */ /** Toggle flag in ch PRF_FLAGS; turns on if off, or off if on. */
@ -479,27 +468,19 @@ do \
(ch)->player.short_descr : GET_PC_NAME(ch)) (ch)->player.short_descr : GET_PC_NAME(ch))
/** Title of PC */ /** Title of PC */
#define GET_TITLE(ch) ((ch)->player.title) #define GET_TITLE(ch) ((ch)->player.title)
/** Mortal Level of PC or NPC. */ /** Level of PC or NPC. */
#define GET_LEVEL(ch) ((ch)->player.level) #define GET_LEVEL(ch) ((ch)->player.level)
/** Admin Level of PC. */
#define GET_ADMLEVEL(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.adm_level))
/** Password of PC. */ /** Password of PC. */
#define GET_PASSWD(ch) ((ch)->player.passwd) #define GET_PASSWD(ch) ((ch)->player.passwd)
/** The player file position of PC. */ /** The player file position of PC. */
#define GET_PFILEPOS(ch)((ch)->pfilepos) #define GET_PFILEPOS(ch)((ch)->pfilepos)
/** Gets the mortal level of a player even if the player is switched. /** Gets the level of a player even if the player is switched.
* @todo Make this the definition of GET_LEVEL. */ * @todo Make this the definition of GET_LEVEL. */
#define GET_REAL_LEVEL(ch) \ #define GET_REAL_LEVEL(ch) \
(ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : \ (ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : \
GET_LEVEL(ch)) GET_LEVEL(ch))
/** Gets the admin level of a player even if the player is switched.
* @todo Make this the definition of GET_LEVEL. */
#define GET_REAL_ADMLEVEL(ch) \
(ch->desc && ch->desc->original ? GET_ADMLEVEL(ch->desc->original) : \
(IS_NPC(ch) ? ADMLVL_MORTAL : GET_ADMLEVEL(ch)))
/** Class of ch. */ /** Class of ch. */
#define GET_CLASS(ch) ((ch)->player.chclass) #define GET_CLASS(ch) ((ch)->player.chclass)
/** Height of ch. */ /** Height of ch. */
@ -632,8 +613,9 @@ do \
#define GET_SKILL(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.skills[i])) #define GET_SKILL(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.skills[i]))
/** Copy the current skill level i of ch to pct. */ /** Copy the current skill level i of ch to pct. */
#define SET_SKILL(ch, i, pct) do { CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[i]) = pct; } while(0) #define SET_SKILL(ch, i, pct) do { CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[i]) = pct; } while(0)
/** The player's default sector type when buildwalking */ /** The player's default sector type when buildwalking */
#define GET_BUILDWALK_SECTOR(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->buildwalk_sector)) #define GET_BUILDWALK_SECTOR(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->buildwalk_sector))
/** Get obj worn in position i on ch. */ /** Get obj worn in position i on ch. */
#define GET_EQ(ch, i) ((ch)->equipment[i]) #define GET_EQ(ch, i) ((ch)->equipment[i])
@ -650,8 +632,6 @@ do \
#define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos) #define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos)
/** Return the memory of ch. */ /** Return the memory of ch. */
#define MEMORY(ch) ((ch)->mob_specials.memory) #define MEMORY(ch) ((ch)->mob_specials.memory)
/** Return the structure used for creating mudmail from mobs */
#define MOB_MAIL(ch) ((ch)->mob_specials.ml_list)
/** Return the equivalent strength of ch if ch has level 18 strength. */ /** Return the equivalent strength of ch if ch has level 18 strength. */
#define STRENGTH_APPLY_INDEX(ch) \ #define STRENGTH_APPLY_INDEX(ch) \
@ -754,8 +734,6 @@ do \
#define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part)) #define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part))
/** Return short description of obj. */ /** Return short description of obj. */
#define GET_OBJ_SHORT(obj) ((obj)->short_description) #define GET_OBJ_SHORT(obj) ((obj)->short_description)
/** Return the mudmail that the object is attached to */
#define IN_MAIL(obj) ((obj)->in_mail)
/* Compound utilities and other macros. */ /* Compound utilities and other macros. */
/** Used to compute version. To see if the code running is newer than 3.0pl13, /** Used to compute version. To see if the code running is newer than 3.0pl13,
@ -782,7 +760,7 @@ do \
/** Defines if there is enough light for sub to see in. */ /** Defines if there is enough light for sub to see in. */
#define LIGHT_OK(sub) (!AFF_FLAGGED(sub, AFF_BLIND) && \ #define LIGHT_OK(sub) (!AFF_FLAGGED(sub, AFF_BLIND) && \
(IS_LIGHT(IN_ROOM(sub)) || AFF_FLAGGED((sub), AFF_INFRAVISION) || \ (IS_LIGHT(IN_ROOM(sub)) || AFF_FLAGGED((sub), AFF_INFRAVISION) || \
IS_ADMIN(sub, ADMLVL_IMMORT))) GET_LEVEL(sub) >= LVL_IMMORT))
/** Defines if sub character can see the invisible obj character. */ /** Defines if sub character can see the invisible obj character. */
#define INVIS_OK(sub, obj) \ #define INVIS_OK(sub, obj) \
@ -803,7 +781,7 @@ do \
/** Can sub character see obj character? */ /** Can sub character see obj character? */
#define CAN_SEE(sub, obj) (SELF(sub, obj) || \ #define CAN_SEE(sub, obj) (SELF(sub, obj) || \
((GET_REAL_ADMLEVEL(sub) >= (IS_NPC(obj) ? 0 : GET_INVIS_LEV(obj))) && \ ((GET_REAL_LEVEL(sub) >= (IS_NPC(obj) ? 0 : GET_INVIS_LEV(obj))) && \
IMM_CAN_SEE(sub, obj))) IMM_CAN_SEE(sub, obj)))
/* End of CAN_SEE */ /* End of CAN_SEE */
@ -835,7 +813,7 @@ do \
CAN_SEE_OBJ((ch),(obj))) CAN_SEE_OBJ((ch),(obj)))
/** If vict can see ch, return ch name, else return "someone". */ /** If vict can see ch, return ch name, else return "someone". */
#define PERS(ch, vict) (CAN_SEE(vict, ch) ? GET_NAME(ch) : (GET_ADMLEVEL(ch) > ADMLVL_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 /** If vict can see obj, return obj short description, else return
* "something". */ * "something". */
@ -862,11 +840,11 @@ do \
!IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)) !IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
/** True total number of directions available to move in. */ /** True total number of directions available to move in. */
#define DIR_COUNT ((CONFIG_DIAGONAL_DIRS) ? 10 : 6) #define DIR_COUNT ((CONFIG_DIAGONAL_DIRS) ? 10 : 6)
/* Returns TRUE if the direction is a diagonal one */ /* Returns TRUE if the direction is a diagonal one */
#define IS_DIAGONAL(dir) (((dir) == NORTHWEST) || ((dir) == NORTHEAST) || \ #define IS_DIAGONAL(dir) (((dir) == NORTHWEST) || ((dir) == NORTHEAST) || \
((dir) == SOUTHEAST) || ((dir) == SOUTHWEST) ) ((dir) == SOUTHEAST) || ((dir) == SOUTHWEST) )
/** Return the class abbreviation for ch. */ /** Return the class abbreviation for ch. */
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)]) #define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
@ -970,8 +948,6 @@ do \
#define CONFIG_MAX_NPC_CORPSE_TIME config_info.play.max_npc_corpse_time #define CONFIG_MAX_NPC_CORPSE_TIME config_info.play.max_npc_corpse_time
/** How long will pc corpses last before decomposing? */ /** How long will pc corpses last before decomposing? */
#define CONFIG_MAX_PC_CORPSE_TIME config_info.play.max_pc_corpse_time #define CONFIG_MAX_PC_CORPSE_TIME config_info.play.max_pc_corpse_time
/** What is the highest level a mortal can obtain? */
#define CONFIG_MAX_LEVEL config_info.play.max_mortal_level
/** How long can a pc be idled before being pulled into the void? */ /** How long can a pc be idled before being pulled into the void? */
#define CONFIG_IDLE_VOID config_info.play.idle_void #define CONFIG_IDLE_VOID config_info.play.idle_void
/** How long until the idle pc is force rented? */ /** How long until the idle pc is force rented? */
@ -996,7 +972,7 @@ do \
/** Get the display closed doors setting. */ /** Get the display closed doors setting. */
#define CONFIG_DISP_CLOSED_DOORS config_info.play.disp_closed_doors #define CONFIG_DISP_CLOSED_DOORS config_info.play.disp_closed_doors
/** Get the diagonal directions setting. */ /** Get the diagonal directions setting. */
#define CONFIG_DIAGONAL_DIRS config_info.play.diagonal_dirs #define CONFIG_DIAGONAL_DIRS config_info.play.diagonal_dirs
/* Map/Automap options */ /* Map/Automap options */
#define CONFIG_MAP config_info.play.map_option #define CONFIG_MAP config_info.play.map_option
@ -1068,7 +1044,7 @@ do \
/** Should medit show the advnaced stats menu? */ /** Should medit show the advnaced stats menu? */
#define CONFIG_MEDIT_ADVANCED config_info.operation.medit_advanced #define CONFIG_MEDIT_ADVANCED config_info.operation.medit_advanced
/** Does "bug resolve" autosave ? */ /** Does "bug resolve" autosave ? */
#define CONFIG_IBT_AUTOSAVE config_info.operation.ibt_autosave #define CONFIG_IBT_AUTOSAVE config_info.operation.ibt_autosave
/* Autowiz */ /* Autowiz */
/** Use autowiz or not? */ /** Use autowiz or not? */
@ -1076,31 +1052,4 @@ do \
/** What is the minimum level character to put on the wizlist? */ /** What is the minimum level character to put on the wizlist? */
#define CONFIG_MIN_WIZLIST_LEV config_info.autowiz.min_wizlist_lev #define CONFIG_MIN_WIZLIST_LEV config_info.autowiz.min_wizlist_lev
/* Mudmail Configuraton */
/** Mail system enabled or not? */
#define CONFIG_CAN_MAIL config_info.mail.mail_allowed
/** Able to attach objects to mails? */
#define CONFIG_CAN_MAIL_OBJ config_info.mail.objects_allowed
/** Able to attach gold to mails? */
#define CONFIG_CAN_MAIL_GOLD config_info.mail.gold_allowed
/** Cost of stamps per mail for mortals */
#define CONFIG_STAMP_COST config_info.mail.stamp_cost
/** Extra Cost per object attachment for mortals */
#define CONFIG_OBJECT_COST config_info.mail.object_cost
/** Minimum level that can send mails */
#define CONFIG_MIN_MAIL_LEVEL config_info.mail.min_level
/** Lowest admin level that can always send free mails */
#define CONFIG_FREE_MAIL_LEVEL config_info.mail.min_free_level
/** Can mails be saved as drafts for later sending? */
#define CONFIG_DRAFTS_ALLOWED config_info.mail.allow_drafts
/** How long (in days) should draft mails be kept? */
#define CONFIG_DRAFT_TIMEOUT config_info.mail.draft_timeout
/** While mailing, are players safe from attack or stealing? */
#define CONFIG_SAFE_MAILING config_info.mail.safe_mailing
/** Minimum admin level at which a post office isn't required */
#define CONFIG_MIN_MAIL_ANYWHERE config_info.mail.min_mail_anywhere
/** Minimum admin level that can send to groups/all */
#define CONFIG_MIN_SEND_TO_ALL config_info.mail.min_send_to_all
#endif /* _UTILS_H_ */ #endif /* _UTILS_H_ */

View file

@ -74,7 +74,7 @@ ACMD(do_oasis_zedit)
send_to_char(ch, "Save which zone?\r\n"); send_to_char(ch, "Save which zone?\r\n");
return; return;
} }
} else if (IS_ADMIN(ch, ADMLVL_IMPL)) { } else if (GET_LEVEL(ch) >= LVL_IMPL) {
if (str_cmp("new", buf1) || !stop || !*stop) if (str_cmp("new", buf1) || !stop || !*stop)
send_to_char(ch, "Format: zedit new <zone number> <bottom-room> " send_to_char(ch, "Format: zedit new <zone number> <bottom-room> "
"<upper-room>\r\n"); "<upper-room>\r\n");
@ -122,7 +122,7 @@ ACMD(do_oasis_zedit)
/* Give the builder's descriptor an OLC structure. */ /* Give the builder's descriptor an OLC structure. */
if (d->olc) { if (d->olc) {
mudlog(BRF, ADMLVL_IMMORT, TRUE, "SYSERR: do_oasis_zedit: Player already " mudlog(BRF, LVL_IMMORT, TRUE, "SYSERR: do_oasis_zedit: Player already "
"had olc structure."); "had olc structure.");
free(d->olc); free(d->olc);
} }
@ -153,7 +153,7 @@ ACMD(do_oasis_zedit)
if (save) { if (save) {
send_to_char(ch, "Saving all zone information for zone %d.\r\n", send_to_char(ch, "Saving all zone information for zone %d.\r\n",
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE,
"OLC: %s saves zone information for zone %d.", GET_NAME(ch), "OLC: %s saves zone information for zone %d.", GET_NAME(ch),
zone_table[OLC_ZNUM(d)].number); zone_table[OLC_ZNUM(d)].number);
@ -183,7 +183,7 @@ ACMD(do_oasis_zedit)
act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM); act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING); SET_BIT_AR(PLR_FLAGS(ch), PLR_WRITING);
mudlog(CMP, ADMLVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d", mudlog(CMP, LVL_IMMORT, TRUE, "OLC: %s starts editing zone %d allowed zone %d",
GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch)); GET_NAME(ch), zone_table[OLC_ZNUM(d)].number, GET_OLC_ZONE(ch));
} }
@ -279,7 +279,7 @@ static void zedit_new_zone(struct char_data *ch, zone_vnum vzone_num, room_vnum
zedit_save_to_disk(result); /* save to disk .. */ zedit_save_to_disk(result); /* save to disk .. */
mudlog(BRF, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s creates new zone #%d", GET_NAME(ch), vzone_num); mudlog(BRF, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE, "OLC: %s creates new zone #%d", GET_NAME(ch), vzone_num);
write_to_output(ch->desc, "Zone created successfully.\r\n"); write_to_output(ch->desc, "Zone created successfully.\r\n");
} }
@ -425,7 +425,7 @@ static void zedit_disp_menu(struct descriptor_data *d)
/* Menu header */ /* Menu header */
send_to_char(d->character, send_to_char(d->character,
"Room number: %s%d%s Room zone: %s%d\r\n" "Room number: %s%d%s Room zone: %s%d\r\n"
"%s1%s) Builders : %s%s\r\n" "%s1%s) Builders : %s%s\r\n"
"%sZ%s) Zone name : %s%s\r\n" "%sZ%s) Zone name : %s%s\r\n"
"%sL%s) Lifespan : %s%d minutes\r\n" "%sL%s) Lifespan : %s%d minutes\r\n"
@ -601,7 +601,7 @@ static void zedit_disp_arg1(struct descriptor_data *d)
default: default:
/* We should never get here. */ /* We should never get here. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg1(): Help!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg1(): Help!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
return; return;
} }
@ -641,7 +641,7 @@ static void zedit_disp_arg2(struct descriptor_data *d)
default: default:
/* We should never get here, but just in case. */ /* We should never get here, but just in case. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg2(): Help!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg2(): Help!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
return; return;
} }
@ -678,7 +678,7 @@ static void zedit_disp_arg3(struct descriptor_data *d)
default: default:
/* We should never get here, just in case. */ /* We should never get here, just in case. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg3(): Help!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_disp_arg3(): Help!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
return; return;
} }
@ -728,7 +728,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
} else } else
write_to_output(d, "Saving zone info in memory.\r\n"); write_to_output(d, "Saving zone info in memory.\r\n");
mudlog(CMP, MAX(ADMLVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits zone info for room %d.", GET_NAME(d->character), OLC_NUM(d)); mudlog(CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits zone info for room %d.", GET_NAME(d->character), OLC_NUM(d));
/* FALL THROUGH */ /* FALL THROUGH */
case 'n': case 'n':
case 'N': case 'N':
@ -794,21 +794,21 @@ void zedit_parse(struct descriptor_data *d, char *arg)
case 'b': case 'b':
case 'B': case 'B':
/* Edit bottom of zone. */ /* Edit bottom of zone. */
if (!IS_ADMIN(d->character, ADMLVL_IMPL)) if (GET_LEVEL(d->character) < LVL_IMPL)
zedit_disp_menu(d); zedit_disp_menu(d);
else { else {
write_to_output(d, "Enter new bottom of zone : "); write_to_output(d, "Enter new bottom of zone : ");
OLC_MODE(d) = ZEDIT_ZONE_BOT; OLC_MODE(d) = ZEDIT_ZONE_BOT;
} }
break; break;
case 't': case 't':
case 'T': case 'T':
/* Edit top of zone. */ /* Edit top of zone. */
if (!IS_ADMIN(d->character, ADMLVL_IMPL)) if (GET_LEVEL(d->character) < LVL_IMPL)
zedit_disp_menu(d); zedit_disp_menu(d);
else { else {
write_to_output(d, "Enter new top of zone : "); write_to_output(d, "Enter new top of zone : ");
OLC_MODE(d) = ZEDIT_ZONE_TOP; OLC_MODE(d) = ZEDIT_ZONE_TOP;
} }
break; break;
case 'l': case 'l':
@ -846,11 +846,11 @@ void zedit_parse(struct descriptor_data *d, char *arg)
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
case ZEDIT_LEVELS: case ZEDIT_LEVELS:
switch (*arg) { switch (*arg) {
case '1': write_to_output(d, "Enter the min level for this zone (0-%d, -1 = none): ", (CONFIG_MAX_LEVEL)); case '1': write_to_output(d, "Enter the min level for this zone (0-%d, -1 = none): ", (LVL_IMMORT-1));
OLC_MODE(d) = ZEDIT_LEV_MIN; OLC_MODE(d) = ZEDIT_LEV_MIN;
break; break;
case '2': write_to_output(d, "Enter the max level for this zone (0-%d, -1 = none): ", (CONFIG_MAX_LEVEL)); case '2': write_to_output(d, "Enter the max level for this zone (0-%d, -1 = none): ", (LVL_IMMORT-1));
OLC_MODE(d) = ZEDIT_LEV_MAX; OLC_MODE(d) = ZEDIT_LEV_MAX;
break; break;
@ -1009,7 +1009,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here. */ /* We should never get here. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG1: Ack!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG1: Ack!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }
@ -1072,7 +1072,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here, but just in case. */ /* We should never get here, but just in case. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG2: Ack!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG2: Ack!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }
@ -1121,7 +1121,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here, but just in case. */ /* We should never get here, but just in case. */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG3: Ack!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): case ARG3: Ack!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }
@ -1245,7 +1245,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
default: default:
/* We should never get here, but just in case... */ /* We should never get here, but just in case... */
cleanup_olc(d, CLEANUP_ALL); cleanup_olc(d, CLEANUP_ALL);
mudlog(BRF, ADMLVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): Reached default case!"); mudlog(BRF, LVL_BUILDER, TRUE, "SYSERR: OLC: zedit_parse(): Reached default case!");
write_to_output(d, "Oops...\r\n"); write_to_output(d, "Oops...\r\n");
break; break;
} }