mud/lib/cmds/creators/exits.c
2020-09-06 05:43:07 -07:00

57 lines
1.6 KiB
C

/* /cmds/creator/exits.c
* from the Dead Souls LPC Library
* Command to display exit and enter info for rooms
* by Kalinash 100195
*/
#include <lib.h>
inherit LIB_DAEMON;
mixed cmd(){
string *asExits, sDir, sExit;
string *asEnters;
object oEnv;
if ( !( oEnv = environment( this_player() ) ) )
return "You do not have a valid environment.";
if(oEnv->GetRiders()) oEnv = environment( oEnv );
if ( !oEnv )
return "Invalid environment.";
asExits = oEnv->GetExits();
asEnters = oEnv->GetEnters();
message( "Nmy_action", sprintf("\t *** %s ***\n\n", identify( oEnv ) ),
this_player() );
if ( !( sizeof( asExits ) ) )
message( "my_action", "This room has no exits.", this_player() );
else {
message( "Nmy_action", "This room has the following exits :\n\n",
this_player() );
foreach( sExit in asExits ) {
message( "my_action", sprintf( "\t%10s -> %s", sExit,
oEnv->GetExit( sExit ) ), this_player() );
}
}
if ( !( sizeof( asEnters ) ) )
message( "my_action", "\nThis room has no enters.", this_player() );
else {
message( "Nmy_action", "\nThis room has the following enters :\n\n",
this_player() );
foreach( sExit in asEnters ) {
message( "my_action", sprintf( "\t%10s -> %s", sExit,
oEnv->GetEnter( sExit ) ), this_player() );
}
}
return 1;
}
string GetHelp(){
return ("Syntax: exits\n\nDisplays exit and enter "
"information for the current room.");
}