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/
			   Building Armours
		     The Nightmare IV LPC Library
		 written by Descartes of Borg 950430

Armour has changed quite a bit from the days of armour class.  The
Nightmare IV LPC Library now uses damage types, which means armour that
is great against one attack may be pathetic against another.  In fact,
in building armour, it is important that you keep in mind weaknesses.
Fortunately, armour is by default absolutely pathetic.  If you go
making it awesome, chances are that it will not make it through the
approval process.  This document is designed to get you started
building armour as well introduce you to the features available to
make unique and interesting armour.

I. Basic Armour
You should be familiar with /doc/build/Items, as armour is just a
special type of item.  It therefore has all of the features of regular
items. 



The basic armour looks like this:

#include <lib.h>              /* see this everywhere */
#include <armour_types.h>     /* a listing of armour types */
#include <damage_types.h>     /* a listing of damage types */

inherit LIB_ARMOUR;           /* the armour inheritable */

static void create() {
    armour::create();         /* call create() in armour.c */
    SetKeyName("rusty helm");
    SetId( ({ "helm", "rusty helm", "a rusty helm" }) );
    SetAdjectives( ({ "rusty" }) );
    SetShort("a rusty helm");
    SetLong("A rusty helmet which will be better than nothing on your head.");
    SetMass(75);
    SetValue(200);
    SetDamagePoints(1000);    
    SetProtection(BLUNT, 4);   /* SetProtection() sets the sort of */
    SetProtection(BLADE, 3);   /* protection for a given damage type */
    SetProtection(KNIFE, 3);
    SetArmourType(A_HELMET);     /* set what kind of armour this is */
}

As you can see, there is very little that you have to do specific to
armour.  The only armour specific call you MUST make is
SetArmourType().  Everything else is fluff.

int SetArmourType(int type)
Armour types are found in /include/armour_types.h.  The armour type
basically determines where the armour is worn.  Each monster,
depending on its race, has for each limb a list of armour types which
may be worn on that limb.  For example, most monsters have heads.
Some have two heads.  You do not have to worry about this.  They know
that they can wear anything that is A_HELMET on their heads.  What if
you have something that may not be wearable on all monsters?  Like,
for example, you have body armour which should only go on two armed
beings?  See SetRestrictLimbs() later.  It allows you to restrict
exactly which kinds of limbs can wear the armour.

int SetProtection(int type, int amount);
Without this call, armour is nothing.  Just something you wear.  This
allows you to make clothes, which may protect against COLD, but do not
do a thing when struck with a sword.  Protection is a number between 0
and 100.  Refer to approval documentation for details on what levels
are appropriate, as well as for information on mass and value levels.

That's it for the basics!

II. Advanced Function Calls
The Nightmare IV LPC Library armour object is fairly flexible for
allowing you to do interesting things with your armours.  In this
section, you will learn about other function calls you can make to
customize your armour.

string *SetRestrictLimbs(string *limbs);
Example:
	SetRestrictLimbs( ({ "right arm", "left arm", "torso" }) );

For armours which can only be on certain body configurations, for
example regular armour (A_ARMOUR) should only be worn on people with
the same number of hands, this function allows you to restrict the
armour to being worn only on the limbs you name.  If the person trying
to wear the armour does not have one of those limbs, any attempt to
wear fails.

int SetFingers(int num);
Example:
	SetFingers(5);

Used for the glove types.  If a person has more fingers on the limb on
which they are trying to wear a glove type than the glove has spaces
for, the wear fails.

mixed SetWear(string | function val);
Examples:
	SetWear("The cloak feels all yucky on you.");
	SetWear( (: CheckArtrell :) );

Allows you to create a special message seen by the person wearing the
item when they wear it if you pass a string.  On the other hand, if
you pass a function, it will call that function to see if the person
can wear the item.  The function should be of the form:
	int WearFunc();

For example:

int CheckArtrell() {
    if( (string)this_player()->GetRace() == "artrell" ) {
        write("The rusty helm makes you feel safe.");
        say((string)this_player()->GetName() + " wears a rusty helm.");
        return 1;
    }
    else {
        write("You cannot wear that you bum!");
        return 1;
    }
}

III. Function Overrides
The only function of interest that you might want to override is a
function called eventReceiveDamage().  This function is called every
time the armour is hit to see how much of the damage it absorbs.  It
looks like this:

int eventReceiveDamage(int type, int strength, int unused, mixed limbs);

This function is called by combat to determine how much damage the
armour absorbs for a given bit of damage being done.  It thus should
return how much damage it takes.  

You should always at some point call item::eventReceiveDamage() so
that it can do its processing.  You do not want to call it, however,
until you determine how much damage you are absorbing unnaturally.
Here is a sample one for an armour that does extra protection for fighters:

int eventReceiveDamage(int type, int strength, int blah, mixed limbs) {
    object who_is_wearing;
    int x;

    if( !(who_is_wearing = environment()) ) /* eek! no one wearing */
	return 0;
    if( (int)who_is_wearing->ClassMember("fighter") ) /* reduce strength */
        x = strength - random(5); 
    if( x < 1 ) return strength; /* protect against all the damage */
    return armour::eventReceiveDamage(type, x, blah, limbs);
}

Keep in mind what eventReceiveDamage() in armour.c is doing.  First,
it is modifying the strength of the blow based on the protections you
set with SetProtection().  Then, it is having the armour take damage
based on how much it absorbed.  So you need to call
eventReceiveDamage() in armour at the point where you have a value you
want the armour to do its normal stuff with.  In the example above, we
wanted to magically protect fighters against a random(5) points of
damage without having the armour take any damage for that.  Then if
there is still strength left in the blow, the armour does its normal
protection. 

What else can you do with this?  Imagine an armour that turns all cold
damage back on the attacker?

int eventReceiveDamage(int type, int strength, int unused, mixed limbs) {
    object who_wearing, enemy;

    enemy = (object)(who_wearing = previous_object())->GetCurrentEnemy();
    if( !enemy || !(type & COLD) ) 
      return armour::eventReceiveDamage(type, strength, unused, limbs);
    limbs = enemy->GetTargetLimb(0);
    message("environment", "Your anti-cold throws the frost in your "
      "enemy's face!", who_wearing);
    message("environment", "Your cold attack is turned back upon you!",
        enemy);
    enemy->eventReceiveDamage(COLD, strength, unused, limbs);
    return strength; /* we absorb all of the strength but take no damage */
}

	Descartes of Borg
	borg@imaginary.com