1 inherit "room/room";
2 
3 string messages;
4 int new_mail;
5 
reset(arg)6 reset(arg) {
7     if (arg)
8 	return;
9     set_light(1);
10     dest_dir = ({ "room/narr_alley", "north" });
11     short_desc = "The post office";
12     long_desc = "You are in the post office. Commands:\n" +
13 	"read         Read from the mailbox.\n" +
14 	"mail <name>  Mail to player 'name'.\n" +
15 	"from         List all headers.\n";
16     no_castle_flag = 1;
17 }
18 
init()19 init() {
20     ::init();
21     move_object(clone_object("obj/mail_reader"), this_player());
22 }
23 
exit()24 exit() {
25     object ob;
26     if (ob = present("mailread", this_player()))
27 	destruct(ob);
28 }
29 
query_mail(silent)30 query_mail(silent) {
31     string name;
32     string new;
33 
34     name = lower_case(call_other(this_player(), "query_name"));
35     if (!restore_object("room/post_dir/" + name) || messages == "") return 0;
36     if (silent) return 1;
37     new = "";
38     if (new_mail)
39 	new = " NEW";
40     write("\nThere is" + new + " mail for you in the post office\n"+
41         "   (south from village road).\n\n");
42     return 1;
43 }
44