lurf/area/
lurf/build/testing/
lurf/log/
lurf/player/
lurf/player/backup/
#ifndef MERCH
#define MERCH
/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  In particular, you may not remove either of *
 *  these copyright notices.                                               *
 *                                                                         *
 *  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.                                                  *
 ***************************************************************************/

/*
* Accommodate old non-Ansi compilers.
*/
#if defined(TRADITIONAL)
#define const
#define args( list )			( )
#define DECLARE_DO_FUN( fun )		void fun( )
#define DECLARE_SPEC_FUN( fun )		bool fun( )
#define DECLARE_SPELL_FUN( fun )	void fun( )
#define DECLARE_POWER_FUN( fun )	void fun( )
#else
#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_POWER_FUN( fun )	POWER_FUN fun
#endif


/* system calls */
int system();


/*
 * Short scalar types.
 * Diavolo reports AIX compiler has bugs with short types.
 */
#if	!defined(FALSE)
#define FALSE	 0
#endif

#if	!defined(TRUE)
#define TRUE	 1
#endif

#if	defined(_AIX)
#if	!defined(const)
#define const
#endif
typedef int				sh_int;
typedef int				bool;
#define unix
#else
typedef short    int			sh_int;
//typedef unsigned char			bool;
#endif
#include "player.h"

/*
 * Structure types.
 */
typedef struct  dummy_arg           DUMMY_ARG;
typedef struct	affect_data			AFFECT_DATA;
typedef struct	known_data			KNOWN_DATA;
typedef struct	sphere_data			SPHERE_DATA;
typedef struct	area_data			AREA_DATA;
typedef struct	ban_data			BAN_DATA;
typedef struct  buf_type            BUFFER;
typedef struct	char_data			CHAR_DATA;
typedef struct	descriptor_data		DESCRIPTOR_DATA;
typedef struct	exit_data			EXIT_DATA;
typedef struct	extra_descr_data	EXTRA_DESCR_DATA;
typedef struct	help_data			HELP_DATA;
typedef struct	help_area_data		HELP_AREA;
typedef struct	kill_data			KILL_DATA;
typedef struct	mob_index_data		MOB_INDEX_DATA;
typedef struct	note_data			NOTE_DATA;
typedef struct	obj_data			OBJ_DATA;
typedef struct	obj_index_data		OBJ_INDEX_DATA;
typedef struct	mem_data			MEM_DATA;
typedef struct	pc_data				PC_DATA;
typedef struct	reset_data			RESET_DATA;
typedef struct	room_index_data		ROOM_INDEX_DATA;
typedef struct	shop_data			SHOP_DATA;
typedef struct	time_info_data		TIME_INFO_DATA;
typedef struct	temp_list			TEMP_LIST;
typedef struct  mprog_list			MPROG_LIST;
typedef struct  mprog_code			MPROG_CODE;
typedef struct  mud_settings			MUD_SETTING;


struct mud_settings
{
	int 	mud_setting;
	int	total_player_count;
	int	Char_Count;
	int     Obj_Count;
	int	high_mobile_vnum;
	int 	high_object_vnum;
	long 	objects_created;
	long    objects_recycled;
	long    mobiles_created;
	long	Objects_Recycled;
	long	Objects_Recycled_HEAP;
	long	Mobiles_Recycle;
	long	Mobiles_Recycle_Heap;
	long	Mobiles_New;
	long 	total_mobiles_created;
	long    total_objects_created;
	long	total_players_connected;
	long 	current_players_connected;
	long    players_recycled;
	long	players_logged;
	int 	last_proc_logged;
	int 	build;
};

struct tmp_list
{
	TEMP_LIST *next;
	CHAR_DATA *ch;
};

/* Includes for board system */
/* This is version 2 of the board system, (c) 1995-96 erwin@pip.dknet.dk */


typedef struct board_data BOARD_DATA;

#define NOTE_DIR  				"../notes/" /* set it to something you like */

#define DEF_NORMAL  0 /* No forced change, but default (any string)   */
#define DEF_INCLUDE 1 /* 'names' MUST be included (only ONE name!)    */
#define DEF_EXCLUDE 2 /* 'names' must NOT be included (one name only) */

#define MAX_BOARD 	 18 

#define DEFAULT_BOARD 0 /* default board is board #0 in the boards      */
                        /* It should be readable by everyone!           */
                        
#define MAX_LINE_LENGTH 80 /* enforce a max length of 80 on text lines, reject longer lines */
						   /* This only applies in the Body of the note */                        
						   
#define MAX_NOTE_TEXT (4*MAX_STRING_LENGTH - 1000)
						
#define BOARD_NOTFOUND -1 /* Error code from board_lookup() and board_number */

/* Data about a board */

struct board_data
{
	char *short_name; /* Max 8 chars */
	char *long_name;  /* Explanatory text, should be no more than 40 ? chars */
	int read_level; /* minimum level to see board */
	int write_level;/* minimum level to post notes */
	char *names;       /* Default recipient */
	int force_type; /* Default action (DEF_XXX) */
	int purge_days; /* Default expiration */
	NOTE_DATA * note_first;  /*pointer to board's first note */
	bool changed; /* currently unused */
		
};



/* External variables */

extern BOARD_DATA boards[MAX_BOARD]; /* Declare */


/* Prototypes */

void strip_note  args( ( CHAR_DATA *ch, OBJ_DATA *obj) );
void finish_note (BOARD_DATA *board, NOTE_DATA * note); /* attach a note to a board */
void free_note   (NOTE_DATA *note); /* deallocate memory used by a note */
void load_boards (void); /* load all boards */
int board_lookup (const char *name); /* Find a board with that name */
bool is_note_to (CHAR_DATA *ch, NOTE_DATA *note); /* is tha note to ch? */
void personal_message (const char *sender, const char *to, const char *subject, const int expire_days, const char *text);
void make_note (const char* board_name, const char *sender, const char *to, const char *subject, const int expire_days, const char *text);
void save_notes ();

/* for nanny */
void handle_con_note_to 		(DESCRIPTOR_DATA *d, char * argument);
void handle_con_note_subject 	(DESCRIPTOR_DATA *d, char * argument);
void handle_con_note_expire 	(DESCRIPTOR_DATA *d, char * argument);
void handle_con_note_text 		(DESCRIPTOR_DATA *d, char * argument);
void handle_con_note_finish 	(DESCRIPTOR_DATA *d, char * argument);


/* Commands */

/*
 * Function types.
 */
typedef	void DO_FUN	args( ( CHAR_DATA *ch, char *argument ) );
typedef bool SPEC_FUN	args( ( CHAR_DATA *ch ) );
typedef void SPELL_FUN	args( ( int sn, int level, CHAR_DATA *ch, void *vo ) );
typedef void POWER_FUN	args( ( CHAR_DATA *ch, CHAR_DATA *victim, char *argument ) );



/* valid states */
#define BUFFER_SAFE     0
#define BUFFER_OVERFLOW 1
#define BUFFER_FREED    2


/*
 * String and memory management parameters.
 */
#define MAX_KEY_HASH		 1024
#define MAX_SOCIALS               500
#define MAX_XSOCIALS              500
#define MAX_STRING_LENGTH	 4096
#define MAX_RIDDLE		  200
#define MAX_INPUT_LENGTH	  160
#define MAX_QUOTES                 31
#define MAX_MIDI		    9 /* Start at 0 when counting!!! */
#define MAX_IGNORE		    4 /* Start at 0 when counting!!! */
#define MAX_WAV_SCREAM              7
#define MAX_DECAP_WAV               1
#define MAX_GENERALWAV             15
#define HAUNT_MAX 	            	9
#define MAX_REMEMBER				7
#define MIL 	     MAX_INPUT_LENGTH
#define MAX_SPHERE                  9

/*globals for damn reason*/
extern		int			world_affects;

extern          DUMMY_ARG         *     dummy_free;
extern          DUMMY_ARG         *     dummy_list;
extern          int                     thread_count;


/*Define the mud settings for general setup of MUD state.  */
#define MS_CHAOS_NIGHT	 			(A) //Hope to accually use this one night :P
#define MS_DEBUG					(B) //To help debug the mud
#define MS_DOUBLE_HP				(C)	//Double Hp on ticks for players.
#define MS_DOUBLE_MANA				(D)	//Double Mana on Ticks for players.
#define MS_LIVING_DEAD			    (E) //night of the living Dead..(Quest)
#define MS_CASINO                   (F) //Casino's Open/Closed

#define      GAME_NONE       0
#define      GAME_SLOTS      1
#define      GAME_HIGH_DICE  2


void 	check_object 	args( ( char *argument ) );
void 	check_both 	args( ( char *argument ) );
void 	check_mobile 	args( ( char *argument ) );

int 	get_object_count 	args( ( char *argument ) );
int 	get_mobile_count 	args( ( char *argument ) );
int 	get_player_count 	args( ( char *argument ) );

/*
* 
* Rotains Gobal Procedures
*/

void clear_stats    args( (CHAR_DATA *ch) );
void room_is_total_darkness args( (ROOM_INDEX_DATA *pRoomIndex) );
void improve_wpn    args( (CHAR_DATA *ch,int dtype, bool right_hand) );
void improve_stance args( (CHAR_DATA *ch) );
void skillstance    args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void show_spell     args( (CHAR_DATA *ch, int dtype) );
void fightaction    args( (CHAR_DATA *ch, CHAR_DATA *victim, int actype , \
		int dtype, int wpntype) ); 
void crack_head     args( (CHAR_DATA *ch, OBJ_DATA *obj, char *argument) );
void critical_hit   args( (CHAR_DATA *ch, CHAR_DATA *victim, int dt, int dam) );
void take_item      args( (CHAR_DATA *ch, OBJ_DATA *obj) );
void raw_kill       args( (CHAR_DATA *victim) );
void trip           args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void disarm         args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void make_corpse    args( (CHAR_DATA *ch) );
void one_hit        args( (CHAR_DATA *ch, CHAR_DATA *victim, int dt, \
		int handtype) );
void make_part      args( (CHAR_DATA *ch, char *argument) );

/*void clan_table_read        args( ( ) );
void artifact_table_read    args( ( ) );
void clan_table_write       args( ( ) );
void artifact_table_write   args( ( ) );
void home_write             args( ( ) );
void clan_table_powerselect args( (CHAR_DATA *ch, char *power_name) );
void clan_table_namefill    args( (CHAR_DATA *ch) );
void clan_table_bite        args( (CHAR_DATA *ch) );
void clan_table_dec         args( (CHAR_DATA *ch, CHAR_DATA *victim) );
*/
void behead                 args( (CHAR_DATA *victim) );
void paradox                args( (CHAR_DATA *ch) );

/* 
 * Godwars Game Parameters
 * By Rotain
 */

#define SKILL_ADEPT               100
#define SKILL_THAC0_32             18
#define SKILL_THAC0_00              6
#define VERSION_NUMBER              2
#define DONATION_ROOM_WEAPON     6641
#define DONATION_ROOM_ARMOR      6643
#define DONATION_ROOM_REST       6644
#define MAX_VAMPIRE_POWER           3 
#define MAX_CLAN                   11
#define MAX_ART                    21
#define MAX_DISCIPLINE             15
#define MAX_VAMP_CLAN              29
#define MAX_MAGE_CLAN               4
#define MAX_HP                  12000
#define MAX_HARD_SKILLS            10
#define COST_DIS		   50 /* Cost multiplier for disciplines */
#define COST_TOTEM		   50 /* Cost multiplier for totems */

/*
 * Game parameters.
 * Increase the max'es if you add more of something.
 * Adjust the pulse numbers to suit yourself.
 */

#define PARADOX_TICK       30
#define MAX_SKILL		  141
#define MAX_TOTAL_SKILL	  142
#define SKILL_ADD           4
#define MAX_SPELL		   60
#define MAX_ALIAS		   20
#define MAX_LEVEL		   12
#define NO_WATCH		   10
#define NO_GODLESS		   (MAX_LEVEL - 2)
#define LEVEL_HERO		   (MAX_LEVEL - 9)
#define LEVEL_IMMORTAL		   (MAX_LEVEL - 5)

#define LEVEL_MORTAL		   (MAX_LEVEL - 10)
#define LEVEL_AVATAR		   (MAX_LEVEL - 9)
#define LEVEL_APPRENTICE	   (MAX_LEVEL - 8)
#define LEVEL_MAGE		   (MAX_LEVEL - 7)
#define LEVEL_ARCHMAGE		   (MAX_LEVEL - 6)

#define LEVEL_BUILDER		   (MAX_LEVEL - 5)
#define LEVEL_QUESTMAKER	   (MAX_LEVEL - 4)
#define LEVEL_ENFORCER		   (MAX_LEVEL - 3)
#define LEVEL_JUDGE		   (MAX_LEVEL - 2)
#define LEVEL_HIGHJUDGE		   (MAX_LEVEL - 1)
#define LEVEL_IMPLEMENTOR	   (MAX_LEVEL)

#define PULSE_PER_SECOND	    4
#define PULSE_VIOLENCE		  ( 3 * PULSE_PER_SECOND)
#define PULSE_MOBILE		  ( 4 * PULSE_PER_SECOND)
#define PULSE_TICK		  (45 * PULSE_PER_SECOND)
#define PULSE_AREA		  (60 * PULSE_PER_SECOND)
#define PULSE_WW                  ( 4 * PULSE_PER_SECOND)

#define AUTO_REGEN               1000 /* level for casting of clot and mend to suppress errors */

/*
 * Planes of Existance...
 */
#define PLANE_DEAD		0	//Your Dead! Lie Down!
#define PLANE_NORMAL		1	//Normal Mortal Plane
#define PLANE_SHADOW		2       //Lurf Plane Nothing	
#define PLANE_SPIRIT		3 	//Spirit/Wraith Plane	
#define PLANE_UMBRA		4	//WWF Plane (Special things live here)	
#define PLANE_ETHEREAL          5	//Mist Plane for Vampires
#define PLANE_IMMORTAL          6	//Immy plane for imms that want to get away from it all
#define PLANE_EARTH		7	//They are in the Earth
#define PLANE_PUNISHMENT	8	//Oh no! Your FUCkED

/*
 * Rotains Clan Table Structure
 */

struct clan_table_type
{
	char * clan_name;
	char * clan_leader;
	char * clan_powers_1;
	char * clan_powers_2;
	char * clan_powers_3;
	int    clan_kills [MAX_CLAN];
	int    lvnum;       /* Lower vnum of clan area */
	int    uvnum;       /* Upper vnum of clan area */
	int    clan_recall; /* Clan recall vnum */
};


struct artifact_type
{
	char * player_name;
	int    object_vnum;
};


/*
 * Site ban structure.
 */

#define BAN_SUFFIX		A
#define BAN_PREFIX		B
#define BAN_NEWBIES		C
#define BAN_ALL			D	
#define BAN_PERMIT		E
#define BAN_PERMANENT		F

struct	ban_data
{
	BAN_DATA *	next;
	bool        valid;
	sh_int      ban_flags;
	sh_int      level;
	char *	name;
	char *  reason;
};

struct buf_type
{
	BUFFER *    next;
	bool        valid;
	sh_int      state;  /* error state of the buffer */
	sh_int      size;   /* size in k */
	char *      string; /* buffer's string */
};

/* ban data recycling */
#define BD BAN_DATA
BD      *new_ban args( (void) );
void    free_ban args( (BAN_DATA *ban) );
#undef BD


/* global weather table */

typedef struct	weather_data		WEATHER_DATA;


/*
 * Time and weather stuff.
 */

/* Overall time */
#define HOURS_PER_DAY   24
#define DAYS_PER_WEEK    7
#define DAYS_PER_MONTH  28
#define MONTHS_PER_YEAR	13
#define DAYS_PER_YEAR   (DAYS_PER_MONTH * MONTHS_PER_YEAR)

/* PaB: Hours of the day */
/* Notes: Night is half of the day, so sunrise is 1/4 of the way
 * through the day, and sunset 3/4 of the day.  
 */
#define HOUR_SUNRISE		(HOURS_PER_DAY / 4)			
#define HOUR_DAY_BEGIN		(HOUR_SUNRISE + 1)			
#define HOUR_NOON           (HOURS_PER_DAY / 2)			
#define HOUR_SUNSET			((HOURS_PER_DAY / 4) * 3)
#define HOUR_NIGHT_BEGIN	(HOUR_SUNSET + 1)			
#define HOUR_MIDNIGHT		HOURS_PER_DAY

/* Notes: Each season will be arbitrarily set at 1/4 of the year.
 */
#define SEASON_WINTER		0
#define SEASON_SPRING		1
#define SEASON_SUMMER		2
#define SEASON_FALL		3
#define SEASON_MAX         	4

/* Phases of the moon 
 * Have to tie these in to Auspice's for garou
 */
#define MOON_NEW			0
#define MOON_1_QUART        1
#define MOON_HALF			2
#define MOON_LAST_QUART     3
#define MOON_FULL			4
/*
 * Sector types.
 * Used in #ROOMS.
 */
#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_TUNDRA		      8
#define SECT_AIR		      9
#define SECT_DESERT		     10
#define SECT_UNUSED		     11
#define SECT_MAX		     11



/*
 * 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
#define SKY_MAX			    4

struct	time_info_data
{
	int		hour;
	int		half_hour;
	int		day;
	int		month;
	int		year;
};

struct	weather_data
{
	int		mmhg;
	int		change;
	int		sky;
	int		sunlight;
	sh_int     moon;
	sh_int  moon_count;
};



/*
 * Connected state for a channel.
 */
#define CON_GET_NAME			 1
#define CON_GET_OLD_PASSWORD		 2
#define CON_CONFIRM_NEW_NAME		 3
#define CON_GET_NEW_PASSWORD		 4
#define CON_CONFIRM_NEW_PASSWORD	 5
#define CON_GET_NEW_SEX			 6
#define CON_GET_NEW_CLASS		 7
#define CON_READ_MOTD			 8
#define CON_PLAYING			 9
#define CON_NOT_PLAYING			10
#define CON_NOTE_TO                     11
#define CON_NOTE_SUBJECT                12
#define CON_NOTE_EXPIRE                 13
#define CON_NOTE_TEXT                   14
#define CON_NOTE_FINISH                 15
#define CON_COPYOVER_RECOVER            16
#define CON_READLOG	                17
#define CON_HARDCORE	                18


/*
 * threaded status - Jobo
 */
#define STATUS_LOOKUP       0   // New Descriptor, in lookup pr. default.   
#define STATUS_DONE         1   // The lookup is done.
#define STATUS_WAIT         2   // Closed while in thread.
#define STATUS_CLOSED       3   // Closed, ready to be recycled.

/*
 * Needed for threads - Jobo
 */
struct dummy_arg {
  DUMMY_ARG        *next;
  DESCRIPTOR_DATA  *d;
  char             *buf;
  sh_int           status;
};

#define NUM_OPT	255

/*
 * Descriptor (channel) structure.
 */
struct	descriptor_data
{
	GSList *	snoop_by;
	CHAR_DATA *	character;
	CHAR_DATA *	original;
	GString		*host;
	sh_int		descriptor;
    sh_int              lookup_status;
	sh_int		connected;
	bool            valid;
	bool		fcommand;
	char		inbuf	[4 * MAX_INPUT_LENGTH];
	char		incomm	[MAX_INPUT_LENGTH];
	char		inlast	[MAX_INPUT_LENGTH];
	int		repeat;
	GString		*outbuf;
	int 		telnet_option[NUM_OPT];	
	//int		outsize;
	//int		outtop;
	void *		pEdit; /*OLC*/
	char **		pString; /*OLC*/
	int		editor; /*OLC*/
	GString		*showstr_head;
	char * 		showstr_point;
    	int         s_state;

 

};

   enum 
	{
		TOP_LEVEL,
		SEEN_IAC,
		SEEN_DO,
		SEEN_DONT,
		SEEN_WILL,
		SEEN_WONT,
		SEEN_SE,
		SUBNEGOT,
		SEEN_SB
	};

struct wiznet_type
{
    char *	name;
    long 	flag;
    int		level;
};

/*
 * Attribute bonus structures.
 */
struct	str_app_type
{
	sh_int	tohit;
	sh_int	todam;
	sh_int	carry;
	sh_int	wield;
};

struct	int_app_type
{
	sh_int	learn;
};

struct	wis_app_type
{
	sh_int	practice;
};

struct	dex_app_type
{
	sh_int	defensive;
};

struct	con_app_type
{
	sh_int	hitp;
	sh_int	shock;
};



/*
 * TO types for act.
 */
#define TO_ROOM		    0
#define TO_NOTVICT	    1
#define TO_VICT		    2
#define TO_CHAR		    3
#define TO_ALL		    4
#define TO_NOTVICTBR    5



/*
 * Help table types.
 */
struct	help_data
{
	HELP_DATA *	next;
	sh_int	level;
	gchar *	keyword;
	gchar *	text;
};



struct help_area_data
{
	HELP_AREA *	next;
	HELP_DATA *	first;
	HELP_DATA *	last;
	AREA_DATA *	area;
	char *		filename;
};


/*
 * Shop types.
 */
#define MAX_TRADE	 5

struct	shop_data
{
	SHOP_DATA *	next;			/* Next shop in list		*/
	sh_int	keeper;			/* Vnum of shop keeper mob	*/
	sh_int	buy_type [MAX_TRADE];	/* Item types shop will buy	*/
	sh_int	profit_buy;		/* Cost multiplier for buying	*/
	sh_int	profit_sell;		/* Cost multiplier for selling	*/
	sh_int	open_hour;		/* First opening hour		*/
	sh_int	close_hour;		/* First closing hour		*/
};

struct spec_type
{
	char * 	name;			/* special function name */
	SPEC_FUN *	function;		/* the function */
};


/*
 * Data structure for notes.
 */
/* Spirals new Note data format. */

struct	note_data
{
	NOTE_DATA *	next;
	GString *	sender;
	GString *	date;
	GString *	to_list;
	GString *	subject;
	GString *	text;
    /* Spiral changes to the format of the note. */
	bool	valid;
	time_t	date_stamp;
	sh_int	type;
	time_t  expire;
};

struct item_type
{
	int type;
	char * name;
};

/* 
 * define types for Sphere Types(where the bits apply) 
 */

#define TYPE_SPHERE_ADDED     0
#define TYPE_SPHERE_AFFECT    1
#define TYPE_SPHERE_ACT       2
#define TYPE_SPHERE_SPAFFECT  3
#define TYPE_PLANE	      4
#define TYPE_SIGHT	      5

/*
 * A sphere_affect.
 */

struct	sphere_data
{
	SPHERE_DATA *	next;
	bool		valid;
	int             spell_number;
	int		type;
	int		duration;
	int		bitvector;
};


/*
 * An affect.
 */
struct	affect_data
{
	AFFECT_DATA *	next;
	int		type;
	sh_int		duration;
	sh_int		location;
	sh_int		modifier;
	sh_int          where;   /* Rom Compatiblity */
	bool            valid;
	int		bitvector;
};

struct known_data
{
	KNOWN_DATA    *next;
	long           value;
	bool           valid;
};

/*
 * Where type shit
 */
#define TO_OBJECT  1
#define TO_WEAPON  5

#define WEAPON_POISON  A

/*
 * A kill structure (indexed by level).
 */
struct	kill_data
{
	sh_int		number;
	sh_int		killed;
};



/***************************************************************************
 *                                                                         *
 *                   VALUES OF INTEREST TO AREA BUILDERS                   *
 *                   (Start of section ... start here)                     *
 *                                                                         *
 ***************************************************************************/


/* RT ASCII conversions -- used so we can have letters in this file */

#define A                       1
#define B                       2
#define C                       4
#define D                       8
#define E                       16
#define F                       32
#define G                       64
#define H                       128

#define I                       256
#define J                       512
#define K                       1024
#define L                       2048
#define M                       4096
#define N                       8192
#define O                       16384
#define P                       32768

#define Q                       65536
#define R                       131072
#define S                       262144
#define T                       524288
#define U                       1048576
#define V                       2097152
#define W                       4194304
#define X                       8388608

#define Y                       16777216
#define Z                       33554432
#define aa                      67108864        /* doubled due to conflicts */
#define bb                      134217728
#define cc                      268435456
#define dd                      536870912
#define ee                      1073741824


/*
 * Immunities, for players.  KaVir.
 */
#define IMM_SLASH	      A	/* Resistance to slash, slice. 		*/
#define IMM_STAB	      B	/* Resistance to stab, pierce. 		*/
#define IMM_SMASH	      C	/* Resistance to blast, pound, crush. 	*/
#define IMM_ANIMAL	      D	/* Resistance to bite, claw. 		*/
#define IMM_MISC	      E	/* Resistance to grep, suck, whip. 	*/
#define IMM_CHARM	      F	/* Immune to charm spell. 		*/
#define IMM_HEAT	      G	/* Immune to fire/heat spells. 		*/
#define IMM_COLD	      H	/* Immune to frost/cold spells.		*/
#define IMM_LIGHTNING	      I	/* Immune to lightning spells.		*/
#define IMM_ACID	      J	/* Immune to acid spells.		*/
#define IMM_SUMMON	      K	/* Immune to being summoned.		*/
#define IMM_VOODOO	      L	/* Immune to voodoo magic.		*/
#define IMM_VAMPIRE	      M	/* Allow yourself to become a vampire.	*/
#define IMM_STAKE	      N	/* Immune to being staked (vamps only). */
#define IMM_SUNLIGHT	      O	/* Immune to sunlight (vamps only).	*/
#define IMM_SHIELDED	      P /* For Obfuscate. Block scry, etc.	*/
#define IMM_HURL	      Q /* Cannot be hurled.			*/
#define IMM_BACKSTAB	      R /* Cannot be backstabbed.		*/
#define IMM_KICK	      S /* Cannot be kicked.			*/
#define IMM_DISARM	      T /* Cannot be disarmed.			*/
#define IMM_STEAL	      U /* Cannot have stuff stolen.		*/
#define IMM_SLEEP	      V /* Immune to sleep spell.		*/
#define IMM_DRAIN	      W /* Immune to energy drain.		*/
#define IMM_MAGE	      X /* Allow yourself to become a mage.	*/
#define IMM_TRANSPORT         Y /* Objects can't be transported to you.	*/
#define IMM_INDUCT            Z /* Immune to 'induct' command for sects */
#define IMM_WEREWOLF         aa /* Immune to werewolf */
#define IMM_TIME             bb /* Immune to SLOW_TIME affect */
#

/*
 * ACT bits for mobs.
 * Used in #MOBILES.
 */
#define ACT_IS_NPC		      A		/* Auto set for mobs	*/
#define ACT_SENTINEL		      B		/* Stays in one room	*/
#define ACT_SCAVENGER		      C		/* Picks up objects	*/
#define ACT_AGGRESSIVE		      D		/* Attacks PC's		*/
#define ACT_STAY_AREA		      E		/* Won't leave area	*/
#define ACT_WIMPY		      F		/* Flees when hurt	*/
#define ACT_PET			      G		/* NOT USED.. MOVED TO MOBCON	*/
#define ACT_TRAIN		      H		/* Can train PC's	*/
#define ACT_PRACTICE		      I		/* Can practice PC's	*/
#define ACT_MOUNT		      J		/* Can be mounted	*/
#define ACT_NOPARTS		      K		/* Dead = no body parts	*/
#define ACT_NOEXP		      L		/* No exp for killing	*/
#define ACT_HOLYLIGHT		      M		/* No exp for killing	*/
#define ACT_DEAD		      O		/* No exp for killing	*/
#define ACT_PLAYER_KILLER	      P		/* Damage = dam * ch->level*/
#define ACT_HUNTER		      Q		/* Hunter mob           */
#define ACT_ANIMAL		      R		/* animal mob for filets*/
#define ACT_HUMAN 		      S		/* Human mobs for bloody*/
#define ACT_GUARD 		      T		/* Guard mobs for assist*/
#define ACT_ELITE 		      U		/* Elite mobs for avatar*/
#define ACT_COMMANDED		  V    
#define ACT_TAPPING           ee     /* Mage Tapping */


/*Sphere Bits for Mage Spells - Spiral */

#define AFSPHERE_ENTROPY_SHIELD       (A)
#define AFSPHERE_MIND_SHIELD          (B)
#define AFSPHERE_FORCES_SHIELD        (C)
#define AFSPHERE_PRIME_SHIELD         (D)
#define AFSPHERE_LIFE_SHIELD          (E)
#define AFSPHERE_SPIRIT_SHIELD        (F)
//#define AFSPHERE_NIGHTSIGHT           (G)
#define AFSPHERE_SHIELD               (H)
#define AFSPHERE_MANA_SHIELD          (I)
#define AFSPHERE_SLOW_TIME            (J)
#define AFSPHERE_SPEED_TIME           (K)
#define AFSPHERE_TAINTED			  (L)
#define AFSPHERE_FALSE_PRIDE 		  (M)
//#define AFSPHERE_NIGHT_SIGHT 		  (N)
#define AFSPHERE_REGEN		 		  (O)
#define AFSPHERE_SQUARE_CIRCLE 		  (P)


/*
 * Bits for 'affected_by'.
 * Used in #MOBILES.
 */
#define AFF_BLIND		      A
#define AFF_INVISIBLE		      B
//#define AFF_DETECT_EVIL	      C
//#define AFF_DETECT_INVIS	      D
//#define AFF_DETECT_MAGIC	      E
//#define AFF_DETECT_HIDDEN	      F
#define AFF_SHADOWPLANE	      	      G /*Here for Old DB Support.. I should make pMobIndex save load planes */
#define AFF_SANCTUARY		      H
#define AFF_FAERIE_FIRE		      I
//#define AFF_INFRARED		      J
#define AFF_CURSE		      K
#define AFF_FLAMING		      L /* For burning creatures - KaVir */
#define AFF_POISON		      M
#define AFF_PROTECT		      N
//#define AFF_ETHEREAL		      O /* For ethereal creatures - KaVir */
#define AFF_SNEAK		      P
#define AFF_HIDE		      Q
#define AFF_SLEEP		      R
#define AFF_CHARM		      S
#define AFF_FLYING		      T
#define AFF_PASS_DOOR		      U
#define AFF_POLYMORPH		      V /* For polymorphed creatures - KaVir */
//#define AFF_SHADOWSIGHT		      W /* Can see between planes - KaVir */
#define AFF_WEBBED		      X /* Cannot move - KaVir */
#define AFF_CONTRACEPTION             Y /* Cannot get pregnant - KaVir */
#define AFF_DARKNESS                  Z /* Drow Darkness - Rotain */   
#define AFF_DISEASE                  aa   
#define AFF_AGGDAM                   bb   
#define AFF_PLAGUE                   cc /* Rom style plauge */
#define AFF_FEAR                     dd
#define AFF_GHOST		     ee /* Someone brought a spirit in to the real world */

#define SIGHT_INVISABLE		     (A)  //See thos Invis People
#define SIGHT_SHADOW		     (B)  //See the People chilling in teh Shadow Plane
#define SIGHT_SPIRIT		     (C)  //See them Wraiths/Spirits
#define SIGHT_ETHEREAL		     (D)  //See the Misty Eyed People
#define SIGHT_IMMORTAL		     (E)  //See Immortals
#define SIGHT_UMBRA		     (F)  //See Things in the Umbra
#define SIGHT_INFRARED               (G)  //See Things/People in the Dark(normal)
#define SIGHT_MAGIC		     (H)  //See Things/People if they are Magic
#define SIGHT_ALIGNMENT              (I)  //See People Alignment
#define SIGHT_HIDDEN		     (J)  //See The People that like to Sneak/Hide
#define SIGHT_PDARK		     (K)  //See through Player Created Darkness
#define SIGHT_POLY		     (L)  //See people for what they truly are
#define SIGHT_NIGHTSIGHT	     (M)  //See Things Perfectly in the Dark

/*
 * MORE bits for players. (KaVir)
 */
#define MORE_NPC		      1 /* NPC - ie cannot improve */
#define MORE_ANTITRIBU		      2 /* Antitribu vampire */
#define MORE_MUMMIFIED		      4 /* Serpentis 3 */
#define MORE_DARKNESS		      8 /* Obtenebration 1 */
#define MORE_SILENCE		     16 /* Quietus 1 */
#define MORE_PLASMA		     32 /* Vicissitude 5 */
#define MORE_ASHES		     64 /* Thanatosis 3 */
#define MORE_GUARDIAN		    128 /* Necromancy 4 */
#define MORE_LOYAL		    256 /* Dominate 6 */
#define MORE_SINGING		    512 /* Singing atm */
#define MORE_LEADER		   1024 /* Coterie leader */
#define MORE_HAND_FLAME		   2048 /* Hand of Flame */
#define MORE_SPIRIT		   4096 /* You become a true spirit */
#define MORE_STAKED		   8192 /* You have been staked */
#define MORE_DEFLECTION		  16384 /* Deflection ritual in effect */
#define MORE_PROJECTION		  32768 /* Using astral projection */
#define MORE_CHAMPION		  65536 /* Coterie champion */
#define MORE_REINA		 131072 /* Song of Reina - Melpominee 2 */
#define MORE_EVILEYE		 262144 /* Evil Eye ON */
#define MORE_INFORM		8388608 /* Inform when say */
#define MORE_OBEAH	       67108864 /* Obeah third eye is open */
#define MORE_NOPAIN	      134217728 /* Obeah 2, no pain penalties */
#define MORE_NEUTRAL	      268435456 /* Obeah 3, makes room safe room */

#define CRIME_C_OUTLAW		      1 /* Camarilla Outlaw */
#define CRIME_A_OUTLAW		      2 /* Anarch Outlaw */
#define CRIME_S_OUTLAW		      4 /* Sabbat Outlaw */
#define CRIME_I_OUTLAW		      8 /* Inconnu Outlaw */
#define CRIME_BLOODHUNT		     16 /* Camarilla Bloodhunted */
#define CRIME_DIABLERIE		     32 /* Committed Diablerie */
#define CRIME_MASQUERADE	     64 /* Breached the Masquerade */
#define CRIME_DOMAIN		    128 /* Disobeyed Prince */
#define CRIME_PROGENY		    256 /* Sired childe without permission */
#define CRIME_ACCOUNTING	    512 /* Childe broke tradition */
#define CRIME_HOSPITALITY	   1024 /* Not yet presented self to prince */
#define CRIME_DESTRUCTION	   2048 /* Killed a vampire in same sect */

#define DIAB_TIME		      0 /* Duration of diablerie aura */
#define DIAB_EVER		      1 /* Number of diableries committed */

#define LIE_TRUE		      0
#define LIE_FALSE		      1

#define RES_ANIMALISM		      1
#define RES_AUSPEX		      2
#define RES_DOMINATE		      4
#define RES_PRESENCE		      8
#define RES_TOGGLE		     16
#define RES_CELERITY		     32

#define WILL_ANIMALISM		      1
#define WILL_AUSPEX		      2
#define WILL_DOMINATE		      3
#define WILL_PRESENCE		      4

//Basic Classes
#define BCLASS_NONE				 0
#define BCLASS_WARRIOR			(A)
#define	BCLASS_CLERIC			(B)
#define BCLASS_THIEF			(C)
#define BCLASS_MAGE				(D)
#define BCLASS_IMMORTAL			(E)

/*
 * Absorbed things
 */
#define ABS_MOB_VNUM		      0 /* Vnum of Flesh Bonded mob */
#define ABS_MOB_HP		      1 /* Hp of Flesh Bonded mob */
#define ABS_MOB_MAX_HP		      2 /* Vnum of Object 1 */
#define ABS_CORPSE_HP		      3 /* Hp of Consumed corpse */
#define ABS_OBJ_1		      4 /* Vnum of Object 2 */
#define ABS_OBJ_2		      5 /* Vnum of Object 3 */

/*
 * Bits for 'itemaffect'.
 * Used in #MOBILES.
 */
#define ITEMA_SHOCKSHIELD	      A
#define ITEMA_FIRESHIELD	      B
#define ITEMA_ICESHIELD		      C
#define ITEMA_ACIDSHIELD	      D
#define ITEMA_DBPASS                  E
#define ITEMA_CHAOSSHIELD             F
#define ITEMA_ARTIFACT                G
#define ITEMA_REGENERATE              H
#define ITEMA_SPEED                   I
#define ITEMA_VORPAL                  J
#define ITEMA_PEACE                   K
#define ITEMA_RIGHT_SILVER            L
#define ITEMA_LEFT_SILVER             M
#define ITEMA_REFLECT                 N
#define ITEMA_RESISTANCE              O
#define ITEMA_VISION                  P
#define ITEMA_STALKER                 Q
#define ITEMA_VANISH                  R
#define ITEMA_RAGER                   S
#define ITEMA_HIGHLANDER              T
#define ITEMA_FORTITUDE               U
#define ITEMA_SUNSHIELD               V

/*
 *  Sects defined for new Sect code, your one stop sect code!
 */

#define SECT_INDEPENDENT	0
#define SECT_SABBAT			1
#define SECT_CAMARILLA		2
#define SECT_FOLLOWERS		3
#define SECT_WYRM			4
#define SECT_PACK			5
#define	SECT_NEWPACK		6
#define SECT_TECHNOCRACY    7
#define SECT_TRADITIONS		8
#define	SECT_ANARCHS	    9
#define	SECT_INCONNU	   10
#define SECT_NEPHANDI	   11
#define SECT_MARAUDERS	   12
#define SECT_SOCIETY_LEO   13
#define MAX_SECTS		   14  // One plus last sect

/*
 * Advanced spell actions.
 */
#define ACTION_NONE	      0
#define ACTION_MOVE	      1
#define ACTION_MOB	      2
#define ACTION_OBJECT	      3

/*
 * Advanced spell affects.
 */
#define ADV_STR			      1
#define ADV_DEX			      2
#define ADV_INT			      4
#define ADV_WIS			      8
#define ADV_CON			     16
#define ADV_SEX			     32
#define ADV_MANA		     64
#define ADV_HIT			    128
#define ADV_MOVE		    256
#define ADV_AC			    512
#define ADV_HITROLL		   1024
#define ADV_DAMROLL		   2048
#define ADV_SAVING_SPELL	   4096


/*
 * Colour stuff by Lope of Loping Through The MUD
 */
#define CLEAR		""		/* Resets Colour	*/
#define NO_COLOR	""		/* Resets Colour	*/
#define BLINK		""		/* SuperAnnoying Blink	*/
#define C_RED		""	/* Normal Colours	*/
#define RED		""	/* Normal Colours	*/
#define C_GREEN		""
#define C_YELLOW	""
#define C_BLUE		""
#define C_MAGENTA	""
#define C_CYAN		""
#define C_WHITE		""
#define C_D_GREY	""  	/* Light Colors		*/
#define C_B_RED		""
#define C_B_GREEN	""
#define C_B_YELLOW	""
#define C_B_BLUE	""
#define C_B_MAGENTA	""
#define C_B_CYAN	""
#define C_B_WHITE	""
#define CLS             "^[[2J"


/* Colour scale macros - added 12th Aug 1995 by Calamar */

#define NO_COLOUR	""		/* Blank */
#define GREY		""	/* Dark Grey */
#define D_RED		""	/* Dark Red */
#define L_RED		""	/* Light Red */
#define D_GREEN		""	/* Dark Green */
#define L_GREEN		""	/* Light Green */
#define BROWN		""	/* Brown */
#define YELLOW		""	/* Yellow */
#define D_BLUE		""	/* Dark Blue */
#define L_BLUE		""	/* Light Blue */
#define MAGENTA		""	/* Magenta */
#define PINK		""	/* Pink */
#define D_CYAN		""	/* Dark Cyan */
#define L_CYAN		""	/* Light Cyan */
#define NORMAL		""	/* Light Grey */
#define WHITE		""	/* White */

#define ADD_COLOUR(_player,_str,_col) {GString *swh_temp; swh_temp = g_string_new("");\
if (!IS_NPC(_player) && IS_SET(_player->act, PLR_ANSI)) { \
g_string_assign(swh_temp, _col); g_string_append(swh_temp, _str->str); g_string_append(swh_temp, NORMAL); \
g_string_assign(_str, swh_temp->str);}} 

#define SCALE_COLS 4

#define COL_SCALE(_swh_str,_swh_ch,_swh_curr,_swh_max) \
	ADD_COLOUR(_swh_ch, _swh_str, \
	(_swh_curr < 1) ? L_RED : \
	(_swh_curr < _swh_max) ? \
	scale[(SCALE_COLS * _swh_curr) / ((_swh_max > 0) \
	? _swh_max : 1)] : L_CYAN)

extern char *scale[SCALE_COLS];

/*
 * Bits for 'vampire'.
 * Used for player vampires.
 */
#define VAM_FANGS		      A
#define VAM_CLAWS		      B
#define VAM_NIGHTSIGHT		      C
#define VAM_FLYING		      D /* For flying creatures */
#define VAM_SONIC		      E /* For creatures with full detect */
#define VAM_CHANGED		      F /* Changed using a vampire power */
#define VAM_DISGUISED		      G /* For the Obfuscate disguise ability */
#define VAM_MORTAL		      H /* For Obfuscate mortal ability. */
#define VAM_EVILEYE		      I /* Evileye, command */
#define VAM_SPIRITEYES		      J /* Path of Spirit level 2 */
#define VAM_EARTHMELDED		      K /* Path of Spirit level 2 */

             
/* Discipline numbers */ 
#define DIS_ANIMALISM                 0
#define DIS_AUSPEX		              1 /* Truesight, etc */
#define DIS_CELERITY		          2 /* 66%/33% chance 1/2 extra attacks */
#define DIS_DEMENTATION               3
#define DIS_DOMINATE		          4 /* Evileye, command */
#define DIS_FORTITUDE		          5 /* 5 hp less per hit taken */
#define DIS_OBFUSCATE		          6 /* Disguise and invis */
#define DIS_OBTENEBRATION	          7 /* Shadowplane/sight and shadowbody */
#define DIS_POTENCE		              8 /* Deal out 1.5 times normal damage */
#define DIS_PRESENCE		          9 /* Presence discipline */
#define DIS_PROTEAN		             10 /* Claws, nightsight, and change */
#define DIS_QUIETUS                  11
#define DIS_SERPENTIS		         12 /* Eyes/serpent, heart/darkness, etc */
#define DIS_THAUMATURGY              13
#define DIS_VICISSITUDE              14


#define DISC_ABOMBWE                  0
#define DISC_ANIMALISM                1
#define DISC_AUSPEX                   2   
#define DISC_CELERITY                 3
#define DISC_CHIMERSTRY               4
#define DISC_DAIMOINON                5 
#define DISC_DEIMOS                   6
#define DISC_DEMENTATION              7
#define DISC_DOMINATE                 8
#define DISC_FORTITUDE                9
#define DISC_GROTESQUOUS             10
#define DISC_KAI                     11
#define DISC_MELPOMINEE              12
#define DISC_MORTIS                  13
#define DISC_NECROMANCY              14
#define DISC_NIHILISTICS             15
#define DISC_OBEAH                   16
#define DISC_OBFUSCATE               17
#define DISC_OBTENEBRATION           18
#define DISC_OGHAM                   19
#define DISC_POTENCE                 20
#define DISC_PRESENCE                21
#define DISC_PROTEAN                 22
#define DISC_QUIETUS                 23
#define DISC_RIFT                    24
#define DISC_SANGUINUS               25
#define DISC_SERPENTIS               26
#define DISC_TEMPORIS                27
#define DISC_THANATOSIS              28
#define DISC_THAUMATURGY             29
#define DISC_VICISSITUDE             30
#define DISC_VISCERATIKA             31 
#define DISC_EXTRA1                  32
#define DISC_EXTRA2                  33
#define DISC_EXTRA3                  34
#define DISC_EXTRA4                  35
#define DISC_EXTRA5                  36
#define DISC_EXTRA6                  37
#define DISC_EXTRA7                  38
#define DISC_EXTRA8                  39
#define MAX_DISC                     40

#define DISC_EVERYONE               300
/*
 * Bits for 'polymorph'.
 * Used for players.
 */
#define POLY_BAT		      1
#define POLY_WOLF		      2
#define POLY_MIST		      4
#define POLY_SERPENT		      8
#define POLY_RAVEN		     16
#define POLY_FISH		     32
#define POLY_FROG		     64
#define POLY_ZULO		    (H)
#define POLY_CHANGELING	    (I)
#define POLY_BONECRAFT	    (J)

/* Mobile Control Bits for fun mobile stuff */
#define MOBCON_RESLIGHT		     (A)  //Res to Lighting for them pesky mages
#define MOBCON_PET		     (B)  //Evolving Pets for players
#define MOBCON_EVOLVE		     (C)  //Evolving Mobiles (HEHEHEHEHHEHEHE)
#define MOBCON_TEACHER		     (D)  //For tehm Pesky Werewolves to Learn
#define MOBCON_DOMESTIC		     (E)  //Can be make in to a Pet
#define MOBCON_DEALER            (F)  //
#define MOBCON_NICE_SPIRIT           (G) // These Guys are nice.. there just going to stand there
#define MOBCON_PISSED_SPIRIT	     (H) //These Guys hate players..

/* WIZnet flags */
#define WIZ_ON				(A)  //If you Want Wiznet on/Off
#define WIZ_TICKS			(B)	 //See ticks
#define WIZ_LOGINS			(C)	 //See who's logging on
#define WIZ_SITES			(D)
#define WIZ_DECAP			(E)
#define WIZ_DEATHS			(F)	 //See who dies
#define WIZ_RESETS			(G)
#define WIZ_DEBUG    		(H)	  
#define WIZ_FLAGS			(I)	 //Don't Need
#define WIZ_PENALTIES		(J)	 //Don't Need
#define WIZ_SACCING			(K)
#define WIZ_LEVELS			(L)	 //don't need
#define WIZ_GENERAL			(M)
#define WIZ_SWITCHES		(N)
#define WIZ_SNOOPS			(O)
#define WIZ_RESTORE			(P)
#define WIZ_LOAD			(Q)
#define WIZ_NEWBIE			(R)
#define WIZ_PREFIX			(S)
#define WIZ_SPAM			(T)
#define WIZ_LINK			(U)
#define WIZ_BOARD 			(V)
#define WIZ_GLIB		    (W)


//Fun fun rite stuff....
#define RITE_OF_PASSAGE		1
#define RITE_OF_RENOWN		2

/*
 * Languages.
 */
#define LANG_COMMON		      0
#define DIA_OLDE		      1
#define DIA_BAD			      2
#define LANG_DARK		      4



/*
 * Score.
 */
#define SCORE_TOTAL_XP		      0
#define SCORE_HIGH_XP		      1
#define SCORE_TOTAL_LEVEL	      2
#define SCORE_HIGH_LEVEL	      3
#define SCORE_QUEST		      4
#define SCORE_NUM_QUEST		      5



/*
 * Zombie Lord.
 */
#define ZOMBIE_NOTHING		      0
#define ZOMBIE_TRACKING		      1
#define ZOMBIE_ANIMATE		      2
#define ZOMBIE_CAST		      3
#define ZOMBIE_REST		      4



/*
 * Damcap values.
 */
#define DAM_CAP		      0
#define DAM_CHANGE	      1

/*
 * Bits for Demonic Champions.
 *
 * new demon fields in player.h and old ones in old.h
 */


/*
 * Mounts
 */
#define IS_ON_FOOT		      0
#define IS_MOUNT		      1
#define IS_RIDING		      2
#define IS_CARRIED		      4
#define IS_CARRYING		      8




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



/*
 * Well known object virtual numbers.
 * Defined in #OBJECTS.
 */
#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_SLICED_ARM	     14
#define OBJ_VNUM_SLICED_LEG	     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_BLOOD_SPRING	     23
#define OBJ_VNUM_FILET		     40
#define OBJ_VNUM_FIREWOOD	     41
#define OBJ_VNUM_FIRE                42

#define OBJ_VNUM_SCHOOL_MACE	   3700
#define OBJ_VNUM_SCHOOL_DAGGER	   3701
#define OBJ_VNUM_SCHOOL_SWORD	   3702
#define OBJ_VNUM_SCHOOL_VEST	   3703
#define OBJ_VNUM_SCHOOL_SHIELD	   3704
#define OBJ_VNUM_SCHOOL_BANNER     3716

/* For KaVir's stuff */
#define OBJ_VNUM_SOULBLADE	  30000
#define OBJ_VNUM_PORTAL		  30001
#define OBJ_VNUM_EGG		  30002
#define OBJ_VNUM_EMPTY_EGG	  30003
#define OBJ_VNUM_SPILLED_ENTRAILS 30004
#define OBJ_VNUM_QUIVERING_BRAIN  30005
#define OBJ_VNUM_SQUIDGY_EYEBALL  30006
#define OBJ_VNUM_SPILT_BLOOD      30007
#define OBJ_VNUM_VOODOO_DOLL      30010
#define OBJ_VNUM_RIPPED_FACE      30012
#define OBJ_VNUM_TORN_WINDPIPE    30013
#define OBJ_VNUM_CRACKED_HEAD     30014
#define OBJ_VNUM_SLICED_EAR	  30025
#define OBJ_VNUM_SLICED_NOSE	  30026
#define OBJ_VNUM_KNOCKED_TOOTH	  30027
#define OBJ_VNUM_TORN_TONGUE	  30028
#define OBJ_VNUM_SEVERED_HAND	  30029
#define OBJ_VNUM_SEVERED_FOOT	  30030
#define OBJ_VNUM_SEVERED_THUMB	  30031
#define OBJ_VNUM_SEVERED_INDEX	  30032
#define OBJ_VNUM_SEVERED_MIDDLE	  30033
#define OBJ_VNUM_SEVERED_RING	  30034
#define OBJ_VNUM_SEVERED_LITTLE	  30035
#define OBJ_VNUM_SEVERED_TOE	  30036
#define OBJ_VNUM_PROTOPLASM	  30037
#define OBJ_VNUM_QUESTCARD	  30039
#define OBJ_VNUM_QUESTMACHINE	  30040
#define OBJ_VNUM_MASTERY     	  30042

/*
 * Well known mob virtual numbers.
 * Defined in #MOBILES.
 */
#define MOB_VNUM_CITYGUARD	   3060
#define MOB_VNUM_VAMPIRE	   3404
#define MOB_VNUM_FENRIS		  12000
#define MOB_VNUM_GUARDIAN	  30001
#define MOB_VNUM_MOUNT		  30007
#define MOB_VNUM_FROG		  30009
#define MOB_VNUM_RAVEN		  30010
#define MOB_VNUM_CAT		  30011
#define MOB_VNUM_DOG		  30012
#define MOB_VNUM_EYE		  30013
#define MOB_VNUM_MOLERAT 	  30014
#define MOB_VNUM_YAK		  30015
#define MOB_VNUM_CLONE		  30016
#define MOB_VNUM_CDSPIRIT	  30017
#define MOB_VNUM_PET_DOG      30018
#define MOB_VNUM_PET_CAT      30019
#define MOB_VNUM_PET_LION     30020
#define MOB_VNUM_LEO          3180
#define MOB_VNUM_E_LEO        3181
#define MOB_VNUM_RESTLESS_SPIRIT	3

/*Outfit for Imms defines */
#define OBJ_VNUM_FEARBRAC	     25
#define OBJ_VNUM_FEARAMUL	     26
#define OBJ_VNUM_FEARRING     	     27
#define OBJ_VNUM_FEARCHES	     28
#define OBJ_VNUM_FEARHELM	     29
#define OBJ_VNUM_FEARLEGP	     30
#define OBJ_VNUM_FEARBOOT	     31
#define OBJ_VNUM_FEARGAUN	     32
#define OBJ_VNUM_FEARARMP	     33
#define OBJ_VNUM_FEARSHIL	     34
#define OBJ_VNUM_FEARCLOA	     35
#define OBJ_VNUM_FEARGIRT	     36
#define OBJ_VNUM_FEARBAG	     37
#define OBJ_VNUM_FEARMASK	     38
#define OBJ_VNUM_FOCI                50



/*
 * Item types.
 * Used in #OBJECTS.
 */
#define ITEM_LIGHT		      1
#define ITEM_SCROLL		      2
#define ITEM_WAND		      3
#define ITEM_STAFF		      4
#define ITEM_WEAPON		      5
#define ITEM_TREASURE		      8
#define ITEM_ARMOR		      9
#define ITEM_POTION		     10
#define ITEM_FURNITURE		     12
#define ITEM_TRASH		     13
#define ITEM_CONTAINER		     15
#define ITEM_DRINK_CON		     17
#define ITEM_KEY		     18
#define ITEM_FOOD		     19
#define ITEM_MONEY		     20
#define ITEM_BOAT		     22
#define ITEM_CORPSE_NPC		     23
#define ITEM_CORPSE_PC		     24
#define ITEM_FOUNTAIN		     25
#define ITEM_PILL		     26
#define ITEM_PORTAL		     27
#define ITEM_EGG		     28
#define ITEM_VOODOO		     29
#define ITEM_STAKE		     30
#define ITEM_MISSILE		     31 /* Ammo vnum, cur, max, type */
#define ITEM_AMMO		     32 /* ???, dam min, dam max, type */
#define ITEM_QUEST		     33
#define ITEM_QUESTCARD		     34
#define ITEM_QUESTMACHINE	     35
#define ITEM_SYMBOL		     36
#define ITEM_BOOK		     37
#define ITEM_PAGE		     38
#define ITEM_TOOL		     39
#define ITEM_FOCI                    40
#define ITEM_COOKIE                  41
#define ITEM_TFILET                  42
#define ITEM_FIRE                    43
#define ITEM_WALL		     44
#define ITEM_SUNSHIELD               45
#define ITEM_PET_FOOD        46
#define ITEM_SLOT_MACHINE            47
#define ITEM_WWF_CONT        48
#define ITEM_SOUL_GEM                49
#define ITEM_COMPONENT               50
#define ITEM_VAMP_ASH                51
/*
 * Extra flags.
 * Used in #OBJECTS.
 */
#define ITEM_GLOW		     (A)
#define ITEM_HUM		     (B)
#define ITEM_THROWN		     (C)
#define ITEM_KEEP		     (D)
#define ITEM_VANISH		     (E)
#define ITEM_INVIS		     (F)
#define ITEM_MAGIC		     (G)
#define ITEM_NODROP		     (H)
#define ITEM_BLESS		     (I)
#define ITEM_ANTI_GOOD		     (J)
#define ITEM_ANTI_EVIL		     (K)
#define ITEM_ANTI_NEUTRAL	     (L)
#define ITEM_NOREMOVE		     (M)
#define ITEM_INVENTORY		     (N)
#define ITEM_LOYAL		     (O)
#define ITEM_SHADOWPLANE	     (P)
#define ITEM_FILET		     (Q)
#define ITEM_FROZEN		     (R)



/*
 * Wear flags.
 * Used in #OBJECTS.
 */
#define ITEM_TAKE		      A
#define ITEM_WEAR_FINGER	      B
#define ITEM_WEAR_NECK		      C
#define ITEM_WEAR_BODY		      D
#define ITEM_WEAR_HEAD		      E
#define ITEM_WEAR_LEGS		      F
#define ITEM_WEAR_FEET		      G
#define ITEM_WEAR_HANDS	      	      H 
#define ITEM_WEAR_ARMS		      I
#define ITEM_WEAR_SHIELD	      J
#define ITEM_WEAR_ABOUT	              K 
#define ITEM_WEAR_WAIST	      L
#define ITEM_WEAR_WRIST	      M
#define ITEM_WIELD		      N
#define ITEM_HOLD		      O
#define ITEM_WEAR_FACE		      P
#define ITEM_WEAR_HIDDEN              Q
#define ITEM_HAGS_WRINKLES            R


/*
 * Special types.
 * Used in #OBJECTS for special items - KaVir.
 */
#define SITEM_ACTIVATE		      1
#define SITEM_TWIST		      2
#define SITEM_PRESS		      4
#define SITEM_PULL		      8
#define SITEM_TARGET		      16
#define SITEM_SPELL		      32
#define SITEM_TRANSPORTER	      64
#define SITEM_TELEPORTER	      128
#define SITEM_DELAY1		      256
#define SITEM_DELAY2		      512
#define SITEM_OBJECT		     1024
#define SITEM_MOBILE		     2048
#define SITEM_ACTION		     4096
#define SITEM_MORPH		     8192
#define SITEM_SILVER		    16384
#define SITEM_WOLFWEAPON	    32768
#define SITEM_DROWWEAPON	    65536
#define SITEM_CHAMPWEAPON	   131072
#define SITEM_DEMONIC		   262144
#define SITEM_HIGHLANDER	   524288


/*
 * Apply types (for quest affects).
 * Used in #OBJECTS.
 */
#define QUEST_STR		      1
#define QUEST_DEX		      2
#define QUEST_INT		      4
#define QUEST_WIS		      8
#define QUEST_CON		     16
#define QUEST_HITROLL		     32
#define QUEST_DAMROLL		     64
#define QUEST_HIT		    128
#define QUEST_MANA		    256
#define QUEST_MOVE		    512
#define QUEST_AC		   1024

#define QUEST_NAME		   2048
#define QUEST_SHORT		   4096
#define QUEST_LONG		   8192
#define QUEST_FREENAME		  16384

#define QUEST_ENCHANTED		  32768
#define QUEST_SPELLPROOF	  65536
#define QUEST_ARTIFACT		 131072
#define QUEST_IMPROVED		 262144
#define QUEST_MASTER_RUNE	 524288
#define QUEST_RELIC             1048576
#define QUEST_MASTERY           2097152

/*
 * Defines for Hard Skills
 */
#define HARD_SKILL_BLACKSMITH       0  //Make your own custom armor with in reasons
#define HARD_SKILL_BREWING          1  //make alchol
#define HARD_SKILL_BAKING           2  //Baking duh...
#define HARD_SKILL_MURDER           3  //Your REAL good at player killing.. this stat will show..

/*
 * Tool types.
 */
#define TOOL_PEN		      1
#define TOOL_PLIERS		      2
#define TOOL_SCALPEL		      4



/*
 * Apply types (for affects).
 * Used in #OBJECTS.
 */
#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
#define APPLY_LEVEL		      8
#define APPLY_AGE		      9
#define APPLY_HEIGHT		     10
#define APPLY_WEIGHT		     11
#define APPLY_MANA		     12
#define APPLY_HIT		     13
#define APPLY_MOVE		     14
#define APPLY_GOLD		     15
#define APPLY_EXP		     16
#define APPLY_AC		     17
#define APPLY_HITROLL		     18
#define APPLY_DAMROLL		     19
#define APPLY_SAVING_PARA	     20
#define APPLY_SAVING_ROD	     21
#define APPLY_SAVING_PETRI	     22
#define APPLY_SAVING_BREATH	     23
#define APPLY_SAVING_SPELL	     24
#define APPLY_POLY		         25
#define APPLY_BLOOD_MAX          26
#define APPLY_BLOOD_POT          27

//Bodymods
#define MOD_TUSKS		      1 /* Large tusks */
#define MOD_HORNS		      2 /* Horns on head */
#define MOD_WINGS		      4 /* Wings */
#define MOD_UNFOLDED		      8 /* Wings are unfolded */
#define MOD_FINS		     16 /* Fins for swimming */
#define MOD_TAIL		     32 /* Tail, does nothing */
#define MOD_EXOSKELETON		     64 /* +10 STA, -10 DEX */


/*
 * Values for containers (value[1]).
 * Used in #OBJECTS.
 */
#define CONT_CLOSEABLE		      1
#define CONT_PICKPROOF		      2
#define CONT_CLOSED		      4
#define CONT_LOCKED		      8



/*
 * Well known room virtual numbers.
 * Defined in #ROOMS.
 */
#define ROOM_VNUM_LIMBO		      2
#define ROOM_VNUM_CHAT		   1200
#define ROOM_VNUM_TEMPLE	   3001
#define ROOM_VNUM_ALTAR		   3054
#define ROOM_VNUM_SCHOOL	   3700
#define ROOM_VNUM_HELL		  30000
#define ROOM_VNUM_CRYPT		  30001
#define ROOM_VNUM_DISCONNECTION	  30002
#define ROOM_VNUM_IN_OBJECT	  30008
#define ROOM_VNUM_RIDDLE	  30328
#define ROOM_VNUM_RIDDLE_TO	  30001
#define ROOM_VNUM_CAERN		  12003	



/*
 * Room flags.
 * Used in #ROOMS.
 */
#define ROOM_DARK			A //Regular Darkness If the sun goes down
#define ROOM_NO_MOB			B
#define ROOM_INDOORS		      	C
#define ROOM_PRIVATE		      	D
#define ROOM_SAFE		  	E
#define ROOM_SOLITARY		      	F
#define ROOM_PET_SHOP		      	G
#define ROOM_NO_RECALL		      	H
#define ROOM_NO_TELEPORT	      	I
//#define ROOM_TOTAL_DARKNESS        	J //Not Used????
#define ROOM_BLADE_BARRIER          	K
#define ROOM_REINA			L


/*
 * Room Affects, used for Temp Room Affects of course :) 
 */

#define ROOM_AFF_SILENT               A
#define ROOM_AFF_DARK	 	      B //Power Nocturn&ShroudNight
#define ROOM_AFF_AEOLUS		      C //Power Aeolus
#define ROOM_AFF_REINA		      D

/*
 * Room text flags (KaVir).
 * Used in #ROOMS.
 */
#define RT_LIGHTS		      1 /* Toggles lights on/off */
#define RT_SAY			      2 /* Use this if no others powers */
#define RT_ENTER		      4
#define RT_CAST			      8
#define RT_THROWOUT		     16 /* Erm...can't remember ;) */
#define RT_OBJECT		     32 /* Creates an object */
#define RT_MOBILE		     64 /* Creates a mobile */
#define RT_LIGHT		    128 /* Lights on ONLY */
#define RT_DARK			    256 /* Lights off ONLY */
#define RT_OPEN_LIFT		    512 /* Open lift */
#define RT_CLOSE_LIFT		   1024 /* Close lift */
#define RT_MOVE_LIFT		   2048 /* Move lift */
#define RT_SPELL		   4096 /* Cast a spell */
#define RT_PORTAL		   8192 /* Creates a one-way portal */
#define RT_TELEPORT		  16384 /* Teleport player to room */

#define RT_ACTION		  32768
#define RT_BLANK_1		  65536
#define RT_BLANK_2		 131072

#define RT_RETURN		1048576 /* Perform once */
#define RT_PERSONAL		2097152 /* Only shows message to char */
#define RT_TIMER		4194304 /* Sets object timer to 1 tick */



/*
 * Directions.
 * Used in #ROOMS.
 */
#define DIR_NORTH		      0
#define DIR_EAST		      1
#define DIR_SOUTH		      2
#define DIR_WEST		      3
#define DIR_UP			      4
#define DIR_DOWN		      5



/*
 * Exit flags.
 * Used in #ROOMS.
 */
#define EX_ISDOOR		      	A
#define EX_CLOSED		      	B
#define EX_LOCKED		      	C
#define EX_NOPASS						D
#define EX_PICKPROOF		    32
#define EX_PASSPROOF		    64 /* KaVir */
#define EX_WALL_WATER		    128 /* KaVir - Path of Water power 4 */
#define EX_WARD_GHOULS		  256 /* KaVir - Ward vs Ghouls */
#define EX_WARD_LUPINES		  512 /* KaVir - Ward vs Lupines */
#define EX_WARD_KINDRED		  1024 /* KaVir - Ward vs Kindred */
#define EX_WARD_SPIRITS		  2048 /* KaVir - Ward vs Spirits */
#define EX_WALL_FLAME		   	4096 /* KaVir - Path of Flame power 4 */
#define EX_WALL_GRANITE		  8192 /* KaVir - Philodox power 5 */

/*
 * World affect bits.
 */
#define WORLD_FOG		      1
#define WORLD_RAIN		      2
#define WORLD_ECLIPSE		      4
#define WORLD_NICE		      8 /* No swearing while frenzied */



/*
 * Equipment wear locations.
 * Used in #RESETS.
 */
#define WEAR_NONE		     -1
#define WEAR_LIGHT		      0
#define WEAR_FINGER_L		      1
#define WEAR_FINGER_R		      2
#define WEAR_NECK_1		      3
#define WEAR_NECK_2		      4
#define WEAR_BODY		      5
#define WEAR_HEAD		      6
#define WEAR_LEGS		      7
#define WEAR_FEET		      8
#define WEAR_HANDS		      9
#define WEAR_ARMS		     10
#define WEAR_SHIELD		     11
#define WEAR_ABOUT		     12
#define WEAR_WAIST		     13
#define WEAR_WRIST_L		     14
#define WEAR_WRIST_R		     15
#define WEAR_WIELD		     16
#define WEAR_HOLD		     17
#define WEAR_FACE		     18
#define WEAR_SCABBARD_L		     19
#define WEAR_SCABBARD_R		     20
#define WEAR_HIDDEN          	     21
#define WEAR_HAGS		     22
#define MAX_WEAR		     22




/*
 * Locations for damage.
 */
#define LOC_HEAD		      0
#define LOC_BODY		      1
#define LOC_ARM_L		      2
#define LOC_ARM_R		      3
#define LOC_LEG_L		      4
#define LOC_LEG_R		      5

/*
 * For Head
 */
#define LOST_EYE_L		       1
#define LOST_EYE_R		       2
#define LOST_EAR_L		       4
#define LOST_EAR_R		       8
#define LOST_NOSE		      16
#define BROKEN_NOSE		      32
#define BROKEN_JAW		      64
#define BROKEN_SKULL		     128
#define LOST_HEAD		     256
#define LOST_TOOTH_1		     512 /* These should be added..... */
#define LOST_TOOTH_2		    1024 /* ...together to caculate... */
#define LOST_TOOTH_4		    2048 /* ...the total number of.... */
#define LOST_TOOTH_8		    4096 /* ...teeth lost.  Total..... */
#define LOST_TOOTH_16		    8192 /* ...possible is 31 teeth.   */
#define LOST_TONGUE		   16384

/*
 * For Body
 */
#define BROKEN_RIBS_1		       1 /* Remember there are a total */
#define BROKEN_RIBS_2		       2 /* of 12 pairs of ribs in the */
#define BROKEN_RIBS_4		       4 /* human body, so not all of  */
#define BROKEN_RIBS_8		       8 /* these bits should be set   */
#define BROKEN_RIBS_16		      16 /* at the same time.          */
#define BROKEN_SPINE		      32
#define BROKEN_NECK		      64
#define CUT_THROAT		     128
#define CUT_STOMACH		     256
#define CUT_CHEST		     512

/*
 * For Arms
 */
#define BROKEN_ARM		       1
#define LOST_ARM		       2
#define LOST_HAND		       4
#define LOST_FINGER_I		       8 /* Index finger */
#define LOST_FINGER_M		      16 /* Middle finger */
#define LOST_FINGER_R		      32 /* Ring finger */
#define LOST_FINGER_L		      64 /* Little finger */
#define LOST_THUMB		     128
#define BROKEN_FINGER_I		     256 /* Index finger */
#define BROKEN_FINGER_M		     512 /* Middle finger */
#define BROKEN_FINGER_R		    1024 /* Ring finger */
#define BROKEN_FINGER_L		    2048 /* Little finger */
#define BROKEN_THUMB		    4096

/*
 * For Legs
 */
#define BROKEN_LEG		       1
#define LOST_LEG		       2
#define LOST_FOOT		       4
#define LOST_TOE_A		       8
#define LOST_TOE_B		      16
#define LOST_TOE_C		      32
#define LOST_TOE_D		      64 /* Smallest toe */
#define LOST_TOE_BIG		     128
#define BROKEN_TOE_A		     256
#define BROKEN_TOE_B		     512
#define BROKEN_TOE_C		    1024
#define BROKEN_TOE_D		    2048 /* Smallest toe */
#define BROKEN_TOE_BIG		    4096

/*
 * For Bleeding
 */
#define BLEEDING_HEAD		       1
#define BLEEDING_THROAT		       2
#define BLEEDING_ARM_L		       4
#define BLEEDING_ARM_R		       8
#define BLEEDING_HAND_L		      16
#define BLEEDING_HAND_R		      32
#define BLEEDING_LEG_L		      64
#define BLEEDING_LEG_R		     128
#define BLEEDING_FOOT_L		     256
#define BLEEDING_FOOT_R		     512


/*
 * For Spec powers on players
 */
#define EYE_SPELL		       1 /* Spell when they look at you */
#define EYE_SELFACTION		       2 /* You do action when they look */
#define EYE_ACTION		       4 /* Others do action when they look */

/* furniture flags */
#define STAND_AT		(A)
#define STAND_ON		(B)
#define STAND_IN		(C)
#define SIT_AT			(D)
#define SIT_ON			(E)
#define SIT_IN			(F)
#define REST_AT			(G)
#define REST_ON			(H)
#define REST_IN			(I)
#define SLEEP_AT		(J)
#define SLEEP_ON		(K)
#define SLEEP_IN		(L)
#define PUT_AT			(M)
#define PUT_ON			(N)
#define PUT_IN			(O)
#define PUT_INSIDE		(P)

/***************************************************************************
 *                                                                         *
 *                   VALUES OF INTEREST TO AREA BUILDERS                   *
 *                   (End of this section ... stop here)                   *
 *                                                                         *
 ***************************************************************************/

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



/*
 * Stats - KaVir.
 */
#define STAT_STR		      0
#define STAT_END		      1
#define STAT_REF		      2
#define STAT_FLE		      2
#define STAT_DEX		      3

 /*
  * MOBprog definitions
  */                   
#define TRIG_ACT	(A)
#define TRIG_BRIBE	(B)
#define TRIG_DEATH	(C)
#define TRIG_ENTRY	(D)
#define TRIG_FIGHT	(E)
#define TRIG_GIVE	(F)
#define TRIG_GREET	(G)
#define TRIG_GRALL	(H)
#define TRIG_KILL	(I)
#define TRIG_HPCNT	(J)
#define TRIG_RANDOM	(K)
#define TRIG_SPEECH	(L)
#define TRIG_EXIT	(M)
#define TRIG_EXALL	(N)
#define TRIG_DELAY	(O)
#define TRIG_SURR	(P)
#define TRIG_RIDD   (Q)
#define TRIG_PUSH   (R)
#define TRIG_PULL   (S)
#define TRIG_ACTIVATE   (T)
#define TRIG_TWIST  (U)
#define TRIG_LOOK	(V)

/*
 * 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_SITTING		      6
#define POS_RESTING		      7
#define POS_FIGHTING		      8
#define POS_STANDING		      9



/*
 * ACT bits for players.
 */
#define PLR_IS_NPC		      (A)		/* Don't EVER set.	*/
#define PLR_WATCHER	       	  (B)
#define PLR_PERMIT            (C)
#define PLR_AUTOEXIT		  (D)
#define PLR_AUTOLOOT		  (E)
#define PLR_AUTOSAC           (F)
#define PLR_BLANK		      (G)
#define PLR_BRIEF		      (H)
#define PLR_COMBINE		      (J)
#define PLR_PROMPT		      (K)
#define PLR_TELNET_GA		  (L)

#define PLR_HOLYLIGHT		  (M)
#define PLR_WIZINVIS		  (N)
#define PLR_ANSI		  	  (O)

#define	PLR_SILENCE		      (P)
#define PLR_NO_EMOTE		  (Q)
#define PLR_INCOG             (R)
#define PLR_NO_TELL		 	  (S)
#define PLR_LOG			      (T)
#define PLR_DENY			  (U)
#define PLR_FREEZE		      (V)
#define PLR_GODLESS	          (Y)
#define PLR_AUTODAMAGE        (W)
//#define PLR_EARTHMELD         (X)
#define PLR_MARBLEFLESH       (Y)
#define PLR_TAG         	  (Z)
#define PLR_NOTAG       	  (aa)
#define PLR_ATTACK       	  (bb)
#define PLR_QUESTOR       	  (cc)
#define PLR_WOLFMAN           (dd)



//New Comm bits for extra stuff..(Fuck we got a whole bunch of these. time to clean up - Spiral)

#define COMM_SHOW_FIGHT				(A) //Shows the fight varibles.. useful for debug...
#define COMM_RP						(B) //RP Flag!!!!
#define COMM_AUTOPROTECT			(C) //Saves your ass from capping a lower stat
#define COMM_IMM_SAFE				(D) //Instant Safe room ****FIXME****
#define COMM_LOG_TELLS				(E) //Tell loggiing for higher imms
#define COMM_MIND_BLOCK             (F) //This is for the mindblock power for new garou


/*
 * EXTRA bits for players. (KaVir)
 */
#define EXTRA_HAGS		    (A) 
				/*  (B) */
#define EXTRA_TRUSTED		      4
#define EXTRA_NEWPASS		      8
#define EXTRA_OSWITCH		     16
#define EXTRA_SWITCH		     32
#define EXTRA_FAKE_CON		     64
#define TIED_UP			        128
#define GAGGED			        256
#define BLINDFOLDED		        512
#define EXTRA_AWE              1024 
#define EXTRA_DONE		       2048
#define EXTRA_EXP		       4096
#define EXTRA_PREGNANT		   8192
#define EXTRA_LABOUR		  16384
#define EXTRA_BORN		      32768
#define EXTRA_PROMPT		  65536
#define EXTRA_MARRIED		 131072
		        /*	 262144 */
			/*	 524288 */
#define EXTRA_CALL_ALL		1048576
#define EXTRA_ANTI_GODLESS  2097152
#define EXTRA_NOTE_TRUST    4194304
#define EXTRA_STANCE		8388608      

/* Spiral Added bitz */
#define ADDED_ENLARGE               (A)
#define ADDED_SHRINK                (B)
#define ADDED_FLAMES_PURE           (C)
#define ADDED_POLY_MIST             (D)
#define ADDED_POLY_GENERAL          (E)
#define ADDED_CLOAK                 (F)
#define ADDED_NIGHTFALL             (G)
#define ADDED_CONFUSE               (H)
#define ADDED_INSANE                (I)
#define ADDED_HAUNT                 (J)
#define ADDED_CALM	       			(K) /* Cancel's Anger, cannot attack */
#define ADDED_ANGER					(L) /* Anger - Presence 8 */
#define ADDED_COURAGE				(M) /* Courage - Presence 7 */
#define ADDED_BRISTLES	            (N) /* Metis power level 5 */
#define ADDED_FLAMES		        (O) /* Flames of the nether world */
#define ADDED_ANIMAL_MASTER			(P) /* Animals obey and dont attack you */
#define ADDED_ILLUSION              (Q) /* Illusion for vampires */
#define ADDED_LOYAL					(R)
#define ADDED_HAND_FLAME			(S)
#define ADDED_FRENZY				(T)
#define ADDED_DIABLERIE				(U) /* Diablery Flag */
#define ADDED_BRAGE                 (V) //Baccu's Rage for black furies!
#define ADDED_GIFTSPRIG             (W) //Finna's Gift of the Spriggan
#define ADDED_DISCERN               (X) //Vampire Discern power
#define ADDED_CHAMELEON             (Y) //Vampire Chameleon
#define ADDED_VOICESOFCASTLE        (Z) //Vampire Voices
#define ADDED_NEUTRAL               (aa) //Neural Guard...
#define ADDED_LUNAAVENGER			(bb) //Luna's Avenger...
#define ADDED_SPIRIT_SIGHT      	(cc) //Luna's Avenger...
#define ADDED_HARDCORE      	    (dd) //Luna's Avenger...
/*
* AGE Bits.
*/
#define AGE_CHILDE		      0
#define AGE_NEONATE		      1
#define AGE_ANCILLA		      2
#define AGE_ELDER		      3
#define AGE_METHUSELAH		      4


/*
 * Stances for combat
 */
#define STANCE_NONE		     -1
#define STANCE_NORMAL		      0
#define STANCE_VIPER		      1
#define STANCE_CRANE		      2
#define STANCE_CRAB		      3
#define STANCE_MONGOOSE		      4
#define STANCE_BULL		      5
#define STANCE_MANTIS		      6
#define STANCE_DRAGON		      7
#define STANCE_TIGER		      8
#define STANCE_MONKEY		      9
#define STANCE_SWALLOW		     10


/*
 * Obsolete bits.
 */
#if 0
#define PLR_AUCTION		      4	/* Obsolete	*/
#define PLR_CHAT		    256	/* Obsolete	*/
#define PLR_NO_SHOUT		 131072	/* Obsolete	*/
#endif



/*
 * Channel bits.
 */
#define	CHANNEL_CGOSSIP              A
#define	CHANNEL_CHAT		     	 B
#define	CHANNEL_HACKER		         C
#define	CHANNEL_IMMTALK		     	 D
#define	CHANNEL_MUSIC		     	 E
#define	CHANNEL_QUESTION	     	 F
#define	CHANNEL_SHOUT		     	 G
#define	CHANNEL_YELL		     	 H
#define	CHANNEL_VAMPTALK	     	 I
#define	CHANNEL_HOWL		     	 J
#define	CHANNEL_LOG		     		 K
#define	CHANNEL_PRAY		     	 L
#define	CHANNEL_INFO		     	 M
#define	CHANNEL_SPARE		     	 N
#define	CHANNEL_TELL		     	 O
#define	CHANNEL_MAGETALK             P
#define	CHANNEL_TRIBETALK            Q
#define CHANNEL_SECTTALK      	     R
#define CHANNEL_MSP                  S
#define CHANNEL_OOC                  T
#define CHANNEL_MXP                  U

/*
 * Mobile fight defines
 */
#define FIGHT_VIPER		A
#define FIGHT_CRANE		B
#define FIGHT_MONGOOSE		C
#define FIGHT_BULL		D
#define FIGHT_CRAB		E
#define FIGHT_MANTIS		F
#define FIGHT_TIGER		G
#define FIGHT_DRAGON		H
#define FIGHT_MONKEY		I
#define FIGHT_SWALLOW		J
#define FIGHT_RANDOM		K
#define	FIGHT_MASTER		L

#define DAMAGE_HIT			0 		
#define DAMAGE_SLICE		1		
#define DAMAGE_STAB			2	
#define DAMAGE_SLASH		3	
#define DAMAGE_WHIP			4
#define DAMAGE_CLAW			5
#define DAMAGE_BLAST		6	
#define DAMAGE_POUND		7	
#define DAMAGE_CRUSH		8	
#define DAMAGE_GREP			9
#define DAMAGE_BITE			10
#define DAMAGE_PIERCE		11	
#define DAMAGE_SUCK			12
#define DAMAGE_LIGHT_BEAM	13
#define DAMAGE_BASH         14
#define DAMAGE_ELBOW        15
#define DAMAGE_KNEE         16
#define DAMAGE_HEADBUTT     17
#define DAMAGE_GRAPPLE      18
#define DAMAGE_RIP          19
#define DAMAGE_KICK         20
#define DAMAGE_CHARGE       21
#define DAMAGE_SPIT         22
#define DAMAGE_WTALON       23
#define DAMAGE_POISON       24
#define MAX_DAMAGE_TYPE     25


/*
 * Prototype for a mob.
 * This is the in-memory version of #MOBILES.
 */
struct	mob_index_data
{
	MOB_INDEX_DATA *	next;
	MPROG_LIST *  		mprogs;
	SPEC_FUN *		spec_fun;
	SHOP_DATA *		pShop;
	CHAR_DATA *		mount;
	AREA_DATA *         	area;
	CHAR_DATA *		wizard;
	gchar *		player_name;
	gchar *		short_descr;
	gchar *		long_descr;
	gchar *		description;
	gchar *		lord;
	gchar *		clan;
	gchar *		morph;
	gchar *		createtime;
	gchar *		pload;
	gchar *		lasttime;
	gchar *		lasthost;
	gchar *		powertype;
	gchar *		poweraction;
	gchar *		prompt;
	gchar *		cprompt;
	sh_int		spectype;
	sh_int		specpower;
	int		loc_hp	[7];
	sh_int		vnum;
	sh_int		count;
	sh_int		killed;
	sh_int		sex;
	sh_int		mounted;
	sh_int		home;
	int		       level;
	int			immune;
	int			polyaff;
	int			vampaff;
	int			itemaffect;
	int			vamppass;
	int			form;
	int			act;
	int			extra;
	long			mprog_flags;
	int			affected_by;
	sh_int		alignment;
	sh_int		hitroll;		/* Unused */
	sh_int		ac;			/* Unused */
	sh_int		hitnodice;		/* Unused */
	sh_int		hitsizedice;		/* Unused */
	int			hitplus;		/* Unused */
	sh_int		damnodice;		/* Unused */
	sh_int		damsizedice;		/* Unused */
	sh_int		damplus;		/* Unused */
	int			gold;			/* Unused */
/*
 * New bits for other things
 */
	int		added;
	int		mob_fight;
	int 		sphere_spaffect;
	int 		mob_con;

   	/*int                 special;
    	int                 class; */
};



/*
 * One character (PC or NPC).
 */
struct	char_data
{
	CHAR_DATA *		next;			/*!< Next char_data in the global list */
	CHAR_DATA *		next_in_room;	/*!< Used to tell who else is in that room */
	CHAR_DATA *		master;			/*!< if mobile this is your master/leader */
	CHAR_DATA *		leader;			/*!< leader of the player group	*/
	CHAR_DATA *		mob_hunting;	/*!< who the mobile is hunting. */
	CHAR_DATA *		fighting;
	CHAR_DATA *		mprog_target;
	CHAR_DATA *		reply;
	CHAR_DATA *		mount;
	CHAR_DATA *		wizard;
	CHAR_DATA *		killed_by;		/*!< the char in question was killed by. */
	NOTE_DATA *		pnote;
	CHAR_DATA * 	last_attacked;
	OBJ_DATA *		on;
	SPEC_FUN *		spec_fun;
	MOB_INDEX_DATA *	pIndexData;
	DESCRIPTOR_DATA *	desc;
	AFFECT_DATA *		affected;
	SPHERE_DATA *		sphere_affected;
	OBJ_DATA *		carrying;
	ROOM_INDEX_DATA *	in_room;
	ROOM_INDEX_DATA *	was_in_room;
	PC_DATA *		pcdata;
	MEM_DATA *		memory;
	bool		valid;
	GString *		name;
	GString *	        pload;
	GString *	        hunting;
	GString *		short_descr;
	GString *		long_descr;
	GString *		description;
	GString *		lord;
	sh_int		clan;
	sh_int 		sect; /*changed for new sect*/
	GString *		morph;
	GString *		createtime;
	GString *		lasttime;
	GString *		lasthost;
	GString *		poweraction;
	int 		lines;  /*PAGE TO CHAR CODE*/
	int                 silent_time;
	GString *		powertype;
	GString *		prompt;
	GString *		cprompt;
	int             pk_timer;
	int             attack_timer;
	int             pk_sect;
	sh_int		mprog_delay;
	GString *              prefix;
	GString *              murmur_name;
	long		sight;
	GString *              murmur_command;
	sh_int		sex;
	sh_int		race;
	sh_int		creature;
	sh_int		bclass; //Basic Class
	int		immune;
	int		polyaff;
	int		vampaff_a;
	int		itemaffect;
	int		vamppass_a;
	int		form;
	int		RPts;
	sh_int		vampgen_a;
	sh_int		spectype;
	sh_int		specpower;
	sh_int		loc_hp	[7];
	sh_int		wpn	[13];
	sh_int		spl	[5];
	sh_int		cmbt	[8];
	sh_int		stance	[11];
	sh_int		beast;
	sh_int		mounted;
	sh_int		home;
	sh_int		level;
	sh_int		invis_level;
	sh_int		trust;
	int		played;
	time_t		logon;
	time_t		save_time;
	sh_int		timer;
	sh_int		wait;
	int		pkill;
	sh_int		arete;
	int		pdeath;
	int		mkill;
	int		mdeath;
	int		hit;
	int		max_hit;
	int		mana;
	int		max_mana;
	int		move;
	int		max_move;
	int		gold;
	int		exp;
	sh_int		position;
	sh_int		practice;
    long        primal_hold;
	sh_int		carry_weight;
	sh_int		carry_number;
	sh_int		saving_throw;
	sh_int		alignment;
	int		hitroll;
	int		damroll;
	long		id;
	sh_int		armor;
	sh_int		wimpy;
	long		deaf;
	sh_int		paradox[3];
	int		damcap[2];
	int             dead_time; /*how long they got to live*/
	int             special;
	
	/* Flag type var's so i can fucking remember them! -Spiral*/

	int     sphere_spaffect;
	int     added;
	int		act;
	int		extra;
	int		affected_by;
	int		sphere_affected_by[4];
	int		mob_fight;    /*char_data version of mob_fight for fight code */
        int 		mob_con;      /* Bits to control Mob Behavor and Res/Vuln for players */
	long		plane;    //Store what plane the Char is on so we don't get confused
	/* end flag types */

    	sh_int          delay_timer;	
    	int             rp_status;	
  		CHAR_DATA *     questgiver;         /* Vassago */
    	sh_int          nextquest;          /* Vassago */
    	sh_int          countdown;          /* Vassago */
    	sh_int          questobj;           /* Vassago */
    	sh_int          questmob;           /* Vassago */
	int 		blood_count;        /* how bloody can you get? */

	//GW Delux addon's
	
	/*
	 * Pet Properties for the enterprising pet project
         */
	
	CHAR_DATA      *pet;            //Pet Pointer
	int		pet_stats[10];  //Useful Pet Stats
	CHAR_DATA      *pet_master;     //The Pets Master

};

//Define the Pet Stats while were here - Spiral
#define PET_AFFECTION	0
#define PET_BEHAVIOR	1
#define PET_TYPE        2
#define PET_EXAUSTION	3
#define PET_SPELL_CAST  4
#define PET_HUNGER      5
#define PET_THIRST      6
#define PET_LAST_FOOD   7
#define PET_LAST_FCOUNT 8
#define PET_PERM_AFF    9

#define BEHAVIOR_ANNOYING       (A)
#define BEHAVIOR_RANDOM_SPELL   (B)

#define PET_TYPE_DOG    (A)
#define PET_TYPE_CAT    (B)
#define PET_TYPE_LION   (C)

/*
 * Data which only PC's have.
 */
struct	pc_data
{
	PC_DATA *		next;
	CHAR_DATA *		familiar;
	CHAR_DATA *		partner;
	CHAR_DATA *		propose;
	KNOWN_DATA *            known;
	OBJ_DATA *		chobj;
	BOARD_DATA * 		board;
	NOTE_DATA * 		in_progress;
	/* Spiral Note change */
	time_t		last_note[MAX_BOARD];
	/* Last of changes */
	bool 		valid;
	GString *		pwd;
	GString *		bamfin;
	GString *		bamfout;
	GString *		title;
	GString *		conception;
	GString *		parents;
	GString *		cparents;
	GString *		marriage;
	GString *		email;
	GString *		nature;
	GString *		demeanor;
	GString * 	anon_desc;
	sh_int		perm_str;
	sh_int		perm_int;
	sh_int		perm_wis;
	sh_int		perm_dex;
	sh_int		perm_con;
	sh_int		mod_str;
	sh_int		mod_int;
	sh_int		mod_wis;
	sh_int		mod_dex;
	sh_int		mod_con;
	int		quest;
	int		powers[20];
	int 		stats[12];
	sh_int          discipline[MAX_DISCIPLINE];
	sh_int          inherited[MAX_DISCIPLINE];
	sh_int          Ninherited[MAX_DISC];

	sh_int		wolf;
	sh_int		rank;
	sh_int		demonic_a;
	int		language[2];
	sh_int		stage[3];
	sh_int		disc_a[11];
	int		genes[10];
	sh_int		fake_skill;
	sh_int		fake_stance;
	sh_int		fake_hit;
	sh_int		fake_dam;
	sh_int		fake_hp;
	sh_int		fake_mana;
	sh_int		fake_move;
	int		fake_ac;
	sh_int		obj_vnum;
	sh_int		condition	[3];
	sh_int		learned		[MAX_SKILL];
	sh_int		stat_ability	[4];
	sh_int		stat_amount	[4];
	sh_int		stat_duration	[4];
	sh_int		exhaustion;
	sh_int      followers;
	bool        confirm_delete;
	int         security;
	int 		vote;
	GString *      alias[MAX_ALIAS];
	GString *      alias_sub[MAX_ALIAS];
	GString *      ignore[MAX_IGNORE];
	GString *      roompose;
	sh_int		charpoints;
	int			trait_merit[2];
	int			trait_flaw[2];
	int 		spent[5];

	/* 
	 * wwf variables 
	 */
	sh_int		rage_points;  //The Pathos for Wraiths, the Rage for Garou  and the Faith Pool for Hunters
	sh_int 		gnosis;       //Corpus For Wraiths, and Gnosis for Wolves
	sh_int  	renown[3];
	sh_int  	Trenown[3];
	sh_int		wwf_shape;
	sh_int		breed[3];
	sh_int		auspice[5];
	sh_int		tribes[20];
	sh_int		sgift[3];
	int			last_rite;
	sh_int		frenzy_action;
	/* end of ww varibles */

	//sh_int		majesty;
	int			absorb[6];
	sh_int	    willpower;
	int 		comm;		//New Comm bits(We ran out of ACT/Player - Spiral
	sh_int 		disc[MAX_DISC];
	char * 		conding;
	int 		wiznet; //Wiznet Varibles to show on/off state
	int			bodymods; //bonecraft
	sh_int		diab[2];
	int         obeah;
	int         lag_time; //Lag Timer for Knuckleheads
	int         hard_skills[10];
	int		ghost_hit;
	int		ghost_mana;
	int 		ghost_move;
	long		ghost_affects;
	int 		ghost_hitroll;
	int		ghost_damroll;
	int 		ghost_ac;
};



/*
 * Liquids.
 */
#define LIQ_WATER        0
#define LIQ_MAX		16

struct	liq_type
{
	char *	liq_name;
	char *	liq_color;
	sh_int	liq_affect[3];
};

#define MAX_NEST	100



/*
 * Extra description data for a room or object.
 */
struct	extra_descr_data
{
	EXTRA_DESCR_DATA *next;	/* Next in list                     */
	bool valid;
	char *keyword;              /* Keyword in look/examine          */
	char *description;          /* What to see                      */
};



/*
 * Prototype for an object.
 */
struct	obj_index_data
{
	OBJ_INDEX_DATA *	next;
	EXTRA_DESCR_DATA *	extra_descr;
	AFFECT_DATA *	affected;
	AREA_DATA *  	area; /*OLC*/
	MPROG_LIST *  		mprogs;
	gchar *		name;
	gchar *		short_descr;
	gchar *		description;
	gchar *		chpoweron;
	gchar *		chpoweroff;
	gchar *		chpoweruse;
	gchar *		victpoweron;
	gchar *		victpoweroff;
	gchar *		victpoweruse;
	gchar *		questmaker;
	gchar *      page_content;
	gchar *		questowner;
	sh_int		vnum;
	sh_int		item_type;
	sh_int		extra_flags;
	sh_int		wear_flags;
	sh_int		count;
	sh_int		weight;
	sh_int		reset_num;
	int			spectype;
	int			specpower;
	sh_int		condition;
	sh_int		toughness;
	sh_int		resistance;
	int			quest;
	sh_int		points;
	int			cost;			/* Unused */
	int			value	[4];
	long	  	mprog_flags;	/* Mob PRogs */
	
};



/*
 * One object.
 */
struct	obj_data
{
	OBJ_DATA *		next_content;
	OBJ_DATA *		contains;
	OBJ_DATA *		in_obj;
	OBJ_DATA *		on;
	CHAR_DATA *		carried_by;
	CHAR_DATA *		chobj;
	EXTRA_DESCR_DATA *	extra_descr;
	AFFECT_DATA *	affected;
	OBJ_INDEX_DATA *	pIndexData;
	ROOM_INDEX_DATA *	in_room;
	CHAR_DATA *		mprog_target;
	sh_int		mprog_delay;
	bool            valid;
	GString *		name;
	GString *		short_descr;
	GString *		description;
	GString *		chpoweron;
	GString *		chpoweroff;
	GString *		chpoweruse;
	GString *		victpoweron;
	GString *		victpoweroff;
	GString *          owner;
	GString *		victpoweruse;
	GString *		questmaker;
	GString *		questowner;
	GString *      page_content;
	GString * 		OOwner;
	sh_int		item_type;
	int		extra_flags;
	sh_int		wear_flags;
	sh_int		wear_loc;
	sh_int		weight;
	int		spectype;
	int		specpower;
	sh_int		condition;
	sh_int		toughness;
	sh_int		resistance;
	int		quest;
	sh_int		points;
	int		cost;
	sh_int		level;
	sh_int		timer;
	int		value	[4];
	sh_int          sphere[MAX_SPHERE];
	long		last_seen_on;   /* Last time it was logged on */
	int 		plane;
};



/*
 * Exit data.
 */
struct	exit_data
{
	union                              /*Spiral*/
	{
		ROOM_INDEX_DATA *	to_room;
		sh_int		vnum;
	} u1;
	ROOM_INDEX_DATA *	to_room;
	sh_int		vnum;
	
	sh_int		exit_info;
	sh_int		key;
	char *		keyword;
	char *		description;
	EXIT_DATA *         next; /*OLC*/
	int                 rs_flags; /*OLC*/
	int                 orig_door; /*OLC*/
};



/*
 * Room text checking data.
 */
typedef struct roomtext_data
{
	int				type;
	int				power;
	int				mob;
	char *			input;
	char *			output;
	char *			choutput;
	char *			name;
	struct roomtext_data	*next;
} ROOMTEXT_DATA;



/*
 * Reset commands:
 *   '*': comment
 *   'M': read a mobile 
 *   'O': read an object
 *   'P': put object in object
 *   'G': give object to mobile
 *   'E': equip object to mobile
 *   'D': set state of door
 *   'R': randomize room exits
 *   'S': stop (end of list)
 */

/*
 * Area-reset definition.
 */
struct	reset_data
{
	char		command;
	sh_int		arg1;
	sh_int		arg2;
	sh_int		arg3;
	sh_int		arg4;
};



/*
 * Area definition.
 */
struct	area_data
{
	AREA_DATA *	next;
	RESET_DATA *	reset_first;
	RESET_DATA *	reset_last;
	HELP_AREA *     helps;  /*OLC*/
	gchar *		name;
	gchar *		file_name;
	gchar *		test_name;
	sh_int		age;
	sh_int		nplayer;
	int             min_vnum;
	int             max_vnum;
	gchar *		builders;/*OLC*/
	gchar *		credits; /*OLC*/
	bool 		empty;   /*OLC*/
	int		vnum;
	int		area_flags;
	int		security;    /* OLC End*/ 
	
};



/*
 * Room type.
 */
struct	room_index_data
{
	ROOM_INDEX_DATA *	next;
	CHAR_DATA *		people;
	OBJ_DATA *		contents;
	EXTRA_DESCR_DATA *	extra_descr;
	AREA_DATA *		area;
	EXIT_DATA *		exit	  [6];
	GSList *	reset_list; /*OLC*/
	ROOMTEXT_DATA *	roomtext;
	AFFECT_DATA *       affected; 
	MPROG_LIST *  		mprogs;
	CHAR_DATA *		mprog_target;
	sh_int		mprog_delay;
	int 		affected_by;
	GString *	track     [5];
	gchar *		name;
	gchar *		owner;
	gchar *		description;
	sh_int		vnum;
	int		        room_flags;
	sh_int		light;
	sh_int		blood;
	sh_int		track_dir [5];
	long	  	mprog_flags;	/* Mob PRogs */
	sh_int		sector_type;
};

//Mud Prog Code,

struct mprog_list
{
	int				trig_type;
	GString *			trig_phrase;
	sh_int			vnum;
	GString *  		code;
	MPROG_LIST * 	next;
	bool           	valid;
};

struct mprog_code
{
	sh_int			vnum;
	GString *			code;
	MPROG_CODE *	next;
	bool           	valid;
};

/*
 * Types of attacks.
 * Must be non-overlapping with spell/skill types,
 * but may be arbitrary beyond that.
 */
#define TYPE_UNDEFINED               -1
#define TYPE_HIT                     1000
#define TYPE_SLICE		             1001		
#define TYPE_STAB			         1002	
#define TYPE_SLASH		             1003	
#define TYPE_WHIP			         1004 
#define TYPE_CLAW			         1005
#define TYPE_BLAST		             1006	
#define TYPE_POUND		             1007
#define TYPE_CRUSH		             1008	
#define TYPE_GREP			         1009
#define TYPE_BITE                    1010
#define TYPE_PIERCE		             1011	
#define TYPE_SUCK			         1012
#define TYPE_LIGHT		             1013
#define TYPE_BASH                    1014
#define TYPE_ELBOW                   1015
#define TYPE_KNEE                    1016
#define TYPE_HEADBUTT                1017
#define TYPE_GRAPPLE                 1018
#define TYPE_RIP                     1019
#define TYPE_KICK                    1020
#define TYPE_CHARGE                  1021
#define TYPE_SPIT                    1022
#define TYPE_WTALON                  1023
#define TYPE_POISON                  1024

/*
 *  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

#define PURPLE_MAGIC		    0
#define RED_MAGIC		    1
#define BLUE_MAGIC		    2
#define GREEN_MAGIC		    3
#define YELLOW_MAGIC		    4



/*
 * Skills include spells as a particular case.
 */
struct	skill_type
{
	char *	name;			/* Name of skill		*/
	sh_int	skill_level;	        /* Level needed by class	*/
	SPELL_FUN *	spell_fun;		/* Spell pointer (for spells)	*/
	sh_int	target;			/* Legal targets		*/
	sh_int	minimum_position;	/* Position for caster / user	*/
	sh_int *	pgsn;			/* Pointer to associated gsn	*/
	sh_int	slot;			/* Slot for #OBJECT loading	*/
	sh_int	min_mana;		/* Minimum mana used		*/
	sh_int	beats;			/* Waiting time after use	*/
	char *	noun_damage;		/* Damage message		*/
	char *	msg_off;		/* Wear off message		*/
	sh_int	bclass;         /* Basic class, 1,2,3,4  etc*/
};

struct	discipline_type
{
	char *	name;		/* Duh! Name of the discipline */
	char *	name_caps;	/* Duh! Name of the discipline in caps */
	char *      powers;         /* The powers to show the player */
};

struct	spell_colour_type
{
	char *	name;
	char *	colour;
};

struct mage_clan_type
{
	char *	name;		/* the name of the clan */
	sh_int	sect;		/* the SPC flag for the default sect */
	int	sphere;		/* default disciplines */
	int     iclan_number;
	char *	lineage;	/* the lineage traced back to Dominion */
	char *  pretty_name;
};

struct vamp_clan_type
{
	char *	name;		/* the name of the clan */
	int     iclan_number;
	char *	sect;		/* the SPC flag for the default sect */
	int		discipline[3];	/* default disciplines */
	char *	lineage;	/* the lineage traced back to Dominion */
};

struct tribe_type
{
	char * tribe_name;
	int     iclan_number;
	char * tribe_sect;
	int    tribe_real_name;
	char * tribe_pretty_name; 
};

/*
 * These are skill_lookup return values for common skills and spells.
 */
extern  sh_int  gsn_potency;
extern	sh_int	gsn_agg_damage;
extern	sh_int	gsn_backstab;
extern	sh_int	gsn_tail;
extern	sh_int	gsn_hunt;
extern	sh_int	gsn_hide;
extern	sh_int	gsn_peek;
extern	sh_int	gsn_pick_lock;
extern	sh_int	gsn_sneak;
extern	sh_int	gsn_steal;
extern	sh_int	gsn_weaken;
extern	sh_int	gsn_silent;

extern	sh_int	gsn_fastdraw;
extern	sh_int	gsn_berserk;
extern	sh_int	gsn_punch;
extern	sh_int	gsn_stomp;
extern	sh_int	gsn_elbow;
extern	sh_int	gsn_headbutt;
extern	sh_int	gsn_sweep;
extern	sh_int	gsn_knee;
extern	sh_int	gsn_disarm;
extern	sh_int	gsn_hurl;
extern	sh_int	gsn_kick;
extern	sh_int	gsn_rescue;
extern	sh_int	gsn_track;
extern	sh_int	gsn_polymorph;
extern	sh_int	gsn_web;
extern	sh_int	gsn_arm;
extern	sh_int	gsn_fear;

extern	sh_int	gsn_blindness;
extern	sh_int	gsn_charm_person;
extern	sh_int	gsn_curse;
extern	sh_int	gsn_invis;
extern	sh_int	gsn_mass_invis;
extern	sh_int	gsn_poison;
extern	sh_int	gsn_plague;
extern	sh_int	gsn_sleep;

extern	sh_int	gsn_paradox;
extern	sh_int	gsn_darkness;
extern	sh_int	gsn_bash;


/*
 * Utility macros.
 */
#define IS_VALID(data)          ((data) != NULL && (data)->valid)
#define VALIDATE(data)          ((data)->valid = TRUE)
#define INVALIDATE(data)        ((data)->valid = FALSE)
#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)		((c) >= 'A' && (c) <= 'Z' ? (c)+'a'-'A' : (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))


/*
 * Character macros.
 */
#define HAS_TRIGGER(ch,trig)	(IS_SET((ch)->pIndexData->mprog_flags,(trig)))
#define HAS_PROG(what, prog)	(IS_SET((what)->mprog_flags, (prog)))
#define HAS_DELAY(ch)           ( ch->delay_timer > 0 )
#define IS_TECH(ch)		((ch)->sect == SECT_TECHNOCRACY))
#define IS_TRAD(ch)		((ch)->sect == SECT_TRADITIONS)
#define IS_NPC(ch)		(IS_SET((ch)->act, ACT_IS_NPC))
#define IS_PET(ch)		(IS_SET((ch)->mob_con, MOBCON_PET))
#define IS_JUDGE(ch)		(get_trust(ch) >= LEVEL_JUDGE)
#define IS_IMMORTAL(ch) 	(get_trust(ch) >= LEVEL_IMMORTAL)
#define IS_HERO(ch)		(get_trust(ch) >= LEVEL_HERO)
#define IS_AVATAR(ch)		(get_trust(ch) == 3)
#define IS_MORTAL(ch)		(get_trust(ch) <= 2)
#define IS_TRUSTED(ch,level)	(get_trust(ch) >= level )
#define CAN_PK(ch)		(get_trust(ch) >= 3 && get_trust(ch) <= 6)
#define IS_AFFECTED(ch, sn)	(IS_SET((ch)->affected_by, (sn)))
#define IS_MOD(ch, sn)		(IS_SET((ch)->pcdata->bodymods, (sn)))
#define IS_RAFFECTED(room, sn)	(IS_SET((room)->affected_by, (sn)))
#define IS_SPEAKING(ch, sn)	(IS_SET((ch)->pcdata->language[0], (sn)))
#define CAN_SPEAK(ch, sn)	(IS_SET((ch)->pcdata->language[1], (sn)))
#define IS_ITEMAFF(ch, sn)	(IS_SET((ch)->itemaffect, (sn)))
#define IS_IMMUNE(ch, sn)	(IS_SET((ch)->immune, (sn)))
#define IS_IMMMERIT(ch, sn)	(IS_SET((ch)->pcdata->trait_merit[IMM_MERIT], (sn)))
#define IS_MERIT(ch, sn)	(IS_SET((ch)->pcdata->trait_merit[REG_MERIT], (sn)))
#define IS_FLAW(ch, sn)		(IS_SET((ch)->pcdata->trait_flaw[REG_FLAW], (sn)))
#define IS_IMMFLAW(ch, sn)	(IS_SET((ch)->pcdata->trait_flaw[IMM_FLAW], (sn)))
#define IS_VAMPAFF(ch, sn)	(IS_SET((ch)->pcdata->stats[UNI_AFF], (sn)))
#define IS_VAMPPASS(ch, sn)	((ch)->pcdata->Ninherited[(sn)]) 
#define IS_FORM(ch, sn)		(IS_SET((ch)->form, (sn)))
#define IS_POLYAFF(ch, sn)	(IS_SET((ch)->polyaff, (sn)))
#define IS_EXTRA(ch, sn)	(IS_SET((ch)->extra, (sn)))
#define IS_ADDED(ch, sn)	(IS_SET((ch)->added, (sn)))
#define IS_STANCE(ch, sn)	(ch->stance[0] == sn)
#define IS_DEMPOWER(ch, sn)	(IS_SET((ch)->pcdata->powers[DPOWER_FLAGS], (sn)))
#define IS_DEMAFF(ch, sn)	(IS_SET((ch)->pcdata->powers[DPOWER_CURRENT], (sn))) 
#define IS_CLASS(ch, CLASS)	(IS_SET((ch)->creature, CLASS))
#define IS_TRIBE(ch, TRIBE)     (IS_SET((ch)->pcdata->wwf_tribe, TRIBE))
/* Code changed By Spiral - Since non Inducted clans can use these bits still
*#define IS_CAMARILLA(ch)	(!strcmp((ch)->sect, "Camarilla") || \
*                                 (strcmp((ch)->sect, "Camarilla") && IS_SET((ch)->special, SPC_ANTITRIBU)) )
*#define IS_SABBAT(ch)		(!strcmp((ch)->sect, "Sabbat") || \
*                                 (strcmp((ch)->sect, "Sabbat") && IS_SET((ch)->special, SPC_ANTITRIBU)) )
*#define IS_FOLLOWERS(ch)	(!strcmp((ch)->sect, "Followers") || \
*                                 (strcmp((ch)->sect, "Followers") && IS_SET((ch)->special, SPC_ANTITRIBU)) )
*/
#define IS_CAMARILLA(ch)	((ch)->sect == SECT_CAMARILLA) 
#define IS_SABBAT(ch)		((ch)->sect == SECT_SABBAT)
#define IS_FOLLOWERS(ch)	((ch)->sect == SECT_FOLLOWERS)
#define IS_WYRM(ch)			((ch)->sect == SECT_WYRM)
#define IS_PACK(ch)			((ch)->sect == SECT_PACK)
#define IS_NEWPACK(ch)		((ch)->sect == SECT_NEWPACK)
#define IS_HEAD(ch, sn)		(IS_SET((ch)->loc_hp[0], (sn)))
#define IS_BODY(ch, sn)		(IS_SET((ch)->loc_hp[1], (sn)))
#define IS_ARM_L(ch, sn)	(IS_SET((ch)->loc_hp[2], (sn)))
#define IS_ARM_R(ch, sn)	(IS_SET((ch)->loc_hp[3], (sn)))
#define IS_LEG_L(ch, sn)	(IS_SET((ch)->loc_hp[4], (sn)))
#define IS_LEG_R(ch, sn)	(IS_SET((ch)->loc_hp[5], (sn)))
#define IS_BLEEDING(ch, sn)	(IS_SET((ch)->loc_hp[6], (sn)))
#define IS_WILLPOWER(ch, sn)	(IS_SET((ch)->pcdata->resist[0], (sn)))
#define IS_MORE(ch, sn)		(IS_SET((ch)->more, (sn)))
#define IS_WEREWOLF(ch)		(IS_SET((ch)->creature, CLASS_WEREWOLF))
#define IS_VAMPIRE(ch)		(IS_SET((ch)->creature, CLASS_VAMPIRE))
#define IS_SWWF(ch)		(IS_SET((ch)->creature, CLASS_SWWF) && ch->level >= LEVEL_AVATAR)
#define IS_MAGE(ch)		(IS_SET((ch)->creature, CLASS_MAGE))


#define IN_CLAN( ch )           (IS_NPC(ch)?0:ch->clan)
#define IS_PLAYING( d )         (d->connected==CON_PLAYING)

#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 GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 ))
#define GET_HITROLL(ch)		((ch)->hitroll+str_app[get_curr_str(ch)].tohit)
#define GET_DAMROLL(ch)		((ch)->damroll+str_app[get_curr_str(ch)].todam)

#define IS_OUTSIDE(ch)		(!IS_SET(				    \
				    (ch)->in_room->room_flags,		    \
				    ROOM_INDOORS))

#define WAIT_STATE(ch, npulse)	((ch)->wait = UMAX((ch)->wait, (npulse)))
#define CH(descriptor) ((descriptor)->original ? (descriptor)->original : (descriptor)->character)


/*
 * Object Macros.
 */
#define IS_ARTIFACT(obj)        (IS_SET((obj)->quest, QUEST_ARTIFACT))
#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.   ---- Taken out for Replacement Function
 *
#define PERS(ch, looker)	( can_see( looker, (ch) ) ?		\
				( IS_NPC(ch) ? (ch)->short_descr	\
				: ( IS_AFFECTED( (ch), AFF_POLYMORPH) ?   \
				(ch)->morph : (ch)->name ) )		\
				: "someone" )
*/


/*
 * Structure for a command in the command lookup table.
 */
struct	cmd_type
{
	char * const	name;
	DO_FUN *		do_fun;
	sh_int		position;
	sh_int		level;
	sh_int		log;
};



/*
 * Structure for a social in the socials table.
 */
struct	social_type
{
	char  	name[20];
	char * 	char_no_arg;
	char *	others_no_arg;
	char * 	char_found;
	char * 	others_found;
	char *	vict_found;
	char *      char_not_found;
	char *	char_auto;
	char *	others_auto;
};

extern int riddle_max;
extern int riddle_number;

struct  riddle_type
{
	char *	riddle;
	char *  clue;
	char *  clue_do;
	char *  answer;
	char *  answer_do;
};


/*
 * Structure for an X-social in the socials table.
 */
struct	xsocial_type
{
	char * 	name;
	char * 	char_no_arg;
	char * 	others_no_arg;
	char * 	char_found;
	char * 	others_found;
	char * 	vict_found;
	char * 	char_auto;
	char * 	others_auto;
	char * 	msp;
	sh_int		gender;
	sh_int		stage;
	sh_int		position;
	sh_int		self;
	sh_int		other;
	bool		chance;
};



/*
 * Global constants.
 */
extern	const	struct	str_app_type	str_app		[26];
extern	const	struct	int_app_type	int_app		[26];
extern	const	struct	wis_app_type	wis_app		[26];
extern	const	struct	dex_app_type	dex_app		[26];
extern	const	struct	con_app_type	con_app		[26];

extern	const	struct	cmd_type	cmd_table	[];
extern	const	struct	liq_type	liq_table	[LIQ_MAX];
extern	const	struct	skill_type	skill_table	[];
extern		struct	clan_table_type	clan_table	[MAX_CLAN];
extern		struct	artifact_type	artifact_table	[MAX_ART];
extern		struct	social_type	social_table	[MAX_SOCIALS];
extern		struct  riddle_type	riddle_table	[MAX_RIDDLE];
extern		struct	xsocial_type	xsocial_table	[MAX_XSOCIALS];
extern  const   struct  discipline_type discipline_table        [MAX_DISC];
extern  const   struct  spell_colour_type spell_colour_table        [5];
extern  const   struct  vamp_clan_type  vamp_clan_table [MAX_VAMP_CLAN];
extern  const   struct  mage_clan_type  mage_clan_table [];




/*
 * Global variables.
 */
extern		HELP_DATA	  *	help_first;
extern		SHOP_DATA	  *	shop_first;

extern		BAN_DATA	  *	ban_list;
extern		CHAR_DATA	  *	char_list;
extern		GSList   	  *descriptor_list;
extern		NOTE_DATA	  *	note_list;
extern		GSList	  	  * object_list;
extern		MPROG_CODE	  *	mprog_list;
extern		AFFECT_DATA	  *	affect_free;
extern		BAN_DATA	  *	ban_free;
extern		CHAR_DATA	  *	char_free;
extern		GSList	      * object_free;
extern		GSList	      *	descriptor_free;
extern		GSList  *	extra_descr_free;
extern		ROOMTEXT_DATA     *	roomtext_free;
extern		NOTE_DATA	  *	note_free;
extern		GSList	  *	obj_free;
extern		PC_DATA		  *	pcdata_free;

extern		char			bug_buf		[];
extern		time_t			current_time;
extern		bool			fLogAll;
extern		FILE *			fpReserve;
extern		KILL_DATA		kill_table	[];
extern		char			log_buf		[];
extern		TIME_INFO_DATA		time_info;
extern		char 			last_command[MAX_STRING_LENGTH];
extern		MUD_SETTING		*mudsetting;
extern		bool			MOBtrigger;

/*
 * Spell functions.
 * Defined in magic.c.
 */
DECLARE_SPELL_FUN(	spell_null		);
DECLARE_SPELL_FUN(	spell_acid_blast	);
DECLARE_SPELL_FUN(	spell_armor		);
DECLARE_SPELL_FUN(	spell_bless		);
DECLARE_SPELL_FUN(	spell_blindness		);
DECLARE_SPELL_FUN(	spell_burning_hands	);
DECLARE_SPELL_FUN(	spell_call_lightning	);
DECLARE_SPELL_FUN(	spell_cause_critical	);
DECLARE_SPELL_FUN(	spell_cause_light	);
DECLARE_SPELL_FUN(	spell_cause_serious	);
DECLARE_SPELL_FUN(	spell_change_sex	);
DECLARE_SPELL_FUN(	spell_charm_person	);
DECLARE_SPELL_FUN(	spell_chill_touch	);
DECLARE_SPELL_FUN(	spell_colour_spray	);
DECLARE_SPELL_FUN(	spell_continual_light	);
DECLARE_SPELL_FUN(	spell_control_weather	);
DECLARE_SPELL_FUN(	spell_create_food	);
DECLARE_SPELL_FUN(	spell_create_spring	);
DECLARE_SPELL_FUN(	spell_create_water	);
DECLARE_SPELL_FUN(	spell_cure_blindness	);
DECLARE_SPELL_FUN(	spell_cure_critical	);
DECLARE_SPELL_FUN(	spell_cure_light	);
DECLARE_SPELL_FUN(	spell_cure_poison	);
DECLARE_SPELL_FUN(	spell_cure_serious	);
DECLARE_SPELL_FUN(	spell_curse		);
DECLARE_SPELL_FUN(	spell_detect_evil	);
DECLARE_SPELL_FUN(	spell_detect_hidden	);
DECLARE_SPELL_FUN(	spell_detect_invis	);
DECLARE_SPELL_FUN(	spell_detect_magic	);
DECLARE_SPELL_FUN(	spell_detect_poison	);
DECLARE_SPELL_FUN(	spell_dispel_evil	);
DECLARE_SPELL_FUN(	spell_dispel_magic	);
DECLARE_SPELL_FUN(	spell_earthquake	);
DECLARE_SPELL_FUN(	spell_enchant_weapon	);
DECLARE_SPELL_FUN(	spell_energy_drain	);
DECLARE_SPELL_FUN(	spell_faerie_fire	);
DECLARE_SPELL_FUN(	spell_faerie_fog	);
DECLARE_SPELL_FUN(	spell_fireball		);
DECLARE_SPELL_FUN(	spell_flamestrike	);
DECLARE_SPELL_FUN(	spell_fly		);
DECLARE_SPELL_FUN(	spell_gate		);
DECLARE_SPELL_FUN(	spell_general_purpose	);
DECLARE_SPELL_FUN(	spell_giant_strength	);
DECLARE_SPELL_FUN(	spell_harm		);
DECLARE_SPELL_FUN(	spell_heal		);
DECLARE_SPELL_FUN(	spell_high_explosive	);
DECLARE_SPELL_FUN(	spell_identify		);
DECLARE_SPELL_FUN(	spell_infravision	);
DECLARE_SPELL_FUN(	spell_invis		);
DECLARE_SPELL_FUN(	spell_know_alignment	);
DECLARE_SPELL_FUN(	spell_lightning_bolt	);
DECLARE_SPELL_FUN(	spell_locate_object	);
DECLARE_SPELL_FUN(	spell_fear			);
DECLARE_SPELL_FUN(	spell_magic_missile	);
DECLARE_SPELL_FUN(	spell_mass_invis	);
DECLARE_SPELL_FUN(	spell_pass_door		);
DECLARE_SPELL_FUN(	spell_poison		);
DECLARE_SPELL_FUN(	spell_plague 		);
DECLARE_SPELL_FUN(	spell_cure_disease	);
DECLARE_SPELL_FUN(	spell_protection	);
DECLARE_SPELL_FUN(	spell_refresh		);
DECLARE_SPELL_FUN(	spell_remove_curse	);
DECLARE_SPELL_FUN(	spell_sanctuary		);
DECLARE_SPELL_FUN(	spell_shocking_grasp	);
DECLARE_SPELL_FUN(	spell_shield		);
DECLARE_SPELL_FUN(	spell_sleep		);
DECLARE_SPELL_FUN(	spell_stone_skin	);
DECLARE_SPELL_FUN(	spell_summon		);
DECLARE_SPELL_FUN(	spell_teleport		);
DECLARE_SPELL_FUN(	spell_ventriloquate	);
DECLARE_SPELL_FUN(	spell_weaken		);
DECLARE_SPELL_FUN(	spell_word_of_recall	);
DECLARE_SPELL_FUN(	spell_acid_breath	);
DECLARE_SPELL_FUN(	spell_fire_breath	);
DECLARE_SPELL_FUN(	spell_frost_breath	);
DECLARE_SPELL_FUN(	spell_gas_breath	);
DECLARE_SPELL_FUN(	spell_lightning_breath	);

DECLARE_SPELL_FUN(	spell_guardian		);
DECLARE_SPELL_FUN(	spell_soulblade		);
DECLARE_SPELL_FUN(	spell_mana		);
DECLARE_SPELL_FUN(	spell_frenzy		);
DECLARE_SPELL_FUN(	spell_darkblessing	);
DECLARE_SPELL_FUN(	spell_portal		);
DECLARE_SPELL_FUN(	spell_energyflux	);
DECLARE_SPELL_FUN(	spell_voodoo		);
DECLARE_SPELL_FUN(	spell_transport		);
DECLARE_SPELL_FUN(	spell_regenerate	);
DECLARE_SPELL_FUN(	spell_clot		);
DECLARE_SPELL_FUN(	spell_mend		);
DECLARE_SPELL_FUN(	spell_quest		);
DECLARE_SPELL_FUN(	spell_minor_creation	);
DECLARE_SPELL_FUN(	spell_brew		);
DECLARE_SPELL_FUN(	spell_scribe		);
DECLARE_SPELL_FUN(	spell_carve		);
DECLARE_SPELL_FUN(	spell_engrave		);
DECLARE_SPELL_FUN(	spell_bake		);
DECLARE_SPELL_FUN(	spell_mount		);
DECLARE_SPELL_FUN(	spell_scan		);
DECLARE_SPELL_FUN(	spell_repair		);
DECLARE_SPELL_FUN(	spell_spellproof	);
DECLARE_SPELL_FUN(	spell_preserve		);
DECLARE_SPELL_FUN(	spell_perfection	);
DECLARE_SPELL_FUN(	spell_major_creation	);
DECLARE_SPELL_FUN(	spell_insert_page	);
DECLARE_SPELL_FUN(	spell_chaos_blast	);
DECLARE_SPELL_FUN(	spell_resistance	);
DECLARE_SPELL_FUN(	spell_web		);
DECLARE_SPELL_FUN(	spell_arm		);
DECLARE_SPELL_FUN(	spell_polymorph	);
DECLARE_SPELL_FUN(	spell_contraception	);
DECLARE_SPELL_FUN(	spell_remove_page	);
DECLARE_SPELL_FUN(	spell_find_familiar	);
DECLARE_SPELL_FUN(	spell_improve		);

/*
 * OS-dependent declarations.
 * These are all very standard library functions,
 *   but some systems have incomplete or non-ansi header files.
 */
#if	defined(_AIX)
char *	crypt		args( ( const char *key, const char *salt ) );
#endif

#if	defined(apollo)
int	atoi		args( ( const char *string ) );
void *	calloc		args( ( unsigned nelem, size_t size ) );
char *	crypt		args( ( const char *key, const char *salt ) );
#endif

#if	defined(hpux)
char *	crypt		args( ( const char *key, const char *salt ) );
#endif

#if	defined(interactive)
#endif

#if	defined(linux)
//char *	crypt		args( ( const char *key, const char *salt ) );
#endif

#if	defined(unix)
//char *	crypt		args( ( const char *key, const char *salt ) );
#endif

#if	defined(MSDOS)
#define NOCRYPT
#if	defined(unix)
#undef	unix
#endif
#endif

#if	defined(sequent)
char *	crypt		args( ( const char *key, const char *salt ) );
int	fclose		args( ( FILE *stream ) );
int	fprintf		args( ( FILE *stream, const char *format, ... ) );
int	fread		args( ( void *ptr, int size, int n, FILE *stream ) );
int	fseek		args( ( FILE *stream, long offset, int ptrname ) );
void	perror		args( ( const char *s ) );
int	ungetc		args( ( int c, FILE *stream ) );
#endif

#if	defined(sun)
char *	crypt		args( ( const char *key, const char *salt ) );
int	fclose		args( ( FILE *stream ) );
int	fprintf		args( ( FILE *stream, const char *format, ... ) );
#if 	defined(SYSV)
size_t 	fread		args( ( void *ptr, size_t size, size_t n, 
		FILE *stream ) );
#else
int	fread		args( ( void *ptr, int size, int n, FILE *stream ) );
#endif
int	fseek		args( ( FILE *stream, long offset, int ptrname ) );
void	perror		args( ( const char *s ) );
int	ungetc		args( ( int c, FILE *stream ) );
#endif

#if	defined(ultrix)
char *	crypt		args( ( const char *key, const char *salt ) );
#endif



/*
 * The crypt(3) function is not available on some operating systems.
 * In particular, the U.S. Government prohibits its export from the
 *   United States to foreign countries.
 * Turn on NOCRYPT to keep passwords in plain text.
 */
#if	defined(NOCRYPT)
#define crypt(s1, s2)	(s1)
#endif



/*
 * 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(macintosh)
#define PLAYER_DIR	"asdfasdfadf/"		/* Player files			*/
#define NULL_FILE	"proto.are"	/* To reserve one stream	*/
#endif

#if defined(MSDOS)
#define PLAYER_DIR	"..\\player2\\"		/* Player files                 */
#define NULL_FILE	"nul"		/* To reserve one stream	*/
#endif

#if defined(_WIN32)
#define PLAYER_DIR	"..\\player\\"		/* Player files                 */
#define NULL_FILE	"proto.are"		/* To reserve one stream	*/
#endif

#if defined(unix)
#define PLAYER_DIR	"../player/"	/* Player files			*/
#define NULL_FILE	"/dev/null"	/* To reserve one stream	*/
#endif

#define LAST_COMMAND	"command.txt"	/* For the Signal Handler	*/
#define AREA_LIST	"area.lst"	/* List of areas		*/
#define CLAN_LIST	"clan1.txt"	/* List of clans		*/
#define ART_LIST	"art1.txt"	/* List of artifacts            */
#define HOME_AREA	"../area/homes.are" /* Mages towers, etc        */

#define BAN_FILE	"bans.txt"      /* For permbanned sites		*/
#define BUILD_FILE	"build.txt"	/* New Build System		*/
#define BUG_FILE	"bugs.txt"      /* For bug( )			*/
#define PLAYER_BUG_FILE	"playerbugs.txt"/* For 'bug' 			*/
#define TYPO_FILE	"typos.txt"     /* For 'typo'			*/
#define SHUTDOWN_FILE	"shutdown.txt"	/* For 'shutdown'		*/
#define COPYOVER_FILE   "copyover.temp" /* For Copyover                 */
#define EXE_FILE        "lurf"          /* For Copyover                 */
#define MSP_SERVER      "members.tripod.com/lurf2" /* For MSP(Mud Sound Protocol)  */
#define MSP_WAVDIR      "/sounds/wav/"     /* For MSP                      */
#define MSP_MIDDIR      "/sounds/midi/"    /* For MSP                      */  
#define HELP_FILE       "help.txt"       /* For undefined helps */
#define BAD_NAME_FILE   "bad.names"	    /* bad names */
/*
 * Our function prototypes.
 * One big lump ... this is every function in Merc.
 */
#define CD	CHAR_DATA
#define MID	MOB_INDEX_DATA
#define OD	OBJ_DATA
#define OID	OBJ_INDEX_DATA
#define RID	ROOM_INDEX_DATA
#define SF	SPEC_FUN
#define MPC	MPROG_CODE

/* act_comm.c */
void    page_to_char	args( ( const char *txt, CHAR_DATA *ch ) );
void	show_string	args( ( struct descriptor_data *d, char *input) );
void	add_follower	args( ( CHAR_DATA *ch, CHAR_DATA *master ) );
void	stop_follower	args( ( CHAR_DATA *ch ) );
bool	check_pk	args( ( CHAR_DATA *ch, CHAR_DATA *victim, int flag ) );
bool	check_pk_range	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void	die_follower	args( ( CHAR_DATA *ch ) );
bool	is_same_group	args( ( CHAR_DATA *ach, CHAR_DATA *bch ) );
void	room_text	args( ( CHAR_DATA *ch, char *argument ) );
char    *strlower       args( ( char * ip ) );
void	excessive_cpu	args( ( int blx ) );
bool	check_parse_name args( ( char *name ) );
bool    write_to_descriptor args((int desc,char *txt,int lenght ));

/* act_info.c */
int	get_hours	args( ( CHAR_DATA *ch ) );
void	set_title	args( ( CHAR_DATA *ch, char *title ) );
char    *PERS           args( ( CHAR_DATA *ch, CHAR_DATA *viewer) );
bool    knows_char      args( ( CHAR_DATA *ch, CHAR_DATA *victim) );
void    add_known       args( ( CHAR_DATA *ch, CHAR_DATA *victim) );
char    *unknown_name   args( ( CHAR_DATA *ch, CHAR_DATA *viewer) );
void	show_list_to_char	args( ( OBJ_DATA *list, CHAR_DATA *ch,
		bool fShort, bool fShowNothing ) );
int	char_hitroll	args( ( CHAR_DATA *ch ) );
int	char_damroll	args( ( CHAR_DATA *ch ) );
int	char_ac		args( ( CHAR_DATA *ch ) );
void	playwave_toroom	args( ( CHAR_DATA *ch, int wavnum ) );
void	playwave_toch	args( ( CHAR_DATA *ch, int wavnum ) );
int	get_breed	args( ( CHAR_DATA *ch, int disc ) );
int	get_auspice	args( ( CHAR_DATA *ch, int disc ) );
int	get_tribe	args( ( CHAR_DATA *ch, int disc ) );


/* act_move.c */
void	move_char	args( ( CHAR_DATA *ch, int door ) );
void	open_lift	args( ( CHAR_DATA *ch ) );
void	close_lift	args( ( CHAR_DATA *ch ) );
void	move_lift	args( ( CHAR_DATA *ch, int to_room ) );
void	move_door	args( ( CHAR_DATA *ch ) );
void	thru_door	args( ( CHAR_DATA *ch, int doorexit ) );
void	open_door	args( ( CHAR_DATA *ch, bool be_open ) );
bool	is_open		args( ( CHAR_DATA *ch ) );
bool	same_floor	args( ( CHAR_DATA *ch, int cmp_room ) );
void	check_hunt	args( ( CHAR_DATA *ch ) );
void    check_pet_reaction args((CHAR_DATA *pet));

/* act_obj.c */
CD *	find_keeper	args( ( CHAR_DATA *ch ) );
bool	is_ok_to_wear	args( ( CHAR_DATA *ch, bool wolf_ok, char *argument ) );
void	quest_object	args( ( CHAR_DATA *ch, OBJ_DATA *obj ) );
bool	remove_obj	args( ( CHAR_DATA *ch, int iWear, bool fReplace ) );
void	wear_obj	args( ( CHAR_DATA *ch, OBJ_DATA *obj, bool fReplace ) );
void 	create_zombie args( ( OBJ_DATA *obj ) );

/* act_wiz.c */
void	bind_char	args( ( CHAR_DATA *ch  ) );
//void	logchan		args( ( char *argument ) );
void	do_gen_info	args( ( char *argument ) );
void	play_wave	args( ( int  wavnum    ) );
void 	logchan		args( (char *string, CHAR_DATA *ch, OBJ_DATA *obj,
			       long flag, long flag_skip, int min_level ) );
void 	check_mobile args( ( char *argument ) );

/* alias.c */
void    substitute_alias args( (DESCRIPTOR_DATA *d, char *input) );

/* comm.c */
void	close_socket	args( ( DESCRIPTOR_DATA *dclose ) );
void	write_to_buffer	args( ( DESCRIPTOR_DATA *d, const char *txt,
		int length ) );
void	send_to_char	args( ( const char *txt, CHAR_DATA *ch ) );
void	act		args( ( const char *format, CHAR_DATA *ch,
		const void *arg1, const void *arg2, int type ) );
void	act2		args( ( const char *format, CHAR_DATA *ch,
		const void *arg1, const void *arg2, int type ) );
void	kavitem		args( ( const char *format, CHAR_DATA *ch,
		const void *arg1, const void *arg2, int type ) );
void	ch_printf	args( ( CHAR_DATA *ch, char *fmt, ... ) );
void    mxpconv     args( ( GString *output, const char *txt, CHAR_DATA *ch ) );
void 	frenzy_colour  args( ( char type, CHAR_DATA *ch, GString *string ) );

/*
 * Colour stuff by Lope of Loping Through The MUD
 */
void	colour		args( ( char type, CHAR_DATA *ch, GString *string ) );
void	colourconv	args( ( GString *buffer, GString *txt, CHAR_DATA *ch ) );
void	send_to_char_bw	args( ( const char *txt, CHAR_DATA *ch ) );


/* db.c */
#define                 MAX_PERM_BLOCK  131072
void	str_cpy args( ( char *dest, char *src ) );

#define DATPATH ""
extern unsigned strspace_size;  
char* strspace_alloc();
void  strspace_size_increment();
extern int      social_count;

#define MAGIC_NUM 52571214
char *  print_flags     args( ( int flag ));
void	reset_area      args( ( AREA_DATA * pArea ) );		/* OLC */
void	reset_room	args( ( ROOM_INDEX_DATA *pRoom ) );	/* OLC */
void	boot_db		args( ( void ) );
long	get_pc_id	args( ( void ) );
long	get_mob_id	args( ( void ) );
void	area_update	args( ( void ) );
CD *	create_mobile	args( ( MOB_INDEX_DATA *pMobIndex ) );
OD *	create_object	args( ( OBJ_INDEX_DATA *pObjIndex, int level ) );
void	clear_char	args( ( CHAR_DATA *ch ) );
void	free_char	args( ( CHAR_DATA *ch ) );
char *	get_extra_descr	args( ( char *name, EXTRA_DESCR_DATA *ed ) );
char *	get_roomtext	args( ( const char *name, ROOMTEXT_DATA    *rt ) );
MID *	get_mob_index	args( ( int vnum ) );
OID *	get_obj_index	args( ( int vnum ) );
RID *	get_room_index	args( ( int vnum ) );
char	fread_letter	args( ( FILE *fp ) );
MPC *	get_mprog_index args( ( int vnum ) );
int	fread_number	args( ( FILE *fp ) );
long    fread_flag      args( ( FILE *fp ) );
char *	fread_string	args( ( FILE *fp ) );
GString *nonfread_string	args( ( GString *string,FILE *fp ) );
void	fread_to_eol	args( ( FILE *fp ) );
char *	fread_word	args( ( FILE *fp ) );
/*
void *	alloc_mem	args( ( size_t sMem ) );
void *	alloc_perm	args( ( size_t sMem ) );
void	free_mem	args( ( void *pMem, size_t sMem ) );
*/
char *	str_dup		args( ( const char *str ) );
void	free_string	args( ( char *pstr ) );
int	number_fuzzy	args( ( int number ) );
int	number_range	args( ( int from, int to ) );
int	number_percent	args( ( void ) );
int	number_door	args( ( void ) );
int	number_bits	args( ( int width ) );
int	number_mm	args( ( void ) );
int	dice		args( ( int number, int size ) );
int	interpolate	args( ( int level, int value_00, int value_32 ) );
void	smash_tilde	args( ( char *str ) );
void	smash_quote	args( ( char *str ) );
void	smash_CRLF	args( ( char *str ) );
bool	str_cmp		args( ( const char *astr, const char *bstr ) );
bool	str_prefix	args( ( const char *astr, const char *bstr ) );
bool	str_infix	args( ( const char *astr, const char *bstr ) );
bool	str_suffix	args( ( const char *astr, const char *bstr ) );
char *	capitalize	args( ( const char *str ) );
void	append_file	args( ( CHAR_DATA *ch, char *file, char *str ) );
void	bug		args( ( const char *str, int param ) );
void	log_string2	args( ( const char *str ) );
void	tail_chain	args( ( void ) );
/* disc.c */
bool 	check_disc  args( (CHAR_DATA *ch, CHAR_DATA *victim, int flag));

/* fight.c */
void    put_stance  args((CHAR_DATA *ch));
void	violence_update	args( ( void ) );
void	multi_hit	args( ( CHAR_DATA *ch, CHAR_DATA *victim, int dt ) );
void	damage		args( ( CHAR_DATA *ch, CHAR_DATA *victim, int dam,
		int dt ) );
void	adv_damage	args( ( CHAR_DATA *ch, CHAR_DATA *victim, int dam ) );
void	update_pos	args( ( CHAR_DATA *victim ) );
void	stop_fighting	args( ( CHAR_DATA *ch, bool fBoth ) );
bool	no_attack	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void	set_attack_flag	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void	check_pkstatus 	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
bool	is_safe		args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
bool	is_tempsafe	args( ( CHAR_DATA *ch ) );
void	hurt_person	args( ( CHAR_DATA *ch, CHAR_DATA *victim, int dam ) );
//void	do_killperson	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
void	group_gain	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
int	dambonus	args( ( CHAR_DATA *ch, CHAR_DATA *victim, 
			    int dam, int stance) );
bool 	check_safe_imm  args((CHAR_DATA *ch));
/* handler.c */
int    check_follower_count args ((CHAR_DATA *ch));
bool	is_in		args( (char *, char *) );
bool	is_inpref		args( (char *, char *) );
bool	all_in		args( (char *, char *) );
bool    is_same_plane   args( ( CHAR_DATA *ch, CHAR_DATA *victim) );
char    *act_bit_name   args( ( int act_flags ) );
char    *fight_bit_name   args( ( int act_flags ) );
char    *attack_bit_name   args( ( int act_flags ) );
char    *added_bit_name   args( ( int vector ) );
char    *spaffect_bit_name   args( ( int vector ) );
char    *comm_bit_name   args( ( int vector ) );
AFFECT_DATA *find_affect args( ( CHAR_DATA *ch, int bitvector ) );
SPHERE_DATA *find_spaffect args( ( CHAR_DATA *ch, int bitvector ) );
int	get_trust	args( ( CHAR_DATA *ch ) );
int	get_age		args( ( CHAR_DATA *ch ) );
void	shift_obj_plane args((CHAR_DATA *ch));
int	get_curr_str	args( ( CHAR_DATA *ch ) );
int	get_curr_int	args( ( CHAR_DATA *ch ) );
int	get_curr_wis	args( ( CHAR_DATA *ch ) );
int	get_curr_dex	args( ( CHAR_DATA *ch ) );
int	get_curr_con	args( ( CHAR_DATA *ch ) );
int	can_carry_n	args( ( CHAR_DATA *ch ) );
int	can_carry_w	args( ( CHAR_DATA *ch ) );
void	set_mob_stance	args( ( CHAR_DATA *ch ) );
void	set_random_stance	args( ( CHAR_DATA *ch ) );
void	set_master_stance	args( ( CHAR_DATA *ch ) );
bool	is_name		args( ( char *str, char *namelist ) );
bool	is_full_name	args( ( const char *str, char *namelist ) );
bool	is_exact_name	args( ( char *str, char *namelist ) );
void	affect_to_char	args( ( CHAR_DATA *ch, AFFECT_DATA *paf ) );
void	sphere_to_char	args( ( CHAR_DATA *ch, SPHERE_DATA *paf ) );
void	affect_to_obj	args( ( OBJ_DATA *obj, AFFECT_DATA *paf ) );
void	affect_to_room	args( ( ROOM_INDEX_DATA *room, AFFECT_DATA *paf ) );
void	affect_remove	args( ( CHAR_DATA *ch, AFFECT_DATA *paf ) );
void	sphere_remove	args( ( CHAR_DATA *ch, SPHERE_DATA *paf ) );
void	affect_remove_obj args( ( OBJ_DATA *obj, AFFECT_DATA *paf ) );
void	affect_strip	args( ( CHAR_DATA *ch, int sn ) );
bool	is_affected	args( ( CHAR_DATA *ch, int sn ) );
void	affect_join	args( ( CHAR_DATA *ch, AFFECT_DATA *paf ) );
void	char_from_room	args( ( CHAR_DATA *ch ) );
void	char_to_room	args( ( CHAR_DATA *ch, ROOM_INDEX_DATA *pRoomIndex ) );
void	obj_to_char	args( ( OBJ_DATA *obj, CHAR_DATA *ch ) );
void	obj_from_char	args( ( OBJ_DATA *obj ) );
int	apply_ac	args( ( OBJ_DATA *obj, int iWear ) );
OD *	get_eq_char	args( ( CHAR_DATA *ch, int iWear ) );
void	equip_char	args( ( CHAR_DATA *ch, OBJ_DATA *obj, int iWear ) );
void	unequip_char	args( ( CHAR_DATA *ch, OBJ_DATA *obj ) );
int	count_obj_list	args( ( OBJ_INDEX_DATA *obj, OBJ_DATA *list ) );
void	obj_from_room	args( ( OBJ_DATA *obj ) );
void	obj_to_room	args( ( OBJ_DATA *obj, ROOM_INDEX_DATA *pRoomIndex ) );
void	obj_to_obj	args( ( OBJ_DATA *obj, OBJ_DATA *obj_to ) );
void	obj_from_obj	args( ( OBJ_DATA *obj ) );
void	extract_obj	args( ( OBJ_DATA *obj ) );
void	extract_char	args( ( CHAR_DATA *ch, bool fPull ) );
CD *	get_char_room	args( ( CHAR_DATA *ch, char *argument ) );
CD *    get_char_world  args( ( CHAR_DATA *ch, char *argument ) );
CD *    get_char_id     args( ( long id ) );
CD *    get_char_world2 args( ( CHAR_DATA *ch, char *argument ) );
CD *    get_char_area   args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_type	args( ( OBJ_INDEX_DATA *pObjIndexData ) );
OD *	get_obj_list	args( ( CHAR_DATA *ch, char *argument,
		OBJ_DATA *list ) );
OD *	get_obj_in_obj	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_carry	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_wear	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_here	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_room	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_world	args( ( CHAR_DATA *ch, char *argument ) );
OD *	get_obj_world2	args( ( CHAR_DATA *ch, char *argument ) );
OD *	create_money	args( ( int amount ) );
int	get_obj_number	args( ( OBJ_DATA *obj ) );
int	get_obj_weight	args( ( OBJ_DATA *obj ) );
bool	room_is_dark	args( ( ROOM_INDEX_DATA *pRoomIndex ) );
bool	room_is_private	args( ( ROOM_INDEX_DATA *pRoomIndex ) );
bool	can_see		args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
bool	has_planesight	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
bool	can_see_obj	args( ( CHAR_DATA *ch, OBJ_DATA *obj ) );
bool	can_drop_obj	args( ( CHAR_DATA *ch, OBJ_DATA *obj ) );
char *	item_type_name	args( ( OBJ_DATA *obj ) );
char *	affect_loc_name	args( ( int location ) );
char *	affect_bit_name	args( ( int vector ) );
char *	extra_bit_name	args( ( int extra_flags ) );
void	affect_modify	args( ( CHAR_DATA *ch, AFFECT_DATA *paf, bool fAdd ) );
void	sphere_modify	args( ( CHAR_DATA *ch, SPHERE_DATA *paf, bool fAdd ) );
void	affect_remove_room	args( ( ROOM_INDEX_DATA *room, AFFECT_DATA *paf ) );
void 	strip_player args( ( CHAR_DATA *ch )) ;
long	wiznet_lookup	args( ( const char *name) );

/* interp.c */
void	interpret	args( ( CHAR_DATA *ch, char *argument ) );
bool	is_number	args( ( char *arg ) );
int	number_argument	args( ( char *argument, char *arg ) );
char *	one_argument	args( ( char *argument, char *arg_first ) );
void	stage_update	args( ( CHAR_DATA *ch, CHAR_DATA *victim, int stage ) );
bool	check_social	args( ( CHAR_DATA *ch, char *command,
	char *argument ) );


int	discipline_lookup args( ( const char *discipline ) );
int	vamp_clan_lookup args( ( const char *vamp_clan ) );
int	mage_clan_lookup args( ( const char *mage_clan ) );
/* magic.c */
int     mage_affect_slot args( (char * command) );
int	skill_lookup	args( ( const char *name ) );
int	slot_lookup	args( ( int slot ) );
bool	saves_spell	args( ( int level, CHAR_DATA *victim ) );
void	obj_cast_spell	args( ( int sn, int level, CHAR_DATA *ch,
		CHAR_DATA *victim, OBJ_DATA *obj ) );
void	enhance_stat	args( ( int sn, int level, CHAR_DATA *ch, 
		CHAR_DATA *victim, int apply_bit,
		int bonuses, int affect_bit ) );
void    set_rObjNest_null args(());
		
/* save.c */
void	save_char_obj		args( ( CHAR_DATA *ch ) );
void	save_char_obj_backup	args( ( CHAR_DATA *ch ) );
bool	load_char_obj		args( ( DESCRIPTOR_DATA *d, char *name ) );
bool	load_char_short		args( ( DESCRIPTOR_DATA *d, char *name ) );

/* special.c */
SF *	spec_lookup	args( ( const char *name ) );
char  *spec_name	args( ( SPEC_FUN *function ) );

/* update.c */
void	gain_exp	args( ( CHAR_DATA *ch, int gain ) );
void	gain_condition	args( ( CHAR_DATA *ch, int iCond, int value ) );
void	update_handler	args( ( void ) );
bool    hates_players   args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );

/* kav_fight.c */
void	special_move	args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );

/* kav_info.c */
void	birth_date	args( ( CHAR_DATA *ch, bool is_self ) );
void	other_age	args( ( CHAR_DATA *ch, int extra, bool is_preg, 
		char *argument ) );
int	years_old	args( ( CHAR_DATA *ch ) );

/* kav_wiz.c */
void oset_affect args( ( CHAR_DATA *ch, OBJ_DATA *obj, int value, int affect, bool is_quest) );

/* clan.c */
void	werewolf_regen	args( ( CHAR_DATA *ch ) );
void	reg_mend	args( ( CHAR_DATA *ch ) );
void	vamp_rage	args( ( CHAR_DATA *ch ) );
bool	char_exists	args( ( bool backup, char *argument ) );
int	get_disc	args( ( CHAR_DATA *ch, int discipline) );
int	get_disc	args( ( CHAR_DATA *ch, int discipline) );
int	has_sphere	args( ( CHAR_DATA *ch, int discipline) );
OD *	get_page	args( ( OBJ_DATA *book, int page_num ) );

 /* mob_prog.c */
void	program_flow	args( ( sh_int vnum, char *source, CHAR_DATA *mob, CHAR_DATA *ch,
		const void *arg1, const void *arg2 ) );
void	mp_act_trigger	args( ( char *argument, CHAR_DATA *mob, CHAR_DATA *ch, const void *arg1, const void *arg2, int type ) );

void    rprog_act_trigger args(( char *argument, ROOM_INDEX_DATA *pRoom, CHAR_DATA *ch, void *arg1, void *arg2, int type));
void    oprog_act_trigger args(( char *argument, OBJ_DATA *obj, CHAR_DATA *ch, void *arg1, void *arg2, int type));

bool	rprog_percent_trigger args( ( ROOM_INDEX_DATA *pRoom, CHAR_DATA *ch, const void *arg1, const void *arg2, int type ) );
bool	oprog_percent_trigger args( ( OBJ_DATA *obj, CHAR_DATA *ch, const void *arg1, const void *arg2, int type ) );

void	mp_riddle_trigger	args( ( char *argument, CHAR_DATA *mob, CHAR_DATA *ch,
		const void *arg1, const void *arg2, int type ) );
bool	mp_percent_trigger args( ( CHAR_DATA *mob, CHAR_DATA *ch, 				
		const void *arg1, const void *arg2, int type ) );
void	mp_bribe_trigger  args( ( CHAR_DATA *mob, CHAR_DATA *ch, int amount ) );
bool	mp_exit_trigger   args( ( CHAR_DATA *ch, int dir ) );
bool	rprog_exit_trigger   args( ( CHAR_DATA *ch, int dir ) );
bool	oprog_exit_trigger   args( ( OBJ_DATA *ch, int dir ) );
void	mp_give_trigger   args( ( CHAR_DATA *mob, CHAR_DATA *ch, OBJ_DATA *obj ) );
void 	mp_greet_trigger  args( ( CHAR_DATA *ch ) );
void	mp_hprct_trigger  args( ( CHAR_DATA *mob, CHAR_DATA *ch ) );
MEM_DATA *get_mem_data      args( ( CHAR_DATA *ch, CHAR_DATA *target ) );
void 	mob_remember      args( ( CHAR_DATA *ch, CHAR_DATA *target, int recation));
void 	mem_fade      args( ( CHAR_DATA *ch));

 /* mob_cmds.c */
void	mob_interpret	args( ( CHAR_DATA *ch, char *argument ) );
void    hunt_victim     args( ( CHAR_DATA *ch ));


/* string.c */
void	string_edit	args( ( CHAR_DATA *ch, char **pString ) );
void    string_append   args( ( CHAR_DATA *ch, char **pString ) );
char *	string_replace	args( ( char * orig, char * old, char *new_string ) );
void    string_add      args( ( CHAR_DATA *ch, char *argument ) );
char *  format_string   args( ( char *oldstring /*, bool fSpace */ ) );
char *  first_arg       args( ( char *argument, char *arg_first, bool fCase ) );
char *	string_unpad	args( ( char * argument ) );
char *	string_proper	args( ( char * argument ) );

/* olc.c */
bool	run_olc_editor	args( ( DESCRIPTOR_DATA *d ) );
char	*olc_ed_name	args( ( CHAR_DATA *ch ) );
char	*olc_ed_vnum	args( ( CHAR_DATA *ch ) );

/*olc_act.c */
void    copyover_recover args ( ( void ));
extern bool    fCopyOver;
void    do_ispell       args( ( CHAR_DATA *ch, char *argument) );
void    ispell_string   args( ( CHAR_DATA *ch ) );

#define IS_NULLSTR(str) ((str)==NULL || (str)[0]=='\0')
#define MSL MAX_STRING_LENGTH

/* lookup.c */
int	race_lookup	args( ( const char *name) );
int	item_lookup	args( ( const char *name) );
int	liq_lookup	args( ( const char *name) );

/* New Mem.c*/
void alloc_dhost args( ( DESCRIPTOR_DATA *d, const char *host) );
void free_host args( ( DESCRIPTOR_DATA *d ) );

/*mage.c*/
bool  	        check_has_foci  args( ( CHAR_DATA *ch, int Sphere_num, int Sphere_Lev) );
extern SPHERE_DATA     *sphere_free;
int gain_paradox args( ( CHAR_DATA *ch ));

/*wolf.c*/
void   update_wwf       args( ( void ) );
char *get_tribe_name    args( ( int flags ) );
int  get_max_rage       args( ( CHAR_DATA *ch ) );
void chbreed_form		args( ( CHAR_DATA *ch, char *argument) );
sh_int get_renown		args( ( CHAR_DATA *ch ) );
void shape_shift      args( ( CHAR_DATA *ch, int change));

/*board.c*/
void decap_note      args( ( CHAR_DATA *ch, CHAR_DATA *victim, int Decap_Type, int Decap_OutCome) );

#undef	CD
#undef	MID
#undef	OD
#undef	OID
#undef	RID
#undef	SF


/*****************************************************************************
 *                                    OLC                                    *
 *****************************************************************************/

/*
 * Object defined in limbo.are
 * Used in save.c to load objects that don't exist.
 */
#define OBJ_VNUM_DUMMY	30

/*
 * Area flags.
 */
#define         AREA_NONE       0
#define         AREA_CHANGED    1	/* Area has been modified. */
#define         AREA_ADDED      2	/* Area has been added to. */
#define         AREA_LOADING    4	/* Used for counting in db.c */

#define MAX_DIR	6
#define NO_FLAG -99	/* Must not be used in flags or stats. */

/*
 * Global Constants
 */
extern	char *	const	dir_name        [];
extern	const	sh_int	rev_dir         [];          /* sh_int - ROM OLC */
extern	const	struct	spec_type	spec_table	[];

/*
 * Global variables
 */
extern		AREA_DATA *		area_first;
extern		AREA_DATA *		area_last;
extern		SHOP_DATA *		shop_last;

extern		int			top_affect;
extern		int			top_area;
extern		int			top_ed;
extern		int			top_exit;
extern		int			top_help;
extern		int			top_mob_index;
extern		int			top_mprog_index;
extern		int			top_obj_index;
extern		int			top_reset;
extern		int			top_room;
extern		int			top_shop;

extern		int			top_vnum_mob;
extern		int			top_vnum_obj;
extern		int			top_vnum_room;

extern		char			str_empty       [1];

extern		MOB_INDEX_DATA *	mob_index_hash  [MAX_KEY_HASH];
extern		OBJ_INDEX_DATA *	obj_index_hash  [MAX_KEY_HASH];
extern		ROOM_INDEX_DATA *	room_index_hash [MAX_KEY_HASH];


/* Mem Opt Calls - Spiral */

#define			MAX_MEM_LIST	11
//extern const int  		rgSizeList[MAX_MEM_LIST];


/* Mob Memory stuff - Spiral */

/* memory settings */
#define MEM_CUSTOMER	A	
#define MEM_SELLER	B
#define MEM_HOSTILE	C
#define MEM_AFRAID	D

/* memory for mobs */
struct mem_data
{
    MEM_DATA 	*next;
    bool	valid;
    long	id; 	
    int 	reaction;
    time_t 	when;
};
void 	check_string args(( void *pMem, size_t sMem ));
int		logf( const char *format, ... );
			// mkw: print to log formatted

int		chprintf( CHAR_DATA* ch, const char *format, ... );
			// mkw: print to character formatted

int		strswitch( const char* arg, ... );
			// mkw: "bundles" any number of string comparisons neatly 
			// into one return value that can be used in a switch statement.
			// Last argument passed must be NULL to mark end of list.
			// Will behave badly if that is forgotten or anything other than 
			// strings are passed.
			// First variable argument is counted as one.
			// Returns 0 if no strings match.

void	vinterpret( CHAR_DATA *ch, char *argument, ... );
			// mkw: This is my subcommand interpreter.
			// Pattern for variable args: 
			// { string_1, [do_fun_1|NULL], ... } NULL, [default_do_fun|NULL]
			// NULL passed for a string marks end of list.
			// NULL passed for a do_fun means no action on match.

extern WEATHER_DATA		weather_info[SECT_MAX];
extern  const   struct  item_type	item_table	[];
extern	const	struct	wiznet_type	wiznet_table	[];

#define g_KEY( literal, field, value )					\
				if ( !str_cmp( word, literal ) )	\
				{					\
				    field  = g_string_assign(field,value);			\
				    fMatch = TRUE;			\
				    break;				\
				}

#define h_KEY( literal, field, value )					\
				if ( !str_cmp( word, literal ) )	\
				{					\
				    field  = value;			\
				    fMatch = TRUE;			\
				    break;				\
				}


#define KEY( literal, field, value )					\
				if ( !str_cmp( word, literal ) )	\
				{					\
				    field  = value;			\
				    fMatch = TRUE;			\
				    break;				\
				}

extern GMemChunk *obj_mem_chunk;
extern GMemChunk *char_data_mem_chunk;
extern GMemChunk *descriptor_mem_chunk;
extern GMemChunk *affect_mem_chunk;
extern GMemChunk *sphere_mem_chunk;
extern GMemChunk *extra_desc_mem_chunk;
extern GMemChunk *pcdata_mem_chunk;
extern GMemChunk *MobID_mem_chunk;
extern GMemChunk *ObjID_mem_chunk;
extern GMemChunk *RoomID_mem_chunk;
extern GMemChunk *AreaID_mem_chunk;
extern GMemChunk *HelpID_mem_chunk;

extern bool 	copyover_start;
/* player loading error correction */

extern bool    Player_Load;
extern bool    Player_Error;

/* Global Spiralsoft shit */
extern int    copyover_time;
extern bool    copyover_set;

extern GStringChunk *LurfStringChunk;
#endif