int cmd_move( string a ) { mixed o1, o2; string str; int ret; if(member_group(geteuid(previous_object()), "ambassador")) return 0; if( !a || ( sscanf( a, "%s to %s", o1, o2 ) < 2 ) ) { notify_fail( SYNTAX ); return 0; } seteuid( geteuid( previous_object() ) ); o1 = ref_ob( o1 ); if( !objectp( o1 ) ) { notify_fail( wrap( "Could not identify " + identify( o1 ) + " as an object." ) ); return 0; } o2 = ref_ob( o2 ); if( !objectp( o2 ) ) { notify_fail( wrap( "Could not identify " + identify( o2 ) + " as an object." ) ); return 0; } set_ref( 0, o2 ); write( wrap( "Moving " + identify( o1 ) + " to " + identify( o2 ) + "..." ) ); ret = o1-> move( o2 ); switch( ret ) { case MOVE_OK: str = "Move OK.\n"; break; case MOVE_NOT_ALLOWED: str = "Move not allowed.\n"; break; case MOVE_NO_ROOM: str = "No room in object2 for object1\n"; break; case MOVE_DESTRUCTED: str = "Move destructed\n"; break; case MOVE_NO_DEST: str = "object2 is not a destination\n"; break; #ifdef MOVE_TOO_HEAVY case MOVE_TOO_HEAVY: str = "object1 too heavy for object2\n"; break; #endif /* MOVE_TOO_HEAVY */ #ifdef MOVE_DOOR_CLOSED case MOVE_DOOR_CLOSED: str = "The door is closed.\n"; break; #endif /* MOVE_DOOR_CLOSED */ default: str = "Error: move return code " + ret + "\n"; break; } if( ret == MOVE_OK ) { write( str ); return 1; } notify_fail( str ); return 0; }
int cmd_ilist(string str) { object ob; string file, *files; int deep_list, i, s; notify_fail(SYNTAX); if(!str) return 0; seteuid(geteuid(previous_object())); if(sscanf(str, "-R %s", file)) deep_list = 1; else if(sscanf(str, "-T %s", file)) deep_list = 2; else file = str; ob = ref_ob(file); if(!ob || !objectp(ob)) { notify_fail("Couldn't find object.\n"); return 0; } write(wrap("Files inherited by " + dump_variable(ob))); if(!deep_list) files = inherit_list(ob); else if(deep_list == 1) files = deep_inherit_list(ob); else if(deep_list == 2) return show_tree(ob, 1); for(i = 0, s = sizeof(files); i < s; i ++) printf(" %d: %s\n", i + 1, files[i]); return 1; } // do_cmd
int cmd_cref( string a ) { mixed ob; object new_ob; string name, num; seteuid( geteuid( previous_object() ) ); if( !a ) a = "#default"; ob = ref_ob( a ); if( !objectp( ob ) ) { notify_fail( wrap( "Could not identify " + identify( ob ) + " as an object." ) ); return 0; } name = file_name( ob ); if( sscanf( name, "%s#%s", ob, num ) < 2 ) ob = name; if( catch( new_ob = new( ob ) ) ) { notify_fail( "Could not clone " + ob + "\n" ); return 0; } write( "CLONE: You have created " + identify( new_ob ) + "\n" ); if( new_ob-> move( this_player() ) != MOVE_OK ) new_ob-> move( environment( this_player() ) ); set_ref( 0, new_ob ); return 1; }
int cmd_sc( string a ) { mixed ob; object obj; int i; seteuid( geteuid( previous_object() ) ); if( !a ) a = "here"; ob = ref_ob( a ); if( !objectp( ob ) ) { notify_fail( wrap( "Could not identify " + identify( ob ) + " as an object." ) ); return 0; } write( wrap( "Deep Scanning: " + identify( ob ) + " EUID(" + geteuid( ob ) + ") UID(" + getuid( ob ) + ")" ) ); sc_object( ob, " " ); set_ref( "default", ob ); set_ref( "sc", deep_inventory( ob ) ); return 1; }