daleken/
daleken/data/notes/
daleken/data/player/
daleken/data/system/poses/
daleken/doc/Homepage/images/
daleken/log/
/*___________________________________________________________________________*
   )()(			  DalekenMUD 1.12 (C) 2000			)()(
   `]['		       by Martin Thomson, Lee Brooks,			`]['
    ||		       Ken Herbert and David Jacques			 ||
    || ----------------------------------------------------------------- ||
    || Envy Diku Mud improvements copyright (C) 1994 by Michael Quan,	 ||
    || David Love, Guilherme 'Willie' Arnold, and Mitchell Tse.		 ||
    || Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael	 ||
    || Chastain, Michael Quan, and Mitchell Tse.			 ||
    || Original Diku Mud copyright (C) 1990, 1991			 ||
    || by Sebastian Hammer, Michael Seifert, Hans Henrik St{rfeldt,	 ||
    || Tom Madsen, and Katja Nyboe.					 ||
    || ----------------------------------------------------------------- ||
    || Any use of this software must follow the licenses of the		 ||
    || creators.  Much time and thought has gone into this software and	 ||
    || you are benefitting. We hope that you share your changes too.	 ||
    || What goes around, comes around.					 ||
    || ----------------------------------------------------------------- ||
    ||				const.h					 ||
    || This file contains #defines for all constant values.		 ||
 *_/<>\_________________________________________________________________/<>\_*/


#define args( list )			list
#define DECLARE_DO_FUN( fun )		DO_FUN	  fun
#define DECLARE_SPEC_FUN( fun )		SPEC_FUN  fun
#define DECLARE_SPELL_FUN( fun )	SPELL_FUN fun
#define DECLARE_READ_FUN( fun )		READ_FUN fun

/*
 * Game parameters.
 *
 * Increase the max'es if you add more of something.  Adjust the pulse
 * numbers to suit yourself.
 */
#define MAX_SKILL		351	/* Number of skills		*/
#define MAX_CLASS		23	/* Total number of classes	*/
#define AVAIL_CLASS		5	/* Number of base classes	*/
#define NUM_MULTI_CLASS		5	/* Should be the same as above	*/
#define MAX_RACE		41	/* Number of races		*/
#define MAX_BOARD		8	/* Notice boards for notes	*/

#define MAX_LEVEL		1000	/* Absolute maximum level	*/
#define L_OVL		    MAX_LEVEL	/* Overlord			*/
#define L_MAS			900	/* Master			*/
#define L_MBLD			850	/* Master Builder (Architect)	*/
#define L_SEN			800	/* Senior			*/
#define L_JUN			700	/* Junior			*/
#define L_ARCH			650	/* Archangel			*/
#define L_APP			500	/* Apprentice			*/
#define L_BLD			400	/* Builder			*/
#define L_ANG			300	/* Angel			*/
#define LEVEL_IMMORTAL		L_ANG
#define LEVEL_HERO		250	/* Maximum player level		*/
#define L_HER			LEVEL_HERO

/*
 * Timing.
 */
#define PULSE_PER_SECOND	    4
#define PULSE_VIOLENCE		  (  3 * PULSE_PER_SECOND )
#define PULSE_MOBILE		  (  7 * PULSE_PER_SECOND )
#define PULSE_TICK		  ( 30 * PULSE_PER_SECOND )
#define PULSE_AREA		  ( 60 * PULSE_PER_SECOND )
#define PULSE_DB_DUMP		  ( 1800* PULSE_PER_SECOND ) /* 30 minutes */


/*
 * String and memory management parameters.
 */
#define MAX_KEY_HASH		1024
#define MAX_STRING_LENGTH	4096
#define MAX_INPUT_LENGTH	256
#define SMALL_OUTBUF_SIZE	2048
#define MAX_CHUNKS		20	/*   Used in ssm.c  */
#define MAX_VECTOR		2


/*
 * Limits for CPU time used.
 *
 * Note: ALARM_BOOT_DB should be less than ALARM_FREQUENCY.  If the MUD takes
 * longer to boot and you have to increase this value, then the other values
 * should be increased correspondingly.
 *
 * ALARM_BOOT_DB and ALARM_RUNNING are in 1/10ths of seconds.
 */
#define ALARM_FREQUENCY		20	/* checked every 20 seconds	*/
#define ALARM_BOOT_DB		150	/* allow for 15 seconds to boot */
#define ALARM_RUNNING		50	/* 5 sec of CPU time every 20 sec */


/*
 * Utility macros.
 */
#define UMIN( a, b )		( (a) < (b) ? (a) : (b) )
#define UMAX( a, b )		( (a) > (b) ? (a) : (b) )
#define URANGE( a, b, c )	( (b) < (a) ? (a)	\
				  : ( (b) > (c) ? (c)	\
					: (b) ) )
#define LOWER( c )		tolower( (c) )
#define UPPER( c )		toupper( (c) )
/* #define UPPER( c )		( ( (c) >= 'a' && (c) <= 'z' )	\
				  ? ( (c) + 'A' - 'a' ) : (c) ) */
#define IS_SET( flag, bit )	( (flag) &   (bit) )
#define SET_BIT( var, bit )	( (var)	 |=  (bit) )
#define REMOVE_BIT( var, bit )	( (var)	 &= ~(bit) )
#define TOGGLE_BIT( var, bit )	( (var)	 ^=  (bit) )

/*
 * Vector macros for long bitfields.
 * using 32 bit integers for these to improve pointer compatability.
 */
#define BMASK( bit )		( 1 << ( ( bit ) % 32 ) )
#define BSLOT( bit )		(	 ( bit ) / 32 )

#define xIS_SET( var, bit )	 ( ( var )[BSLOT( bit )] &   BMASK( bit ) )
#define xSET_BIT( var, bit )	 ( ( var )[BSLOT( bit )] |=  BMASK( bit ) )
#define xREMOVE_BIT( var, bit )	 ( ( var )[BSLOT( bit )] &= ~BMASK( bit ) )
#define xTOGGLE_BIT( var, bit )	 ( ( var )[BSLOT( bit )] ^=  BMASK( bit ) )


/*
 * Character macros.
 */
#define IS_NPC( ch )		( xIS_SET( (ch)->act, ACT_IS_NPC ) )
#define IS_NPC_CLASS( ch )	( (ch)->class == CLASS_NONE )
#define CH( descriptor )	( (descriptor)->original	\
				  ? (descriptor)->original	\
				  : (descriptor)->character )
#define IS_IMMORTAL( ch )	( get_trust(ch) >= LEVEL_IMMORTAL )
#define IS_HERO( ch )		( get_trust(ch) >= LEVEL_HERO	  )
#define IS_ANGEL( ch )		( IS_HERO(ch) && !IS_IMMORTAL(ch) )
#define IS_AFFECTED( ch, sn )	( xIS_SET( (ch)->affected_by, (sn) ) )

#define IS_GOOD( ch )		( ch->alignment >=  350 )
#define IS_EVIL( ch )		( ch->alignment <= -350 )
#define IS_NEUTRAL( ch )	( !IS_GOOD(ch) && !IS_EVIL(ch) )
#define IS_AWAKE( ch )		( ch->position > POS_SLEEPING )
#define IS_OUTSIDE( ch )	( !IS_SET( (ch)->in_room->room_flags,	 \
					   ROOM_INDOORS )		 \
				  && !IS_SET( (ch)->in_room->room_flags, \
						ROOM_UNDERGROUND )	 \
				  && !IS_SET( (ch)->in_room->room_flags, \
						ROOM_FLOODED )		 \
				  && (ch)->in_room->sector_type !=	 \
						SECT_UNDERWATER )

#define WAIT_STATE( ch, pulse ) ( (ch)->wait = UMAX( (ch)->wait, (pulse) ) )


#define IS_SWITCHED( ch )	 ( (ch)->pcdata->switched )

#define IS_BUILDER( ch, Area )	is_builder( ch, Area )

/*
 * Object macros.
 */
#define CAN_WEAR( obj, part )	( IS_SET( (obj)->wear_flags,  (part) ) )
#define IS_OBJ_STAT( obj, stat )( IS_SET( (obj)->extra_flags, (stat) ) )


/*
 * Description macros.
 */
#define PERS( ch, looker )  ( can_see( (looker), (ch) )			\
				? ( ( (ch)->short_descr			\
				    && (ch)->short_descr[0] )		\
				  ? (ch)->short_descr : (ch)->name )	\
				: ( IS_IMMORTAL( ch )			\
				  ? "an immortal" : "someone" ) )

/*
 * Macro to cover the use of the old functions
 */
#define GET_AC( ch )			get_ac( (ch) )
#define one_argument( str, arg )	first_arg( (str), (arg), TRUE )


/* Miscellaneous #defines */
#define AUTOLOOK	"|illi|"   /* unlikely to be used as an argument.   */
#define LINE_SEPARATOR	"&B-------------------------------------------------------------------------------&n\n\r"
/* Simple barrier line for formatted output.	    */
#define MAX_JUGGLED	5	   /* for the juggle skill.		    */
#define NO_FLAG		-99	   /* Must not be used in flags or stats.   */
#define IDENT_TIMEOUT	120	   /* for ident (2 minutes)		    */

/* Magic numbers */
#define MAGIC_NUM_CHAR		0
#define MAGIC_NUM_OBJECT	1


/* Erwin A's extremely useful bitvalue #define's */
#define		BIT_00		  (1 <<	 0)	  /*	      1 */
#define		BIT_01		  (1 <<	 1)	  /*	      2 */
#define		BIT_02		  (1 <<	 2)	  /*	      4 */
#define		BIT_03		  (1 <<	 3)	  /*	      8 */
#define		BIT_04		  (1 <<	 4)	  /*	     16 */
#define		BIT_05		  (1 <<	 5)	  /*	     32 */
#define		BIT_06		  (1 <<	 6)	  /*	     64 */
#define		BIT_07		  (1 <<	 7)	  /*	    128 */
#define		BIT_08		  (1 <<	 8)	  /*	    256 */
#define		BIT_09		  (1 <<	 9)	  /*	    512 */
#define		BIT_10		  (1 << 10)	  /*	   1024 */
#define		BIT_11		  (1 << 11)	  /*	   2048 */
#define		BIT_12		  (1 << 12)	  /*	   4096 */
#define		BIT_13		  (1 << 13)	  /*	   8192 */
#define		BIT_14		  (1 << 14)	  /*	  16384 */
#define		BIT_15		  (1 << 15)	  /*	  32768 */
#define		BIT_16		  (1 << 16)	  /*	  65536 */
#define		BIT_17		  (1 << 17)	  /*	 131072 */
#define		BIT_18		  (1 << 18)	  /*	 262144 */
#define		BIT_19		  (1 << 19)	  /*	 524288 */
#define		BIT_20		  (1 << 20)	  /*	1048576 */
#define		BIT_21		  (1 << 21)	  /*	2097152 */
#define		BIT_22		  (1 << 22)	  /*	4194304 */
#define		BIT_23		  (1 << 23)	  /*	8388608 */
#define		BIT_24		  (1 << 24)	  /*   16777216 */
#define		BIT_25		  (1 << 25)	  /*   33554432 */
#define		BIT_26		  (1 << 26)	  /*   67108864 */
#define		BIT_27		  (1 << 27)	  /*  134217728 */
#define		BIT_28		  (1 << 28)	  /*  268435456 */
#define		BIT_29		  (1 << 29)	  /*  536870912 */
#define		BIT_30		  (1 << 30)	  /* 1073741824 */
#define		BIT_31		  (1 << 31)	  /* 2147482648 */
/* should watch this last one, it's the sign bit, use a vector instead */

/*
 * Magic Numbers for PFile loading.
 */
#define MAND		3344556 /* Magic # for manditory field		 */
#define SPECIFIED	3344557 /* Key was used already.		 */
#define DEFLT		3344558 /* Use default from fread_char_obj	 */
#define REALLY_STRING  -2423641	/* Use in special_read to note a string */


/* Mud Client Compression Protocol definitions.*/
#if defined( MCCP )
#define TELOPT_COMPRESS	85
#define TELOPT_COMPRESS2	86
#define COMPRESS_BUF_SIZE	MAX_STRING_LENGTH
#endif


/*-----------------------------------------------------------------
 * System constants, bitfield values etc...
 * These values are used as part of the mapping of integer values to actual
 * useful values in the code.  This section no longer really applies to area
 * builders, instead they should refer to bit.c for the values they can use.
 */

/*
 * SysInfo flags.
 */
#define SYSINFO_REBOOT		BIT_00	/* Reboot instead of shutdown	*/
#define SYSINFO_LOGALL		BIT_01	/* Log all commands		*/
#define SYSINFO_NOFIGHT		BIT_02	/* No fights can be started	*/
#define SYSINFO_WIZLOCK		BIT_03	/* Non-wizified players are denied */
#define SYSINFO_ACT_TRIGGER	BIT_04	/* Global toggle for MUDprogs	*/
#define SYSINFO_VERBOSE_LOG	BIT_05	/* The system log is verbose	*/
#define SYSINFO_SAVEALL		BIT_06	/* Save all areas, not just changed */
#define SYSINFO_ISPELL		BIT_07	/* Enable ispell		*/
#define SYSINFO_FORTUNES	BIT_08	/* Use fortune for quotes	*/
#define SYSINFO_HOLYWAR		BIT_09	/* There is a Holy War raging	*/
#define SYSINFO_NOCPULIMIT	BIT_10	/* The CPU time limit is ignored */
#define SYSINFO_LOGNOHELP	BIT_11	/* Log unfound helps		*/


/*
 * Time and weather stuff.
 */
#define SUN_DARK		    0
#define SUN_RISE		    1
#define SUN_LIGHT		    2
#define SUN_SET			    3

#define SKY_CLOUDLESS		    0
#define SKY_CLOUDY		    1
#define SKY_RAINING		    2
#define SKY_LIGHTNING		    3


/*
 * Interpreter flags, refer to comm.c.
 */
#define INTERPRETER_STANDARD		0
#define INTERPRETER_SAFE		BIT_00	/* can't be attacked	*/
#define INTERPRETER_NOALIAS		BIT_01	/* block aliasing	*/
#define INTERPRETER_NOMESSAGE		BIT_02	/* no game messages	*/
#define INTERPRETER_LEADSPACE		BIT_03	/* don't ignore spaces	*/


/*
 * TO types for act.
 */
#define TO_ROOM		    0	/* to all but actor			*/
#define TO_NOTVICT	    1	/* to all but actor and victim		*/
#define TO_VICT		    2	/* to the victim (secondary target)	*/
#define TO_CHAR		    3	/* to the actor (primary target)	*/
#define TO_ALL		    4	/* everyone except those asleep not target */
#define TO_CANSEE	    5	/* TO_ROOM, only if they can see actor	*/


/*
 * Clans, Guilds, Orders.
 */
#define CLAN_NORMAL		0	/* a PK clan		*/
#define CLAN_ORDER		1	/* religious order	*/
#define CLAN_GUILD		2	/* class only group	*/

#define RANK_NONE		0	/* not a clan member	*/
#define RANK_EXILED		1	/* Exiled from a clan	*/
#define RANK_CLANSMAN		2	/* Foot soldier		*/
#define RANK_CLANHERO		3	/* Knight		*/
#define RANK_CHIEFTAIN		4	/* Knight Lord		*/
#define RANK_OVERLORD		5	/* Head clan leader	*/


/*
 * Sacrifice.
 */
#define SAC_EVENT_GOLD		0	/* normal, get gold		*/
#define SAC_EVENT_BLESS		1	/* get blessed			*/
#define SAC_EVENT_CURSE		2	/* get cursed			*/
#define SAC_EVENT_ARMOUR	3	/* get armour cast on them	*/
#define SAC_EVENT_HEAL		4	/* get a few hps		*/
#define SAC_EVENT_DISPEL_EVIL	5	/* condemn cast on them */
#define SAC_EVENT_BLIND		6	/* blinded			*/
#define SAC_EVENT_BAMF		7	/* randomly transported		*/
#define SAC_EVENT_MANA		8	/* get a little mana		*/
#define SAC_EVENT_FOOD		9	/* get some food		*/
#define SAC_EVENT_WATER		10	/* thirst quenched a little	*/
#define SAC_EVENT_DRUNK		11	/* get a little drunker		*/
#define SAC_EVENT_RAISE		12	/* if it's a corpse it rises	*/
#define SAC_EVENT_PLAGUE	13	/* get plagued			*/


/*
 * Types of attacks.
 * Must be non-overlapping with spell/skill types, but may * be arbitrary
 * beyond that.
 */
#define TYPE_UNDEFINED		-1
#define TYPE_HIT		(MAX_SKILL<<1)
#define TYPE_MPDAMAGE		(MAX_SKILL<<2)


/*
 * Well known mob virtual numbers.
 * WARNING: Any basic area file system should include these vnums for the
 * game to work properly, without them crashes are certain.
 */
#define MOB_VNUM_SUPERMOB	      3
#define MOB_VNUM_DEMON		     10
#define MOB_VNUM_ZOMBIE		     11
#define MOB_VNUM_SKELETON	     12
#define MOB_VNUM_MUMMY		     13
#define MOB_VNUM_LICH		     14


/*
 * Well known object virtual numbers.
 * Most of these are used in either spells or skills.
 * WARNING: Any basic area file system should include these vnums for the
 * game to work properly, without them crashes are certain.
 */
#define OBJ_VNUM_DUMMY			1
#define OBJ_VNUM_MONEY_ONE		2
#define OBJ_VNUM_MONEY_SOME		3

#define OBJ_VNUM_CORPSE_NPC		10
#define OBJ_VNUM_CORPSE_PC		11
#define OBJ_VNUM_SEVERED_HEAD		12
#define OBJ_VNUM_TORN_HEART		13
#define OBJ_VNUM_SPILLED_GUTS		14
#define OBJ_VNUM_LOOSE_TEETH		15
#define OBJ_VNUM_FINAL_TURD		16

#define OBJ_VNUM_MUSHROOM		20
#define OBJ_VNUM_LIGHT_BALL		21
#define OBJ_VNUM_SPRING			22
#define OBJ_VNUM_PORTAL			23
#define OBJ_VNUM_NEXUS			24
#define OBJ_VNUM_FORAGE_FIRST		26
#define OBJ_VNUM_FORAGE_LAST		36

#define OBJ_VNUM_WHETSTONE		37
#define OBJ_VNUM_BLOOD_STAIN		38
#define OBJ_VNUM_MAGIC_PILL		39
#define OBJ_VNUM_HERBS			42
#define OBJ_VNUM_BANDAGES		43
#define OBJ_VNUM_DIM_DOOR		44
#define OBJ_VNUM_SPIRIT_HAM		45

/* Stuff given out in MudSchool */
#define OBJ_VNUM_SCHOOL_LIGHT		3726
#define OBJ_VNUM_SCHOOL_VEST		3708
#define OBJ_VNUM_SCHOOL_ARMOUR		3707
#define OBJ_VNUM_SCHOOL_SHIELD		3718
#define OBJ_VNUM_SCHOOL_MACE		3700
#define OBJ_VNUM_SCHOOL_DAGGER		3701
#define OBJ_VNUM_SCHOOL_SWORD		3702
#define OBJ_VNUM_SCHOOL_STAFF		3703

#define OBJ_VNUM_BLACK_POWDER		8903	/* not in use */


/*
 * Well known room virtual numbers.
 */
#define ROOM_VNUM_LIMBO		      2
#define ROOM_VNUM_ARENA		      3
#define ROOM_VNUM_PREP_ROOM	      4
#define ROOM_VNUM_IMMPLANE	    700
#define ROOM_VNUM_TEMPLE	   3001
#define ROOM_VNUM_SCHOOL	   3700


/*
 * ACT bits for mobs.
 */
#define ACT_IS_NPC		0		/* Auto set for mobs	     */
#define ACT_SENTINEL		1		/* Stays in one room	     */
#define ACT_SCAVENGER		2		/* Picks up objects	     */
#define ACT_AGGRESSIVE		3		/* Attacks PC's		     */
#define ACT_STAY_AREA		4		/* Won't leave area	     */
#define ACT_WIMPY		5		/* Flees when hurt	     */
#define ACT_PET			6		/* Auto set for pets	     */
#define ACT_TRAIN		7		/* Can train PC's	     */
#define ACT_PRACTICE		8		/* Can practice PC's	     */
#define ACT_GAMBLE		9		/* Runs a gambling game	     */
#define ACT_BANKER		10		/* Can take your money	     */
#define ACT_MERCENARY		11		/* Will be for hire	     */
#define ACT_ASSIST		12		/* will fight if others are  */
#define ACT_BURIED		13		/* Imposible to see	     */
#define ACT_MOVED		14		/* Dont ever set!	     */
#define ACT_RACIST		15		/* acts on racial instinct   */
#define ACT_HUNTER		16		/* will hunt and kill fleers */
#define ACT_QUESTMASTER		17		/* is a questmaster	     */
#define ACT_HEALER		18		/* heals players for a fee   */
#define ACT_DELAYED		19		/* when mob delays itself    */
#define ACT_SMITH		20		/* a mob who can repair stuff*/
#define ACT_PRAC_AIR		21		/* Can practice air	     */
#define ACT_PRAC_EARTH		22		/* Can practice earth	     */
#define ACT_PRAC_FIRE		23		/* Can practice fire	     */
#define ACT_PRAC_SPIRIT		24		/* Can practice spirit	     */
#define ACT_PRAC_WATER		25		/* Can practice water	     */
#define ACT_MUDPROG		26		/* is running a MUDProg      */


/*
 * Shopkeeper Maximum number of trading types.
 */
#define MAX_TRADE	5

/*
 * Bits for 'affected_by'.
 */
#define AFF_BLIND		0	/* Can't see			*/
#define AFF_INVISIBLE		1	/* Can't be seen		*/
#define AFF_DETECT_EVIL		2	/* Can see evil things		*/
#define AFF_DETECT_INVIS	3	/* Can see invisible stuff	*/
#define AFF_DETECT_MAGIC	4	/* Can see if things are magical */
#define AFF_DETECT_HIDDEN	5	/* Can see hidden things	*/
#define AFF_HOLD		6	/* Webbed, can't move		*/
#define AFF_SANCTUARY		7	/* Takes half damage		*/
#define AFF_FAERIE_FIRE		8	/* Bright outline, easy to hit	*/
#define AFF_INFRARED		9	/* See characters in the dark	*/
#define AFF_MIND_MIST		10	/* Can't remember anything	*/
#define AFF_POISON		11	/* Poisoned, take damage	*/
#define AFF_PROTECT		12	/* Protected from opposite align */
#define AFF_POLYMORPH		13	/* Race or sex mutation		*/
#define AFF_SNEAK		14	/* Entrances/exits wont be shown */
#define AFF_HIDE		15	/* Hiding			*/
#define AFF_SLEEP		16	/* Affected by sleep spell	*/
#define AFF_CHARM		17	/* Charmed by someone		*/
#define AFF_FLYING		18	/* Is flying			*/
#define AFF_PASS_DOOR		19	/* Can walk through doors	*/
#define AFF_AURA_SIGHT		20	/* Can see auras		*/
#define AFF_BLEEDING		21	/* Leaking blood can't regen	*/
#define AFF_MUTE		22	/* Can't speak			*/
#define AFF_BREATHING		23	/* Can breath underwater	*/
#define AFF_VAMP_BITE		24	/* Affected by a vampiric bite	*/
#define AFF_GHOUL		25	/* Ephemeral, can't hit or be hit */
#define AFF_ATTACKSHIELD	26	/* Has a defensive shield	*/
#define AFF_HASTE		27	/* Gets an extra attack		*/
#define AFF_FAST_TALK		28	/* Might not get aggied		*/
#define AFF_WARP_FLESH		29	/* Takes double damage from hits */
#define AFF_PLAGUE		30	/* Diseased			*/
#define AFF_BERSERK		31	/* Absolutely nuts		*/
#define AFF_TAUNT		32	/* More likely to get aggied	*/
#define AFF_NEVERMISS		33	/* Can't ever miss a hit	*/
#define AFF_MAGICHANDS		34	/* Chill Touch, Burning Hands.. */
#define AFF_DARKNESS		35	/* Makes the room darker	*/
#define AFF_POISONRESIST	36	/* Chance of removing poison	*/
#define AFF_CONFUSION		37	/* Dazed and Confused		*/
#define AFF_DEAD		38	/* Used for swan song		*/
#define AFF_CALM		39	/* The char wont be able to attack/aggress */
#define AFF_SENSE_LIFE		40	/* Can sense invisible life	*/


/*
 * Character extra bits.
 * Bits for avoiding damage, so it happens only once.
 * Extra affects can be put here as well.
 */
#define CH_EX_DODGE		BIT_00
#define CH_EX_PARRY		BIT_01
#define CH_EX_SHIELD_BLOCK	BIT_02
#define CH_EX_DODGE_2		BIT_03
#define CH_EX_STUMBLE		BIT_04
#define CH_EX_FAMILIAR		BIT_05
#define CH_EX_BLINK		BIT_06

#define CH_EX_RESET		(CH_EX_DODGE|CH_EX_PARRY|CH_EX_SHIELD_BLOCK| \
				 CH_EX_DODGE_2|CH_EX_STUMBLE|CH_EX_FAMILIAR| \
				 CH_EX_BLINK)


/*
 * Sex.
 *
 */
#define SEX_NEUTRAL		0
#define SEX_MALE		1
#define SEX_FEMALE		2


/*
 * Item types.
 *
 */
#define ITEM_LIGHT		1
#define ITEM_SCROLL		2
#define ITEM_WAND		3
#define ITEM_STAFF		4
#define ITEM_WEAPON		5
#define ITEM_TREASURE		6
#define ITEM_ARMOUR		7
#define ITEM_POTION		8
#define ITEM_FURNITURE		9
#define ITEM_TRASH		10
#define ITEM_CONTAINER		11
#define ITEM_DRINK_CON		12
#define ITEM_KEY		13
#define ITEM_FOOD		14
#define ITEM_MONEY		15
#define ITEM_BOAT		16
#define ITEM_CORPSE_NPC		17
#define ITEM_CORPSE_PC		18
#define ITEM_FOUNTAIN		19
#define ITEM_PILL		20
#define ITEM_PORTAL		21
#define ITEM_EXPLOSIVE		22
#define ITEM_PLANT		23
#define ITEM_LIMB		24
#define ITEM_BOOK		25
#define ITEM_GEM		26


/*
 * Extra flags.
 *
 */
#define ITEM_GLOW		BIT_00	/* purely visual		*/
#define ITEM_HUM		BIT_01	/*	""			*/
#define ITEM_DARK		BIT_02	/* affects the light		*/
#define ITEM_QUEST		BIT_03	/* temporary quest flag		*/
#define ITEM_EVIL		BIT_04	/* purely visual		*/
#define ITEM_INVIS		BIT_05	/* can't be seen, der		*/
#define ITEM_MAGIC		BIT_06	/* visual, used for transmute	*/
#define ITEM_NODROP		BIT_07	/* can't leave the hand		*/
#define ITEM_BLESS		BIT_08	/* harder to damage		*/
#define ITEM_ANTI_GOOD		BIT_09	/* Good players can't use it	*/
#define ITEM_ANTI_EVIL		BIT_10	/* Evil players can't use it	*/
#define ITEM_ANTI_NEUTRAL	BIT_11	/* Guess!			*/
#define ITEM_NOREMOVE		BIT_12	/* Can't be taken off		*/
#define ITEM_INVENTORY		BIT_13	/* For shops, decays on death	*/
#define ITEM_POISONED		BIT_14	/* Weapons, can't be sold	*/
#define ITEM_VAMPIRE_BANE	BIT_15	/* Anti-vampire			*/
#define ITEM_HOLY		BIT_16	/* Lose 50hps when picking it up*/
#define ITEM_CHARGED		BIT_17	/* Temporarily charged		*/
#define ITEM_SHARP		BIT_18	/* Sharp, weapons only		*/
#define ITEM_HORNED		BIT_19	/* Horned, for weapons and helms*/
#define ITEM_OWNER		BIT_20	/* Tied to a certain person	*/
#define ITEM_NO_CAST		BIT_21	/* Can't cast while wearing it	*/
#define ITEM_RUNED		BIT_22	/* Engraved upon, looks cool	*/
#define ITEM_BURIED		BIT_23	/* Underneath the ground	*/
#define ITEM_NO_IDENTIFY	BIT_24	/* Cannot be identified		*/
#define ITEM_FRAGILE		BIT_25	/* Is easily destroyed		*/


/*
 * Wear flags.
 *
 */
#define ITEM_TAKE		BIT_00
#define ITEM_WEAR_FINGER	BIT_01
#define ITEM_WEAR_NECK		BIT_02
#define ITEM_WEAR_BODY		BIT_03
#define ITEM_WEAR_HEAD		BIT_04
#define ITEM_WEAR_LEGS		BIT_05
#define ITEM_WEAR_FEET		BIT_06
#define ITEM_WEAR_HANDS		BIT_07
#define ITEM_WEAR_ARMS		BIT_08
#define ITEM_WEAR_SHIELD	BIT_09
#define ITEM_WEAR_SHOULDERS	BIT_10
#define ITEM_WEAR_WAIST		BIT_11
#define ITEM_WEAR_WRIST		BIT_12
#define ITEM_WIELD		BIT_13
#define ITEM_HOLD		BIT_14
#define ITEM_FLOAT		BIT_15
#define ITEM_WEAR_FACE		BIT_16
#define ITEM_WIELD_DOUBLE	BIT_17
#define ITEM_WEAR_ANKLE		BIT_18
#define ITEM_WEAR_HORNS		BIT_19
#define ITEM_WEAR_WINGS		BIT_20
#define ITEM_WEAR_EAR		BIT_21
#define ITEM_WEAR_NOSE		BIT_22


/*
 * New wear locations
 */
#define WEAR_NONE			0	/* -1 really sucked here */
#define WEAR_HEAD			1
#define WEAR_HORNS			2
#define WEAR_EAR_L			3
#define WEAR_EAR_R			4
#define WEAR_FACE			5
#define WEAR_NOSE			6
#define WEAR_NECK_1			7
#define WEAR_NECK_2			8
#define WEAR_SHOULDERS			9
#define WEAR_WINGS			10
#define WEAR_FLOAT_L			11
#define WEAR_FLOAT_R			12
#define WEAR_ARMS			13
#define WEAR_WRIST_L			14
#define WEAR_WRIST_R			15
#define WEAR_HANDS			16
#define WEAR_FINGER_L			17
#define WEAR_FINGER_R			18
#define WEAR_WIELD_R			19
#define WEAR_HOLD_L			20
#define WEAR_HOLD_R			21
#define WEAR_SHIELD			22
#define WEAR_WIELD_L			23
#define WEAR_WIELD_DOUBLE		24
#define WEAR_BODY			25
#define WEAR_WAIST			26
#define WEAR_LEGS			27
#define WEAR_ANKLE_L			28
#define WEAR_ANKLE_R			29
#define WEAR_FEET			30
#define WEAR_JUGGLED			31 /* unique slot, multiple items */
#define MAX_WEAR			32


/*
 * Apply types (for affects).
 *
 */
#define APPLY_NONE		0
#define APPLY_STR		1
#define APPLY_DEX		2
#define APPLY_INT		3
#define APPLY_WIS		4
#define APPLY_CON		5
#define APPLY_SEX		6
#define APPLY_CLASS		7	/* pointless	*/
#define APPLY_LEVEL		8	/* pointless	*/
#define APPLY_AGE		9	/* pointless	*/
#define APPLY_HEIGHT		10	/* pointless	*/
#define APPLY_WEIGHT		11	/* pointless	*/
#define APPLY_HIT		12
#define APPLY_MOVE		13
#define APPLY_GOLD		14
#define APPLY_EXP		15
#define APPLY_AC		16
#define APPLY_HITROLL		17
#define APPLY_DAMROLL		18
#define APPLY_RACE		19
#define APPLY_RESILIENCE	20
#define APPLY_BODY_TEMP		21
#define APPLY_APPEARANCE	22	/* pointless	*/
#define APPLY_BODY_PART		23	/* strange, may not work well */
#define APPLY_SPEED		24
#define APPLY_SIZE		25
#define APPLY_AIR		26
#define APPLY_EARTH		27
#define APPLY_FIRE		28
#define APPLY_SPIRIT		29
#define APPLY_WATER		30
#define APPLY_MANA_AIR		31
#define APPLY_MANA_EARTH	32
#define APPLY_MANA_FIRE		33
#define APPLY_MANA_SPIRIT	34
#define APPLY_MANA_WATER	35
#define APPLY_MAGIC_RESIST	36	/* generic magic resistance */


/*
 * Values for containers (value[1]).
 *
 */
#define CONT_CLOSEABLE		BIT_00
#define CONT_PICKPROOF		BIT_01
#define CONT_HARDPICK		BIT_02	/* Four times harder to pick */
#define CONT_CLOSED		BIT_03
#define CONT_LOCKED		BIT_04
#define CONT_TRAPPED		BIT_05
#define CONT_WEIGHTLESS		BIT_06	/* all objects inside are weightless */
#define CONT_HUNGRY		BIT_07	/* eats all objects placed inside */
#define CONT_HOLEY		BIT_08	/* items fall through when placed in */
#define CONT_EAT_KEY		BIT_09	/* when unlocking it chews the key */


/*
 * Values for Furniture, stand, rest, sleep, on, in, at.
 */
#define FURN_STAND_ON		BIT_00
#define FURN_STAND_IN		BIT_01
#define FURN_STAND_AT		BIT_02
#define FURN_STAND		(FURN_STAND_ON|FURN_STAND_IN|FURN_STAND_AT)
#define FURN_SIT_ON		BIT_03
#define FURN_SIT_IN		BIT_04
#define FURN_SIT_AT		BIT_05
#define FURN_SIT		(FURN_SIT_ON|FURN_SIT_IN|FURN_SIT_AT)
#define FURN_REST_ON		BIT_03
#define FURN_REST_IN		BIT_04
#define FURN_REST_AT		BIT_05
#define FURN_REST		(FURN_REST_ON|FURN_REST_IN|FURN_REST_AT)
#define FURN_SLEEP_ON		BIT_06
#define FURN_SLEEP_IN		BIT_07
#define FURN_SLEEP_AT		BIT_08
#define FURN_SLEEP		(FURN_SLEEP_ON|FURN_SLEEP_IN|FURN_SLEEP_AT)


/*
 * Room flags.
 *
 */
#define ROOM_DARK			BIT_00	/* VERY dark		*/
#define ROOM_NO_MOB			BIT_01	/* Mobiles can't walk in*/
#define ROOM_INDOORS			BIT_02	/* Hmmmm		*/
#define ROOM_UNDERGROUND		BIT_03	/* Beneath the ground	*/
#define ROOM_PRIVATE			BIT_04	/* Two people at a time */
#define ROOM_SAFE			BIT_05	/* Safe from attackers	*/
#define ROOM_SOLITARY			BIT_06	/* One person at a time */
#define ROOM_PET_SHOP			BIT_07	/* Pet room		*/
#define ROOM_NO_RECALL			BIT_08	/* Can't recall from here */
#define ROOM_CONE_OF_SILENCE		BIT_09	/* No talking or casting */
#define ROOM_TEMP_CONE_OF_SILENCE	BIT_10	/*	""	*/
#define ROOM_TRACK_MARK			BIT_11	/* Temporary		*/
#define ROOM_NO_PORTAL			BIT_12	/* Can't portal here	*/
#define ROOM_ARENA			BIT_13	/* Players can fight	*/
#define ROOM_FALL			BIT_14	/* You fall downwards	*/
#define ROOM_HOT			BIT_15	/* Hot (temperature)	*/
#define ROOM_COLD			BIT_16	/* No prizes for guessing */
#define ROOM_FORAGE			BIT_17	/* You get food by foraging */
#define ROOM_FLOODED			BIT_18	/* From the flood spell */


/*
 * Directions.
 *
 */
#define DIR_NORTH			0
#define DIR_EAST			1
#define DIR_SOUTH			2
#define DIR_WEST			3
#define DIR_UP				4
#define DIR_DOWN			5
#define MAX_DIR				6


/*
 * Exit flags.
 *
 */
#define EX_ISDOOR		BIT_00
#define EX_CLOSED		BIT_01
#define EX_LOCKED		BIT_02
#define EX_BASHED		BIT_03	/* Bashed (bashdoor skill)	*/
#define EX_BASHPROOF		BIT_04	/* Impossible to bash down	*/
#define EX_PICKPROOF		BIT_05	/* Impossible to pick		*/
#define EX_HARDPICK		BIT_06	/* Four times harder to pick	*/
#define EX_PASSPROOF		BIT_07	/* Block phase-shifted movement	*/
#define EX_TRAPPED		BIT_08	/* Spring a trap when opened	*/
#define EX_HIDDEN		BIT_09	/* Doesn't show up on scan	*/
#define EX_EAT_KEY		BIT_10	/* Eats keys when unlocked	*/
#define EX_TEMPORARY		BIT_11	/* For MUDPrograms		*/
#define EX_NOSHADOW		BIT_12	/* For shadow door passing	*/


/*
 * Sector types.
 */
#define SECT_INSIDE			0
#define SECT_CITY			1
#define SECT_FIELD			2
#define SECT_FOREST			3
#define SECT_HILLS			4
#define SECT_MOUNTAIN			5
#define SECT_WATER_SWIM			6
#define SECT_WATER_NOSWIM		7
#define SECT_UNDERWATER			8
#define SECT_AIR			9
#define SECT_DESERT			10
#define SECT_SPACE			11
#define SECT_SWAMP			12
#define SECT_MAX			13


/*
 * Area flags.
 */
#define	   AREA_NONE		0
#define	   AREA_CHANGED		BIT_00	/* Area has been modified. */
#define	   AREA_ADDED		BIT_01	/* Area has been added to. */
#define	   AREA_LOADING		BIT_02	/* Used for counting in db.c */
#define	   AREA_VERBOSE		BIT_03	/* OLC */
#define	   AREA_ALWAYS_VERBOSE	BIT_04	/* Always save in verbose mode */
#define	   AREA_DELETED		BIT_05	/* Dont save it, be careful */
#define	   AREA_HIDE		BIT_06	/* Wont show up on "areas" */
#define	   AREA_NOSAVE		BIT_07	/* For finished areas no save */
#define	   AREA_SENTINEL	BIT_08	/* All mobs will stand still (test) */
#define	   AREA_NO_FLOOD	BIT_09	/* The flood spell doesn't work */

#define	   AREA_SAVE	(AREA_DELETED|AREA_ALWAYS_VERBOSE|AREA_HIDE)


/*
 * Conditions.
 */
#define COND_DRUNK			0
#define COND_FULL			1
#define COND_THIRST			2


/*
 * Positions.
 */
#define POS_DEAD			0
#define POS_MORTAL			1
#define POS_INCAP			2
#define POS_STUNNED			3
#define POS_SLEEPING			4
#define POS_MEDITATING			5
#define POS_RESTING			6
#define POS_SITTING			7
#define POS_SMASHED			8	/* the ram skill */
#define POS_GETTING_UP			9	/* trip and throw */
#define POS_FIGHTING			10
#define POS_STANDING			11


/*
 * ACT bits for players.
 */
#define PLR_IS_NPC		0	/*   Don't EVER set.		*/
#define PLR_BOUGHT_PET		1	/* Bought a pet this level	*/
#define PLR_BATTLE		2	/* Part of a MUD-wide PK battle */
#define PLR_AUTOEXIT		3	/* Show exits on autolook	*/
#define PLR_AUTOLOOT		4	/* Loots corpses		*/
#define PLR_AUTOSAC		5	/* Sacrifices corpses		*/
#define PLR_BLANK		6	/* Gets a blank line		*/
#define PLR_BRIEF		7	/* Doesn't room desc on enter	*/
#define PLR_COLOUR		8	/* Gets ANSI colour		*/
#define PLR_COMBINE		9	/* Combines multiple objects	*/
#define PLR_PROMPT		10	/* Gets a prompt		*/
#define PLR_TELNET_GA		11	/* Special prompt sequence	*/
#define PLR_HOLYLIGHT		12	/* Can see _everything_		*/
#define PLR_WIZINVIS		13	/* Is invisible to all/most	*/
#define PLR_WIZBIT		14	/* Is a certified immortal	*/
#define PLR_SILENCE		15	/* Can't use say or channels	*/
#define PLR_NO_EMOTE		16	/* Can't use emote		*/
#define PLR_MOVED		17	/* --- Dont mess with this ---	*/
#define PLR_NO_TELL		18	/* Can't use tell		*/
#define PLR_LOG			19	/* All commands are logged	*/
#define PLR_DENY		20	/* Is denied from the MUD	*/
#define PLR_FREEZE		21	/* Can't enter any commands	*/
#define PLR_OUTLAW		22	/* Either stole from PC or killed */
#define PLR_KEYLOCK		23	/* Immortal keyboard lock	*/
#define PLR_AUTOGOLD		24	/* Gets gold from corpses	*/
#define PLR_AFK			25	/* Away from keyboard		*/
#define PLR_AUTOSPLIT		26	/* Splits gold with groupies	*/
#define PLR_NO_BEEP		27	/* Can't be BEEPED		*/
#define PLR_BUSY		28	/* Doesn't receive channels etc */
#define PLR_BATTLEOTHER		29	/* Gets others spam compressed	*/
#define PLR_BATTLESELF		30	/* Gets self spam compressed	*/
#define PLR_VT100		31	/* Receives terminal codes	*/
#define PLR_NO_LAG		32	/* player doesn't lag (imm)	*/
#define PLR_INFO		33	/* player gets extra info (imm) */
#define PLR_NOSAVE		34	/* player can't save, for pload only */


/*
 * VT100 Codes.
 */
#define VT_SAVECURSOR		"\0337"	  /* Save cursor and attrib */
#define VT_RESTORECURSOR	"\0338"	  /* Restore cursor pos and attribs */
#define VT_SETWIN_CLEAR		"\033[r"  /* Clear scrollable window size */
#define VT_CLEAR_SCREEN		"\033[2J" /* Clear screen */
#define VT_CLEAR_LINE		"\033[2K" /* Clear this whole line */
#define VT_RESET_TERMINAL	"\033c"


/*
 * Channel bits.
 */
#define CHANNEL_DEAF		BIT_00	/* Master switch */
#define CHANNEL_AUCTION		BIT_01
#define CHANNEL_CHAT		BIT_02
#define CHANNEL_IMMTALK		BIT_03
#define CHANNEL_MUSIC		BIT_04
#define CHANNEL_QUESTION	BIT_05
#define CHANNEL_SHOUT		BIT_06
#define CHANNEL_YELL		BIT_07
#define CHANNEL_INFO		BIT_08
#define CHANNEL_SENIORTALK	BIT_09
#define CHANNEL_GRATZ		BIT_10
#define CHANNEL_CLANTALK	BIT_11


/* WIZNET flags, extensions of channels */
#define WIZ_ON			BIT_12	 /* On|Off switch.	*/
#define WIZ_LOG			BIT_13	 /* log_string().	*/
#define WIZ_LOGINS		BIT_14	 /* Login|Logoff.	*/
#define WIZ_DEATHS		BIT_15	 /* Plr death's.	*/
#define WIZ_LEVELS		BIT_16	 /* Level's advancing.	*/
#define WIZ_TICKS		BIT_17	 /* Ticks/Counters	*/
#define WIZ_COMMANDS		BIT_18	 /* Logged commands	*/
#define WIZ_MISC		BIT_19	 /* Miscellaneous	*/
#define WIZ_CREATE		BIT_20	 /* Creation of stuff	*/
#define WIZ_CLAN		BIT_21	 /* Clan info		*/
#define WIZ_DEBUG		BIT_22	 /* Debug info, bug()	*/


/*
 * Mob spec functions,
 * to make mobprograms easier.
 */
#define SPEC_NULL		0
#define SPEC_AUTONOMOUS		BIT_00	/* spec goes on timer		*/
#define SPEC_FIGHT		BIT_01	/* spec goes off in a fight	*/
#define SPEC_DEATH		BIT_02	/* spec goes on mob being deaded */
#define SPEC_TELL		BIT_03	/* when some tells or says	*/
#define SPEC_GIVE		BIT_04	/* when given an object		*/
#define SPEC_BRIBE		BIT_05	/* when given cash		*/
#define SPEC_ENTER		BIT_06	/* when someone walks in	*/
#define SPEC_ATTACK		BIT_07	/* when being attacked		*/


/*
 * Mud program information
 */
#define PROG_ERROR		-1

/* universal programs */
#define GLOBAL_PROG		0	/* A global mud prog		*/
#define SUB_PROG		1	/* Sub procedure, no trigger	*/
#define ACT_PROG		2	/* On act message		*/
#define SPEECH_PROG		3	/* On speech			*/
#define RAND_PROG		4	/* At random time		*/
#define GREET_PROG		5	/* When player enters		*/
#define ALL_GREET_PROG		6	/* When player enters inc. sneak */
#define LEAVE_PROG		7	/* Just before a player leaves	*/
#define TIME_PROG		8	/* At specified time(s)		*/
#define REPOP_PROG		9	/* When loaded			*/
#define LOOK_PROG		10	/* explicitly look at		*/
#define COMMAND_PROG		11	/* explicitly look at		*/

/* mob only programs */
#define FIGHT_PROG		12	/* Every round when fighting	*/
#define DEATH_PROG		13	/* When killed, before corpse	*/
#define HITPRCNT_PROG		14	/* When below %age hps, every round */
#define ENTRY_PROG		15	/* When it walks into a room	*/
#define GIVE_PROG		16	/* When an item is given to it	*/
#define BRIBE_PROG		17	/* When gold is given		*/
#define ATTACK_PROG		18	/* When someone attacks it	*/
#define DELAY_PROG		19	/* When it finishes being delayed */
#define CAST_PROG		20	/* When someone casts a spell at it */

/* object programs */
#define WEAR_PROG		21	/* When worn			*/
#define REMOVE_PROG		22	/* When taken off		*/
#define SAC_PROG		23	/* Just before sacrifice	*/
#define EXAMINE_PROG		24	/* Examine or "look in"		*/
#define USE_PROG		25	/* Wands, staves, scrolls, potions.. */
#define GET_PROG		26	/* When picked up		*/
#define DROP_PROG		27	/* When put back down		*/
#define DAMAGE_PROG		28	/* When damaged			*/
#define REPAIR_PROG		29	/* When repaired		*/
#define OPEN_PROG		30	/* When opened (container)	*/
#define CLOSE_PROG		31	/* When closed (container)	*/
#define LOOT_PROG		32	/* When items are taken out	*/
#define PUTIN_PROG		33	/* Placing an item in a contain.*/

/* room programs */
#define SLEEP_PROG		34	/* When a player goes to sleep	*/
#define REST_PROG		35	/* When a player rests		*/

#define MPROG_GLOBAL_HASH	16

#define MPROG_GLOBAL_MOB	1	/* Allow mobs to use the prog.	*/
#define MPROG_GLOBAL_OBJ	2	/* Allow objects to use the prog. */
#define MPROG_GLOBAL_ROOM	4	/* Allow rooms to use the prog.	*/



/*
 * Languages.
 */
#define LANG_COMMON		0
#define LANG_FAERIE		BIT_00
#define LANG_DWARVEN		BIT_01
#define LANG_ORCISH		BIT_02
#define LANG_ELVEN		BIT_03
#define LANG_VARTHAN		BIT_04
#define LANG_ASTRAL		BIT_05
#define LANG_ELEMENTAL		BIT_06
#define LANG_GIBBERISH		BIT_07
#define LANG_BAD		BIT_08
#define LANG_ARCHAIC		BIT_09


/*
 * Magic stuff.
 */
#define MAGIC_AIR	0
#define MAGIC_EARTH	1
#define MAGIC_FIRE	2
#define MAGIC_SPIRIT	3
#define MAGIC_WATER	4
#define MAGIC_GENERIC	5
#define MAGIC_MAX	5


/*
 * Alias #defines.
 */
#define ALIAS_SIMPLE	0
#define ALIAS_MULTIPLE	1
#define ALIAS_COMPLEX	2


/*
 * Questing.
 */
#define QUEST_KILL_COMPLETE    -1
#define QUEST_NONE		0
#define QUEST_ITEM		1
#define QUEST_KILL		2
#define QUEST_BODY_PART		3
#define QUEST_RACE_CORPSE	4
#define QUEST_OBJ_MATERIAL	5


/*
 * Extra bitfields specifically for PCs.
 * These are no longer saved, no need to.
 */
#define PC_BIT_SURGE	BIT_00	/* player is surging spells		*/
#define PC_BIT_QUICKEN	BIT_01	/* player is quickening spells		*/
#define PC_BIT_RACIAL	BIT_02	/* player is using a racial skill	*/
#define PC_BIT_HANDOFKAZ BIT_12 /* hand of kaz instead of strangle	*/
#define PC_BIT_STRANGLE BIT_13	/* this must be the highest, as a large
				 * number of the slots above this are
				 * used in the strangle code */


/*
 * Trade #defines.
 */
#define MAX_TRADE_OBJ	5
#define TRADE_LOCKED	1
#define TRADE_AGREED	2


/*
 *  Target types.
 */
#define TAR_IGNORE		    0
#define TAR_CHAR_OFFENSIVE	    1
#define TAR_CHAR_DEFENSIVE	    2
#define TAR_CHAR_SELF		    3
#define TAR_OBJ_INV		    4


/*
 * Spell types used for damage modification
 */
#define SKILL_TYPE_NONE		BIT_00	/* mainly for skills		    */
#define SKILL_TYPE_MAGIC	BIT_01	/* set if you want to check surge   */
#define SKILL_TYPE_FIRE		BIT_02	/* set if you want firey damage	    */
#define SKILL_TYPE_ICE		BIT_03	/* opposite to fire		    */
#define SKILL_TYPE_NO_RESIL	BIT_04	/* ignores resilience		    */
#define SKILL_TYPE_ACTION	BIT_05	/* for mob autonomous action	    */
#define SKILL_TYPE_ENCHANTMENT	BIT_06	/* for enchantments... and applying */
#define SKILL_TYPE_WEAPONSTRIKE BIT_07	/* for weapon spells		    */
#define SKILL_TYPE_DODGEABLE	BIT_08	/* if it can be avoided/blocked	    */


/*
 * Classes.
 * These values follow very strict rules - refer to documentation.
 */
#define CLASS_NONE	    -1
#define CLASS_MAGE	     0	/* Base Class			*/
#define CLASS_CLERIC	     1	/* Base Class			*/
#define CLASS_THIEF	     2	/* Base Class			*/
#define CLASS_WARRIOR	     3	/* Base Class			*/
#define CLASS_MARTIAL_ARTIST 4	/* Base Class			*/
#define CLASS_SORCEROR	     5	/* Specialist Mage		*/
#define CLASS_WARLOCK	     6	/* Dual Class: Mage/Cleric	*/
#define CLASS_ILLUSIONIST    7	/* Dual Class: Mage/Thief	*/
#define CLASS_RANGER	     8	/* Dual Class: Mage/Warrior	*/
#define CLASS_PSIONICIST     9	/* Dual Class: Mage/MarArt	*/
#define CLASS_BISHOP	    10	/* Specialist Cleric		*/
#define CLASS_JESTER	    11	/* Dual Class: Cleric/Thief	*/
#define CLASS_PALADIN	    12	/* Dual Class: Cleric/Warrior	*/
#define CLASS_MONK	    13	/* Dual Class: Cleric/MarArt	*/
#define CLASS_ASSASSIN	    14	/* Specialist Thief		*/
#define CLASS_CRUSADER	    15	/* Dual Class: Thief/Warrior	*/
#define CLASS_NINJA	    16	/* Dual Class: Thief/MarArt	*/
#define CLASS_KNIGHT	    17	/* Specialist Warrior		*/
#define CLASS_SAMURAI	    18	/* Dual Class: Warrior/MarArt	*/
#define CLASS_MYSTIC	    19	/* Specialist Martial Artist	*/
#define CLASS_BUILDER	    20	/* Special Class		*/
#define CLASS_ANGEL	    21	/* Special Class		*/
#define CLASS_DUMMY	    22	/* Nothing Class		*/


/*
 * Multiclassing states.
 */
#define CLASS_UNKNOWN	0	/* No skill in this class	*/
#define CLASS_ASPIRING	1	/* Learning to become this	*/
#define CLASS_ADEPT	2	/* Well known class		*/
#define CLASS_SECOND	3	/* Character's second class	*/
#define CLASS_FIRST	4	/* Original class		*/


/*
 * Race ability bits
 */
#define RACE_NO_ABILITIES		0
#define RACE_NPC_ONLY			BIT_00	/* players can't choose */
#define RACE_BREATHING			BIT_01	/* can breath underwater */
#define RACE_SWIM			BIT_02	/* can swim		*/
#define RACE_PASSDOOR			BIT_03	/* permanent passdoor	*/
#define RACE_INFRAVISION		BIT_04	/* permanent affect	*/
#define RACE_DETECT_ALIGN		BIT_05	/* perm.		*/
#define RACE_DETECT_INVIS		BIT_06	/* perm.		*/
#define RACE_DETECT_HIDDEN		BIT_07	/* perm.		*/
#define RACE_PROTECTION			BIT_08	/* perm.		*/
#define RACE_SANCT			BIT_09	/* perm. sanctuary	*/
#define RACE_NO_WEAPON_WIELD		BIT_10	/* can't use a weapon	*/
#define RACE_MUTE			BIT_11	/* can't speak		*/
#define RACE_NO_SUN			BIT_12	/* gets nuked by the sun */
#define RACE_DUAL_WIELD			BIT_13	/* can wield two weapons */
#define RACE_DARK_SIGHT			BIT_14	/* see in the dark	*/
#define RACE_NO_POISON			BIT_15	/* can't be poisoned	*/
#define RACE_UNDEAD			BIT_16	/* no life		*/


/*
 * Body part bits.
 */
#define BODY_PART_TORSO		BIT_00
#define BODY_PART_HEAD		BIT_01
#define BODY_PART_EYES		BIT_02
#define BODY_PART_ARM_L		BIT_03
#define BODY_PART_ARM_R		BIT_04
#define BODY_PART_ARMS		(BIT_03|BIT_04) /* combination */
#define BODY_PART_HAND_L	BIT_05
#define BODY_PART_HAND_R	BIT_06
#define BODY_PART_HANDS		(BIT_05|BIT_06) /* */
#define BODY_PART_FINGERS_L	BIT_07
#define BODY_PART_FINGERS_R	BIT_08
#define BODY_PART_FINGERS	(BIT_07|BIT_08) /* */
#define BODY_PART_LEG_L		BIT_09
#define BODY_PART_LEG_R		BIT_10
#define BODY_PART_LEGS		(BIT_09|BIT_10) /* */
#define BODY_PART_FOOT_L	BIT_11
#define BODY_PART_FOOT_R	BIT_12
#define BODY_PART_FEET		(BIT_11|BIT_12) /* */
#define BODY_PART_TAIL		BIT_13
#define BODY_PART_HORNS		BIT_14
#define BODY_PART_WINGS		BIT_15
#define BODY_PART_LUNGS		BIT_16
#define BODY_PART_GILLS		BIT_17
#define BODY_PART_NOSE		BIT_18
#define BODY_PART_EAR_L		BIT_19
#define BODY_PART_EAR_R		BIT_20
#define BODY_PART_EARS		(BIT_19|BIT_20) /* */

/* Special body part define. */
#define BODY_PARTS_HUMAN	( BODY_PART_TORSO|BODY_PART_HEAD| \
				  BODY_PART_EYES|BODY_PART_ARMS| \
				  BODY_PART_HANDS|BODY_PART_FINGERS| \
				  BODY_PART_LEGS|BODY_PART_FEET| \
				  BODY_PART_LUNGS|BODY_PART_NOSE| \
				  BODY_PART_EARS )


/*
 * Liquids.
 */
#define LIQ_WATER	0
#define LIQ_BLOOD	13
#define LIQ_MAX		32



/*------------------------------------------------------------
 * Data files used by the server.
 *
 * AREA_LIST contains a list of areas to boot.
 * All files are read in completely at bootup.
 * Most output files (bug, idea, typo, shutdown) are append-only.
 *
 * The NULL_FILE is held open so that we have a stream handle in reserve,
 *   so players can go ahead and telnet to all the other descriptors.
 * Then we close it whenever we need to open a file (e.g. a save file).
 */
#if defined( unix ) || defined( linux ) || defined( CYGWIN32 )
#if !defined( CYGWIN32 )
#define NULL_FILE	"/dev/null"	/* To reserve one stream	   */
#else
#define NULL_FILE	"proto.are"
#endif
#define AREA_DIR	"area/"		/* Area files			   */
#define PLAYER_DIR	"player/"	/* Player files			   */
#define NOTE_DIR	"notes/"	/* Note files			   */
#define SYSTEM_DIR	"system/"	/* for system information	   */
#define POSES_DIR	"system/poses/" /* poses in files here		   */
#define EXE_FILE	"../bin/daleken" /*  For running the program	   */
#define NEW_EXE_FILE	"../bin/daleken.new"
#define OLD_EXE_FILE	"../bin/daleken.old"
#define DIR_SEPARATOR	"/"
#endif

#if defined( WIN32 ) || defined( BCB )
#define AREA_DIR	"area\\"	   /* Area files		   */
#define PLAYER_DIR	"player\\"	   /*	Player files		   */
#define NULL_FILE	"nul"		   /*  To reserve one stream	   */
#define NOTE_DIR	"notes\\"	   /* Note files		   */
#define SYSTEM_DIR	"system\\"	   /* for system information	   */
#define POSES_DIR	"system\\poses\\" /* poses in files here */
#define EXE_FILE	"..\\bin\\daleken.exe" /*  For running the program */
#define NEW_EXE_FILE	"..\\bin\\daleken.new"
#define OLD_EXE_FILE	"..\\bin\\daleken.old"
#define DIR_SEPARATOR	"\\"
#endif

#define AREA_LIST	"AREA.LST"	/*   List of areas (in AREA_DIR)     */

/* In the base data directory. */
#define BUG_FILE	"BUGS.TXT"	/*   For 'bug' and bug()	     */
#define IDEA_FILE	"ideas.txt"	/*   For 'idea'			     */
#define TYPO_FILE	"typos.txt"	/*   For 'typo'			     */
#define NOHELP_FILE	"nohelp.txt"	/*   For helps which don't exist     */
#define SHUTDOWN_FILE	"SHUTDOWN.TXT"	/*   For 'shutdown'		     */
#define LAST_COMM_FILE	"lastcomm.txt"	/*   last command before crash	     */
#define SYSINFO_FILE	"SYSINFO.TXT"	/*   static system information	     */
#define SYSINFO_SAVE	"SYSINFO.SAV"	/*   saved system information	     */
#define COPYOVER_FILE	"copyover.txt"	/*   For copyover recovery	     */

/* In the system directory - prepend SYSTEM_DIR to these. */
#define BAN_FILE	"ban.txt"	/*   For banned site save	     */
#define HIGHEST_FILE	"highest.txt"	/*   For highest player info	     */
#define BURIED_FILE	"buried.txt"	/*   For saving buried items	     */
#define UNIQUE_KEY_FILE "unique.key"	/*   To ensure unique numbers	     */
#define BADNAME_FILE	"badnames.txt"	/*   All the names that are banned   */
#define PLANE_FILE	"planes.txt"	/*   Plane information		     */
#define SOCIAL_FILE	"socials.txt"	/*   Socials for the mud.	     */
#define CLAN_FILE	"clans.txt"	/*   Clans file.		     */
#define RELIGION_FILE	"religion.txt"	/*   Religions file.		     */