home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / d-linux.zip / dm-dist / structs.h < prev    next >
C/C++ Source or Header  |  1991-03-01  |  24KB  |  776 lines

  1. /* ************************************************************************
  2. *  file: structs.h , Structures        .                  Part of DIKUMUD *
  3. *  Usage: Declarations of central data structures                         *
  4. ************************************************************************* */
  5.  
  6. #include <sys/types.h>
  7.  
  8. typedef signed char sbyte;
  9. typedef unsigned char ubyte;
  10. typedef signed short int sh_int;
  11. typedef unsigned short int ush_int;
  12. typedef char bool;
  13. typedef char byte;
  14.  
  15. #define PULSE_ZONE     240
  16. #define PULSE_MOBILE    40
  17. #define PULSE_VIOLENCE  12
  18. #define WAIT_SEC       4
  19. #define WAIT_ROUND     4
  20.  
  21. #define MAX_STRING_LENGTH   4096
  22. #define MAX_INPUT_LENGTH      80
  23. #define MAX_MESSAGES          60
  24. #define MAX_ITEMS            153
  25.  
  26. #define MESS_ATTACKER 1
  27. #define MESS_VICTIM   2
  28. #define MESS_ROOM     3
  29.  
  30. #define SECS_PER_REAL_MIN  60
  31. #define SECS_PER_REAL_HOUR (60*SECS_PER_REAL_MIN)
  32. #define SECS_PER_REAL_DAY  (24*SECS_PER_REAL_HOUR)
  33. #define SECS_PER_REAL_YEAR (365*SECS_PER_REAL_DAY)
  34.  
  35. #define SECS_PER_MUD_HOUR  75
  36. #define SECS_PER_MUD_DAY   (24*SECS_PER_MUD_HOUR)
  37. #define SECS_PER_MUD_MONTH (35*SECS_PER_MUD_DAY)
  38. #define SECS_PER_MUD_YEAR  (17*SECS_PER_MUD_MONTH)
  39.  
  40. /* The following defs are for obj_data  */
  41.  
  42. /* For 'type_flag' */
  43.  
  44. #define ITEM_LIGHT      1
  45. #define ITEM_SCROLL     2
  46. #define ITEM_WAND       3
  47. #define ITEM_STAFF      4
  48. #define ITEM_WEAPON     5
  49. #define ITEM_FIREWEAPON 6
  50. #define ITEM_MISSILE    7
  51. #define ITEM_TREASURE   8
  52. #define ITEM_ARMOR      9
  53. #define ITEM_POTION    10 
  54. #define ITEM_WORN      11
  55. #define ITEM_OTHER     12
  56. #define ITEM_TRASH     13
  57. #define ITEM_TRAP      14
  58. #define ITEM_CONTAINER 15
  59. #define ITEM_NOTE      16
  60. #define ITEM_DRINKCON  17
  61. #define ITEM_KEY       18
  62. #define ITEM_FOOD      19
  63. #define ITEM_MONEY     20
  64. #define ITEM_PEN       21
  65. #define ITEM_BOAT      22
  66.  
  67. /* Bitvector For 'wear_flags' */
  68.  
  69. #define ITEM_TAKE              1 
  70. #define ITEM_WEAR_FINGER       2
  71. #define ITEM_WEAR_NECK         4
  72. #define ITEM_WEAR_BODY         8
  73. #define ITEM_WEAR_HEAD        16
  74. #define ITEM_WEAR_LEGS        32
  75. #define ITEM_WEAR_FEET        64
  76. #define ITEM_WEAR_HANDS      128 
  77. #define ITEM_WEAR_ARMS       256
  78. #define ITEM_WEAR_SHIELD     512
  79. #define ITEM_WEAR_ABOUT     1024 
  80. #define ITEM_WEAR_WAISTE    2048
  81. #define ITEM_WEAR_WRIST     4096
  82. #define ITEM_WIELD          8192
  83. #define ITEM_HOLD          16384
  84. #define ITEM_THROW         32768
  85. /* UNUSED, CHECKS ONLY FOR ITEM_LIGHT #define ITEM_LIGHT_SOURCE  65536 */
  86.  
  87. /* Bitvector for 'extra_flags' */
  88.  
  89. #define ITEM_GLOW            1
  90. #define ITEM_HUM             2
  91. #define ITEM_DARK            4
  92. #define ITEM_LOCK            8
  93. #define ITEM_EVIL           16
  94. #define ITEM_INVISIBLE      32
  95. #define ITEM_MAGIC          64
  96. #define ITEM_NODROP        128
  97. #define ITEM_BLESS         256
  98. #define ITEM_ANTI_GOOD     512 /* not usable by good people    */
  99. #define ITEM_ANTI_EVIL    1024 /* not usable by evil people    */
  100. #define ITEM_ANTI_NEUTRAL 2048 /* not usable by neutral people */
  101.  
  102.  
  103. /* Some different kind of liquids */
  104. #define LIQ_WATER      0
  105. #define LIQ_BEER       1
  106. #define LIQ_WINE       2
  107. #define LIQ_ALE        3
  108. #define LIQ_DARKALE    4
  109. #define LIQ_WHISKY     5
  110. #define LIQ_LEMONADE   6
  111. #define LIQ_FIREBRT    7
  112. #define LIQ_LOCALSPC   8
  113. #define LIQ_SLIME      9
  114. #define LIQ_MILK       10
  115. #define LIQ_TEA        11
  116. #define LIQ_COFFE      12
  117. #define LIQ_BLOOD      13
  118. #define LIQ_SALTWATER  14
  119. #define LIQ_COKE       15
  120.  
  121. /* for containers  - value[1] */
  122.  
  123. #define CONT_CLOSEABLE      1
  124. #define CONT_PICKPROOF      2
  125. #define CONT_CLOSED         4
  126. #define CONT_LOCKED         8
  127.  
  128. struct extra_descr_data
  129. {
  130.     char *keyword;                 /* Keyword in look/examine          */
  131.     char *description;             /* What to see                      */
  132.     struct extra_descr_data *next; /* Next in list                     */
  133. };
  134.  
  135. #define MAX_OBJ_AFFECT 2         /* Used in OBJ_FILE_ELEM *DO*NOT*CHANGE* */
  136. #define OBJ_NOTIMER    -7000000
  137.  
  138. struct obj_flag_data
  139. {
  140.     int value[4];       /* Values of the item (see list)    */
  141.     byte type_flag;     /* Type of item                     */
  142.     int wear_flags;     /* Where you can wear it            */
  143.     int extra_flags;    /* If it hums,glows etc             */
  144.     int weight;         /* Weigt what else                  */
  145.     int cost;           /* Value when sold (gp.)            */
  146.     int cost_per_day;   /* Cost to keep pr. real day        */
  147.     int timer;          /* Timer for object                 */
  148.     long bitvector;     /* To set chars bits                */
  149. };
  150.  
  151. /* Used in OBJ_FILE_ELEM *DO*NOT*CHANGE* */
  152. struct obj_affected_type {
  153.     byte location;      /* Which ability to change (APPLY_XXX) */
  154.     sbyte modifier;     /* How much it changes by              */
  155. };
  156.  
  157. /* ======================== Structure for object ========================= */
  158. struct obj_data
  159. {
  160.     sh_int item_number;            /* Where in data-base               */
  161.     sh_int in_room;                /* In what room -1 when conta/carr  */ 
  162.     struct obj_flag_data obj_flags;/* Object information               */
  163.     struct obj_affected_type
  164.         affected[MAX_OBJ_AFFECT];  /* Which abilities in PC to change  */
  165.  
  166.     char *name;                    /* Title of object :get etc.        */
  167.     char *description ;            /* When in room                     */
  168.     char *short_description;       /* when worn/carry/in cont.         */
  169.      char *action_description;      /* What to write when used          */
  170.      struct extra_descr_data *ex_description; /* extra descriptions     */
  171.     struct char_data *carried_by;  /* Carried by :NULL in room/conta   */
  172.  
  173.     struct obj_data *in_obj;       /* In what object NULL when none    */
  174.     struct obj_data *contains;     /* Contains objects                 */
  175.  
  176.     struct obj_data *next_content; /* For 'contains' lists             */
  177.     struct obj_data *next;         /* For the object list              */
  178. };
  179. /* ======================================================================= */
  180.  
  181. /* The following defs are for room_data  */
  182.  
  183. #define NOWHERE    -1    /* nil reference for room-database    */
  184.  
  185. /* Bitvector For 'room_flags' */
  186.  
  187. #define DARK           1
  188. #define DEATH          2
  189. #define NO_MOB         4
  190. #define INDOORS        8
  191. #define LAWFULL       16
  192. #define NEUTRAL       32
  193. #define CHAOTIC       64
  194. #define NO_MAGIC     128
  195. #define TUNNEL       256
  196. #define PRIVATE      512
  197.  
  198. /* For 'dir_option' */
  199.  
  200. #define NORTH          0
  201. #define EAST           1
  202. #define SOUTH          2
  203. #define WEST           3
  204. #define UP             4
  205. #define DOWN           5
  206.  
  207. #define EX_ISDOOR        1
  208. #define EX_CLOSED        2
  209. #define EX_LOCKED        4
  210. #define EX_RSCLOSED    8
  211. #define EX_RSLOCKED    16
  212. #define EX_PICKPROOF 32
  213.  
  214. /* For 'Sector types' */
  215.  
  216. #define SECT_INSIDE          0
  217. #define SECT_CITY            1
  218. #define SECT_FIELD           2
  219. #define SECT_FOREST          3
  220. #define SECT_HILLS           4
  221. #define SECT_MOUNTAIN        5
  222. #define SECT_WATER_SWIM      6
  223. #define SECT_WATER_NOSWIM    7
  224.  
  225. struct room_direction_data
  226. {
  227.     char *general_description;       /* When look DIR.                  */ 
  228.     char *keyword;                   /* for open/close                  */    
  229.     sh_int exit_info;                /* Exit info                       */
  230.     sh_int key;                           /* Key's number (-1 for no key)    */
  231.     sh_int to_room;                  /* Where direction leeds (NOWHERE) */
  232. };
  233.  
  234. /* ========================= Structure for room ========================== */
  235. struct room_data
  236. {
  237.     sh_int number;               /* Rooms number                       */
  238.     sh_int zone;                 /* Room zone (for resetting)          */
  239.     int sector_type;             /* sector type (move/hide)            */
  240.     char *name;                  /* Rooms name 'You are ...'           */
  241.     char *description;           /* Shown when entered                 */
  242.     struct extra_descr_data *ex_description; /* for examine/look       */
  243.     struct room_direction_data *dir_option[6]; /* Directions           */
  244.     sh_int room_flags;           /* DEATH,DARK ... etc                 */ 
  245.     byte light;                  /* Number of lightsources in room     */
  246.     int (*funct)();              /* special procedure                  */
  247.          
  248.     struct obj_data *contents;   /* List of items in room              */
  249.     struct char_data *people;    /* List of NPC / PC in room           */
  250. };
  251. /* ======================================================================== */
  252.  
  253. /* The following defs and structures are related to char_data   */
  254.  
  255. /* For 'equipment' */
  256.  
  257. #define WEAR_LIGHT      0
  258. #define WEAR_FINGER_R   1
  259. #define WEAR_FINGER_L   2
  260. #define WEAR_NECK_1     3
  261. #define WEAR_NECK_2     4
  262. #define WEAR_BODY       5
  263. #define WEAR_HEAD       6
  264. #define WEAR_LEGS       7
  265. #define WEAR_FEET       8
  266. #define WEAR_HANDS      9
  267. #define WEAR_ARMS      10
  268. #define WEAR_SHIELD    11
  269. #define WEAR_ABOUT     12
  270. #define WEAR_WAISTE    13
  271. #define WEAR_WRIST_R   14
  272. #define WEAR_WRIST_L   15
  273. #define WIELD          16
  274. #define HOLD           17
  275.  
  276.  
  277. /* For 'char_payer_data' */
  278.  
  279. #define MAX_TOUNGE  3     /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  280. #define MAX_SKILLS  53    /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  281. #define MAX_WEAR    18
  282. #define MAX_AFFECT  25    /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  283.  
  284. /* Predifined  conditions */
  285. #define DRUNK        0
  286. #define FULL         1
  287. #define THIRST       2
  288.  
  289. /* Bitvector for 'affected_by' */
  290. #define AFF_BLIND             1
  291. #define AFF_INVISIBLE         2
  292. #define AFF_DETECT_EVIL       4
  293. #define AFF_DETECT_INVISIBLE  8
  294. #define AFF_DETECT_MAGIC      16
  295. #define AFF_SENSE_LIFE        32
  296. #define AFF_HOLD              64
  297. #define AFF_SANCTUARY         128
  298. #define AFF_GROUP             256
  299. #define AFF_CURSE             1024
  300. #define AFF_FLAMING           2048
  301. #define AFF_POISON            4096
  302. #define AFF_PROTECT_EVIL      8192
  303. #define AFF_PARALYSIS         16384
  304. #define AFF_MORDEN_SWORD      32768
  305. #define AFF_FLAMING_SWORD     65536
  306. #define AFF_SLEEP             131072
  307. #define AFF_DODGE             262144
  308. #define AFF_SNEAK             524288
  309. #define AFF_HIDE              1048576
  310. #define AFF_FEAR              2097152
  311. #define AFF_CHARM             4194304
  312. #define AFF_FOLLOW            8388608
  313.  
  314. /* modifiers to char's abilities */
  315.  
  316. #define APPLY_NONE              0
  317. #define APPLY_STR               1
  318. #define APPLY_DEX               2
  319. #define APPLY_INT               3
  320. #define APPLY_WIS               4
  321. #define APPLY_CON               5
  322. #define APPLY_SEX               6
  323. #define APPLY_CLASS             7
  324. #define APPLY_LEVEL             8
  325. #define APPLY_AGE               9
  326. #define APPLY_CHAR_WEIGHT      10
  327. #define APPLY_CHAR_HEIGHT      11
  328. #define APPLY_MANA             12
  329. #define APPLY_HIT              13
  330. #define APPLY_MOVE             14
  331. #define APPLY_GOLD             15
  332. #define APPLY_EXP              16
  333. #define APPLY_AC               17
  334. #define APPLY_ARMOR            17
  335. #define APPLY_HITROLL          18
  336. #define APPLY_DAMROLL          19
  337. #define APPLY_SAVING_PARA      20
  338. #define APPLY_SAVING_ROD       21
  339. #define APPLY_SAVING_PETRI     22
  340. #define APPLY_SAVING_BREATH    23
  341. #define APPLY_SAVING_SPELL     24
  342.  
  343.  
  344. /* 'class' for PC's */
  345. #define CLASS_MAGIC_USER  1
  346. #define CLASS_CLERIC      2
  347. #define CLASS_THIEF       3
  348. #define CLASS_WARRIOR     4
  349.  
  350. /* 'class' for NPC's */
  351. #define CLASS_OTHER       0 /* These are not yet used!   */
  352. #define CLASS_UNDEAD      1 /* But may soon be so        */
  353. #define CLASS_HUMANOID    2 /* Idea is to use general    */
  354. #define CLASS_ANIMAL      3 /* monster classes           */
  355. #define CLASS_DRAGON      4 /* Then for example a weapon */
  356. #define CLASS_GIANT       5 /* of dragon slaying is pos. */
  357.  
  358. /* sex */
  359. #define SEX_NEUTRAL   0
  360. #define SEX_MALE      1
  361. #define SEX_FEMALE    2
  362.  
  363. /* positions */
  364. #define POSITION_DEAD       0
  365. #define POSITION_MORTALLYW  1
  366. #define POSITION_INCAP      2
  367. #define POSITION_STUNNED    3
  368. #define POSITION_SLEEPING   4
  369. #define POSITION_RESTING    5
  370. #define POSITION_SITTING    6
  371. #define POSITION_FIGHTING   7
  372. #define POSITION_STANDING   8
  373.  
  374.  
  375. /* for mobile actions: specials.act */
  376. #define ACT_SPEC         1     /* special routine to be called if exist   */
  377. #define ACT_SENTINEL     2     /* this mobile not to be moved             */
  378. #define ACT_SCAVENGER    4     /* pick up stuff lying around              */
  379. #define ACT_ISNPC        8     /* This bit is set for use with IS_NPC()   */
  380. #define ACT_NICE_THIEF  16     /* Set if a thief should NOT be killed     */
  381. #define ACT_AGGRESSIVE  32     /* Set if automatic attack on NPC's        */
  382. #define ACT_STAY_ZONE   64     /* MOB Must stay inside its own zone       */
  383. #define ACT_WIMPY      128     /* MOB Will flee when injured, and if      */
  384.                                /* aggressive only attack sleeping players */
  385.  
  386. /* For players : specials.act */
  387. #define PLR_BRIEF        1
  388. #define PLR_NOSHOUT      2
  389. #define PLR_COMPACT      4
  390. #define PLR_DONTSET      8   /* Dont EVER set */
  391.  
  392.  
  393.  
  394. /* This structure is purely intended to be an easy way to transfer */
  395. /* and return information about time (real or mudwise).            */
  396. struct time_info_data
  397. {
  398.     byte hours, day, month;
  399.     sh_int year;
  400. };
  401.  
  402. /* These data contain information about a players time data */
  403. struct time_data
  404. {
  405.   time_t birth;    /* This represents the characters age                */
  406.   time_t logon;    /* Time of the last logon (used to calculate played) */
  407.   int played;      /* This is the total accumulated time played in secs */
  408. };
  409.  
  410. struct char_player_data
  411. {
  412.     char *name;            /* PC / NPC s name (kill ...  )         */
  413.     char *short_descr;  /* for 'actions'                        */
  414.     char *long_descr;   /* for 'look'.. Only here for testing   */
  415.     char *description;  /* Extra descriptions                   */
  416.     char *title;        /* PC / NPC s title                     */
  417.     byte sex;           /* PC / NPC s sex                       */
  418.     byte class;         /* PC s class or NPC alignment          */
  419.     byte level;         /* PC / NPC s level                     */
  420.     int hometown;       /* PC s Hometown (zone)                 */
  421.     bool talks[MAX_TOUNGE]; /* PC s Tounges 0 for NPC           */
  422.      struct time_data time; /* PC s AGE in days                 */
  423.     ubyte weight;       /* PC / NPC s weight                    */
  424.     ubyte height;       /* PC / NPC s height                    */
  425. };
  426.  
  427.  
  428. /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  429. struct char_ability_data
  430. {
  431.     sbyte str; 
  432.     sbyte str_add;      /* 000 - 100 if strength 18             */
  433.     sbyte intel;
  434.     sbyte wis; 
  435.     sbyte dex; 
  436.     sbyte con; 
  437. };
  438.  
  439.  
  440. /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  441. struct char_point_data
  442. {
  443.     sh_int mana;         
  444.     sh_int max_mana;     /* Not useable may be erased upon player file renewal */
  445.     sh_int hit;   
  446.     sh_int max_hit;      /* Max hit for NPC                         */
  447.     sh_int move;  
  448.     sh_int max_move;     /* Max move for NPC                        */
  449.  
  450.     sh_int armor;        /* Internal -100..100, external -10..10 AC */
  451.     int gold;            /* Money carried                           */
  452.     int exp;             /* The experience of the player            */
  453.  
  454.     sbyte hitroll;       /* Any bonus or penalty to the hit roll    */
  455.     sbyte damroll;       /* Any bonus or penalty to the damage roll */
  456. };
  457.  
  458.  
  459. struct char_special_data
  460. {
  461.     struct char_data *fighting; /* Opponent                             */
  462.     struct char_data *hunting;  /* Hunting person..                     */
  463.  
  464.     long affected_by;        /* Bitvector for spells/skills affected by */ 
  465.  
  466.     byte position;           /* Standing or ...                         */
  467.     byte default_pos;        /* Default position for NPC                */
  468.     ubyte act;               /* flags for NPC behavior                  */
  469.  
  470.     byte spells_to_learn;    /* How many can you learn yet this level   */
  471.  
  472.     int carry_weight;        /* Carried weight                          */
  473.     byte carry_items;        /* Number of items carried                 */
  474.     int timer;               /* Timer for update                        */
  475.     sh_int was_in_room;      /* storage of location for linkdead people */
  476.     sh_int apply_saving_throw[5]; /* Saving throw (Bonuses)             */
  477.     sbyte conditions[3];      /* Drunk full etc.                        */
  478.  
  479.     byte damnodice;           /* The number of damage dice's            */
  480.     byte damsizedice;         /* The size of the damage dice's          */
  481.     byte last_direction;      /* The last direction the monster went    */
  482.     int attack_type;          /* The Attack Type Bitvector for NPC's    */
  483.     int alignment;            /* +-1000 for alignments                  */
  484. };
  485.  
  486.  
  487. /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  488. struct char_skill_data
  489. {
  490.     byte learned;           /* % chance for success 0 = not learned   */
  491.     bool recognise;         /* If you can recognise the scroll etc.   */
  492. };
  493.  
  494.  
  495.  
  496. /* Used in CHAR_FILE_U *DO*NOT*CHANGE* */
  497. struct affected_type
  498. {
  499.     sbyte type;           /* The type of spell that caused this      */
  500.     sh_int duration;      /* For how long its effects will last      */
  501.     sbyte modifier;       /* This is added to apropriate ability     */
  502.     byte location;        /* Tells which ability to change(APPLY_XXX)*/
  503.     long bitvector;       /* Tells which bits to set (AFF_XXX)       */
  504.  
  505.     struct affected_type *next;
  506. };
  507.  
  508. struct follow_type
  509. {
  510.     struct char_data *follower;
  511.     struct follow_type *next;
  512. };
  513.  
  514. /* ================== Structure for player/non-player ===================== */
  515. struct char_data
  516. {
  517.     sh_int nr;                            /* monster nr (pos in file)      */
  518.     sh_int in_room;                       /* Location                      */
  519.  
  520.     struct char_player_data player;       /* Normal data                   */
  521.     struct char_ability_data abilities;   /* Abilities                     */
  522.     struct char_ability_data tmpabilities;/* The abilities we will use     */
  523.     struct char_point_data points;        /* Points                        */
  524.     struct char_special_data specials;    /* Special plaing constants      */
  525.     struct char_skill_data skills[MAX_SKILLS]; /* Skills                   */
  526.  
  527.     struct affected_type *affected;       /* affected by what spells       */
  528.     struct obj_data *equipment[MAX_WEAR]; /* Equipment array               */
  529.  
  530.     struct obj_data *carrying;            /* Head of list                  */
  531.     struct descriptor_data *desc;         /* NULL for mobiles              */
  532.  
  533.     struct char_data *next_in_room;     /* For room->people - list         */
  534.     struct char_data *next;             /* For either monster or ppl-list  */
  535.     struct char_data *next_fighting;    /* For fighting list               */
  536.  
  537.     struct follow_type *followers;        /* List of chars followers       */
  538.     struct char_data *master;             /* Who is char following?        */
  539. };
  540.  
  541.  
  542. /* ======================================================================== */
  543.  
  544. /* How much light is in the land ? */
  545.  
  546. #define SUN_DARK    0
  547. #define SUN_RISE    1
  548. #define SUN_LIGHT    2
  549. #define SUN_SET        3
  550.  
  551. /* And how is the sky ? */
  552.  
  553. #define SKY_CLOUDLESS    0
  554. #define SKY_CLOUDY    1
  555. #define SKY_RAINING    2
  556. #define SKY_LIGHTNING    3
  557.  
  558. struct weather_data
  559. {
  560.     int pressure;    /* How is the pressure ( Mb ) */
  561.     int change;    /* How fast and what way does it change. */
  562.     int sky;    /* How is the sky. */
  563.     int sunlight;    /* And how much sun. */
  564. };
  565.  
  566.  
  567. /* ***********************************************************************
  568. *  file element for player file. BEWARE: Changing it will ruin the file  *
  569. *********************************************************************** */
  570.  
  571.  
  572. struct char_file_u
  573. {
  574.     byte sex;
  575.     byte class;
  576.     byte level;
  577.     time_t birth;  /* Time of birth of character     */
  578.   int played;    /* Number of secs played in total */
  579.  
  580.     ubyte weight;
  581.     ubyte height;
  582.  
  583.     char title[80];
  584.     sh_int hometown;
  585.     char description[240];
  586.     bool talks[MAX_TOUNGE];
  587.  
  588.     sh_int load_room;            /* Which room to place char in           */
  589.  
  590.     struct char_ability_data abilities;
  591.  
  592.     struct char_point_data points;
  593.  
  594.     struct char_skill_data skills[MAX_SKILLS];
  595.  
  596.     struct affected_type affected[MAX_AFFECT];
  597.  
  598.     /* specials */
  599.  
  600.     byte spells_to_learn;  
  601.     int alignment;     
  602.  
  603.     time_t last_logon;  /* Time (in secs) of last logon */
  604.     ubyte act;          /* ACT Flags                    */
  605.  
  606.     /* char data */
  607.     char name[20];
  608.     char pwd[11];
  609.     sh_int apply_saving_throw[5];
  610.     int conditions[3];
  611. };
  612.  
  613.  
  614.  
  615. /* ***********************************************************************
  616. *  file element for object file. BEWARE: Changing it will ruin the file  *
  617. *********************************************************************** */
  618.  
  619. #define MAX_OBJ_SAVE 15 /* Used in OBJ_FILE_U *DO*NOT*CHANGE* */
  620.  
  621.  
  622. struct obj_file_elem 
  623. {
  624.     sh_int item_number;
  625.  
  626.     int value[4];
  627.     int extra_flags;
  628.     int weight;
  629.     int timer;
  630.     long bitvector;
  631.     struct obj_affected_type affected[MAX_OBJ_AFFECT];
  632. };
  633.  
  634. struct obj_file_u
  635. {
  636.     char owner[20];    /* Name of player                     */
  637.     int gold_left;     /* Number of goldcoins left at owner  */
  638.     int total_cost;    /* The cost for all items, per day    */
  639.     long last_update;  /* Time in seconds, when last updated */
  640.  
  641.     struct obj_file_elem objects[MAX_OBJ_SAVE];
  642. };
  643.  
  644. /* ***********************************************************
  645. *  The following structures are related to descriptor_data   *
  646. *********************************************************** */
  647.  
  648.  
  649.  
  650. struct txt_block
  651. {
  652.     char *text;
  653.     struct txt_block *next;
  654. };
  655.  
  656. struct txt_q
  657. {
  658.     struct txt_block *head;
  659.     struct txt_block *tail;
  660. };
  661.  
  662.  
  663.  
  664. /* modes of connectedness */
  665.  
  666. #define CON_PLYNG   0
  667. #define CON_NME        1
  668. #define CON_NMECNF  2
  669. #define CON_PWDNRM  3
  670. #define CON_PWDGET  4
  671. #define CON_PWDCNF  5
  672. #define CON_QSEX    6
  673. #define CON_RMOTD   7
  674. #define CON_SLCT    8
  675. #define CON_EXDSCR  9
  676. #define CON_QCLASS  10
  677. #define CON_LDEAD   11
  678. #define CON_PWDNEW  12
  679. #define CON_PWDNCNF 13
  680.  
  681. struct snoop_data
  682. {
  683.     struct char_data *snooping;    
  684.         /* Who is this char snooping */
  685.     struct char_data *snoop_by;
  686.         /* And who is snooping on this char */
  687. };
  688.  
  689. struct descriptor_data
  690. {
  691.     int descriptor;                /* file descriptor for socket */
  692.     char host[50];                /* hostname                   */
  693.     char pwd[12];                 /* password                   */
  694.     int pos;                      /* position in player-file    */
  695.     int connected;                /* mode of 'connectedness'    */
  696.     int wait;                     /* wait for how many loops    */
  697.     char *showstr_head;                /* for paging through texts    */
  698.     char *showstr_point;                /*       -                    */
  699.     char **str;                   /* for the modify-str system  */
  700.     int max_str;                  /* -                          */
  701.     int prompt_mode;              /* control of prompt-printing */
  702.     char buf[MAX_STRING_LENGTH];  /* buffer for raw input       */
  703.     char last_input[MAX_INPUT_LENGTH];/* the last input         */
  704.     struct txt_q output;          /* q of strings to send       */
  705.     struct txt_q input;           /* q of unprocessed input     */
  706.     struct char_data *character;  /* linked to char             */
  707.    struct char_data *original;   /* original char              */
  708.     struct snoop_data snoop;      /* to snoop people.             */
  709.     struct descriptor_data *next; /* link to next descriptor    */
  710. };
  711.  
  712. struct msg_type 
  713. {
  714.     char *attacker_msg;  /* message to attacker */
  715.     char *victim_msg;    /* message to victim   */
  716.     char *room_msg;      /* message to room     */
  717. };
  718.  
  719. struct message_type
  720. {
  721.     struct msg_type die_msg;      /* messages when death            */
  722.     struct msg_type miss_msg;     /* messages when miss             */
  723.     struct msg_type hit_msg;      /* messages when hit              */
  724.     struct msg_type sanctuary_msg;/* messages when hit on sanctuary */
  725.     struct msg_type god_msg;      /* messages when hit on god       */
  726.     struct message_type *next;/* to next messages of this kind.*/
  727. };
  728.  
  729. struct message_list
  730. {
  731.     int a_type;               /* Attack type                          */
  732.     int number_of_attacks;      /* How many attack messages to chose from. */
  733.     struct message_type *msg; /* List of messages.                 */
  734. };
  735.  
  736. struct dex_skill_type
  737. {
  738.     sh_int p_pocket;
  739.     sh_int p_locks;
  740.     sh_int traps;
  741.     sh_int sneak;
  742.     sh_int hide;
  743. };
  744.  
  745. struct dex_app_type
  746. {
  747.     sh_int reaction;
  748.     sh_int miss_att;
  749.     sh_int defensive;
  750. };
  751.  
  752. struct str_app_type
  753. {
  754.     sh_int tohit;    /* To Hit (THAC0) Bonus/Penalty        */
  755.     sh_int todam;    /* Damage Bonus/Penalty                */
  756.     sh_int carry_w;  /* Maximum weight that can be carrried */
  757.     sh_int wield_w;  /* Maximum weight that can be wielded  */
  758. };
  759.  
  760. struct wis_app_type
  761. {
  762.     byte bonus;       /* how many bonus skills a player can */
  763.                       /* practice pr. level                 */
  764. };
  765.  
  766. struct int_app_type
  767. {
  768.     byte learn;       /* how many % a player learns a spell/skill */
  769. };
  770.  
  771. struct con_app_type
  772. {
  773.     sh_int hitp;
  774.     sh_int shock;
  775. };
  776.