/ circle3.1 / src / structs.h
structs.h
   1  /* ************************************************************************
   2  *   File: structs.h                                     Part of CircleMUD *
   3  *  Usage: header file for central structures and contstants               *
   4  *                                                                         *
   5  *  All rights reserved.  See license.doc for complete information.        *
   6  *                                                                         *
   7  *  Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
   8  *  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
   9  ************************************************************************ */
  10  
  11  /*
  12   * Intended use of this macro is to allow external packages to work with
  13   * a variety of CircleMUD versions without modifications.  For instance,
  14   * an IS_CORPSE() macro was introduced in pl13.  Any future code add-ons
  15   * could take into account the CircleMUD version and supply their own
  16   * definition for the macro if used on an older version of CircleMUD.
  17   * You are supposed to compare this with the macro CIRCLEMUD_VERSION()
  18   * in utils.h.  See there for usage.
  19   */
  20  #define _CIRCLEMUD	0x030100 /* Major/Minor/Patchlevel - MMmmPP */
  21  
  22  /*
  23   * If you want equipment to be automatically equipped to the same place
  24   * it was when players rented, set the define below to 1.  Please note
  25   * that this will require erasing or converting all of your rent files.
  26   * And of course, you have to recompile everything.  We need this feature
  27   * for CircleMUD to be complete but we refuse to break binary file
  28   * compatibility.
  29   */
  30  #define USE_AUTOEQ	0	/* TRUE/FALSE aren't defined yet. */
  31  
  32  
  33  /* preamble *************************************************************/
  34  
  35  /*
  36   * As of bpl20, it should be safe to use unsigned data types for the
  37   * various virtual and real number data types.  There really isn't a
  38   * reason to use signed anymore so use the unsigned types and get
  39   * 65,535 objects instead of 32,768.
  40   *
  41   * NOTE: This will likely be unconditionally unsigned later.
  42   */
  43  #define CIRCLE_UNSIGNED_INDEX	0	/* 0 = signed, 1 = unsigned */
  44  
  45  #if CIRCLE_UNSIGNED_INDEX
  46  # define IDXTYPE	ush_int
  47  # define NOWHERE	((IDXTYPE)~0)
  48  # define NOTHING	((IDXTYPE)~0)
  49  # define NOBODY		((IDXTYPE)~0)
  50  #else
  51  # define IDXTYPE	sh_int
  52  # define NOWHERE	(-1)	/* nil reference for rooms	*/
  53  # define NOTHING	(-1)	/* nil reference for objects	*/
  54  # define NOBODY		(-1)	/* nil reference for mobiles	*/
  55  #endif
  56  
  57  #define SPECIAL(name) \
  58     int (name)(struct char_data *ch, void *me, int cmd, char *argument)
  59  
  60  
  61  /* room-related defines *************************************************/
  62  
  63  
  64  /* The cardinal directions: used as index to room_data.dir_option[] */
  65  #define NORTH          0
  66  #define EAST           1
  67  #define SOUTH          2
  68  #define WEST           3
  69  #define UP             4
  70  #define DOWN           5
  71  
  72  
  73  /* Room flags: used in room_data.room_flags */
  74  /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
  75  #define ROOM_DARK		(1 << 0)   /* Dark			*/
  76  #define ROOM_DEATH		(1 << 1)   /* Death trap		*/
  77  #define ROOM_NOMOB		(1 << 2)   /* MOBs not allowed		*/
  78  #define ROOM_INDOORS		(1 << 3)   /* Indoors			*/
  79  #define ROOM_PEACEFUL		(1 << 4)   /* Violence not allowed	*/
  80  #define ROOM_SOUNDPROOF		(1 << 5)   /* Shouts, gossip blocked	*/
  81  #define ROOM_NOTRACK		(1 << 6)   /* Track won't go through	*/
  82  #define ROOM_NOMAGIC		(1 << 7)   /* Magic not allowed		*/
  83  #define ROOM_TUNNEL		(1 << 8)   /* room for only 1 pers	*/
  84  #define ROOM_PRIVATE		(1 << 9)   /* Can't teleport in		*/
  85  #define ROOM_GODROOM		(1 << 10)  /* LVL_GOD+ only allowed	*/
  86  #define ROOM_HOUSE		(1 << 11)  /* (R) Room is a house	*/
  87  #define ROOM_HOUSE_CRASH	(1 << 12)  /* (R) House needs saving	*/
  88  #define ROOM_ATRIUM		(1 << 13)  /* (R) The door to a house	*/
  89  #define ROOM_OLC		(1 << 14)  /* (R) Modifyable/!compress	*/
  90  #define ROOM_BFS_MARK		(1 << 15)  /* (R) breath-first srch mrk	*/
  91  
  92  
  93  /* Exit info: used in room_data.dir_option.exit_info */
  94  #define EX_ISDOOR		(1 << 0)   /* Exit is a door		*/
  95  #define EX_CLOSED		(1 << 1)   /* The door is closed	*/
  96  #define EX_LOCKED		(1 << 2)   /* The door is locked	*/
  97  #define EX_PICKPROOF		(1 << 3)   /* Lock can't be picked	*/
  98  
  99  
 100  /* Sector types: used in room_data.sector_type */
 101  #define SECT_INSIDE          0		   /* Indoors			*/
 102  #define SECT_CITY            1		   /* In a city			*/
 103  #define SECT_FIELD           2		   /* In a field		*/
 104  #define SECT_FOREST          3		   /* In a forest		*/
 105  #define SECT_HILLS           4		   /* In the hills		*/
 106  #define SECT_MOUNTAIN        5		   /* On a mountain		*/
 107  #define SECT_WATER_SWIM      6		   /* Swimmable water		*/
 108  #define SECT_WATER_NOSWIM    7		   /* Water - need a boat	*/
 109  #define SECT_FLYING	     8		   /* Wheee!			*/
 110  #define SECT_UNDERWATER	     9		   /* Underwater		*/
 111  
 112  
 113  /* char and mob-related defines *****************************************/
 114  
 115  
 116  /* PC classes */
 117  #define CLASS_UNDEFINED	  (-1)
 118  #define CLASS_MAGIC_USER  0
 119  #define CLASS_CLERIC      1
 120  #define CLASS_THIEF       2
 121  #define CLASS_WARRIOR     3
 122  
 123  #define NUM_CLASSES	  4  /* This must be the number of classes!! */
 124  
 125  /* NPC classes (currently unused - feel free to implement!) */
 126  #define CLASS_OTHER       0
 127  #define CLASS_UNDEAD      1
 128  #define CLASS_HUMANOID    2
 129  #define CLASS_ANIMAL      3
 130  #define CLASS_DRAGON      4
 131  #define CLASS_GIANT       5
 132  
 133  
 134  /* Sex */
 135  #define SEX_NEUTRAL   0
 136  #define SEX_MALE      1
 137  #define SEX_FEMALE    2
 138  
 139  
 140  /* Positions */
 141  #define POS_DEAD       0	/* dead			*/
 142  #define POS_MORTALLYW  1	/* mortally wounded	*/
 143  #define POS_INCAP      2	/* incapacitated	*/
 144  #define POS_STUNNED    3	/* stunned		*/
 145  #define POS_SLEEPING   4	/* sleeping		*/
 146  #define POS_RESTING    5	/* resting		*/
 147  #define POS_SITTING    6	/* sitting		*/
 148  #define POS_FIGHTING   7	/* fighting		*/
 149  #define POS_STANDING   8	/* standing		*/
 150  
 151  
 152  /* Player flags: used by char_data.char_specials.act */
 153  #define PLR_KILLER	(1 << 0)   /* Player is a player-killer		*/
 154  #define PLR_THIEF	(1 << 1)   /* Player is a player-thief		*/
 155  #define PLR_FROZEN	(1 << 2)   /* Player is frozen			*/
 156  #define PLR_DONTSET     (1 << 3)   /* Don't EVER set (ISNPC bit)	*/
 157  #define PLR_WRITING	(1 << 4)   /* Player writing (board/mail/olc)	*/
 158  #define PLR_MAILING	(1 << 5)   /* Player is writing mail		*/
 159  #define PLR_CRASH	(1 << 6)   /* Player needs to be crash-saved	*/
 160  #define PLR_SITEOK	(1 << 7)   /* Player has been site-cleared	*/
 161  #define PLR_NOSHOUT	(1 << 8)   /* Player not allowed to shout/goss	*/
 162  #define PLR_NOTITLE	(1 << 9)   /* Player not allowed to set title	*/
 163  #define PLR_DELETED	(1 << 10)  /* Player deleted - space reusable	*/
 164  #define PLR_LOADROOM	(1 << 11)  /* Player uses nonstandard loadroom	*/
 165  #define PLR_NOWIZLIST	(1 << 12)  /* Player shouldn't be on wizlist	*/
 166  #define PLR_NODELETE	(1 << 13)  /* Player shouldn't be deleted	*/
 167  #define PLR_INVSTART	(1 << 14)  /* Player should enter game wizinvis	*/
 168  #define PLR_CRYO	(1 << 15)  /* Player is cryo-saved (purge prog)	*/
 169  #define PLR_NOTDEADYET	(1 << 16)  /* (R) Player being extracted.	*/
 170  
 171  
 172  /* Mobile flags: used by char_data.char_specials.act */
 173  #define MOB_SPEC         (1 << 0)  /* Mob has a callable spec-proc	*/
 174  #define MOB_SENTINEL     (1 << 1)  /* Mob should not move		*/
 175  #define MOB_SCAVENGER    (1 << 2)  /* Mob picks up stuff on the ground	*/
 176  #define MOB_ISNPC        (1 << 3)  /* (R) Automatically set on all Mobs	*/
 177  #define MOB_AWARE	 (1 << 4)  /* Mob can't be backstabbed		*/
 178  #define MOB_AGGRESSIVE   (1 << 5)  /* Mob auto-attacks everybody nearby	*/
 179  #define MOB_STAY_ZONE    (1 << 6)  /* Mob shouldn't wander out of zone	*/
 180  #define MOB_WIMPY        (1 << 7)  /* Mob flees if severely injured	*/
 181  #define MOB_AGGR_EVIL	 (1 << 8)  /* Auto-attack any evil PC's		*/
 182  #define MOB_AGGR_GOOD	 (1 << 9)  /* Auto-attack any good PC's		*/
 183  #define MOB_AGGR_NEUTRAL (1 << 10) /* Auto-attack any neutral PC's	*/
 184  #define MOB_MEMORY	 (1 << 11) /* remember attackers if attacked	*/
 185  #define MOB_HELPER	 (1 << 12) /* attack PCs fighting other NPCs	*/
 186  #define MOB_NOCHARM	 (1 << 13) /* Mob can't be charmed		*/
 187  #define MOB_NOSUMMON	 (1 << 14) /* Mob can't be summoned		*/
 188  #define MOB_NOSLEEP	 (1 << 15) /* Mob can't be slept		*/
 189  #define MOB_NOBASH	 (1 << 16) /* Mob can't be bashed (e.g. trees)	*/
 190  #define MOB_NOBLIND	 (1 << 17) /* Mob can't be blinded		*/
 191  #define MOB_NOTDEADYET   (1 << 18) /* (R) Mob being extracted.		*/
 192  
 193  
 194  /* Preference flags: used by char_data.player_specials.pref */
 195  #define PRF_BRIEF       (1 << 0)  /* Room descs won't normally be shown	*/
 196  #define PRF_COMPACT     (1 << 1)  /* No extra CRLF pair before prompts	*/
 197  #define PRF_DEAF	(1 << 2)  /* Can't hear shouts			*/
 198  #define PRF_NOTELL	(1 << 3)  /* Can't receive tells		*/
 199  #define PRF_DISPHP	(1 << 4)  /* Display hit points in prompt	*/
 200  #define PRF_DISPMANA	(1 << 5)  /* Display mana points in prompt	*/
 201  #define PRF_DISPMOVE	(1 << 6)  /* Display move points in prompt	*/
 202  #define PRF_AUTOEXIT	(1 << 7)  /* Display exits in a room		*/
 203  #define PRF_NOHASSLE	(1 << 8)  /* Aggr mobs won't attack		*/
 204  #define PRF_QUEST	(1 << 9)  /* On quest				*/
 205  #define PRF_SUMMONABLE	(1 << 10) /* Can be summoned			*/
 206  #define PRF_NOREPEAT	(1 << 11) /* No repetition of comm commands	*/
 207  #define PRF_HOLYLIGHT	(1 << 12) /* Can see in dark			*/
 208  #define PRF_COLOR_1	(1 << 13) /* Color (low bit)			*/
 209  #define PRF_COLOR_2	(1 << 14) /* Color (high bit)			*/
 210  #define PRF_NOWIZ	(1 << 15) /* Can't hear wizline			*/
 211  #define PRF_LOG1	(1 << 16) /* On-line System Log (low bit)	*/
 212  #define PRF_LOG2	(1 << 17) /* On-line System Log (high bit)	*/
 213  #define PRF_NOAUCT	(1 << 18) /* Can't hear auction channel		*/
 214  #define PRF_NOGOSS	(1 << 19) /* Can't hear gossip channel		*/
 215  #define PRF_NOGRATZ	(1 << 20) /* Can't hear grats channel		*/
 216  #define PRF_ROOMFLAGS	(1 << 21) /* Can see room flags (ROOM_x)	*/
 217  #define PRF_DISPAUTO	(1 << 22) /* Show prompt HP, MP, MV when < 30%.	*/
 218  
 219  /* Affect bits: used in char_data.char_specials.saved.affected_by */
 220  /* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
 221  #define AFF_BLIND             (1 << 0)	   /* (R) Char is blind		*/
 222  #define AFF_INVISIBLE         (1 << 1)	   /* Char is invisible		*/
 223  #define AFF_DETECT_ALIGN      (1 << 2)	   /* Char is sensitive to align*/
 224  #define AFF_DETECT_INVIS      (1 << 3)	   /* Char can see invis chars  */
 225  #define AFF_DETECT_MAGIC      (1 << 4)	   /* Char is sensitive to magic*/
 226  #define AFF_SENSE_LIFE        (1 << 5)	   /* Char can sense hidden life*/
 227  #define AFF_WATERWALK	      (1 << 6)	   /* Char can walk on water	*/
 228  #define AFF_SANCTUARY         (1 << 7)	   /* Char protected by sanct.	*/
 229  #define AFF_GROUP             (1 << 8)	   /* (R) Char is grouped	*/
 230  #define AFF_CURSE             (1 << 9)	   /* Char is cursed		*/
 231  #define AFF_INFRAVISION       (1 << 10)	   /* Char can see in dark	*/
 232  #define AFF_POISON            (1 << 11)	   /* (R) Char is poisoned	*/
 233  #define AFF_PROTECT_EVIL      (1 << 12)	   /* Char protected from evil  */
 234  #define AFF_PROTECT_GOOD      (1 << 13)	   /* Char protected from good  */
 235  #define AFF_SLEEP             (1 << 14)	   /* (R) Char magically asleep	*/
 236  #define AFF_NOTRACK	      (1 << 15)	   /* Char can't be tracked	*/
 237  #define AFF_UNUSED16	      (1 << 16)	   /* Room for future expansion	*/
 238  #define AFF_UNUSED17	      (1 << 17)	   /* Room for future expansion	*/
 239  #define AFF_SNEAK             (1 << 18)	   /* Char can move quietly	*/
 240  #define AFF_HIDE              (1 << 19)	   /* Char is hidden		*/
 241  #define AFF_UNUSED20	      (1 << 20)	   /* Room for future expansion	*/
 242  #define AFF_CHARM             (1 << 21)	   /* Char is charmed		*/
 243  
 244  
 245  /* Modes of connectedness: used by descriptor_data.state */
 246  #define CON_PLAYING	 0	/* Playing - Nominal state		*/
 247  #define CON_CLOSE	 1	/* User disconnect, remove character.	*/
 248  #define CON_GET_NAME	 2	/* By what name ..?			*/
 249  #define CON_NAME_CNFRM	 3	/* Did I get that right, x?		*/
 250  #define CON_PASSWORD	 4	/* Password:				*/
 251  #define CON_NEWPASSWD	 5	/* Give me a password for x		*/
 252  #define CON_CNFPASSWD	 6	/* Please retype password:		*/
 253  #define CON_QSEX	 7	/* Sex?					*/
 254  #define CON_QCLASS	 8	/* Class?				*/
 255  #define CON_RMOTD	 9	/* PRESS RETURN after MOTD		*/
 256  #define CON_MENU	 10	/* Your choice: (main menu)		*/
 257  #define CON_EXDESC	 11	/* Enter a new description:		*/
 258  #define CON_CHPWD_GETOLD 12	/* Changing passwd: get old		*/
 259  #define CON_CHPWD_GETNEW 13	/* Changing passwd: get new		*/
 260  #define CON_CHPWD_VRFY   14	/* Verify new password			*/
 261  #define CON_DELCNF1	 15	/* Delete confirmation 1		*/
 262  #define CON_DELCNF2	 16	/* Delete confirmation 2		*/
 263  #define CON_DISCONNECT	 17	/* In-game link loss (leave character)	*/
 264  
 265  /* Character equipment positions: used as index for char_data.equipment[] */
 266  /* NOTE: Don't confuse these constants with the ITEM_ bitvectors
 267     which control the valid places you can wear a piece of equipment */
 268  #define WEAR_LIGHT      0
 269  #define WEAR_FINGER_R   1
 270  #define WEAR_FINGER_L   2
 271  #define WEAR_NECK_1     3
 272  #define WEAR_NECK_2     4
 273  #define WEAR_BODY       5
 274  #define WEAR_HEAD       6
 275  #define WEAR_LEGS       7
 276  #define WEAR_FEET       8
 277  #define WEAR_HANDS      9
 278  #define WEAR_ARMS      10
 279  #define WEAR_SHIELD    11
 280  #define WEAR_ABOUT     12
 281  #define WEAR_WAIST     13
 282  #define WEAR_WRIST_R   14
 283  #define WEAR_WRIST_L   15
 284  #define WEAR_WIELD     16
 285  #define WEAR_HOLD      17
 286  
 287  #define NUM_WEARS      18	/* This must be the # of eq positions!! */
 288  
 289  
 290  /* object-related defines ********************************************/
 291  
 292  
 293  /* Item types: used by obj_data.obj_flags.type_flag */
 294  #define ITEM_LIGHT      1		/* Item is a light source	*/
 295  #define ITEM_SCROLL     2		/* Item is a scroll		*/
 296  #define ITEM_WAND       3		/* Item is a wand		*/
 297  #define ITEM_STAFF      4		/* Item is a staff		*/
 298  #define ITEM_WEAPON     5		/* Item is a weapon		*/
 299  #define ITEM_FIREWEAPON 6		/* Unimplemented		*/
 300  #define ITEM_MISSILE    7		/* Unimplemented		*/
 301  #define ITEM_TREASURE   8		/* Item is a treasure, not gold	*/
 302  #define ITEM_ARMOR      9		/* Item is armor		*/
 303  #define ITEM_POTION    10 		/* Item is a potion		*/
 304  #define ITEM_WORN      11		/* Unimplemented		*/
 305  #define ITEM_OTHER     12		/* Misc object			*/
 306  #define ITEM_TRASH     13		/* Trash - shopkeeps won't buy	*/
 307  #define ITEM_TRAP      14		/* Unimplemented		*/
 308  #define ITEM_CONTAINER 15		/* Item is a container		*/
 309  #define ITEM_NOTE      16		/* Item is note 		*/
 310  #define ITEM_DRINKCON  17		/* Item is a drink container	*/
 311  #define ITEM_KEY       18		/* Item is a key		*/
 312  #define ITEM_FOOD      19		/* Item is food			*/
 313  #define ITEM_MONEY     20		/* Item is money (gold)		*/
 314  #define ITEM_PEN       21		/* Item is a pen		*/
 315  #define ITEM_BOAT      22		/* Item is a boat		*/
 316  #define ITEM_FOUNTAIN  23		/* Item is a fountain		*/
 317  
 318  
 319  /* Take/Wear flags: used by obj_data.obj_flags.wear_flags */
 320  #define ITEM_WEAR_TAKE		(1 << 0)  /* Item can be takes		*/
 321  #define ITEM_WEAR_FINGER	(1 << 1)  /* Can be worn on finger	*/
 322  #define ITEM_WEAR_NECK		(1 << 2)  /* Can be worn around neck 	*/
 323  #define ITEM_WEAR_BODY		(1 << 3)  /* Can be worn on body 	*/
 324  #define ITEM_WEAR_HEAD		(1 << 4)  /* Can be worn on head 	*/
 325  #define ITEM_WEAR_LEGS		(1 << 5)  /* Can be worn on legs	*/
 326  #define ITEM_WEAR_FEET		(1 << 6)  /* Can be worn on feet	*/
 327  #define ITEM_WEAR_HANDS		(1 << 7)  /* Can be worn on hands	*/
 328  #define ITEM_WEAR_ARMS		(1 << 8)  /* Can be worn on arms	*/
 329  #define ITEM_WEAR_SHIELD	(1 << 9)  /* Can be used as a shield	*/
 330  #define ITEM_WEAR_ABOUT		(1 << 10) /* Can be worn about body 	*/
 331  #define ITEM_WEAR_WAIST 	(1 << 11) /* Can be worn around waist 	*/
 332  #define ITEM_WEAR_WRIST		(1 << 12) /* Can be worn on wrist 	*/
 333  #define ITEM_WEAR_WIELD		(1 << 13) /* Can be wielded		*/
 334  #define ITEM_WEAR_HOLD		(1 << 14) /* Can be held		*/
 335  
 336  
 337  /* Extra object flags: used by obj_data.obj_flags.extra_flags */
 338  #define ITEM_GLOW          (1 << 0)	/* Item is glowing		*/
 339  #define ITEM_HUM           (1 << 1)	/* Item is humming		*/
 340  #define ITEM_NORENT        (1 << 2)	/* Item cannot be rented	*/
 341  #define ITEM_NODONATE      (1 << 3)	/* Item cannot be donated	*/
 342  #define ITEM_NOINVIS	   (1 << 4)	/* Item cannot be made invis	*/
 343  #define ITEM_INVISIBLE     (1 << 5)	/* Item is invisible		*/
 344  #define ITEM_MAGIC         (1 << 6)	/* Item is magical		*/
 345  #define ITEM_NODROP        (1 << 7)	/* Item is cursed: can't drop	*/
 346  #define ITEM_BLESS         (1 << 8)	/* Item is blessed		*/
 347  #define ITEM_ANTI_GOOD     (1 << 9)	/* Not usable by good people	*/
 348  #define ITEM_ANTI_EVIL     (1 << 10)	/* Not usable by evil people	*/
 349  #define ITEM_ANTI_NEUTRAL  (1 << 11)	/* Not usable by neutral people	*/
 350  #define ITEM_ANTI_MAGIC_USER (1 << 12)	/* Not usable by mages		*/
 351  #define ITEM_ANTI_CLERIC   (1 << 13)	/* Not usable by clerics	*/
 352  #define ITEM_ANTI_THIEF	   (1 << 14)	/* Not usable by thieves	*/
 353  #define ITEM_ANTI_WARRIOR  (1 << 15)	/* Not usable by warriors	*/
 354  #define ITEM_NOSELL	   (1 << 16)	/* Shopkeepers won't touch it	*/
 355  
 356  
 357  /* Modifier constants used with obj affects ('A' fields) */
 358  #define APPLY_NONE              0	/* No effect			*/
 359  #define APPLY_STR               1	/* Apply to strength		*/
 360  #define APPLY_DEX               2	/* Apply to dexterity		*/
 361  #define APPLY_INT               3	/* Apply to intelligence	*/
 362  #define APPLY_WIS               4	/* Apply to wisdom		*/
 363  #define APPLY_CON               5	/* Apply to constitution	*/
 364  #define APPLY_CHA		6	/* Apply to charisma		*/
 365  #define APPLY_CLASS             7	/* Reserved			*/
 366  #define APPLY_LEVEL             8	/* Reserved			*/
 367  #define APPLY_AGE               9	/* Apply to age			*/
 368  #define APPLY_CHAR_WEIGHT      10	/* Apply to weight		*/
 369  #define APPLY_CHAR_HEIGHT      11	/* Apply to height		*/
 370  #define APPLY_MANA             12	/* Apply to max mana		*/
 371  #define APPLY_HIT              13	/* Apply to max hit points	*/
 372  #define APPLY_MOVE             14	/* Apply to max move points	*/
 373  #define APPLY_GOLD             15	/* Reserved			*/
 374  #define APPLY_EXP              16	/* Reserved			*/
 375  #define APPLY_AC               17	/* Apply to Armor Class		*/
 376  #define APPLY_HITROLL          18	/* Apply to hitroll		*/
 377  #define APPLY_DAMROLL          19	/* Apply to damage roll		*/
 378  #define APPLY_SAVING_PARA      20	/* Apply to save throw: paralz	*/
 379  #define APPLY_SAVING_ROD       21	/* Apply to save throw: rods	*/
 380  #define APPLY_SAVING_PETRI     22	/* Apply to save throw: petrif	*/
 381  #define APPLY_SAVING_BREATH    23	/* Apply to save throw: breath	*/
 382  #define APPLY_SAVING_SPELL     24	/* Apply to save throw: spells	*/
 383  
 384  
 385  /* Container flags - value[1] */
 386  #define CONT_CLOSEABLE      (1 << 0)	/* Container can be closed	*/
 387  #define CONT_PICKPROOF      (1 << 1)	/* Container is pickproof	*/
 388  #define CONT_CLOSED         (1 << 2)	/* Container is closed		*/
 389  #define CONT_LOCKED         (1 << 3)	/* Container is locked		*/
 390  
 391  
 392  /* Some different kind of liquids for use in values of drink containers */
 393  #define LIQ_WATER      0
 394  #define LIQ_BEER       1
 395  #define LIQ_WINE       2
 396  #define LIQ_ALE        3
 397  #define LIQ_DARKALE    4
 398  #define LIQ_WHISKY     5
 399  #define LIQ_LEMONADE   6
 400  #define LIQ_FIREBRT    7
 401  #define LIQ_LOCALSPC   8
 402  #define LIQ_SLIME      9
 403  #define LIQ_MILK       10
 404  #define LIQ_TEA        11
 405  #define LIQ_COFFE      12
 406  #define LIQ_BLOOD      13
 407  #define LIQ_SALTWATER  14
 408  #define LIQ_CLEARWATER 15
 409  
 410  
 411  /* other miscellaneous defines *******************************************/
 412  
 413  
 414  /* Player conditions */
 415  #define DRUNK        0
 416  #define FULL         1
 417  #define THIRST       2
 418  
 419  
 420  /* Sun state for weather_data */
 421  #define SUN_DARK	0
 422  #define SUN_RISE	1
 423  #define SUN_LIGHT	2
 424  #define SUN_SET		3
 425  
 426  
 427  /* Sky conditions for weather_data */
 428  #define SKY_CLOUDLESS	0
 429  #define SKY_CLOUDY	1
 430  #define SKY_RAINING	2
 431  #define SKY_LIGHTNING	3
 432  
 433  
 434  /* Rent codes */
 435  #define RENT_UNDEF      0
 436  #define RENT_CRASH      1
 437  #define RENT_RENTED     2
 438  #define RENT_CRYO       3
 439  #define RENT_FORCED     4
 440  #define RENT_TIMEDOUT   5
 441  
 442  
 443  /* other #defined constants **********************************************/
 444  
 445  /*
 446   * **DO**NOT** blindly change the number of levels in your MUD merely by
 447   * changing these numbers and without changing the rest of the code to match.
 448   * Other changes throughout the code are required.  See coding.doc for
 449   * details.
 450   *
 451   * LVL_IMPL should always be the HIGHEST possible immortal level, and
 452   * LVL_IMMORT should always be the LOWEST immortal level.  The number of
 453   * mortal levels will always be LVL_IMMORT - 1.
 454   */
 455  #define LVL_IMPL	34
 456  #define LVL_GRGOD	33
 457  #define LVL_GOD		32
 458  #define LVL_IMMORT	31
 459  
 460  /* Level of the 'freeze' command */
 461  #define LVL_FREEZE	LVL_GRGOD
 462  
 463  #define NUM_OF_DIRS	6	/* number of directions in a room (nsewud) */
 464  #define MAGIC_NUMBER	(0x06)	/* Arbitrary number that won't be in a string */
 465  
 466  /*
 467   * OPT_USEC determines how many commands will be processed by the MUD per
 468   * second and how frequently it does socket I/O.  A low setting will cause
 469   * actions to be executed more frequently but will increase overhead due to
 470   * more cycling to check.  A high setting (e.g. 1 Hz) may upset your players
 471   * as actions (such as large speedwalking chains) take longer to be executed.
 472   * You shouldn't need to adjust this.
 473   */
 474  #define OPT_USEC	100000		/* 10 passes per second */
 475  #define PASSES_PER_SEC	(1000000 / OPT_USEC)
 476  #define RL_SEC		* PASSES_PER_SEC
 477  
 478  #define PULSE_ZONE      (10 RL_SEC)
 479  #define PULSE_MOBILE    (10 RL_SEC)
 480  #define PULSE_VIOLENCE  ( 2 RL_SEC)
 481  #define PULSE_AUTOSAVE	(60 RL_SEC)
 482  #define PULSE_IDLEPWD	(15 RL_SEC)
 483  #define PULSE_SANITY	(30 RL_SEC)
 484  #define PULSE_USAGE	(5 * 60 RL_SEC)	/* 5 mins */
 485  #define PULSE_TIMESAVE	(30 * 60 RL_SEC) /* should be >= SECS_PER_MUD_HOUR */
 486  
 487  /* Variables for the output buffering system */
 488  #define MAX_SOCK_BUF            (12 * 1024) /* Size of kernel's sock buf   */
 489  #define MAX_PROMPT_LENGTH       96          /* Max length of prompt        */
 490  #define GARBAGE_SPACE		32          /* Space for **OVERFLOW** etc  */
 491  #define SMALL_BUFSIZE		1024        /* Static output buffer size   */
 492  /* Max amount of output that can be buffered */
 493  #define LARGE_BUFSIZE	   (MAX_SOCK_BUF - GARBAGE_SPACE - MAX_PROMPT_LENGTH)
 494  
 495  #define HISTORY_SIZE		5	/* Keep last 5 commands. */
 496  #define MAX_STRING_LENGTH	8192
 497  #define MAX_INPUT_LENGTH	256	/* Max length per *line* of input */
 498  #define MAX_RAW_INPUT_LENGTH	512	/* Max size of *raw* input */
 499  #define MAX_MESSAGES		60
 500  #define MAX_NAME_LENGTH		20  /* Used in char_file_u *DO*NOT*CHANGE* */
 501  #define MAX_PWD_LENGTH		10  /* Used in char_file_u *DO*NOT*CHANGE* */
 502  #define MAX_TITLE_LENGTH	80  /* Used in char_file_u *DO*NOT*CHANGE* */
 503  #define HOST_LENGTH		30  /* Used in char_file_u *DO*NOT*CHANGE* */
 504  #define EXDSCR_LENGTH		240 /* Used in char_file_u *DO*NOT*CHANGE* */
 505  #define MAX_TONGUE		3   /* Used in char_file_u *DO*NOT*CHANGE* */
 506  #define MAX_SKILLS		200 /* Used in char_file_u *DO*NOT*CHANGE* */
 507  #define MAX_AFFECT		32  /* Used in char_file_u *DO*NOT*CHANGE* */
 508  #define MAX_OBJ_AFFECT		6 /* Used in obj_file_elem *DO*NOT*CHANGE* */
 509  #define MAX_NOTE_LENGTH		1000	/* arbitrary */
 510  
 511  /*
 512   * A MAX_PWD_LENGTH of 10 will cause BSD-derived systems with MD5 passwords
 513   * and GNU libc 2 passwords to be truncated.  On BSD this will enable anyone
 514   * with a name longer than 5 character to log in with any password.  If you
 515   * have such a system, it is suggested you change the limit to 20.
 516   *
 517   * Please note that this will erase your player files.  If you are not
 518   * prepared to do so, simply erase these lines but heed the above warning.
 519   */
 520  #if defined(HAVE_UNSAFE_CRYPT) && MAX_PWD_LENGTH == 10
 521  #error You need to increase MAX_PWD_LENGTH to at least 20.
 522  #error See the comment near these errors for more explanation.
 523  #endif
 524  
 525  /**********************************************************************
 526  * Structures                                                          *
 527  **********************************************************************/
 528  
 529  
 530  typedef signed char		sbyte;
 531  typedef unsigned char		ubyte;
 532  typedef signed short int	sh_int;
 533  typedef unsigned short int	ush_int;
 534  #if !defined(__cplusplus)	/* Anyone know a portable method? */
 535  typedef char			bool;
 536  #endif
 537  
 538  #if !defined(CIRCLE_WINDOWS) || defined(LCC_WIN32)	/* Hm, sysdep.h? */
 539  typedef signed char			byte;
 540  #endif
 541  
 542  /* Various virtual (human-reference) number types. */
 543  typedef IDXTYPE room_vnum;
 544  typedef IDXTYPE obj_vnum;
 545  typedef IDXTYPE mob_vnum;
 546  typedef IDXTYPE zone_vnum;
 547  typedef IDXTYPE shop_vnum;
 548  
 549  /* Various real (array-reference) number types. */
 550  typedef IDXTYPE room_rnum;
 551  typedef IDXTYPE obj_rnum;
 552  typedef IDXTYPE mob_rnum;
 553  typedef IDXTYPE zone_rnum;
 554  typedef IDXTYPE shop_rnum;
 555  
 556  
 557  /*
 558   * Bitvector type for 32 bit unsigned long bitvectors.
 559   * 'unsigned long long' will give you at least 64 bits if you have GCC.
 560   *
 561   * Since we don't want to break the pfiles, you'll have to search throughout
 562   * the code for "bitvector_t" and change them yourself if you'd like this
 563   * extra flexibility.
 564   */
 565  typedef unsigned long int	bitvector_t;
 566  
 567  /* Extra description: used in objects, mobiles, and rooms */
 568  struct extra_descr_data {
 569     char	*keyword;                 /* Keyword in look/examine          */
 570     char	*description;             /* What to see                      */
 571     struct extra_descr_data *next; /* Next in list                     */
 572  };
 573  
 574  
 575  /* object-related structures ******************************************/
 576  
 577  
 578  /* object flags; used in obj_data */
 579  struct obj_flag_data {
 580     int	value[4];	/* Values of the item (see list)    */
 581     byte type_flag;	/* Type of item			    */
 582     int /*bitvector_t*/	wear_flags;	/* Where you can wear it	    */
 583     int /*bitvector_t*/	extra_flags;	/* If it hums, glows, etc.	    */
 584     int	weight;		/* Weigt what else                  */
 585     int	cost;		/* Value when sold (gp.)            */
 586     int	cost_per_day;	/* Cost to keep pr. real day        */
 587     int	timer;		/* Timer for object                 */
 588     long /*bitvector_t*/	bitvector;	/* To set chars bits                */
 589  };
 590  
 591  
 592  /* Used in obj_file_elem *DO*NOT*CHANGE* */
 593  struct obj_affected_type {
 594     byte location;      /* Which ability to change (APPLY_XXX) */
 595     sbyte modifier;     /* How much it changes by              */
 596  };
 597  
 598  
 599  /* ================== Memory Structure for Objects ================== */
 600  struct obj_data {
 601     obj_vnum item_number;	/* Where in data-base			*/
 602     room_rnum in_room;		/* In what room -1 when conta/carr	*/
 603  
 604     struct obj_flag_data obj_flags;/* Object information               */
 605     struct obj_affected_type affected[MAX_OBJ_AFFECT];  /* affects */
 606  
 607     char	*name;                    /* Title of object :get etc.        */
 608     char	*description;		  /* When in room                     */
 609     char	*short_description;       /* when worn/carry/in cont.         */
 610     char	*action_description;      /* What to write when used          */
 611     struct extra_descr_data *ex_description; /* extra descriptions     */
 612     struct char_data *carried_by;  /* Carried by :NULL in room/conta   */
 613     struct char_data *worn_by;	  /* Worn by?			      */
 614     sh_int worn_on;		  /* Worn where?		      */
 615  
 616     struct obj_data *in_obj;       /* In what object NULL when none    */
 617     struct obj_data *contains;     /* Contains objects                 */
 618  
 619     struct obj_data *next_content; /* For 'contains' lists             */
 620     struct obj_data *next;         /* For the object list              */
 621  };
 622  /* ======================================================================= */
 623  
 624  
 625  /* ====================== File Element for Objects ======================= */
 626  /*                 BEWARE: Changing it will ruin rent files		   */
 627  struct obj_file_elem {
 628     obj_vnum item_number;
 629  
 630  #if USE_AUTOEQ
 631     sh_int location;
 632  #endif
 633     int	value[4];
 634     int /*bitvector_t*/	extra_flags;
 635     int	weight;
 636     int	timer;
 637     long /*bitvector_t*/	bitvector;
 638     struct obj_affected_type affected[MAX_OBJ_AFFECT];
 639  };
 640  
 641  
 642  /* header block for rent files.  BEWARE: Changing it will ruin rent files  */
 643  struct rent_info {
 644     int	time;
 645     int	rentcode;
 646     int	net_cost_per_diem;
 647     int	gold;
 648     int	account;
 649     int	nitems;
 650     int	spare0;
 651     int	spare1;
 652     int	spare2;
 653     int	spare3;
 654     int	spare4;
 655     int	spare5;
 656     int	spare6;
 657     int	spare7;
 658  };
 659  /* ======================================================================= */
 660  
 661  
 662  /* room-related structures ************************************************/
 663  
 664  
 665  struct room_direction_data {
 666     char	*general_description;       /* When look DIR.			*/
 667  
 668     char	*keyword;		/* for open/close			*/
 669  
 670     sh_int /*bitvector_t*/ exit_info;	/* Exit info			*/
 671     obj_vnum key;		/* Key's number (-1 for no key)		*/
 672     room_rnum to_room;		/* Where direction leads (NOWHERE)	*/
 673  };
 674  
 675  
 676  /* ================== Memory Structure for room ======================= */
 677  struct room_data {
 678     room_vnum number;		/* Rooms number	(vnum)		      */
 679     zone_rnum zone;              /* Room zone (for resetting)          */
 680     int	sector_type;            /* sector type (move/hide)            */
 681     char	*name;                  /* Rooms name 'You are ...'           */
 682     char	*description;           /* Shown when entered                 */
 683     struct extra_descr_data *ex_description; /* for examine/look       */
 684     struct room_direction_data *dir_option[NUM_OF_DIRS]; /* Directions */
 685     int /*bitvector_t*/ room_flags;		/* DEATH,DARK ... etc */
 686  
 687     byte light;                  /* Number of lightsources in room     */
 688     SPECIAL(*func);
 689  
 690     struct obj_data *contents;   /* List of items in room              */
 691     struct char_data *people;    /* List of NPC / PC in room           */
 692  };
 693  /* ====================================================================== */
 694  
 695  
 696  /* char-related structures ************************************************/
 697  
 698  
 699  /* memory structure for characters */
 700  struct memory_rec_struct {
 701     long	id;
 702     struct memory_rec_struct *next;
 703  };
 704  
 705  typedef struct memory_rec_struct memory_rec;
 706  
 707  
 708  /* This structure is purely intended to be an easy way to transfer */
 709  /* and return information about time (real or mudwise).            */
 710  struct time_info_data {
 711     int hours, day, month;
 712     sh_int year;
 713  };
 714  
 715  
 716  /* These data contain information about a players time data */
 717  struct time_data {
 718     time_t birth;    /* This represents the characters age                */
 719     time_t logon;    /* Time of the last logon (used to calculate played) */
 720     int	played;     /* This is the total accumulated time played in secs */
 721  };
 722  
 723  
 724  /* general player-related info, usually PC's and NPC's */
 725  struct char_player_data {
 726     char	passwd[MAX_PWD_LENGTH+1]; /* character's password      */
 727     char	*name;	       /* PC / NPC s name (kill ...  )         */
 728     char	*short_descr;  /* for NPC 'actions'                    */
 729     char	*long_descr;   /* for 'look'			       */
 730     char	*description;  /* Extra descriptions                   */
 731     char	*title;        /* PC / NPC's title                     */
 732     byte sex;           /* PC / NPC's sex                       */
 733     byte chclass;       /* PC / NPC's class		       */
 734     byte level;         /* PC / NPC's level                     */
 735     sh_int hometown;    /* PC s Hometown (zone)                 */
 736     struct time_data time;  /* PC's AGE in days                 */
 737     ubyte weight;       /* PC / NPC's weight                    */
 738     ubyte height;       /* PC / NPC's height                    */
 739  };
 740  
 741  
 742  /* Char's abilities.  Used in char_file_u *DO*NOT*CHANGE* */
 743  struct char_ability_data {
 744     sbyte str;
 745     sbyte str_add;      /* 000 - 100 if strength 18             */
 746     sbyte intel;
 747     sbyte wis;
 748     sbyte dex;
 749     sbyte con;
 750     sbyte cha;
 751  };
 752  
 753  
 754  /* Char's points.  Used in char_file_u *DO*NOT*CHANGE* */
 755  struct char_point_data {
 756     sh_int mana;
 757     sh_int max_mana;     /* Max mana for PC/NPC			   */
 758     sh_int hit;
 759     sh_int max_hit;      /* Max hit for PC/NPC                      */
 760     sh_int move;
 761     sh_int max_move;     /* Max move for PC/NPC                     */
 762  
 763     sh_int armor;        /* Internal -100..100, external -10..10 AC */
 764     int	gold;           /* Money carried                           */
 765     int	bank_gold;	/* Gold the char has in a bank account	   */
 766     int	exp;            /* The experience of the player            */
 767  
 768     sbyte hitroll;       /* Any bonus or penalty to the hit roll    */
 769     sbyte damroll;       /* Any bonus or penalty to the damage roll */
 770  };
 771  
 772  
 773  /* 
 774   * char_special_data_saved: specials which both a PC and an NPC have in
 775   * common, but which must be saved to the playerfile for PC's.
 776   *
 777   * WARNING:  Do not change this structure.  Doing so will ruin the
 778   * playerfile.  If you want to add to the playerfile, use the spares
 779   * in player_special_data.
 780   */
 781  struct char_special_data_saved {
 782     int	alignment;		/* +-1000 for alignments                */
 783     long	idnum;			/* player's idnum; -1 for mobiles	*/
 784     long /*bitvector_t*/ act;	/* act flag for NPC's; player flag for PC's */
 785  
 786     long /*bitvector_t*/	affected_by;
 787  				/* Bitvector for spells/skills affected by */
 788     sh_int apply_saving_throw[5]; /* Saving throw (Bonuses)		*/
 789  };
 790  
 791  
 792  /* Special playing constants shared by PCs and NPCs which aren't in pfile */
 793  struct char_special_data {
 794     struct char_data *fighting;	/* Opponent				*/
 795     struct char_data *hunting;	/* Char hunted by this char		*/
 796  
 797     byte position;		/* Standing, fighting, sleeping, etc.	*/
 798  
 799     int	carry_weight;		/* Carried weight			*/
 800     byte carry_items;		/* Number of items carried		*/
 801     int	timer;			/* Timer for update			*/
 802  
 803     struct char_special_data_saved saved; /* constants saved in plrfile	*/
 804  };
 805  
 806  
 807  /*
 808   *  If you want to add new values to the playerfile, do it here.  DO NOT
 809   * ADD, DELETE OR MOVE ANY OF THE VARIABLES - doing so will change the
 810   * size of the structure and ruin the playerfile.  However, you can change
 811   * the names of the spares to something more meaningful, and then use them
 812   * in your new code.  They will automatically be transferred from the
 813   * playerfile into memory when players log in.
 814   */
 815  struct player_special_data_saved {
 816     byte skills[MAX_SKILLS+1];	/* array of skills plus skill 0		*/
 817     byte PADDING0;		/* used to be spells_to_learn		*/
 818     bool talks[MAX_TONGUE];	/* PC s Tongues 0 for NPC		*/
 819     int	wimp_level;		/* Below this # of hit points, flee!	*/
 820     byte freeze_level;		/* Level of god who froze char, if any	*/
 821     sh_int invis_level;		/* level of invisibility		*/
 822     room_vnum load_room;		/* Which room to place char in		*/
 823     long /*bitvector_t*/	pref;	/* preference flags for PC's.		*/
 824     ubyte bad_pws;		/* number of bad password attemps	*/
 825     sbyte conditions[3];         /* Drunk, full, thirsty			*/
 826  
 827     /* spares below for future expansion.  You can change the names from
 828        'sparen' to something meaningful, but don't change the order.  */
 829  
 830     ubyte spare0;
 831     ubyte spare1;
 832     ubyte spare2;
 833     ubyte spare3;
 834     ubyte spare4;
 835     ubyte spare5;
 836     int spells_to_learn;		/* How many can you learn yet this level*/
 837     int spare7;
 838     int spare8;
 839     int spare9;
 840     int spare10;
 841     int spare11;
 842     int spare12;
 843     int spare13;
 844     int spare14;
 845     int spare15;
 846     int spare16;
 847     long	spare17;
 848     long	spare18;
 849     long	spare19;
 850     long	spare20;
 851     long	spare21;
 852  };
 853  
 854  /*
 855   * Specials needed only by PCs, not NPCs.  Space for this structure is
 856   * not allocated in memory for NPCs, but it is for PCs and the portion
 857   * of it labelled 'saved' is saved in the playerfile.  This structure can
 858   * be changed freely; beware, though, that changing the contents of
 859   * player_special_data_saved will corrupt the playerfile.
 860   */
 861  struct player_special_data {
 862     struct player_special_data_saved saved;
 863  
 864     char	*poofin;		/* Description on arrival of a god.     */
 865     char	*poofout;		/* Description upon a god's exit.       */
 866     struct alias_data *aliases;	/* Character's aliases			*/
 867     long last_tell;		/* idnum of last tell from		*/
 868     void *last_olc_targ;		/* olc control				*/
 869     int last_olc_mode;		/* olc control				*/
 870  };
 871  
 872  
 873  /* Specials used by NPCs, not PCs */
 874  struct mob_special_data {
 875     memory_rec *memory;	    /* List of attackers to remember	       */
 876     byte	attack_type;        /* The Attack Type Bitvector for NPC's     */
 877     byte default_pos;        /* Default position for NPC                */
 878     byte damnodice;          /* The number of damage dice's	       */
 879     byte damsizedice;        /* The size of the damage dice's           */
 880  };
 881  
 882  
 883  /* An affect structure.  Used in char_file_u *DO*NOT*CHANGE* */
 884  struct affected_type {
 885     sh_int type;          /* The type of spell that caused this      */
 886     sh_int duration;      /* For how long its effects will last      */
 887     sbyte modifier;       /* This is added to apropriate ability     */
 888     byte location;        /* Tells which ability to change(APPLY_XXX)*/
 889     long /*bitvector_t*/	bitvector; /* Tells which bits to set (AFF_XXX) */
 890  
 891     struct affected_type *next;
 892  };
 893  
 894  
 895  /* Structure used for chars following other chars */
 896  struct follow_type {
 897     struct char_data *follower;
 898     struct follow_type *next;
 899  };
 900  
 901  
 902  /* ================== Structure for player/non-player ===================== */
 903  struct char_data {
 904     int pfilepos;			 /* playerfile pos		  */
 905     mob_rnum nr;                          /* Mob's rnum			  */
 906     room_rnum in_room;                    /* Location (real room number)	  */
 907     room_rnum was_in_room;		 /* location for linkdead people  */
 908     int wait;				 /* wait for how many loops	  */
 909  
 910     struct char_player_data player;       /* Normal data                   */
 911     struct char_ability_data real_abils;	 /* Abilities without modifiers   */
 912     struct char_ability_data aff_abils;	 /* Abils with spells/stones/etc  */
 913     struct char_point_data points;        /* Points                        */
 914     struct char_special_data char_specials;	/* PC/NPC specials	  */
 915     struct player_special_data *player_specials; /* PC specials		  */
 916     struct mob_special_data mob_specials;	/* NPC specials		  */
 917  
 918     struct affected_type *affected;       /* affected by what spells       */
 919     struct obj_data *equipment[NUM_WEARS];/* Equipment array               */
 920  
 921     struct obj_data *carrying;            /* Head of list                  */
 922     struct descriptor_data *desc;         /* NULL for mobiles              */
 923  
 924     struct char_data *next_in_room;     /* For room->people - list         */
 925     struct char_data *next;             /* For either monster or ppl-list  */
 926     struct char_data *next_fighting;    /* For fighting list               */
 927  
 928     struct follow_type *followers;        /* List of chars followers       */
 929     struct char_data *master;             /* Who is char following?        */
 930  };
 931  /* ====================================================================== */
 932  
 933  
 934  /* ==================== File Structure for Player ======================= */
 935  /*             BEWARE: Changing it will ruin the playerfile		  */
 936  struct char_file_u {
 937     /* char_player_data */
 938     char	name[MAX_NAME_LENGTH+1];
 939     char	description[EXDSCR_LENGTH];
 940     char	title[MAX_TITLE_LENGTH+1];
 941     byte sex;
 942     byte chclass;
 943     byte level;
 944     sh_int hometown;
 945     time_t birth;   /* Time of birth of character     */
 946     int	played;    /* Number of secs played in total */
 947     ubyte weight;
 948     ubyte height;
 949  
 950     char	pwd[MAX_PWD_LENGTH+1];    /* character's password */
 951  
 952     struct char_special_data_saved char_specials_saved;
 953     struct player_special_data_saved player_specials_saved;
 954     struct char_ability_data abilities;
 955     struct char_point_data points;
 956     struct affected_type affected[MAX_AFFECT];
 957  
 958     time_t last_logon;		/* Time (in secs) of last logon */
 959     char host[HOST_LENGTH+1];	/* host of last logon */
 960  };
 961  /* ====================================================================== */
 962  
 963  
 964  /* descriptor-related structures ******************************************/
 965  
 966  
 967  struct txt_block {
 968     char	*text;
 969     int aliased;
 970     struct txt_block *next;
 971  };
 972  
 973  
 974  struct txt_q {
 975     struct txt_block *head;
 976     struct txt_block *tail;
 977  };
 978  
 979  
 980  struct descriptor_data {
 981     socket_t	descriptor;	/* file descriptor for socket		*/
 982     char	host[HOST_LENGTH+1];	/* hostname				*/
 983     byte	bad_pws;		/* number of bad pw attemps this login	*/
 984     byte idle_tics;		/* tics idle at password prompt		*/
 985     int	connected;		/* mode of 'connectedness'		*/
 986     int	desc_num;		/* unique num assigned to desc		*/
 987     time_t login_time;		/* when the person connected		*/
 988     char *showstr_head;		/* for keeping track of an internal str	*/
 989     char **showstr_vector;	/* for paging through texts		*/
 990     int  showstr_count;		/* number of pages to page through	*/
 991     int  showstr_page;		/* which page are we currently showing?	*/
 992     char	**str;			/* for the modify-str system		*/
 993     size_t max_str;	        /*		-			*/
 994     long	mail_to;		/* name for mail system			*/
 995     int	has_prompt;		/* is the user at a prompt?             */
 996     char	inbuf[MAX_RAW_INPUT_LENGTH];  /* buffer for raw input		*/
 997     char	last_input[MAX_INPUT_LENGTH]; /* the last input			*/
 998     char small_outbuf[SMALL_BUFSIZE];  /* standard output buffer		*/
 999     char *output;		/* ptr to the current output buffer	*/
1000     char **history;		/* History of commands, for ! mostly.	*/
1001     int	history_pos;		/* Circular array position.		*/
1002     int  bufptr;			/* ptr to end of current output		*/
1003     int	bufspace;		/* space left in the output buffer	*/
1004     struct txt_block *large_outbuf; /* ptr to large buffer, if we need it */
1005     struct txt_q input;		/* q of unprocessed input		*/
1006     struct char_data *character;	/* linked to char			*/
1007     struct char_data *original;	/* original char if switched		*/
1008     struct descriptor_data *snooping; /* Who is this char snooping	*/
1009     struct descriptor_data *snoop_by; /* And who is snooping this char	*/
1010     struct descriptor_data *next; /* link to next descriptor		*/
1011  };
1012  
1013  
1014  /* other miscellaneous structures ***************************************/
1015  
1016  
1017  struct msg_type {
1018     char	*attacker_msg;  /* message to attacker */
1019     char	*victim_msg;    /* message to victim   */
1020     char	*room_msg;      /* message to room     */
1021  };
1022  
1023  
1024  struct message_type {
1025     struct msg_type die_msg;	/* messages when death			*/
1026     struct msg_type miss_msg;	/* messages when miss			*/
1027     struct msg_type hit_msg;	/* messages when hit			*/
1028     struct msg_type god_msg;	/* messages when hit on god		*/
1029     struct message_type *next;	/* to next messages of this kind.	*/
1030  };
1031  
1032  
1033  struct message_list {
1034     int	a_type;			/* Attack type				*/
1035     int	number_of_attacks;	/* How many attack messages to chose from. */
1036     struct message_type *msg;	/* List of messages.			*/
1037  };
1038  
1039  
1040  struct dex_skill_type {
1041     sh_int p_pocket;
1042     sh_int p_locks;
1043     sh_int traps;
1044     sh_int sneak;
1045     sh_int hide;
1046  };
1047  
1048  
1049  struct dex_app_type {
1050     sh_int reaction;
1051     sh_int miss_att;
1052     sh_int defensive;
1053  };
1054  
1055  
1056  struct str_app_type {
1057     sh_int tohit;    /* To Hit (THAC0) Bonus/Penalty        */
1058     sh_int todam;    /* Damage Bonus/Penalty                */
1059     sh_int carry_w;  /* Maximum weight that can be carrried */
1060     sh_int wield_w;  /* Maximum weight that can be wielded  */
1061  };
1062  
1063  
1064  struct wis_app_type {
1065     byte bonus;       /* how many practices player gains per lev */
1066  };
1067  
1068  
1069  struct int_app_type {
1070     byte learn;       /* how many % a player learns a spell/skill */
1071  };
1072  
1073  
1074  struct con_app_type {
1075     sh_int hitp;
1076     sh_int shock;
1077  };
1078  
1079  
1080  struct weather_data {
1081     int	pressure;	/* How is the pressure ( Mb ) */
1082     int	change;	/* How fast and what way does it change. */
1083     int	sky;	/* How is the sky. */
1084     int	sunlight;	/* And how much sun. */
1085  };
1086  
1087  
1088  /*
1089   * Element in monster and object index-tables.
1090   *
1091   * NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum)
1092   */
1093  struct index_data {
1094     mob_vnum	vnum;	/* virtual number of this mob/obj		*/
1095     int		number;	/* number of existing units of this mob/obj	*/
1096     SPECIAL(*func);
1097  };
1098  
1099  struct guild_info_type {
1100    int pc_class;
1101    room_vnum guild_room;
1102    int direction;
1103  };