[Dec 22 2009] - Rumble

Made copyover save loadroom so players stay in the same room during copyover.
  Added scan command.
This commit is contained in:
Rumble 2009-12-22 20:44:12 +00:00
parent 2b74ef23ad
commit 577d67041f
6 changed files with 111 additions and 5 deletions

View file

@ -24,7 +24,7 @@ showvnums (roomflags that includes mobs, objs, triggers)
zpurge (purge an entire zone)
zcheck (head builder tool to check balancing)
mob autoroll (standard values set on mob level entry)
checkload (list where a mob/obj is loaded)
checkload (list where a mob/obj/trg is loaded)
Auto Toggles (loot, gold, split, sac, assist, map, door, key)
Hidden mob/obj
mob/obj stacking
@ -36,11 +36,14 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too)
@
tbaMUD 3.61
[Dec 22 2009] - Rumble
Made copyover save loadroom so players stay in the same room during copyover.
Added scan command.
[Dec 21 2009] - Rumble
Added identify command to shops.
moved identify to an active spell. Cleric 11, Mage 20.
Moved identify to an active spell. Cleric 11, Mage 20.
[Dec 17 2009] - Rumble
standardized /n/r to /r/n in ibt.c
Standardized /n/r to /r/n in ibt.c
Removed ability to set a modifier to obj apply NONE.
[Dec 16 2009] - Rumble
Added some missing code for last_ibt in ibt.c.
@ -981,6 +984,10 @@ CircleMUD 3.5
- Added buildwalk and dig.
Release history:
Version 3.60 release: September, 2009
Version 3.59 release: April, 2009
Version 3.58 release: January, 2009
Version 3.57 release: August, 2008
Version 3.56 release: January, 2008
Version 3.55 release: January, 2008
Version 3.54 release: December, 2007

View file

@ -93,6 +93,7 @@ ACMD(do_help);
ACMD(do_history);
ACMD(do_inventory);
ACMD(do_levels);
ACMD(do_scan);
ACMD(do_score);
ACMD(do_time);
ACMD(do_toggle);

View file

@ -2525,3 +2525,96 @@ ACMD(do_areas)
if (overlap_shown)
send_to_char(ch, "Areas shown in @rred@n may have some creatures outside the specified range.\r\n");
}
void list_scanned_chars(struct char_data * list, struct char_data * ch, int
distance, int door)
{
char buf[MAX_STRING_LENGTH], buf2[MAX_STRING_LENGTH];
const char *how_far[] = {
"close by",
"a ways off",
"far off to the"
};
struct char_data *i;
int count = 0;
*buf = '\0';
/* 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.) */
for (i = list; i; i = i->next_in_room)
/* put any other conditions for scanning someone in this if statement -
i.e., if (CAN_SEE(ch, i) && condition2 && condition3) or whatever */
if (CAN_SEE(ch, i))
count++;
if (!count)
return;
for (i = list; i; i = i->next_in_room) {
/* make sure to add changes to the if statement above to this one also, using
or's to join them.. i.e.,
if (!CAN_SEE(ch, i) || !condition2 || !condition3) */
if (!CAN_SEE(ch, i))
continue;
if (!*buf)
sprintf(buf, "You see %s", GET_NAME(i));
else
sprintf(buf, "%s%s", buf, GET_NAME(i));
if (--count > 1)
strcat(buf, ", ");
else if (count == 1)
strcat(buf, " and ");
else {
sprintf(buf2, " %s %s.\r\n", how_far[distance], dirs[door]);
strcat(buf, buf2);
}
}
send_to_char(ch, buf);
}
ACMD(do_scan)
{
int door;
char buf[MAX_STRING_LENGTH];
*buf = '\0';
if (IS_AFFECTED(ch, AFF_BLIND)) {
send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
return;
}
/* may want to add more restrictions here, too */
send_to_char(ch, "You quickly scan the area.\r\n");
for (door = 0; door < NUM_OF_DIRS - 2; door++) /* don't scan up/down */
if (EXIT(ch, door) && EXIT(ch, door)->to_room != NOWHERE &&
!IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED)
&& !IS_DARK(EXIT(ch, door)->to_room)) {
if (world[EXIT(ch, door)->to_room].people) {
list_scanned_chars(world[EXIT(ch, door)->to_room].people, ch, 0, door);
} else if (_2ND_EXIT(ch, door) && _2ND_EXIT(ch, door)->to_room !=
NOWHERE && !IS_SET(_2ND_EXIT(ch, door)->exit_info, EX_CLOSED)
&& !IS_DARK(_2ND_EXIT(ch, door)->to_room)) {
/* check the second room away */
if (world[_2ND_EXIT(ch, door)->to_room].people) {
list_scanned_chars(world[_2ND_EXIT(ch, door)->to_room].people, ch, 1, door);
} else if (_3RD_EXIT(ch, door) && _3RD_EXIT(ch, door)->to_room !=
NOWHERE && !IS_SET(_3RD_EXIT(ch, door)->exit_info, EX_CLOSED)
&& !IS_DARK(_3RD_EXIT(ch, door)->to_room)) {
/* check the third room */
if (world[_3RD_EXIT(ch, door)->to_room].people) {
list_scanned_chars(world[_3RD_EXIT(ch, door)->to_room].people, ch, 2,
door);
}
}
}
}
}

View file

@ -4068,6 +4068,7 @@ ACMD(do_copyover)
} else {
fprintf (fp, "%d %ld %s %s\n", d->descriptor, GET_PREF(och), GET_NAME(och), d->host);
/* save och */
GET_LOADROOM(och) = GET_ROOM_VNUM(IN_ROOM(och));
Crash_rentsave(och,0);
save_char(och);
write_to_descriptor (d->descriptor, buf);

View file

@ -171,9 +171,9 @@ cpp_extern const struct command_info cmd_info[] = {
{ "holylight", "holy" , POS_DEAD , do_gen_tog , LVL_IMMORT, SCMD_HOLYLIGHT },
{ "house" , "house" , POS_RESTING , do_house , 0, 0 },
{ "identify" , "id" , POS_STANDING, do_not_here , 1, 0 },
{ "inventory", "i" , POS_DEAD , do_inventory, 0, 0 },
{ "idea" , "id" , POS_DEAD , do_ibt , 0, SCMD_IDEA },
{ "identify" , "id" , POS_STANDING, do_not_here , 1, 0 },
{ "idea" , "ide" , POS_DEAD , do_ibt , 0, SCMD_IDEA },
{ "imotd" , "imo" , POS_DEAD , do_gen_ps , LVL_IMMORT, SCMD_IMOTD },
{ "immlist" , "imm" , POS_DEAD , do_gen_ps , 0, SCMD_IMMLIST },
{ "info" , "info" , POS_SLEEPING, do_gen_ps , 0, SCMD_INFO },
@ -264,6 +264,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "sacrifice", "sac" , POS_RESTING , do_sac , 0, 0 },
{ "say" , "s" , POS_RESTING , do_say , 0, 0 },
{ "score" , "sc" , POS_DEAD , do_score , 0, 0 },
{ "scan" , "sca" , POS_RESTING , do_scan , 0, 0 },
{ "scopy" , "scopy" , POS_DEAD , do_oasis_copy, LVL_GOD, CON_SEDIT },
{ "sit" , "si" , POS_RESTING , do_sit , 0, 0 },
{ "'" , "'" , POS_RESTING , do_say , 0, 0 },

View file

@ -820,6 +820,9 @@ do \
/** Does room pointer have direction option num? */
#define R_EXIT(room, num) ((room)->dir_option[(num)])
#define _2ND_EXIT(ch, door) (world[EXIT(ch, door)->to_room].dir_option[door])
#define _3RD_EXIT(ch, door) (world[_2ND_EXIT(ch, door)->to_room].dir_option[door])
/** Can ch walk through direction door. */
#define CAN_GO(ch, door) (EXIT(ch,door) && \
(EXIT(ch,door)->to_room != NOWHERE) && \