
#include    <sys/types.h>
#include    <arpa/telnet.h>
#include    <netinet/in.h>

struct invite_data {
	char		name[MAX_NAM_LEN+1];
	char		type;
};

struct _col_table_ {
	char	*col;
	char	*name;
};

struct zone_data {
   int    xyz[3];                          /* The X,Y,Z co-ordinates of the zone */
   int    reset;                           /* How often to reset the zone */
   int    countdown;                       /* How long till next reset */
   int    num_rooms;                       /* How many CREATED rooms in this zone */
   struct room_data *room[ZONE_SIZE];      /* A list of the rooms in this zone */
};

struct skill_list {
   char     skill;
   char     a;
   char     b;
   long     c;
   char     d;
};

struct affect_data {
   short    affect;
	short		list;
   short    value;
   struct   affect_data *next;
};

/***********************************************************
	Regeneration information:
***********************************************************/
union any {
	struct char_data   *ch;
	struct object_data *ob;
	struct cook_data   *co;
	struct regen_data  *re;
	struct zone_data   *zo;
	struct room_data   *ro;
};

struct regen_data {
	char  type;                     /* Mob or Object */
	int   counter;                  /* Counter for active regen */
	int   time;                     /* Seconds between death and regeneration */
	int	reg_num;						  /* Where we are in the regen_index */
	union any  proto;               /* Our pointer to our proto type */
	union any  data;                /* Our pointer to any of our objects */
	int   xyz[4];                   /* X Y Z */
	int   obj_regen[MAX_OBJ_REGEN]; /* Attributed objects at regneration */
	struct regen_data *next;        /* Pointer to next of type */
};

/***********************************************************
	Slow cook information:- Timed removal of objects
***********************************************************/
struct cook_data {
	char   type;
	int    counter;
	union  any data;
	struct cook_data   *next;
};

/************************************************************
	object related stuff
************************************************************/
struct object_data {
	char	*name;			/* The object name (ie. sword) */
	char	*still_desc;	/* For when lying on the ground */
	char	*exam_desc;		/* For examine */
	char	*extra_desc;	/* For read writing, etc */
	char	*aliases;		/* Aliases for get, etc */

	int    data[MAX_DATA];
	long   flags;

	struct affect_data *affect;			/* Affects user */
	struct room_data   *in_room;        /* Pointer to the room it's in */
	struct char_data   *carried_by;		/* Who's carrying it */
	struct char_data	 *character;		/* Used when an object is a person */

	struct object_data *contains;			/* pointer to contents of a container */
	struct object_data *contained_in;   /* pointer to the object this is in */
	struct object_data *next_contained;	/* pointer to next object in container */
	struct object_data *next_carried;	/* pointer to next object if carried */
	struct object_data *next_in_room;	/* pointer to next object if in room */
	struct object_data *next_in_list;	/* For the global list */
	struct object_data *proto_object;   /* Pointer to the proto-type object */
	struct object_data *next_of_type;	/* Pointer to next object of same type */
};

struct descriptor_data {
	int	port_desc;
	int	connected;
	char	prompt;
	char	wait;

	char	input_buf[MAX_INP_LEN+2];
	char	last_input[MAX_INP_LEN+2];
	char	*output_buf;
	char	buf_size;
	int	bufptr;
	int	bufspace;

	struct char_data *character;
	struct char_data *original;

	struct descriptor_data *next_in_list;
};

struct say_data {
	char	*sentence;
	struct say_data *next;
};
// CRTH - The skill struture.
struct skill_data{
	char	*name;				// Skill name.
	char	*desc;				// Description.
	int	useby;				// Who can use it.
	int	type;					// % general or use once.
	int	useon;				// use on self, npc,obj or room.
	int	oftype[5];
	int	stat[5];				// up to 5 effects.
	int	statto[5];
	int	opper[5];			// up to 5 types +-=*/%
	int	value[5];			// up to 5 values either % or stat.
	int	special[5];			// up to 5 specials.	
	int	durat[5];			// up to 5 durations.
	char	*attempt[3];			// attempt text to 0 = self 1 = room 2 = npc.
	char	*fail[3];				// fail text as above.
	char	*success[3];			// success as above.
};
struct char_data {
   char     name[MAX_NAM_LEN+1];
	char		home[MAX_PATH_LEN+MAX_NAM_LEN+1];
	char		bin[MAX_PATH_LEN+MAX_NAM_LEN+4];
   char     pwd[MAX_PWD_LEN+1];
   char     title[41];
   char     host[HOST_LEN+1];
	char		*description;

	int	   data[MAX_DATA];
	long     l_data[MAX_L_DATA];

	// CRTH - Character skill data.
	struct	skill_data		skills[MAX_SKILLS];

	struct	timeval			*dob;
	struct	object_data		*wearing[MAX_WEAR];
	struct	object_data		*carrying;

	struct   room_data      *in_room;
	struct	char_data		*master;
	struct   char_data      *owner;
	struct	char_data		*leader;
	struct	char_data		*fighting;
	struct	char_data		*followers;
	struct	char_data		*next_follower;
	struct	char_data		*next_in_room;
	struct	char_data		*next_in_list;
	struct	char_data		*next_of_type;
	struct   char_data      *carried_by;
	struct   object_data    *next_carried;
	struct   object_data    *contained_in;
	struct   object_data    *next_contained;
	struct	invite_data		company[MAX_COMPANY];

	/* Mob only stuff */
	struct   char_data      *proto_mob;
	struct   say_data			*says;
	char		*l_name;

	/* Characters login descriptor */
   struct   descriptor_data   *desc;
};


struct char_save_data {
   char     name[MAX_NAM_LEN+1];
	char		home[MAX_PATH_LEN+MAX_NAM_LEN+1];
	char		bin[MAX_PATH_LEN+MAX_NAM_LEN+4];
   char     pwd[MAX_PWD_LEN+1];
   char     title[41];
   char     host[HOST_LEN+1];

	int		data[MAX_DATA];
	long     l_data[MAX_L_DATA];
	struct	skill_data		skills[MAX_SKILLS];

	struct	timeval		*dob;
};


struct exit_data {
   int	   key;         /* What key unlocks it (if applicable) */
   char     *desc;       /* Description for doors, etc */
   char     *alias;      /* An alias for opening, closing, etc. */
   char     status;      /* Locked, Wizlocked, Open, etc */
   int      special;     /* Special routines */
};

struct extra_desc {
   char     *name;
   char     *desc;
   struct   extra_desc *next;
};

struct room_data {
   char     *name;                   /* Room title */
   char     *description;            /* Long description of room */

	int      xyz[4];                  /* X Y Z */
   int	   data[MAX_DATA];
   long     flags;

   struct   extra_desc  *extra;      /* Extra examine descriptions */
   struct   object_data *objects;    /* A list of objects */
   struct   char_data   *people;	    /* People in the room */
   struct   exit_data   *exits[10];  /* Exits out of this room */
};

struct cmd_mode {
	char		number;
	void		(*mode_pointer)();
};

