/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/function/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
inherit "inherit/room2";

static string *players;
static status pannel;

reset(arg) {
  pannel = 0;
  if(!present("samantha")) {
    move_object(clone_object("room/city/pub/sam"),this_object());
  }

  if(arg) return;

  players = ({});
  set_weather(1, 1, 0);
  set_short("the inn above skandles downfall");
  set_long(
	"The shadows from the fire in the bar spread their long dark \n"+
	"fingers across the floor and walls here, enveloping everything \n"+
	"in a soft, blanket of grey. A long thin wooden staircase extends \n"+
	"upward to the north, and a small table against the base of the   \n"+
	"staircase bears a small white book with a blue grey cover.       \n");
  
  search_array = ({
   "pannel", "It looks like you might be able to move it",
    "room", "One of the pannels on the wall looks like it might"
    "be able to be moved"
  });
  set_items(({
        "book#register",
	"It appears to be the register for the inn and the rooms upstairs.\n"+
	"Perhaps you could read it?",

	"stairs#staircase#stair",
	"A thin wooden staircase of old rotting wood creaks upward "+
	"to the rooms of the inn",

	"shadows#shadow#fingers#finger#darkness#blanket",
	"They eminate from the bar",

	"bar", "It is in the next room",

	"floor",
	"The floor is made of simple wooden boards, once polished to a \n"+
	"high sheen, and now scuffed and dirty with the many travellers \n"+
	"who havepassed through here on their journeys",

	"wall#walls",
	"The walls are made of wood pannels",
	"pannel#pannels",
	"As you look closer at one of the pannels it seems to be slightly \n"+
	"adjar from the others. Perhaps you could move it?"
  }));

  set_exits(({
   "room/city/pub/inn2", "up",
   "room/city/pub/pub",   "south"
  }));
}

init() {
  add_action("read", "read");
  add_action("move_pannel", "move");
  add_action("enter", "enter");
  add_action("enter", "squeeze");
  add_action("enter", "crawl");
  ::init();
}

read(string str) {
  string tmp;
  if(str == "book" || str == "register") {
    write("If you want to rent a room, just ask samantha about one.\n");
    write("To rent a room - say <room> \n");
    if(!players || !sizeof(players)) {
      write("No one has checked into the inn today.\n");
      return 1;
    }
    write("The following people are staying here in the inn...\n");
    tmp = implode(players, ",");
    write("\t"+ tmp +"\n");
    say(this_player()->query_name() +" reads the inn's register.\n");
    return 1;
  }
return 0;
}

move_pannel(string str) {
  if(str == "pannel") {
    if(pannel) {
      write("The pannel has already been moved to one side.\n");
      write("It reveals a hole in the wall big enough to crawl through.\n");
      return 1;
    }
    write("You move the pannel in the wall to one side.\n");
    write("It reveals a hole in the wall big enough to crawl through.\n");
    pannel = 1;
    say(this_player()->query_name() +" opens a pannel in the wall.\n");
    return 1;
  }
return 0;
}

enter( string str) {
  string tmp1, tmp2;
  if(str == "hole" || str == "through hole" || 
     str == "wall" || str == "through wall") {
     if(!pannel) return 0;
     else {
       write("You squeeze through the hole in the wall.\n");
       if(!this_player()->query_stealth_on())
         say(this_player()->query_name() +" crawls through a hole in "+
         "the wall.\n");
       move_object(this_player(), "room/city/pub/saferoom");
       command("look", this_player());
       return 1;
     }
  }
}

add_players(string str) {
  if(!str || query_players(str)) return;
  return players += ({ str, });
}

query_players(string str) {
  if(!players || !sizeof(players)) return;
  if(member_array(str, players) != -1) return str;
  return;
}