ds2.9a12/bin/
ds2.9a12/extra/
ds2.9a12/extra/crat/
ds2.9a12/extra/creremote/
ds2.9a12/extra/mingw/
ds2.9a12/extra/wolfpaw/
ds2.9a12/fluffos-2.14-ds13/
ds2.9a12/fluffos-2.14-ds13/Win32/
ds2.9a12/fluffos-2.14-ds13/compat/
ds2.9a12/fluffos-2.14-ds13/compat/simuls/
ds2.9a12/fluffos-2.14-ds13/include/
ds2.9a12/fluffos-2.14-ds13/testsuite/
ds2.9a12/fluffos-2.14-ds13/testsuite/clone/
ds2.9a12/fluffos-2.14-ds13/testsuite/command/
ds2.9a12/fluffos-2.14-ds13/testsuite/data/
ds2.9a12/fluffos-2.14-ds13/testsuite/etc/
ds2.9a12/fluffos-2.14-ds13/testsuite/include/
ds2.9a12/fluffos-2.14-ds13/testsuite/inherit/
ds2.9a12/fluffos-2.14-ds13/testsuite/inherit/master/
ds2.9a12/fluffos-2.14-ds13/testsuite/log/
ds2.9a12/fluffos-2.14-ds13/testsuite/single/
ds2.9a12/fluffos-2.14-ds13/testsuite/single/tests/compiler/
ds2.9a12/fluffos-2.14-ds13/testsuite/single/tests/efuns/
ds2.9a12/fluffos-2.14-ds13/testsuite/single/tests/operators/
ds2.9a12/fluffos-2.14-ds13/testsuite/u/
ds2.9a12/lib/cmds/admins/
ds2.9a12/lib/cmds/common/
ds2.9a12/lib/cmds/creators/include/
ds2.9a12/lib/daemon/services/
ds2.9a12/lib/daemon/tmp/
ds2.9a12/lib/doc/
ds2.9a12/lib/doc/bguide/
ds2.9a12/lib/doc/efun/all/
ds2.9a12/lib/doc/efun/arrays/
ds2.9a12/lib/doc/efun/buffers/
ds2.9a12/lib/doc/efun/compile/
ds2.9a12/lib/doc/efun/floats/
ds2.9a12/lib/doc/efun/functions/
ds2.9a12/lib/doc/efun/general/
ds2.9a12/lib/doc/efun/mixed/
ds2.9a12/lib/doc/efun/numbers/
ds2.9a12/lib/doc/efun/parsing/
ds2.9a12/lib/doc/hbook/
ds2.9a12/lib/doc/help/classes/
ds2.9a12/lib/doc/help/races/
ds2.9a12/lib/doc/lfun/
ds2.9a12/lib/doc/lfun/all/
ds2.9a12/lib/doc/lfun/lib/abilities/
ds2.9a12/lib/doc/lfun/lib/armor/
ds2.9a12/lib/doc/lfun/lib/bank/
ds2.9a12/lib/doc/lfun/lib/bot/
ds2.9a12/lib/doc/lfun/lib/clay/
ds2.9a12/lib/doc/lfun/lib/clean/
ds2.9a12/lib/doc/lfun/lib/clerk/
ds2.9a12/lib/doc/lfun/lib/client/
ds2.9a12/lib/doc/lfun/lib/combat/
ds2.9a12/lib/doc/lfun/lib/connect/
ds2.9a12/lib/doc/lfun/lib/container/
ds2.9a12/lib/doc/lfun/lib/corpse/
ds2.9a12/lib/doc/lfun/lib/creator/
ds2.9a12/lib/doc/lfun/lib/daemon/
ds2.9a12/lib/doc/lfun/lib/damage/
ds2.9a12/lib/doc/lfun/lib/deterioration/
ds2.9a12/lib/doc/lfun/lib/donate/
ds2.9a12/lib/doc/lfun/lib/door/
ds2.9a12/lib/doc/lfun/lib/equip/
ds2.9a12/lib/doc/lfun/lib/file/
ds2.9a12/lib/doc/lfun/lib/fish/
ds2.9a12/lib/doc/lfun/lib/fishing/
ds2.9a12/lib/doc/lfun/lib/flashlight/
ds2.9a12/lib/doc/lfun/lib/follow/
ds2.9a12/lib/doc/lfun/lib/ftp_client/
ds2.9a12/lib/doc/lfun/lib/ftp_data_connection/
ds2.9a12/lib/doc/lfun/lib/fuel/
ds2.9a12/lib/doc/lfun/lib/furnace/
ds2.9a12/lib/doc/lfun/lib/genetics/
ds2.9a12/lib/doc/lfun/lib/holder/
ds2.9a12/lib/doc/lfun/lib/id/
ds2.9a12/lib/doc/lfun/lib/interactive/
ds2.9a12/lib/doc/lfun/lib/lamp/
ds2.9a12/lib/doc/lfun/lib/leader/
ds2.9a12/lib/doc/lfun/lib/light/
ds2.9a12/lib/doc/lfun/lib/limb/
ds2.9a12/lib/doc/lfun/lib/living/
ds2.9a12/lib/doc/lfun/lib/load/
ds2.9a12/lib/doc/lfun/lib/look/
ds2.9a12/lib/doc/lfun/lib/manipulate/
ds2.9a12/lib/doc/lfun/lib/meal/
ds2.9a12/lib/doc/lfun/lib/messages/
ds2.9a12/lib/doc/lfun/lib/player/
ds2.9a12/lib/doc/lfun/lib/poison/
ds2.9a12/lib/doc/lfun/lib/position/
ds2.9a12/lib/doc/lfun/lib/post_office/
ds2.9a12/lib/doc/lfun/lib/potion/
ds2.9a12/lib/doc/lfun/lib/room/
ds2.9a12/lib/doc/lfun/lib/server/
ds2.9a12/lib/doc/lfun/lib/spell/
ds2.9a12/lib/doc/lfun/lib/torch/
ds2.9a12/lib/doc/lfun/lib/vendor/
ds2.9a12/lib/doc/lfun/lib/virt_sky/
ds2.9a12/lib/doc/lfun/lib/weapon/
ds2.9a12/lib/doc/lfun/lib/worn_storage/
ds2.9a12/lib/doc/lpc/basic/
ds2.9a12/lib/doc/lpc/concepts/
ds2.9a12/lib/doc/lpc/constructs/
ds2.9a12/lib/doc/lpc/etc/
ds2.9a12/lib/doc/lpc/intermediate/
ds2.9a12/lib/doc/lpc/types/
ds2.9a12/lib/doc/misc/
ds2.9a12/lib/doc/old/
ds2.9a12/lib/domains/
ds2.9a12/lib/domains/Praxis/adm/
ds2.9a12/lib/domains/Praxis/attic/
ds2.9a12/lib/domains/Praxis/cemetery/mon/
ds2.9a12/lib/domains/Praxis/data/
ds2.9a12/lib/domains/Praxis/death/
ds2.9a12/lib/domains/Praxis/mountains/
ds2.9a12/lib/domains/Praxis/obj/armour/
ds2.9a12/lib/domains/Praxis/obj/magic/
ds2.9a12/lib/domains/Praxis/obj/weapon/
ds2.9a12/lib/domains/Praxis/orc_valley/
ds2.9a12/lib/domains/Ylsrim/
ds2.9a12/lib/domains/Ylsrim/adm/
ds2.9a12/lib/domains/Ylsrim/armor/
ds2.9a12/lib/domains/Ylsrim/broken/
ds2.9a12/lib/domains/Ylsrim/fish/
ds2.9a12/lib/domains/Ylsrim/meal/
ds2.9a12/lib/domains/Ylsrim/npc/
ds2.9a12/lib/domains/Ylsrim/obj/
ds2.9a12/lib/domains/Ylsrim/virtual/
ds2.9a12/lib/domains/Ylsrim/weapon/
ds2.9a12/lib/domains/campus/adm/
ds2.9a12/lib/domains/campus/etc/
ds2.9a12/lib/domains/campus/meals/
ds2.9a12/lib/domains/campus/save/
ds2.9a12/lib/domains/campus/txt/ai/charles/
ds2.9a12/lib/domains/campus/txt/ai/charles/bak2/
ds2.9a12/lib/domains/campus/txt/ai/charles/bak2/bak1/
ds2.9a12/lib/domains/campus/txt/ai/charly/
ds2.9a12/lib/domains/campus/txt/ai/charly/bak/
ds2.9a12/lib/domains/campus/txt/jenny/
ds2.9a12/lib/domains/cave/doors/
ds2.9a12/lib/domains/cave/etc/
ds2.9a12/lib/domains/cave/meals/
ds2.9a12/lib/domains/cave/weap/
ds2.9a12/lib/domains/default/creator/
ds2.9a12/lib/domains/default/doors/
ds2.9a12/lib/domains/default/etc/
ds2.9a12/lib/domains/default/vehicles/
ds2.9a12/lib/domains/default/virtual/
ds2.9a12/lib/domains/default/weap/
ds2.9a12/lib/domains/town/txt/shame/
ds2.9a12/lib/domains/town/virtual/
ds2.9a12/lib/domains/town/virtual/bottom/
ds2.9a12/lib/domains/town/virtual/space/
ds2.9a12/lib/estates/
ds2.9a12/lib/ftp/
ds2.9a12/lib/lib/comp/
ds2.9a12/lib/lib/daemons/
ds2.9a12/lib/lib/daemons/include/
ds2.9a12/lib/lib/lvs/
ds2.9a12/lib/lib/user/
ds2.9a12/lib/lib/virtual/
ds2.9a12/lib/log/
ds2.9a12/lib/log/adm/
ds2.9a12/lib/log/archive/
ds2.9a12/lib/log/chan/
ds2.9a12/lib/log/errors/
ds2.9a12/lib/log/law/adm/
ds2.9a12/lib/log/law/email/
ds2.9a12/lib/log/law/names/
ds2.9a12/lib/log/law/sites-misc/
ds2.9a12/lib/log/law/sites-register/
ds2.9a12/lib/log/law/sites-tempban/
ds2.9a12/lib/log/law/sites-watch/
ds2.9a12/lib/log/open/
ds2.9a12/lib/log/reports/
ds2.9a12/lib/log/router/
ds2.9a12/lib/log/secure/
ds2.9a12/lib/log/watch/
ds2.9a12/lib/obj/book_source/
ds2.9a12/lib/obj/include/
ds2.9a12/lib/powers/prayers/
ds2.9a12/lib/powers/spells/
ds2.9a12/lib/realms/template/adm/
ds2.9a12/lib/realms/template/area/armor/
ds2.9a12/lib/realms/template/area/npc/
ds2.9a12/lib/realms/template/area/obj/
ds2.9a12/lib/realms/template/area/room/
ds2.9a12/lib/realms/template/area/weap/
ds2.9a12/lib/realms/template/bak/
ds2.9a12/lib/realms/template/cmds/
ds2.9a12/lib/save/kills/o/
ds2.9a12/lib/secure/cfg/classes/
ds2.9a12/lib/secure/cmds/builders/
ds2.9a12/lib/secure/cmds/creators/include/
ds2.9a12/lib/secure/cmds/players/
ds2.9a12/lib/secure/cmds/players/include/
ds2.9a12/lib/secure/daemon/imc2server/
ds2.9a12/lib/secure/daemon/include/
ds2.9a12/lib/secure/lib/
ds2.9a12/lib/secure/lib/include/
ds2.9a12/lib/secure/lib/net/include/
ds2.9a12/lib/secure/lib/std/
ds2.9a12/lib/secure/log/adm/
ds2.9a12/lib/secure/log/bak/
ds2.9a12/lib/secure/log/intermud/
ds2.9a12/lib/secure/log/network/
ds2.9a12/lib/secure/modules/
ds2.9a12/lib/secure/npc/
ds2.9a12/lib/secure/obj/include/
ds2.9a12/lib/secure/room/
ds2.9a12/lib/secure/save/
ds2.9a12/lib/secure/save/backup/
ds2.9a12/lib/secure/save/boards/
ds2.9a12/lib/secure/tmp/
ds2.9a12/lib/secure/upgrades/files/
ds2.9a12/lib/secure/verbs/creators/
ds2.9a12/lib/std/board/
ds2.9a12/lib/std/lib/
ds2.9a12/lib/tmp/
ds2.9a12/lib/verbs/admins/include/
ds2.9a12/lib/verbs/builders/
ds2.9a12/lib/verbs/common/
ds2.9a12/lib/verbs/common/include/
ds2.9a12/lib/verbs/creators/
ds2.9a12/lib/verbs/creators/include/
ds2.9a12/lib/verbs/rooms/
ds2.9a12/lib/verbs/rooms/include/
ds2.9a12/lib/www/client/
ds2.9a12/lib/www/errors/
ds2.9a12/lib/www/images/
ds2.9a12/lib/www/lpmuds/downloads_files/
ds2.9a12/lib/www/lpmuds/intermud_files/
ds2.9a12/lib/www/lpmuds/links_files/
ds2.9a12/win32/
chapter 19 "Doors"
		   Creating Doors between Two Rooms
		     The Nightmare IV LPC Library
		 created by Descartes of Borg 950419

This document describes how to build door-type objects which link two
rooms.  These door-type objects do not need to be doors, but in fact
can be windows or boulders or any other such object.  The Nightmare IV
LPC Library door object, unlike the old way of doing doors, is an
object separate from the rooms it connects.  In other words, in order
to build a door, you have three objects (just as you would visualize):
two rooms and a door.

The door object is /lib/door.c.  To inherit it, #include <lib.h> and
inherit LIB_DOOR;.  An example door may be found in
/domains/Examples/etc/door.c as well as the rooms
/domains/Examples/room/doorroom1.c and /domains/Examples/room/doorroom2.c.

Setting up the door object
The first thing you must do is create the door object.  You must
visualize this door object just like a door connecting two rooms in
real life.  You have a room on each side with a single door with two
sides.  Technically, a door object may have any number of sides.
Practically speaking, most people using this object will be using it
as a door, which means it will have two sides.

To create a door object, you simply describe each side of the door.
The easiest way to do this is through the SetSide() function.

mapping SetSide(string side, mapping mp);

Example:

	SetSide("east", ([ "id" : "red door", "short" : "a red door",
	                  "long" : "A freshly painted red door.",
                          "lockable" : 0 ]) );

The name of the side is simply the exit used by the room which sees
that side.  For example, if in one room the door is at the east exit,
then the side is identified as east.  The mapping consists of the
following data:

"id"
What a person on that side calls the door.  For example, you can have a
door blue on one side and red on the other.  On one side, you go east
to go through the door, and from that room the door appears red.  The
id for that side might be "red door".  The id for the other side might
be "blue door".

"short" 
The short description for the door as seen from the side in question.
This can be a function or a string.

"long"
The long description for the door as seen from the side in question.
Whether the door is open or not will be added to the long if the long
is a string.  This can be either a string or function.  If it is a
function, you must specify whether the door is open or close on your
own.

"lockable"
0 if the door cannot be locked (and unlocked) from that side, 1 if it
can.

"keys"
An array of id's of objects which can be used to unlock it if it is
lockable.  Lockable doors do not need keys.

II.  Setting up the rooms
After you have called SetItems() and SetExits() in the room
(remembering to set the exit for the exit with the door), call the
function SetDoor().

string SetDoor(string dir, string doorfile);

Example: SetDoor("east", "/realms/descartes/doors/red_door");

Sets the exit named to be blocked by a door object when that door
object is closed.

This is all you need to do in the room.  Note that the exit name
corresponds to the side name mentioned in the door.

III. Advanced Door Stuff
At this point, you should know how to do the minimum stuff to build a
door.  This section goes into detail about door functions and how you
can do advanced things with doors by manipulating door events.  This
section has two parts, door data functions and door events.

a. Door Data Functions

*****
SetSide()
*****
mapping SetSide(string side, mapping mp);

As described above.

*****
SetClosed()
*****
static int SetClosed(int x)

Example: SetClosed(1);

This function can only be called from inside the door object.
Generally you use it to set the initial state of the door.  If you
want to close the door at any other time, or to close it from another
object, use eventClose() or eventOpen().

*****
SetLocked()
*****

static int SetLocked(int x)

Example: SetLocked(1);

Like SetClosed(), this function should only be used from create()
inside the door object to set the initial state of the door.  At other
times, use eventLock() or eventUnlock().

*****
SetLockable()
*****

int SetLockable(string side, int x)

Example: SetLockable("east", 1);

Sets a side as being able to be locked or unlocked.  Since it is done
by sides, this means you can have one side not be lockable with the
other side being lockable.  The first argument is the side being set
lockable or not lockable, the second argument is 1 for lockable and 0
for not lockable.

*****
SetId()
*****

string SetId(string side, string id)

Example: SetId("west", "blue door");

This is not like your traditional SetId() function.  Instead, it sets
a single way of identifying the door from a given side.  It is what
the player might use to open the door or look at it.

*****
SetShort()
*****

mixed SetShort(string side, string | function desc)

Examples:
	SetShort("north", "a red door");
	SetShort("west", (: GetWestShort :) );

Sets the short description for a given side of a door.  If the second
argument is a function, it gets passed as an argument the name of the
side for which the function serves as a description.  That function
should return a string.  For the above:

string GetWestShort(string dir) {
    if( query_night() ) return "a shadowy door";
    else return "a red door";
}

*****
SetLong()
*****

mixed SetLong(string side, string | function desc)

Examples:
	SetLong("south", "An old, dusty door covered in cobwebs.");
	SetLong("east", (: GetEastLong :))

This works much like the SetShort() function, except it handles the
long description.  It is important to note that if the second argument
is a string, that the state of the door will be added onto the long
description automatically.  In other words "It is open." will appear
as the second line.  This will *not* be done if you use a function for
your long description.

*****
SetKeys()
*****

string *SetKeys(string side, string *keys)

Example: SetKeys("east", ({ "skeleton key", "special key" }));

Builds an array of id's which can be used to unlock the door if it is
lockable from this side. In other words, a person can only unlock the
door if that person has an object which has one of the id's you
specify for its id.

b. Events

*****
eventOpen()
*****

varargs int eventOpen(object by, object agent)

Examples:

"/realms/descartes/etc/red_door"->eventOpen(this_object());

int eventOpen(object by, object agent) {
    if( query_night() ) return 0; /* Can't open it at night */
    else return door::eventOpen(by, agent);
}

The function that actually allows the door to be opened externally.
It returns 1 if the door is successfully opened.  It returns 0 if it
fails.  The first argument is the room object from which the door is
being opened.  The second argument, which is optional, is the living
thing responsible for opening the door.

The first example above is an example of what you might do from
reset() inside a room in order to have the door start open at every
reset.

The second example above is an example of how you might conditionally
prevent the door from opening by overriding the Open event.  In this
case, if it is night, you cannot open this door.  If it is day, you
can. 

*****
eventClose()
*****

varargs int eventClose(object by, object agent)

Example: See eventOpen()

This function works just like eventOpen(), except it does the closing
of the door.

*****
eventLock()
*****

varargs int eventLock(object by, object agent)

Example: see eventOpen()

This function works just like eventOpen(), except that it gets called
for locking the door.

*****
eventUnlock()
*****

varargs int eventUnlock(object by, object agent)

Example: See eventOpen()

This function works just like eventOpen(), except that it gets called
for unlocking the door.