New house system, ASCII hcontrol file and hsedit house OLC

This commit is contained in:
JamDog 2010-12-01 18:40:34 +00:00
parent 74c3d208b6
commit 3fa8ebe048
16 changed files with 2647 additions and 681 deletions

View file

@ -35,12 +35,21 @@ 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)
@ @
[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 [Nov 26 2010] - Jamdog
Bug-Fix: set level now allows GRGOD or higher to set to any mortal level 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 Advance command changed to work for both mortal and admin levels
Added increase_gold and increase_bank functions to prevent cash overflows Added increase_gold and increase_bank functions to prevent cash overflows
Added dupe check for new characters in char creation (thanks Mirad) Added dupe check for new characters in char creation (thanks Mirad)
Bug-Fix: Since admin update, real mortals didn't show on who list Bug-Fix: Since admin update, real mortals didn't show on who list (thanks Rhade)
[Nov 25 2010] - Jamdog [Nov 25 2010] - Jamdog
Added diagonal directions with cedit toggle (default to 'off') Added diagonal directions with cedit toggle (default to 'off')
Bug-Fix: admin <player> default now targets the victim player Bug-Fix: admin <player> default now targets the victim player

View file

@ -124,7 +124,7 @@ static void show_obj_to_char(struct obj_data *obj, struct char_data *ch, int mod
snprintf(notebuf, sizeof(notebuf), "There is something written on it:\r\n\r\n%s", obj->action_description); snprintf(notebuf, sizeof(notebuf), "There is something written on it:\r\n\r\n%s", obj->action_description);
page_string(ch->desc, notebuf, TRUE); page_string(ch->desc, notebuf, TRUE);
} else } else
send_to_char(ch, "It's blank.\r\n"); send_to_char(ch, "It's blank.\r\n");
return; return;
case ITEM_DRINKCON: case ITEM_DRINKCON:
@ -272,8 +272,8 @@ static void look_at_char(struct char_data *i, struct char_data *ch)
act("$n is using:", FALSE, i, 0, ch, TO_VICT); act("$n is using:", FALSE, i, 0, ch, TO_VICT);
for (j = 0; j < NUM_WEARS; j++) for (j = 0; j < NUM_WEARS; j++)
if (GET_EQ(i, j) && CAN_SEE_OBJ(ch, GET_EQ(i, j))) { if (GET_EQ(i, j) && CAN_SEE_OBJ(ch, GET_EQ(i, j))) {
send_to_char(ch, "%s", wear_where[j]); send_to_char(ch, "%s", wear_where[j]);
show_obj_to_char(GET_EQ(i, j), ch, SHOW_OBJ_SHORT); show_obj_to_char(GET_EQ(i, j), ch, SHOW_OBJ_SHORT);
} }
} }
if (ch != i && (IS_THIEF(ch) || (ADM_FLAGGED(ch, ADM_SEEINV)))) { if (ch != i && (IS_THIEF(ch) || (ADM_FLAGGED(ch, ADM_SEEINV)))) {
@ -349,22 +349,22 @@ static void list_one_char(struct char_data *i, struct char_data *ch)
if (GET_POS(i) != POS_FIGHTING) { if (GET_POS(i) != POS_FIGHTING) {
if (!SITTING(i)) if (!SITTING(i))
send_to_char(ch, "%s", positions[(int) GET_POS(i)]); send_to_char(ch, "%s", positions[(int) GET_POS(i)]);
else { else {
furniture = SITTING(i); furniture = SITTING(i);
send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ? send_to_char(ch, " is %s upon %s.", (GET_POS(i) == POS_SLEEPING ?
"sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")), "sleeping" : (GET_POS(i) == POS_RESTING ? "resting" : "sitting")),
OBJS(furniture, ch)); OBJS(furniture, ch));
} }
} else { } else {
if (FIGHTING(i)) { if (FIGHTING(i)) {
send_to_char(ch, " is here, fighting "); send_to_char(ch, " is here, fighting ");
if (FIGHTING(i) == ch) if (FIGHTING(i) == ch)
send_to_char(ch, "YOU!"); send_to_char(ch, "YOU!");
else { else {
if (IN_ROOM(i) == IN_ROOM(FIGHTING(i))) if (IN_ROOM(i) == IN_ROOM(FIGHTING(i)))
send_to_char(ch, "%s!", PERS(FIGHTING(i), ch)); send_to_char(ch, "%s!", PERS(FIGHTING(i), ch));
else else
send_to_char(ch, "someone who has already left!"); send_to_char(ch, "someone who has already left!");
} }
} else /* NIL fighting pointer */ } else /* NIL fighting pointer */
send_to_char(ch, " is here struggling with thin air."); send_to_char(ch, " is here struggling with thin air.");
@ -507,14 +507,12 @@ void look_at_room(struct char_data *ch, int ignore_brief)
if ((!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_BRIEF)) || ignore_brief || if ((!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_BRIEF)) || ignore_brief ||
ROOM_FLAGGED(IN_ROOM(ch), ROOM_DEATH)) ROOM_FLAGGED(IN_ROOM(ch), ROOM_DEATH))
{ {
if(!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOMAP) && can_see_map(ch)) if(!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOMAP) && can_see_map(ch))
{ {
str_and_map(world[target_room].description, ch, target_room); str_and_map(world[target_room].description, ch, target_room);
} } else {
else send_to_char(ch, "%s", world[IN_ROOM(ch)].description);
{ }
send_to_char(ch, "%s", world[IN_ROOM(ch)].description);
}
} }
/* autoexits */ /* autoexits */
@ -555,13 +553,13 @@ static void look_in_obj(struct char_data *ch, char *arg)
send_to_char(ch, "There doesn't seem to be %s %s here.\r\n", AN(arg), arg); send_to_char(ch, "There doesn't seem to be %s %s here.\r\n", AN(arg), arg);
} else if ((GET_OBJ_TYPE(obj) != ITEM_DRINKCON) && } else if ((GET_OBJ_TYPE(obj) != ITEM_DRINKCON) &&
(GET_OBJ_TYPE(obj) != ITEM_FOUNTAIN) && (GET_OBJ_TYPE(obj) != ITEM_FOUNTAIN) &&
(GET_OBJ_TYPE(obj) != ITEM_CONTAINER)) (GET_OBJ_TYPE(obj) != ITEM_CONTAINER)) {
send_to_char(ch, "There's nothing inside that!\r\n"); send_to_char(ch, "There's nothing inside that!\r\n");
else { } else {
if (GET_OBJ_TYPE(obj) == ITEM_CONTAINER) { if (GET_OBJ_TYPE(obj) == ITEM_CONTAINER) {
if (OBJVAL_FLAGGED(obj, CONT_CLOSED) && (!IS_ADMIN(ch, ADMLVL_IMMORT) || !PRF_FLAGGED(ch, PRF_NOHASSLE))) if (OBJVAL_FLAGGED(obj, CONT_CLOSED) && (!IS_ADMIN(ch, ADMLVL_IMMORT) || !PRF_FLAGGED(ch, PRF_NOHASSLE))) {
send_to_char(ch, "It is closed.\r\n"); send_to_char(ch, "It is closed.\r\n");
else { } else {
send_to_char(ch, "%s", fname(obj->name)); send_to_char(ch, "%s", fname(obj->name));
switch (bits) { switch (bits) {
case FIND_OBJ_INV: case FIND_OBJ_INV:
@ -585,10 +583,9 @@ static void look_in_obj(struct char_data *ch, char *arg)
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
send_to_char(ch, "It's full of a %s liquid.\r\n", buf2); send_to_char(ch, "It's full of a %s liquid.\r\n", buf2);
} } else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0)) {
else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0))
send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */ send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */
else { } else {
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0); amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0);
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
@ -656,40 +653,46 @@ static void look_at_target(struct char_data *ch, char *arg)
} }
/* Does the argument match an extra desc in the char's equipment? */ /* Does the argument match an extra desc in the char's equipment? */
for (j = 0; j < NUM_WEARS && !found; j++) for (j = 0; j < NUM_WEARS && !found; j++) {
if (GET_EQ(ch, j) && CAN_SEE_OBJ(ch, GET_EQ(ch, j))) if (GET_EQ(ch, j) && CAN_SEE_OBJ(ch, GET_EQ(ch, j))) {
if ((desc = find_exdesc(arg, GET_EQ(ch, j)->ex_description)) != NULL && ++i == fnum) { if ((desc = find_exdesc(arg, GET_EQ(ch, j)->ex_description)) != NULL && ++i == fnum) {
send_to_char(ch, "%s", desc); send_to_char(ch, "%s", desc);
found = TRUE; found = TRUE;
} }
}
}
/* Does the argument match an extra desc in the char's inventory? */ /* Does the argument match an extra desc in the char's inventory? */
for (obj = ch->carrying; obj && !found; obj = obj->next_content) { for (obj = ch->carrying; obj && !found; obj = obj->next_content) {
if (CAN_SEE_OBJ(ch, obj)) if (CAN_SEE_OBJ(ch, obj)) {
if ((desc = find_exdesc(arg, obj->ex_description)) != NULL && ++i == fnum) { if ((desc = find_exdesc(arg, obj->ex_description)) != NULL && ++i == fnum) {
send_to_char(ch, "%s", desc); send_to_char(ch, "%s", desc);
found = TRUE; found = TRUE;
} }
}
} }
/* Does the argument match an extra desc of an object in the room? */ /* Does the argument match an extra desc of an object in the room? */
for (obj = world[IN_ROOM(ch)].contents; obj && !found; obj = obj->next_content) for (obj = world[IN_ROOM(ch)].contents; obj && !found; obj = obj->next_content) {
if (CAN_SEE_OBJ(ch, obj)) if (CAN_SEE_OBJ(ch, obj)) {
if ((desc = find_exdesc(arg, obj->ex_description)) != NULL && ++i == fnum) { if ((desc = find_exdesc(arg, obj->ex_description)) != NULL && ++i == fnum) {
send_to_char(ch, "%s", desc); send_to_char(ch, "%s", desc);
found = TRUE; found = TRUE;
} }
}
}
/* If an object was found back in generic_find */ /* If an object was found back in generic_find */
if (bits) { if (bits) {
if (!found) if (!found) {
show_obj_to_char(found_obj, ch, SHOW_OBJ_ACTION); show_obj_to_char(found_obj, ch, SHOW_OBJ_ACTION);
else { } else {
show_obj_modifiers(found_obj, ch); show_obj_modifiers(found_obj, ch);
send_to_char(ch, "\r\n"); send_to_char(ch, "\r\n");
} }
} else if (!found) } else if (!found) {
send_to_char(ch, "You do not see that here.\r\n"); send_to_char(ch, "You do not see that here.\r\n");
}
} }
ACMD(do_look) ACMD(do_look)
@ -971,14 +974,13 @@ ACMD(do_equipment)
send_to_char(ch, "You are using:\r\n"); send_to_char(ch, "You are using:\r\n");
for (i = 0; i < NUM_WEARS; i++) { for (i = 0; i < NUM_WEARS; i++) {
if (GET_EQ(ch, i)) { if (GET_EQ(ch, i)) {
found = TRUE;
if (CAN_SEE_OBJ(ch, GET_EQ(ch, i))) { if (CAN_SEE_OBJ(ch, GET_EQ(ch, i))) {
send_to_char(ch, "%s", wear_where[i]); send_to_char(ch, "%s", wear_where[i]);
show_obj_to_char(GET_EQ(ch, i), ch, SHOW_OBJ_SHORT); show_obj_to_char(GET_EQ(ch, i), ch, SHOW_OBJ_SHORT);
found = TRUE;
} else { } else {
send_to_char(ch, "%s", wear_where[i]); send_to_char(ch, "%s", wear_where[i]);
send_to_char(ch, "Something.\r\n"); send_to_char(ch, "Something.\r\n");
found = TRUE;
} }
} }
} }
@ -1075,7 +1077,7 @@ int search_help(const char *argument, int level)
while (level < help_table[mid].min_level && mid < (bot + top) / 2) while (level < help_table[mid].min_level && mid < (bot + top) / 2)
mid++; mid++;
// if (strn_cmp(argument, help_table[mid].keywords, minlen) || level < help_table[mid].min_level) // if (strn_cmp(argument, help_table[mid].keywords, minlen) || level < help_table[mid].min_level)
if (strn_cmp(argument, help_table[mid].keywords, minlen)) if (strn_cmp(argument, help_table[mid].keywords, minlen))
break; break;
@ -1303,7 +1305,7 @@ ACMD(do_who)
if (showleader && (!tch->followers || !AFF_FLAGGED(tch, AFF_GROUP))) if (showleader && (!tch->followers || !AFF_FLAGGED(tch, AFF_GROUP)))
continue; continue;
sprintf(admlev, "%11s", admin_level_names[(GET_ADMLEVEL(tch))]); sprintf(admlev, "%-11s", admin_level_names[(GET_ADMLEVEL(tch))]);
if (short_list) { if (short_list) {
send_to_char(ch, "%s[%2d %s] %-12.12s%s%s", send_to_char(ch, "%s[%2d %s] %-12.12s%s%s",
(IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""), (IS_ADMIN(tch, ADMLVL_IMMORT) ? CCYEL(ch, C_SPR) : ""),
@ -1475,7 +1477,7 @@ ACMD(do_users)
continue; continue;
if (IS_PLAYING(d)) { if (IS_PLAYING(d)) {
if (d->original) if (d->original)
tch = d->original; tch = d->original;
else if (!(tch = d->character)) else if (!(tch = d->character))
continue; continue;
@ -1486,7 +1488,7 @@ ACMD(do_users)
if (!CAN_SEE(ch, tch) || GET_ADMLEVEL(tch) < low || GET_ADMLEVEL(tch) > high) if (!CAN_SEE(ch, tch) || GET_ADMLEVEL(tch) < low || GET_ADMLEVEL(tch) > high)
continue; continue;
if (outlaws && !PLR_FLAGGED(tch, PLR_KILLER) && if (outlaws && !PLR_FLAGGED(tch, PLR_KILLER) &&
!PLR_FLAGGED(tch, PLR_THIEF)) !PLR_FLAGGED(tch, PLR_THIEF))
continue; continue;
if (showclass && !(showclass & (1 << GET_CLASS(tch)))) if (showclass && !(showclass & (1 << GET_CLASS(tch))))
continue; continue;
@ -1495,10 +1497,10 @@ ACMD(do_users)
if (d->original) if (d->original)
sprintf(classname, "[%2d %s]", GET_LEVEL(d->original), sprintf(classname, "[%2d %s]", GET_LEVEL(d->original),
CLASS_ABBR(d->original)); CLASS_ABBR(d->original));
else else
sprintf(classname, "[%2d %s]", GET_LEVEL(d->character), sprintf(classname, "[%2d %s]", GET_LEVEL(d->character),
CLASS_ABBR(d->character)); CLASS_ABBR(d->character));
} else } else
strcpy(classname, " - "); strcpy(classname, " - ");
@ -1513,15 +1515,15 @@ ACMD(do_users)
if (d->character && STATE(d) == CON_PLAYING) if (d->character && STATE(d) == CON_PLAYING)
sprintf(idletime, "%5d", d->character->char_specials.timer * sprintf(idletime, "%5d", d->character->char_specials.timer *
SECS_PER_MUD_HOUR / SECS_PER_REAL_MIN); SECS_PER_MUD_HOUR / SECS_PER_REAL_MIN);
else else
strcpy(idletime, " "); strcpy(idletime, " ");
sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname, sprintf(line, "%3d %-7s %-12s %-14s %-3s %-8s ", d->desc_num, classname,
d->original && d->original->player.name ? d->original->player.name : d->original && d->original->player.name ? d->original->player.name :
d->character && d->character->player.name ? d->character->player.name : d->character && d->character->player.name ? d->character->player.name :
"UNDEFINED", "UNDEFINED",
state, idletime, timeptr); state, idletime, timeptr);
if (d->host && *d->host) if (d->host && *d->host)
sprintf(line + strlen(line), "[%s]\r\n", d->host); sprintf(line + strlen(line), "[%s]\r\n", d->host);
@ -1533,7 +1535,7 @@ ACMD(do_users)
strcpy(line, line2); strcpy(line, line2);
} }
if (STATE(d) != CON_PLAYING || if (STATE(d) != CON_PLAYING ||
(STATE(d) == CON_PLAYING && CAN_SEE(ch, d->character))) { (STATE(d) == CON_PLAYING && CAN_SEE(ch, d->character))) {
send_to_char(ch, "%s", line); send_to_char(ch, "%s", line);
num_can_see++; num_can_see++;
} }
@ -1612,23 +1614,23 @@ static void perform_mortal_where(struct char_data *ch, char *arg)
send_to_char(ch, "Players in %s@n.\r\n--------------------\r\n", zone_table[j].name); send_to_char(ch, "Players in %s@n.\r\n--------------------\r\n", zone_table[j].name);
for (d = descriptor_list; d; d = d->next) { for (d = descriptor_list; d; d = d->next) {
if (STATE(d) != CON_PLAYING || d->character == ch) if (STATE(d) != CON_PLAYING || d->character == ch)
continue; continue;
if ((i = (d->original ? d->original : d->character)) == NULL) if ((i = (d->original ? d->original : d->character)) == NULL)
continue; continue;
if (IN_ROOM(i) == NOWHERE || !CAN_SEE(ch, i)) if (IN_ROOM(i) == NOWHERE || !CAN_SEE(ch, i))
continue; continue;
if (world[IN_ROOM(ch)].zone != world[IN_ROOM(i)].zone) if (world[IN_ROOM(ch)].zone != world[IN_ROOM(i)].zone)
continue; continue;
send_to_char(ch, "%-20s%s - %s%s\r\n", GET_NAME(i), QNRM, world[IN_ROOM(i)].name, QNRM); send_to_char(ch, "%-20s%s - %s%s\r\n", GET_NAME(i), QNRM, world[IN_ROOM(i)].name, QNRM);
} }
} else { /* print only FIRST char, not all. */ } else { /* print only FIRST char, not all. */
for (i = character_list; i; i = i->next) { for (i = character_list; i; i = i->next) {
if (IN_ROOM(i) == NOWHERE || i == ch) if (IN_ROOM(i) == NOWHERE || i == ch)
continue; continue;
if (!CAN_SEE(ch, i) || world[IN_ROOM(i)].zone != world[IN_ROOM(ch)].zone) if (!CAN_SEE(ch, i) || world[IN_ROOM(i)].zone != world[IN_ROOM(ch)].zone)
continue; continue;
if (!isname(arg, i->player.name)) if (!isname(arg, i->player.name))
continue; continue;
send_to_char(ch, "%-25s%s - %s%s\r\n", GET_NAME(i), QNRM, world[IN_ROOM(i)].name, QNRM); send_to_char(ch, "%-25s%s - %s%s\r\n", GET_NAME(i), QNRM, world[IN_ROOM(i)].name, QNRM);
return; return;
} }
@ -1771,22 +1773,22 @@ ACMD(do_levels)
for (i = min_lev; i < max_lev; i++) { for (i = min_lev; i < max_lev; i++) {
nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d-%-8d : ", (int)i, nlen = snprintf(buf + len, sizeof(buf) - len, "[%2d] %8d-%-8d : ", (int)i,
level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i + 1) - 1); level_exp(GET_CLASS(ch), i), level_exp(GET_CLASS(ch), i + 1) - 1);
if (len + nlen >= sizeof(buf)) if (len + nlen >= sizeof(buf))
break; break;
len += nlen; len += nlen;
switch (GET_SEX(ch)) { switch (GET_SEX(ch)) {
case SEX_MALE: case SEX_MALE:
case SEX_NEUTRAL: case SEX_NEUTRAL:
nlen = snprintf(buf + len, sizeof(buf) - len, "%s\r\n", title_male(GET_CLASS(ch), i)); nlen = snprintf(buf + len, sizeof(buf) - len, "%s\r\n", title_male(GET_CLASS(ch), i));
break; break;
case SEX_FEMALE: case SEX_FEMALE:
nlen = snprintf(buf + len, sizeof(buf) - len, "%s\r\n", title_female(GET_CLASS(ch), i)); nlen = snprintf(buf + len, sizeof(buf) - len, "%s\r\n", title_female(GET_CLASS(ch), i));
break; break;
default: default:
nlen = snprintf(buf + len, sizeof(buf) - len, "Oh dear. You seem to be sexless.\r\n"); nlen = snprintf(buf + len, sizeof(buf) - len, "Oh dear. You seem to be sexless.\r\n");
break; break;
} }
if (len + nlen >= sizeof(buf)) if (len + nlen >= sizeof(buf))
break; break;
@ -1979,17 +1981,17 @@ ACMD(do_toggle)
else else
sprintf(buf2, "%-3.3d", GET_WIMP_LEV(ch)); /* sprintf: OK */ sprintf(buf2, "%-3.3d", GET_WIMP_LEV(ch)); /* sprintf: OK */
if (IS_ADMIN(ch, ADMLVL_IMPL)) { if (IS_ADMIN(ch, ADMLVL_IMPL)) {
send_to_char(ch, send_to_char(ch,
" SlowNameserver: %-3s " " SlowNameserver: %-3s "
" " " "
" Trackthru Doors: %-3s\r\n", " Trackthru Doors: %-3s\r\n",
ONOFF(CONFIG_NS_IS_SLOW), ONOFF(CONFIG_NS_IS_SLOW),
ONOFF(CONFIG_TRACK_T_DOORS)); ONOFF(CONFIG_TRACK_T_DOORS));
} }
if (IS_ADMIN(ch, ADMLVL_IMMORT)) { if (IS_ADMIN(ch, ADMLVL_IMMORT)) {
send_to_char(ch, send_to_char(ch,
" Buildwalk: %-3s " " Buildwalk: %-3s "
" NoWiz: %-3s " " NoWiz: %-3s "
@ -2083,128 +2085,144 @@ ACMD(do_toggle)
return; return;
} }
len = strlen(arg); len = strlen(arg);
for (toggle = 0; *tog_messages[toggle].command != '\n'; toggle++) for (toggle = 0; *tog_messages[toggle].command != '\n'; toggle++)
if (!strncmp(arg, tog_messages[toggle].command, len)) if (!strncmp(arg, tog_messages[toggle].command, len))
break; break;
if (*tog_messages[toggle].command == '\n' || tog_messages[toggle].min_admlevel > GET_ADMLEVEL(ch)) { if (*tog_messages[toggle].command == '\n' || tog_messages[toggle].min_admlevel > GET_ADMLEVEL(ch)) {
send_to_char(ch, "You can't toggle that!\r\n"); send_to_char(ch, "You can't toggle that!\r\n");
return; return;
} }
switch (toggle) { switch (toggle) {
case SCMD_COLOR: case SCMD_COLOR:
if (!*arg2) { if (!*arg2) {
send_to_char(ch, "Your current color level is %s.\r\n", types[COLOR_LEV(ch)]); send_to_char(ch, "Your current color level is %s.\r\n", types[COLOR_LEV(ch)]);
return;
}
if (((tp = search_block(arg2, types, FALSE)) == -1)) {
send_to_char(ch, "Usage: toggle color { Off | Brief | Normal | On }\r\n");
return;
}
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), types[tp]);
return;
case SCMD_SYSLOG:
if (!*arg2) {
send_to_char(ch, "Your syslog is currently %s.\r\n",
types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)]);
return;
}
if (((tp = search_block(arg2, types, FALSE)) == -1)) {
send_to_char(ch, "Usage: toggle syslog { Off | Brief | Normal | On }\r\n");
return;
}
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
send_to_char(ch, "Your syslog is now %s.\r\n", types[tp]);
return;
case SCMD_SLOWNS:
result = (CONFIG_NS_IS_SLOW = !CONFIG_NS_IS_SLOW);
break;
case SCMD_TRACK:
result = (CONFIG_TRACK_T_DOORS = !CONFIG_TRACK_T_DOORS);
break;
case SCMD_BUILDWALK:
if (!IS_ADMIN(ch, ADMLVL_BUILDER)) {
send_to_char(ch, "Builders only, sorry.\r\n");
return;
}
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK))
mudlog(CMP, GET_LEVEL(ch), TRUE,
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
else
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
break;
case SCMD_AFK:
if ((result = PRF_TOG_CHK(ch, PRF_AFK)))
act("$n is now away from $s keyboard.", TRUE, ch, 0, 0, TO_ROOM);
else {
act("$n has returned to $s keyboard.", TRUE, ch, 0, 0, TO_ROOM);
if (has_mail(GET_IDNUM(ch)))
send_to_char(ch, "You have mail waiting.\r\n");
}
break;
case SCMD_WIMPY:
if (!*arg2) {
if (GET_WIMP_LEV(ch)) {
send_to_char(ch, "Your current wimp level is %d hit points.\r\n", GET_WIMP_LEV(ch));
return;
} else {
send_to_char(ch, "At the moment, you're not a wimp. (sure, sure...)\r\n");
return; return;
} }
}
if (isdigit(*arg2)) { if (((tp = search_block(arg2, types, FALSE)) == -1)) {
if ((wimp_lev = atoi(arg2)) != 0) { send_to_char(ch, "Usage: toggle color { Off | Brief | Normal | On }\r\n");
if (wimp_lev < 0) return;
send_to_char(ch, "Heh, heh, heh.. we are jolly funny today, eh?\r\n"); }
else if (wimp_lev > GET_MAX_HIT(ch)) REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
send_to_char(ch, "That doesn't make much sense, now does it?\r\n"); REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
else if (wimp_lev > (GET_MAX_HIT(ch) / 2)) if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_1);
send_to_char(ch, "You can't set your wimp level above half your hit points.\r\n"); if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_COLOR_2);
else {
send_to_char(ch, "Okay, you'll wimp out if you drop below %d hit points.", wimp_lev); send_to_char(ch, "Your %scolor%s is now %s.\r\n", CCRED(ch, C_SPR), CCNRM(ch, C_OFF), types[tp]);
GET_WIMP_LEV(ch) = wimp_lev; return;
case SCMD_SYSLOG:
if (!*arg2) {
send_to_char(ch, "Your syslog is currently %s.\r\n",
types[(PRF_FLAGGED(ch, PRF_LOG1) ? 1 : 0) + (PRF_FLAGGED(ch, PRF_LOG2) ? 2 : 0)]);
return;
}
if (((tp = search_block(arg2, types, FALSE)) == -1)) {
send_to_char(ch, "Usage: toggle syslog { Off | Brief | Normal | On }\r\n");
return;
}
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
REMOVE_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
if (tp & 1) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG1);
if (tp & 2) SET_BIT_AR(PRF_FLAGS(ch), PRF_LOG2);
send_to_char(ch, "Your syslog is now %s.\r\n", types[tp]);
return;
case SCMD_SLOWNS:
result = (CONFIG_NS_IS_SLOW = !CONFIG_NS_IS_SLOW);
break;
case SCMD_TRACK:
result = (CONFIG_TRACK_T_DOORS = !CONFIG_TRACK_T_DOORS);
break;
case SCMD_BUILDWALK:
if (!IS_ADMIN(ch, ADMLVL_BUILDER)) {
send_to_char(ch, "Builders only, sorry.\r\n");
return;
}
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
if (PRF_FLAGGED(ch, PRF_BUILDWALK))
mudlog(CMP, GET_LEVEL(ch), TRUE,
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
else
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
break;
case SCMD_AFK:
if ((result = PRF_TOG_CHK(ch, PRF_AFK)))
act("$n is now away from $s keyboard.", TRUE, ch, 0, 0, TO_ROOM);
else {
act("$n has returned to $s keyboard.", TRUE, ch, 0, 0, TO_ROOM);
if (has_mail(GET_IDNUM(ch)))
send_to_char(ch, "You have mail waiting.\r\n");
}
break;
case SCMD_WIMPY:
if (!*arg2) {
if (GET_WIMP_LEV(ch)) {
send_to_char(ch, "Your current wimp level is %d hit points.\r\n", GET_WIMP_LEV(ch));
return;
} else {
send_to_char(ch, "At the moment, you're not a wimp. (sure, sure...)\r\n");
return;
} }
} else {
send_to_char(ch, "Okay, you'll now tough out fights to the bitter end.");
GET_WIMP_LEV(ch) = 0;
} }
} else if (isdigit(*arg2)) {
send_to_char(ch, "Specify at how many hit points you want to wimp out at. (0 to disable)\r\n"); if ((wimp_lev = atoi(arg2)) != 0) {
break; if (wimp_lev < 0)
case SCMD_PAGELENGTH: send_to_char(ch, "Heh, heh, heh.. we are jolly funny today, eh?\r\n");
if (!*arg2) else if (wimp_lev > GET_MAX_HIT(ch))
send_to_char(ch, "You current page length is set to %d lines.", GET_PAGE_LENGTH(ch)); send_to_char(ch, "That doesn't make much sense, now does it?\r\n");
else if (is_number(arg2)) { else if (wimp_lev > (GET_MAX_HIT(ch) / 2))
GET_PAGE_LENGTH(ch) = MIN(MAX(atoi(arg2), 5), 255); send_to_char(ch, "You can't set your wimp level above half your hit points.\r\n");
send_to_char(ch, "Okay, your page length is now set to %d lines.", GET_PAGE_LENGTH(ch)); else {
} else send_to_char(ch, "Okay, you'll wimp out if you drop below %d hit points.", wimp_lev);
send_to_char(ch, "Please specify a number of lines (5 - 255)."); GET_WIMP_LEV(ch) = wimp_lev;
}
} else {
send_to_char(ch, "Okay, you'll now tough out fights to the bitter end.");
GET_WIMP_LEV(ch) = 0;
}
} else
send_to_char(ch, "Specify at how many hit points you want to wimp out at. (0 to disable)\r\n");
break; break;
case SCMD_SCREENWIDTH: case SCMD_PAGELENGTH:
if (!*arg2) if (!*arg2)
send_to_char(ch, "Your current screen width is set to %d characters.", GET_SCREEN_WIDTH(ch)); send_to_char(ch, "You current page length is set to %d lines.", GET_PAGE_LENGTH(ch));
else if (is_number(arg2)) { else if (is_number(arg2)) {
GET_SCREEN_WIDTH(ch) = MIN(MAX(atoi(arg2), 40), 200); GET_PAGE_LENGTH(ch) = MIN(MAX(atoi(arg2), 5), 255);
send_to_char(ch, "Okay, your screen width is now set to %d characters.", GET_SCREEN_WIDTH(ch)); send_to_char(ch, "Okay, your page length is now set to %d lines.", GET_PAGE_LENGTH(ch));
} else } else
send_to_char(ch, "Please specify a number of characters (40 - 200)."); send_to_char(ch, "Please specify a number of lines (5 - 255).");
break; break;
case SCMD_AUTOMAP: case SCMD_SCREENWIDTH:
if (can_see_map(ch)) { if (!*arg2)
send_to_char(ch, "Your current screen width is set to %d characters.", GET_SCREEN_WIDTH(ch));
else if (is_number(arg2)) {
GET_SCREEN_WIDTH(ch) = MIN(MAX(atoi(arg2), 40), 200);
send_to_char(ch, "Okay, your screen width is now set to %d characters.", GET_SCREEN_WIDTH(ch));
} else
send_to_char(ch, "Please specify a number of characters (40 - 200).");
break;
case SCMD_AUTOMAP:
if (can_see_map(ch)) {
if (!*arg2) {
TOGGLE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = (PRF_FLAGGED(ch, tog_messages[toggle].toggle));
} else if (!strcmp(arg2, "on")) {
SET_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = 1;
} else if (!strcmp(arg2, "off")) {
REMOVE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
} else {
send_to_char(ch, "Value for %s must either be 'on' or 'off'.\r\n", tog_messages[toggle].command);
return;
}
} else
send_to_char(ch, "Sorry, automap is currently disabled.\r\n");
break;
default:
if (!*arg2) { if (!*arg2) {
TOGGLE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle); TOGGLE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = (PRF_FLAGGED(ch, tog_messages[toggle].toggle)); result = (PRF_FLAGGED(ch, tog_messages[toggle].toggle));
@ -2214,25 +2232,9 @@ ACMD(do_toggle)
} else if (!strcmp(arg2, "off")) { } else if (!strcmp(arg2, "off")) {
REMOVE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle); REMOVE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
} else { } else {
send_to_char(ch, "Value for %s must either be 'on' or 'off'.\r\n", tog_messages[toggle].command); send_to_char(ch, "Value for %s must either be 'on' or 'off'.\r\n", tog_messages[toggle].command);
return; return;
} }
} else
send_to_char(ch, "Sorry, automap is currently disabled.\r\n");
break;
default:
if (!*arg2) {
TOGGLE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = (PRF_FLAGGED(ch, tog_messages[toggle].toggle));
} else if (!strcmp(arg2, "on")) {
SET_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
result = 1;
} else if (!strcmp(arg2, "off")) {
REMOVE_BIT_AR(PRF_FLAGS(ch), tog_messages[toggle].toggle);
} else {
send_to_char(ch, "Value for %s must either be 'on' or 'off'.\r\n", tog_messages[toggle].command);
return;
}
} }
if (result) if (result)
send_to_char(ch, "%s", tog_messages[toggle].enable_msg); send_to_char(ch, "%s", tog_messages[toggle].enable_msg);
@ -2404,8 +2406,7 @@ void add_history(struct char_data *ch, char *str, int type)
if (!tmp) { if (!tmp) {
CREATE(GET_HISTORY(ch, type), struct txt_block, 1); CREATE(GET_HISTORY(ch, type), struct txt_block, 1);
GET_HISTORY(ch, type)->text = strdup(buf); GET_HISTORY(ch, type)->text = strdup(buf);
} } else {
else {
while (tmp->next) while (tmp->next)
tmp = tmp->next; tmp = tmp->next;
CREATE(tmp->next, struct txt_block, 1); CREATE(tmp->next, struct txt_block, 1);
@ -2477,25 +2478,17 @@ ACMD(do_whois)
send_to_char(ch, "Last Logon: They're playing now! (Idle %d Minutes)", send_to_char(ch, "Last Logon: They're playing now! (Idle %d Minutes)",
victim->char_specials.timer * SECS_PER_MUD_HOUR / SECS_PER_REAL_MIN); victim->char_specials.timer * SECS_PER_MUD_HOUR / SECS_PER_REAL_MIN);
if (!victim->desc) if (!victim->desc) {
{
send_to_char(ch, " (Linkless)\r\n"); send_to_char(ch, " (Linkless)\r\n");
} } else {
else
{
send_to_char(ch, "\r\n"); send_to_char(ch, "\r\n");
} }
if (PRF_FLAGGED(victim, PRF_AFK)) if (PRF_FLAGGED(victim, PRF_AFK)) {
{
send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM), GET_NAME(victim), GET_SEX(victim) == SEX_NEUTRAL ? "it" : (GET_SEX(victim) == SEX_MALE ? "he" : "she"), CCNRM(ch, C_NRM)); send_to_char(ch, "%s%s is afk right now, so %s may not respond to communication.%s\r\n", CBGRN(ch, C_NRM), GET_NAME(victim), GET_SEX(victim) == SEX_NEUTRAL ? "it" : (GET_SEX(victim) == SEX_MALE ? "he" : "she"), CCNRM(ch, C_NRM));
} }
} } else if (hours > 0) {
else if (hours > 0)
{
send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours/24, hours%24); send_to_char(ch, "Last Logon: %s (%d days & %d hours ago.)\r\n", buf, hours/24, hours%24);
} } else {
else
{
send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n", send_to_char(ch, "Last Logon: %s (0 hours & %d minutes ago.)\r\n",
buf, (int)(time(0) - victim->player.time.logon)/60); buf, (int)(time(0) - victim->player.time.logon)/60);
} }
@ -2635,25 +2628,25 @@ distance, int door)
int count = 0; int count = 0;
*buf = '\0'; *buf = '\0';
/* this loop is a quick, easy way to help make a grammatical sentence /* this loop is a quick, easy way to help make a grammatical sentence
(i.e., "You see x, x, y, and z." with commas, "and", etc.) */ (i.e., "You see x, x, y, and z." with commas, "and", etc.) */
for (i = list; i; i = i->next_in_room) for (i = list; i; i = i->next_in_room) {
/* put any other conditions for scanning someone in this if statement - /* put any other conditions for scanning someone in this if statement -
i.e., if (CAN_SEE(ch, i) && condition2 && condition3) or whatever */ i.e., if (CAN_SEE(ch, i) && condition2 && condition3) or whatever */
if (CAN_SEE(ch, i)) if (CAN_SEE(ch, i))
count++; count++;
}
if (!count) if (!count)
return; return;
for (i = list; i; i = i->next_in_room) { for (i = list; i; i = i->next_in_room) {
/* make sure to add changes to the if statement above to this one also, using /* make sure to add changes to the if statement above to this one also, using
or's to join them.. i.e., or's to join them.. i.e.,
if (!CAN_SEE(ch, i) || !condition2 || !condition3) */ if (!CAN_SEE(ch, i) || !condition2 || !condition3) */
if (!CAN_SEE(ch, i)) if (!CAN_SEE(ch, i))
continue; continue;

View file

@ -125,35 +125,35 @@ ACMD(do_put)
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);
} }
} }
} }
} }
@ -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,43 +342,45 @@ 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);
} }
} }
} }
@ -397,11 +399,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];
@ -410,11 +412,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];
@ -553,37 +555,38 @@ 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);
} }
} }
@ -686,7 +689,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);
@ -696,9 +699,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 {
@ -710,23 +713,24 @@ 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);
}
} }
} }
} }
@ -843,16 +847,17 @@ 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)) {
@ -1148,8 +1153,7 @@ 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);
@ -1352,8 +1356,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)
@ -1367,15 +1371,16 @@ 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);
@ -1383,9 +1388,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);
} }
} }
} }
@ -1433,9 +1438,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);
} }
} }
} }
@ -1477,11 +1482,12 @@ 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) {
@ -1489,14 +1495,15 @@ 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)
@ -1514,50 +1521,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

@ -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);
@ -393,14 +393,14 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
} }
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);
@ -475,10 +475,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 +533,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:
@ -690,24 +690,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 +721,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 +960,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

@ -522,7 +522,7 @@ static void do_stat_room(struct char_data *ch, struct room_data *rm)
sprinttype(rm->sector_type, sector_types, buf2, sizeof(buf2)); sprinttype(rm->sector_type, sector_types, buf2, sizeof(buf2));
send_to_char(ch, "Zone: [%3d], VNum: [%s%5d%s], RNum: [%5d], IDNum: [%5ld], Type: %s\r\n", send_to_char(ch, "Zone: [%3d], VNum: [%s%5d%s], RNum: [%5d], IDNum: [%5ld], Type: %s\r\n",
zone_table[rm->zone].number, CCGRN(ch, C_NRM), rm->number, zone_table[rm->zone].number, CCGRN(ch, C_NRM), rm->number,
CCNRM(ch, C_NRM), IN_ROOM(ch), (long) rm->number + ROOM_ID_BASE, buf2); CCNRM(ch, C_NRM), real_room(rm->number), (long) rm->number + ROOM_ID_BASE, buf2);
sprintbitarray(rm->room_flags, room_bits, RF_ARRAY_MAX, buf2); sprintbitarray(rm->room_flags, room_bits, RF_ARRAY_MAX, buf2);
send_to_char(ch, "SpecProc: %s, Flags: %s\r\n", rm->func == NULL ? "None" : get_spec_func_name(rm->func), buf2); send_to_char(ch, "SpecProc: %s, Flags: %s\r\n", rm->func == NULL ? "None" : get_spec_func_name(rm->func), buf2);
@ -1785,7 +1785,7 @@ ACMD(do_advance)
} }
oldlevel = GET_LEVEL(victim); oldlevel = GET_LEVEL(victim);
if (newlevel < GET_LEVEL(victim)) { if (newlevel < GET_LEVEL(victim)) {
do_start(victim); do_start(victim); /* Send 'em back to level 1, then advance */
GET_LEVEL(victim) = newlevel; GET_LEVEL(victim) = newlevel;
send_to_char(victim, "You are momentarily enveloped by darkness!\r\nYou feel somewhat diminished.\r\n"); send_to_char(victim, "You are momentarily enveloped by darkness!\r\nYou feel somewhat diminished.\r\n");
} else { } else {

View file

@ -715,7 +715,7 @@ static void cedit_disp_admin_levels(struct descriptor_data *d)
write_to_output(d, "\r\n\r\n"); write_to_output(d, "\r\n\r\n");
for (i=ADMLVL_IMMORT; i<=ADMLVL_IMPL; i++) { for (i=ADMLVL_IMMORT; i<=ADMLVL_IMPL; i++) {
write_to_output(d, "%sd%s) %s%s%s\r\n", grn, nrm, cyn, admin_level_names[i], nrm); write_to_output(d, "%s%d%s) %s%s%s\r\n", grn, i, nrm, cyn, admin_level_names[i], nrm);
} }
} }

View file

@ -1440,6 +1440,7 @@ 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);

View file

@ -569,6 +569,31 @@ 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",
"CLAN_OWNED",
"\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

@ -36,6 +36,8 @@ 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[];

File diff suppressed because it is too large Load diff

View file

@ -1,40 +1,72 @@
/** /**
* @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 #define MAX_HOUSES 100 /* Maximum number of houses in the MUD */
#define MAX_GUESTS 10 #define MAX_GUESTS 10 /* Maximum number of guests per house */
#define HOUSE_PRIVATE 0 /* House modes/types */
#define HOUSE_PRIVATE 0 /* A Normal Player-Owned House */
#define HOUSE_GOD 1 /* Imm owned house */
#define HOUSE_SHOP 2 /* Player-Owned Shop */
struct house_control_rec { #define NUM_HOUSE_TYPES 3
room_vnum vnum; /* vnum of this house */
room_vnum atrium; /* vnum of atrium */ /* House Flags - also see string constants, in constants.c */
sh_int exit_num; /* direction of house's exit */ #define HOUSE_NOGUESTS 0 /* Owner cannot add guests */
time_t built_on; /* date this house was built */ #define HOUSE_FREE 1 /* House does not require payments */
int mode; /* mode of ownership */ #define HOUSE_NOIMMS 2 /* Imms below level 2 cannot enter */
long owner; /* idnum of house's owner */ #define HOUSE_IMPONLY 3 /* Imms below level 4 cannot enter */
int num_of_guests; /* how many guests for house */ #define HOUSE_RENTFREE 4 /* No rent is charged on items left here */
long guests[MAX_GUESTS]; /* idnums of house's guests */ #define HOUSE_SAVENORENT 5 /* NORENT items are crashsaved too */
time_t last_payment; /* date of last house payment */ #define HOUSE_NOSAVE 6 /* Do not crash save this room - private only */
long spare0; #define HOUSE_NOSPEC 7 /* Don't use 'standard' spec proc for house type */
long spare1;
long spare2; #define HOUSE_NUM_FLAGS 8
long spare3;
long spare4; /** House flags.
long spare5; * @param loc The house_control_data structure. */
long spare6; #define HOUSE_FLAGS(loc) ((loc)->house_flags)
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] ? \
@ -42,16 +74,36 @@ struct house_control_rec {
/* 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, int i, int quiet); void House_list_guests(struct char_data *ch, struct house_control_data *h, 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_ */

1134
src/hsedit.c Executable file

File diff suppressed because it is too large Load diff

View file

@ -195,6 +195,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "holler" , "holler" , POS_RESTING , do_gen_comm , 1, ADMLVL_MORTAL, ADM_NONE, SCMD_HOLLER }, { "holler" , "holler" , POS_RESTING , do_gen_comm , 1, ADMLVL_MORTAL, ADM_NONE, SCMD_HOLLER },
{ "holylight", "holy" , POS_DEAD , do_gen_tog , 0, ADMLVL_IMMORT, ADM_NONE, SCMD_HOLYLIGHT }, { "holylight", "holy" , POS_DEAD , do_gen_tog , 0, ADMLVL_IMMORT, ADM_NONE, SCMD_HOLYLIGHT },
{ "house" , "house" , POS_RESTING , do_house , 0, ADMLVL_MORTAL, ADM_NONE, 0 }, { "house" , "house" , POS_RESTING , do_house , 0, ADMLVL_MORTAL, ADM_NONE, 0 },
{ "hsedit" , "hsedit" , POS_DEAD , do_oasis_hsedit,0,ADMLVL_GOD, ADM_ADVBUILD, 0 },
{ "inventory", "i" , POS_DEAD , do_inventory , 0, ADMLVL_MORTAL, ADM_NONE, 0 }, { "inventory", "i" , POS_DEAD , do_inventory , 0, ADMLVL_MORTAL, ADM_NONE, 0 },
{ "identify" , "id" , POS_STANDING, do_not_here , 1, ADMLVL_MORTAL, ADM_NONE, 0 }, { "identify" , "id" , POS_STANDING, do_not_here , 1, ADMLVL_MORTAL, ADM_NONE, 0 },
@ -1320,6 +1321,7 @@ void nanny(struct descriptor_data *d, char *arg)
{ CON_QEDIT, qedit_parse }, { CON_QEDIT, qedit_parse },
{ CON_PREFEDIT, prefedit_parse }, { CON_PREFEDIT, prefedit_parse },
{ CON_IBTEDIT, ibtedit_parse }, { CON_IBTEDIT, ibtedit_parse },
{ CON_HSEDIT, hsedit_parse },
{ -1, NULL } { -1, NULL }
}; };

View file

@ -80,23 +80,24 @@ 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' */
int script_mode; int script_mode;
int trigger_position; int trigger_position;
int item_type; int item_type;
@ -129,6 +130,7 @@ extern const char *nrm, *grn, *cyn, *yel;
#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 */
/* 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)])
@ -381,6 +383,32 @@ extern const char *nrm, *grn, *cyn, *yel;
#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. */
@ -450,6 +478,12 @@ 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

@ -18,8 +18,9 @@
#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 */
@ -166,40 +167,42 @@ 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 },
{"Postmaster", postmaster }, {"Postmaster", postmaster },
{"Receptionist", receptionist }, {"Receptionist", receptionist },
{"Cryogenicist", cryogenicist}, {"Cryogenicist", cryogenicist},
{"Bulletin Board", gen_board }, {"Bulletin Board", gen_board },
{"Bank", bank }, {"Bank", bank },
{"Pet Shop", pet_shops }, {"Pet Shop", pet_shops },
{"Dump", dump }, {"Dump", dump },
{"Guildmaster", guild }, {"Guildmaster", guild },
{"Guild Guard", guild_guard }, {"Guild Guard", guild_guard },
{"Questmaster", questmaster }, {"Questmaster", questmaster },
{"Shopkeeper", shop_keeper }, {"Shopkeeper", shop_keeper },
{"\n", NULL} {"House-Receptionist", house_receptionist },
}; {"House-Shopkeeper", house_shopkeeper },
{"\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

@ -357,10 +357,11 @@
#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 */
/* 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_IBTEDIT /**< The last CON_ state that is an OLC */ #define LAST_OLC_STATE CON_HSEDIT /**< 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
@ -551,6 +552,7 @@
#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 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