void goto_the(string location, string dir) { object room; string error; event("body_leave", this_player()); this_player()->query_environment()->tell_room(this_player(), this_player()->query_Name() + " leaves " + dir + ".\n"); error = catch(this_player()->move(location)); /* Need to do last exit stuff XXX */ if (error) { if (query_wizard(this_player()) == 1) { write("\nConstruction blocks your path.\n" + "Error: " + error + "\n"); return; } else { write ("\nConstruction blocks your path.\n"); } } call_other(this_player(), "do_look",this_environment()); room = this_player()->query_environment(); room->event("body_enter", this_player()); room->tell_room(this_player(), this_player()->query_Name() + " enters.\n"); }
void main( string arg ) { string file; string *tmp; string *lines; int i; int where; if ( !arg || arg == "" ) { arg = "help"; } arg = lowercase(arg); file = normalize_path( arg, "/help/" ); if( file_exists( file ) < 1 ) { if( query_wizard( this_player() ) ) { file = normalize_path( arg, "/help/wiz/"); if( file_exists(file) < 1 ) { write( capitalize(arg) + ": Unknown help topic." ); LOG_D->write_log("help", capitalize(this_player()->query_name()) + " on " + ctime(time()) + ": " + arg + "\n"); return; } } else { write( capitalize(arg) + ": Unknown help topic." ); write_file("/logs/help", capitalize(this_player()->query_name()) + " on " + ctime(time()) + ": " + arg + "\n"); return; } } tmp = explode( read_file( file ), "\n" ); lines = ({ });
void main( string str ) { if (str != "") { if ( !this_player()->is_player() || query_wizard( this_player() ) ) { this_player()->query_environment()->tell_room( nil, capitalize(this_player()->query_name()) + " " + str) ; } else { this_player()->query_environment()->tell_room( nil, "-> " + capitalize(this_player()->query_name()) + " " + str); } } }
nomask int query_mortal(mixed player) { if (objectp(player)) { if (!player <-"/sys/obj/player") { return 0; } player = player->query_name(); } else { argcheck(stringp(player), 1, "player object or string"); } return !query_wizard(player); }
nomask int hat_stat_cmd(string str) { object obj; obj = get_teleport_destination(); if (!nilp(obj)) { write("Teleport destination: " + obj->query_short()); if (query_wizard(this_player())) { write("\t" + teleport_destination); } return 1; } write("Teleport destination has not yet been set."); return 1; }
int do_loan(string str) { int amount; if (query_wizard(this_player())) { if (sscanf(str, "%d",amount)) { this_player()->add_money("ducat", amount); write("The bank loans you " + amount + " ducats.\n"); return 1; } else { write("Usage: loan (amount)\n"); return 1; } } return 0; }
void give_castle(string who) { object player; player = this_environment()->present(who); if (player) { if (query_wizard(player)) { /* XXX Not sure if want to do castles that way or not so do this instead for now */ this_environment()->tell_room(this_object(), "Leo says: I seem to " + "have missplaced my portable castles, please come back later."); } else { this_environment()->tell_room(this_object(), "Leo says: sorry " + player->query_Name() + " you need to be a wizard to get a castle."); } } }