nightmare3_fluffos_v2/
nightmare3_fluffos_v2/bin/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/ChangeLog.old/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/Win32/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/simuls/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/clone/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/command/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/data/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/etc/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/master/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/log/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/compiler/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/efuns/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/operators/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/u/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/tmp/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/windows/
nightmare3_fluffos_v2/lib/cmds/ambassador/
nightmare3_fluffos_v2/lib/cmds/database/
nightmare3_fluffos_v2/lib/cmds/hm/
nightmare3_fluffos_v2/lib/cmds/soul/
nightmare3_fluffos_v2/lib/daemon/cfg/
nightmare3_fluffos_v2/lib/daemon/cfg/mon_races/
nightmare3_fluffos_v2/lib/daemon/cfg/races/
nightmare3_fluffos_v2/lib/daemon/include/
nightmare3_fluffos_v2/lib/daemon/save/
nightmare3_fluffos_v2/lib/daemon/services/
nightmare3_fluffos_v2/lib/daemon/soul/
nightmare3_fluffos_v2/lib/doc/
nightmare3_fluffos_v2/lib/doc/TestPlans/
nightmare3_fluffos_v2/lib/doc/approval/
nightmare3_fluffos_v2/lib/doc/approval/QC/
nightmare3_fluffos_v2/lib/doc/approval/balance/
nightmare3_fluffos_v2/lib/doc/build/
nightmare3_fluffos_v2/lib/doc/build/armours/
nightmare3_fluffos_v2/lib/doc/build/economy/
nightmare3_fluffos_v2/lib/doc/build/etc/
nightmare3_fluffos_v2/lib/doc/build/monster/
nightmare3_fluffos_v2/lib/doc/build/room/
nightmare3_fluffos_v2/lib/doc/build/virtual/
nightmare3_fluffos_v2/lib/doc/build/weapon/
nightmare3_fluffos_v2/lib/doc/classes/
nightmare3_fluffos_v2/lib/doc/efun/
nightmare3_fluffos_v2/lib/doc/etc/
nightmare3_fluffos_v2/lib/doc/help/creator/
nightmare3_fluffos_v2/lib/doc/help/hm/
nightmare3_fluffos_v2/lib/doc/law/
nightmare3_fluffos_v2/lib/doc/lpc/basic/
nightmare3_fluffos_v2/lib/doc/lpc/data_types/
nightmare3_fluffos_v2/lib/doc/lpc/etc/
nightmare3_fluffos_v2/lib/doc/lpc/intermediate/
nightmare3_fluffos_v2/lib/doc/lpc/types/
nightmare3_fluffos_v2/lib/doc/mudlib/
nightmare3_fluffos_v2/lib/doc/mudlib/features/
nightmare3_fluffos_v2/lib/domains/Examples/etc/
nightmare3_fluffos_v2/lib/domains/Examples/room/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaA/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaB/
nightmare3_fluffos_v2/lib/domains/Examples/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/
nightmare3_fluffos_v2/lib/domains/Praxis/adm/
nightmare3_fluffos_v2/lib/domains/Praxis/attic/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/mon/
nightmare3_fluffos_v2/lib/domains/Praxis/data/
nightmare3_fluffos_v2/lib/domains/Praxis/death/
nightmare3_fluffos_v2/lib/domains/Praxis/mountains/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/armour/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/magic/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/orc_valley/
nightmare3_fluffos_v2/lib/domains/Praxis/quests/
nightmare3_fluffos_v2/lib/domains/Praxis/standardOld/
nightmare3_fluffos_v2/lib/include/
nightmare3_fluffos_v2/lib/log/
nightmare3_fluffos_v2/lib/log/errors/
nightmare3_fluffos_v2/lib/log/reports/
nightmare3_fluffos_v2/lib/log/watch/
nightmare3_fluffos_v2/lib/news/
nightmare3_fluffos_v2/lib/secure/cfg/
nightmare3_fluffos_v2/lib/secure/cmds/ambassador/
nightmare3_fluffos_v2/lib/secure/cmds/mortal/
nightmare3_fluffos_v2/lib/secure/save/users/d/
nightmare3_fluffos_v2/lib/secure/std/
nightmare3_fluffos_v2/lib/std/hm/
nightmare3_fluffos_v2/lib/std/living/
nightmare3_fluffos_v2/lib/std/room/
nightmare3_fluffos_v2/lib/std/user/
nightmare3_fluffos_v2/lib/std/virtual/
nightmare3_fluffos_v2/lib/www/
nightmare3_fluffos_v2/lib/www/errors/
nightmare3_fluffos_v2/lib/www/gateways/
nightmare3_fluffos_v2/win32/
              Coding Light Sources Using the Nightmare IV Mudlib
                             Descartes of Borg
                                  940428

This document details how to build light sources using the standard light
source object.  Any light source should inherit and make use of the
features of this object, as other objects on the MUD depend on these
features being in light source type objects.  A light source type
object is something like a torch or a lamp or a match which may be used
to change the lighting of a room or area.

The standard light source object is /std/light.c.  Examples of two such
objects are /d/Examples/etc/torch.c and /d/Examples/etc/match.c.  More
than anything else, these examples should help you come to understand what
the standard light object is doing.

***************************************************************************

Part I: Required Calls
----------------------

/std/light.c inherits /std/weapon.c which inherits /std/Object.c.  Thus,
any object inheriting light.c needs to make all of the needed function
calls of any object, as well as those of a weapon (if you do not disable
the weapon functionality of the light object).  The standard Object
function calls which are mandatory:

set_name("torch");
set_id( ({ "torch", "a wooden torch" }) );
set_adjectives( ({ "a", "small", "wooden" }) );
set_short("a small wooden torch");
set_long("This wooden torch will only last so long you imagine.");
set_mass(70);
set_value(50);

If you are allowing the object to funcion as a weapon, it needs these
function calls as well:

set_type("blunt");
set_wc(2);
set_ac(1);

And, of course, there are function calls you always must make for the light
item itself:

varargs void set_light(int strength, string cmd_light, string cmd_ext);
Example: set_light(2, "light", "extinguish");

This sets up the light object.  The first argument is how strong the light
is.  Consult the table of light values in the room document directory as
well as any relevant balance documents.  The second argument is the command
a player uses in order to light the object.  The third argument is the
command the player uses to extinguish the object.  The second and third
arguments are optional.  If they are not given, then the default commands
are "light" and "extinguish".  You may also disable commands from being
used to light or extinguish the light object, but more on that later.

void set_fuel_required(int x);
Example: set_fuel_required(1);

Sets whether or not the object needs fuel in order to burn.  1 means that
fuel is required.  0 means it is not required.  You must set_burnt_value() 
if your light object requires fuel.

void set_fuel(int x);
Example: set_fuel(300);

Sets how much fuel the light object has.  Only needed if you require
fuel.  The value is how long in seconds the object can stay lit.

void set_source_required(int x);
Example: set_source_required(1);

Sets whether or not an external, burning light source is needed in order
to light this one.  For example, you might need a match burning in order
to light a torch.  A value of 1 means you need soemthing elsewith which
to light it.  A value of 0 means it can be lit on its own.

void set_fire(int x);
Example: set_fire(1);

Sets whether or not the light object is on fire (like a torch) or
simply glowing (like a lamp).

That is all a light object requires!

************************************************************************

Part II: Optional Functionality
-------------------------------

The following functions help add interesting features to your light
source, but they are not required in order to make a light source
work:

void set_burnt_value(int x);
Example: set_burnt_value(10);

Sets the value an object will have after its fuel is exhausted.  Required
for any object that requires fuel.

void set_disable_weapon(int x);
Example: set_disable_weapon(1);

If you pass 1, then a player cannot use the light source as a weapon.
If you do not call this function, or if you pass 0, then the light
source may be used as a weapon and you must make sure to make the 
minimal weapon calls as listed above.

void set_disable_commands(int x);
Example: set_disable_commands(1);

If you pass 1, then no player commands may be used to light the
light source.  Useful for magical light sources and such.  If you
do not call this function, or if 0 is passed, then player commands
as you set up in set_light() will work.

void set_light_function(function f);
Example: set_light_function( (: this_object(), "check_indoors" :) );

Sets up a function which gets called any time a player tries
to use the lighting command to light the object.  If that function
returns 1, then the object can be lit.  If it returns 0, then the
object will not be allowed to be lit.  Any object being used to light
the object is passed to your function.  So your function should
look like:

int check_indoors(object ob) {
    if((int)environment(this_player())->query_property("indoors")) {
        write("You cannot light that indoors!");
        return 0;
    }
    else {
        write("You light the torch.");
        say((string)this_player()->query_cap_name()+" lights the torch.");
        return 1;
    }
}

void set_extinguish_function(function f);
Example: set_extinguish_function( (: this_object(), "check_indoors" :) );

Exactly the same as set_light_function(), except it gets called