REDIT( redit_rlist )
{
ROOM_INDEX_DATA *pRoomIndex;
AREA_DATA *pArea;
char buf[MSL];
char arg[MIL], arg2[MIL];
bool fAll, found;
int vnum, colsp, savesp, col;
char buffer[MSL], spaces [24]; // For tidy listings
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2);
pArea = ch->in_room->area;
fAll = !str_cmp( arg, "all" );
found = FALSE;
col = 0;
send_to_char ("{rREDIT: {yRlist - ", ch);
if (arg[0] == '?' || is_name (arg, "options"))
{
send_to_char ("Options{x\n\r", ch );
send_to_char ("Exitsizes, Elevations, Sizes, Health, Mana\n\r"
"All, Sector (type/all), Flags (type/all), room names\n\r", ch);
return FALSE;
}
if (is_name (arg, "flags"))
{
BUFFER *output;
bool showdisroom;
output = new_buf();
sprintf (buf, "Flags{x '%s'\n\r", arg2[0] == '\0' ? "All" : capitalize(arg2));
send_to_char (buf, ch);
for ( vnum = pArea->min_vnum; vnum <= pArea->max_vnum; vnum++ )
{
showdisroom = FALSE;
if ((pRoomIndex = get_room_index(vnum)) != NULL)
{
if (is_name (arg2, flag_string( room_flags, pRoomIndex->room_flags)))
showdisroom = TRUE;
if (arg2[0] == '\0')
showdisroom = TRUE;
}
else
continue; // Room doesn't exist, or has normal exits/elevations
if (showdisroom)
{
sprintf (buf, "%-14.13s", capitalize( pRoomIndex->name ));
spaces[0] = '\0';
for (colsp = savesp = get_color_changes (buf); colsp > 0; colsp –)
strcat (spaces, " ");
sprintf( buf, "[%5d] %-14.13s%s{x- %8.8s ", pRoomIndex->vnum, capitalize( pRoomIndex->name ),
savesp > 0 ? spaces: "", flag_string( room_flags, pRoomIndex->room_flags) );
add_buf( output, buf );
if ( ++col % 3 == 0 )
add_buf( output, "\n\r" );
}
}
// End Room Flags
page_to_char (buf_string(output), ch);
free_buf(output);
return FALSE;
}
BUFFER *buf1;
buf1 = new_buf();
if (fAll)
send_to_char ("{x 'All'\n\r", ch);
else
{
sprintf (buf, "{x'%s'\n\r", arg[0] == '\0' ? "Used Rooms" : arg);
send_to_char (buf, ch);
}
for ( vnum = pArea->min_vnum; vnum <= pArea->max_vnum; vnum++ )
{
if (fAll) // to show ALL vnums.
{
pRoomIndex = get_room_index(vnum);
sprintf (buf, "%-17.16s", pRoomIndex != NULL ? capitalize( pRoomIndex->name ) : "— unused —");
spaces[0] = '\0';
for (colsp = savesp = get_color_changes (buf); colsp > 0; colsp –)
strcat (spaces, " ");
found = TRUE;
sprintf( buf, "[%5d] %-17.16s%s{x",
vnum, pRoomIndex != NULL?capitalize( pRoomIndex->name ) :
"— unused —", savesp > 0 ? spaces: "" );
add_buf( buf1, buf );
if ( ++col % 3 == 0 )
add_buf( buf1, "\n\r" );
}
else if ( ( pRoomIndex = get_room_index( vnum ) ) != NULL )
{
if ( arg[0] == '\0' || is_name( arg, smash_color(pRoomIndex->name)))
{
sprintf (buf, "%-17.16s", capitalize( pRoomIndex->name ));
spaces[0] = '\0';
for (colsp = savesp = get_color_changes (buf); colsp > 0; colsp –)
strcat (spaces, " ");
found = TRUE;
sprintf( buf, "[%5d] %-17.16s%s{x",
pRoomIndex->vnum, capitalize( pRoomIndex->name ), savesp > 0 ? spaces: "" );
add_buf( buf1, buf );
if ( ++col % 3 == 0 )
add_buf( buf1, "\n\r" );
}
}
}
if ( !found )
{
send_to_char( "Room(s) not found in this area.{x\n\r", ch);
return FALSE;
}
if ( col % 3 != 0 )
add_buf( buf1, "\n\r" );
page_to_char( buf_string(buf1), ch );
free_buf(buf1);
return FALSE;
}
// This from redit_mlist
if (arg[0] == '?' || is_name (arg, "options"))
{
send_to_char ("Options{x\n\r", ch );
send_to_char ("All, Act, Act2, Race, Form, Parts\n\r"
"Imm, Off, Size, Spec (add NOT for excluding those)\n\r", ch);
return FALSE;
}
// redit_olist options
send_to_char ("{rREDIT: {yOlist - ", ch);
if (arg[0] == '?' || is_name (arg, "options"))
{
send_to_char ("Options{x\n\r", ch );
send_to_char ("Wear, Extra, Material, Type, Level (exact)\n\r"
"Levels/Range # # (items in level range)\n\r"
"(add NOT for excluding those)\n\r"
"All, Affected (hitroll/damroll etc)\n\r", ch);
return FALSE;
}