/* Some basic constants */
#define YES         0
#define NO          1
#define TRUE        0
#define FALSE       1
#define ALWAYS      0
#define NEVER       1
#define FROM_GAME   0
#define FROM_WORLD  1
#define DO_ADD      0
#define DO_REMOVE   1
#define OBJ_DROP    0
#define OBJ_GET     1
#define NEW_OBJECT  0
#define OLD_OBJECT  1
 
/* CONSTANTS USED FOR START-UP OF THE GAME */
#define	DEFAULT_PORT   4000
#define  MIN_LOGIN      0        /* 0 = new users, 1 = no new users, etc. */
//#define  MAX_USERS      4
#define  MAX_USERS      6
#define  OPT_USEC       25000
#define  ZONE_WIDTH     15       /* The width of a zone (in rooms) */
#define  ZONE_SIZE      (ZONE_WIDTH * ZONE_WIDTH)
/*******************************************/
/* Define where the Newbies start off from */
#define START_X        0
#define START_Y        0
#define START_Z        0
#define START_ZONE     0
#define START_ROOM     0
/*******************************************/

/* Boot-up flags */
#define LOAD_MOBS      YES
#define LOAD_OBJECTS   YES
#define INIT_WORLD     YES

/* Shutdown constants */
#define SHUTDOWN_COUNTING  1
#define SHUTDOWN_HALTED    2
#define SHUTDOWN_RUNNING   3

/* HMMMMMM... */
#define	DO_VIOLENCE        1    /* Seconds */
#define	DO_MOVEMENT        15   /* Seconds */
#define	ACT_INTELLIGENT    9		/* Seconds */
#define  CHECK_HEALTH		 15   /* Seconds */
///CRTH
#define COMFORTLEVEL		3600
#define WEATHER_UPD		90
#define TIME_OF_DAY	   120	
//#define CHECK_ACTORS		6
#define CHECK_ACTORS		60
//#define	TIME_OF_DAY		1
#define	ROOM_EVENTS	 	15 	
//#define	ROOM_EVENTS		6
///CRTH

/* CONSTANTS FOR BUFFER SIZES ETC. */
#define	SMALL_BUFSIZE  1024
#define	LARGE_BUFSIZE  10240
#define	MAX_STRING_LEN 512
#define	MAX_INP_LEN		512
#define	MAX_DESC			256
#define	MAX_NAM_LEN		12
#define  MAX_PATH_LEN	30
#define	HOST_LEN			50
#define	MAX_PWD_LEN		10
#define	MAX_SKILLS		40
#define	MAX_AFFECT		10
#define  MAX_CHANNELS	100
#define  MAX_COMPANY		5


/***************************************************************
	ALTER AT YOUR OWN RISK !!!!!!!
***************************************************************/
/* ODDS AND SODS */
#define  MAX_OBJ_REGEN 6     /* Maximum objects a character can start with */
#define  MAX_EXITS     6     /* Maximum exits */
#define  NOWHERE       -1
#define  IGNR_INVIS    0     /* For sending messages to people when invisible */
#define  INVIS_CHK     1     /* INVIS_CHK = "Someone" says. IGNR_INVIS = no message */

enum COLOUR {DGREY,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE,BRED,
				BGREEN,BYELLOW,BBLUE,BMAGENTA,BCYAN,BWHITE};

/* CONNECTED STATES OF BEING */
enum {CON_CLOSE,CON_NME,CON_NMECNF,CON_PWDNRM,CON_PWDGET,
		CON_PWDCNF,CON_QSEX,CON_QCLASS,CON_REROLL,CON_LINKLESS,
		CON_PLYNG,CON_BUILD,CON_PRIVATE};

/* CLASS */
#define  MAGE        1
#define  DRUID       2
#define  CLERIC      3
#define  THIEF       4
#define  WARRIOR     5

/* STATES OF BEING ALIVE (OR DEAD) */
enum {POS_DEAD,POS_INCAP,POS_ASLEEP,
	POS_RESTING,POS_SITTING,
	POS_STANDING,
	POS_RIDING,POS_FLYING,POS_DRIVING,
	POS_SWIMMING,
	POS_FIGHTING,
	};
// States of being - Mental & Pysical.
enum	{	STAT_STONED,		// Totaly pissed.
		 	STAT_DRUNK,			// Drunk.
			STAT_TIPSY,			// Tipsy.
			STAT_OK,				// Noefects.
			STAT_POISEND,		// Poisoned.
			STAT_PLAUGE,		// Diseased - Yuk!
			STAT_DAP,			// Drunk & Poisend,
			STAT_PAP,			// Poisond & DISEASE,
			STAT_DPL,			// Drunk & Diseased.
			STAT_DPP,			// Drunk, diseased and posond, bad combo...
		};

/* SEX */
#define  FEMALE         1
#define  MALE           2
#define  NEUTER         3

// CRTH - Skill Flags.
#define	LAST_SKL		0x00000001		// Last skill in list marker.
#define	SELF_SKL		0x00000002		// Used on character.
#define	OTHR_SKL		0x00000004		// Used on NPC.
#define	OBJT_SKL		0x00000010		// Used on objects.
#define	ROOM_SKL		0x00000020		// Use on room.
#define	AWYS_SKL		0x00000040		// Always in use - No need to call it.
#define	PLUS_SKL		0x00000100		// Mod type.
#define	MINS_SKL		0x00000200		// ""
#define	DIVI_SKL		0x00000400		//	""
#define	MULT_SKL		0x00001000		//	""
#define	EQUL_SKL		0x00002000		// ""
#define	INST_SKL		0x00004000		// Duration instant.
#define	UALL_SKL		0x00010000		// Usa by all classes.
#define	EVER_SKL		0x00020000		// Duration 4ever.
#define	ONOF_SKL		0x00040000		// Skill is either on or off.
#define	PERC_SKL		0x00100000		// Percentage skill.
#define	SPEC_SKL		0x00200000		// Special skill.
#define	GENR_SKL		0x00400000		// General skill.
#define	ONES_SKL		0x01000000		// One shot skill.
#define  OWNS_SKL		0x02000000		// If statto is to come from own stats.

/* OBJECT FLAGS */
#define	OBJ_GOLD		0x00000001
#define	OBJ_BOAT		0x00000002
#define	OBJ_CONT		0x00000004
#define	OBJ_POTION  0x00000010
#define	OBJ_SCROLL	0x00000020
#define	OBJ_WAND		0x00000040
#define	OBJ_STAFF	0x00000100
#define	OBJ_FOOD		0x00000200
#define	OBJ_KEY		0x00000400
#define	OBJ_BOW		0x00001000
#define	OBJ_ARROW	0x00002000
#define	OBJ_EXPL		0x00004000
#define	OBJ_LIGHT	0x00010000
#define  OBJ_DRINK   0x00020000   // Drinking objects, wine skins etc...
#define	OBJ_RIDE		0x00040000	 // Horse's and such like.
#define	OBJ_RAW		0x00100000	 // Unprepared food stuffs.
#define	OBJ_CART		0x00200000	 // Carts....

#define	WORN_HANDS	0x00000001
#define	WORN_FINGER	0x00000002
#define	WORN_GLOVES	0x00000004
#define	WORN_WRISTS	0x00000010
#define	WORN_ARMS	0x00000020
#define	WORN_NECK	0x00000040
#define	WORN_HEAD	0x00000100
#define	WORN_CHEST	0x00000200
#define	WORN_WAIST	0x00000400
#define	WORN_LEGS	0x00001000
#define	WORN_FEET	0x00002000
#define	WORN_SHIELD	0x00004000
#define	WORN_BODY	0x00010000
#define	WORN_LIGHT	0x00020000
#define  WORN_BACK   0x00040000  // Now objects can be worn on back.
#define	MAX_WEAR		19      // Was 18 before WORN_BACK
#define	MAX_CARRY	50			/* For save file */

/* ROOM & OBJECT FLAGS */
#define	ANTI_FEMALE		0x0001
#define	ANTI_MALE		0x0002
#define	ANTI_NEUTER 	0x0004

#define	ANTI_MAGE		0x0001
#define	ANTI_DRUID		0x0002
#define	ANTI_CLERIC		0x0004
#define	ANTI_THIEF		0x0010
#define	ANTI_WARRIOR	0x0020

#define	ANTI_EVIL	 	0x0001
#define	ANTI_NEUTRAL 	0x0002
#define	ANTI_GOOD	 	0x0004

#define	NO_MAGIC	   	0x00000001
#define	NO_OFFEN    	0x00000002
#define	NO_DEFEN	   	0x00000004
#define	NO_FIGHT  		0x00000010
#define	NO_MOB			0x00000020
#define	NO_SUMMON		0x00000040
#define	PRIVATE			0x00000100
#define	HEAL_ROOM		0x00000200
#define	IS_DARK			0x00000400
#define	FIRE_ROOM		0x00001000
#define	NO_SWIM			0x00002000
#define	DEATH_TRAP		0x00004000
#define	WATER_ROOM		0x00010000		// Full of water.
#define	MID_AIR			0x00020000
#define	PLAYER_KILL		0x00040000
#define  VOID_ROOM   	0x00100000     /* A room which does not belong to a zone */
#define  OUTSIDE        0x00200000
#define  HAS_LIGHT		0x00400000
#define	SOME_WATER		0x01000000		// Rooms with pools.
#define	SAVE_LOC			0x02000000
#define	LOOT				0x04000000

/* EXIT FLAGS */
#define  OPEN         	0x0001
#define  CLOSED       	0x0002
#define	LOCKED       	0x0004
#define	PICK_PROOF	 	0x0010
#define	HIDDEN			0x0020 


/* CHARACTER LEVELS */
#define IMP             52
#define GRGOD           51
#define GOD             50
#define IMMORT          40
#define WIZARD          30

/*************************/
enum {IS_OBJECT,IS_ROOM,IS_ZONE,IS_CHAR};

/************************************************************/
/* Enumeration for l_data[]                                 */
/************************************************************/
enum {GOLD_NUM,BANK_NUM,EXP_NUM,SPECIALS_NUM,PREFS_NUM,NPC_NUM,
		NUM_KILLS,MAX_L_DATA};
/************************************************************/
/* Enumeration for data[]                                  */
/************************************************************/
enum {ZONE_NUM,SEX_NUM,AGE_NUM,CLASS_NUM,LEVEL_NUM,INVIS_NUM,
		STR_NUM,STR_ADD_NUM,INT_NUM,WIS_NUM,DEX_NUM,CON_NUM,ARMOR_NUM,
		TOHIT_NUM,TODAM_NUM,THAC0_NUM,LIGHT_NUM,BAD_PWDS_NUM,POS_NUM,
		A_SEX_NUM,A_AGE_NUM,A_CLASS_NUM,A_ALIGN_NUM,ID_NUM,WEIGHT_NUM,
		HEIGHT_NUM,MANA_NUM,HIT_NUM,MOVE_NUM,ALIGN_NUM,MAX_MANA_NUM,
		MAX_WGHT_NUM,MAX_MOVE_NUM,MAX_HIT_NUM,LOAD_X_NUM,LOAD_Y_NUM,
		LOAD_Z_NUM,LOAD_ROOM_NUM,ROOM_X,ROOM_Y,ROOM_Z,CUR_WGHT_NUM,WAIT_NUM,DIE_NUM,
		SIDES_NUM,MOD_NUM,VALUE_NUM,OWEIGHT_NUM,MAXIMUM_NUM,CURRENT_NUM,
		SPECIAL_NUM,_REGEN_,MESSAGE,_LIFE_,STATE_NUM,DRUNK_NUM,POISEN_NUM,
		POISONSTR_NUM,DISEASE_NUM,DISEASESTR_NUM,HUNGER_NUM,THIRST_NUM,
		GENSK_NUM,SPSK_NUM,NOSK_NUM,READ_NUM,WRITE_NUM,
		MAX_DATA};
/************************************************************/
/* BITS for the SPECIALS                                    */
/************************************************************/
#define     PKILLER     0x0001
#define     DELETED     0x0002
#define     SEE_INVIS   0x0004
#define     IFRA_VIS    0x0010
#define     HIDE        0x0020
#define     STEALTH     0x0040
#define	   NPC			0x0100
/************************************************************/
/* BITS for the PREFERENCES                                 */
/************************************************************/
#define     NO_TELL     0x0001
#define     NO_GOSS     0x0002
#define     SAVE_POS    0x0004
#define     BRIEF       0x0008
#define	   NO_WEATH    0x0010	
/************************************************************/
/* BITS for the NON-PLAYER-FLAGS                            */
/************************************************************/
#define     WIMPY          0x0001	/* Run away if the going gets tough */
#define     AGGRESSIVE     0x0002	/* Be violent to player characters ;-) */
#define     ACT_THIEF      0x0004	/* Steal off players */
#define     SCAVENGER      0x0010	/* Pick up items off the floor */
#define     STAY_ZONE      0x0020	/* Stay in whatever zone it is currently in */
#define     ANTI_PKILLER   0x0040	/* Attack all player killers on sight! */
#define	   SENTINEL	   	0x0100	/* NPC doesn't move at all */
/************************************************************/
//////////////////CRTH

#define	YEAR 	12			// How many months in a year.
#define	MONTH	29			// How many days in a month.

// Debug markers.
extern char DEBUG_WORLD;
extern char DEBUG_MOB;
extern char DEBUG_CHAR;
//////////////CRTH


