/* ************************************************************************
* File: structs.h Part of CircleMUD *
* Usage: header file for central structures and contstants *
* *
* All rights reserved. See license.doc for complete information. *
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
************************************************************************ */
/*
* We have hare the parts of structs.h needed to load the stock world
* and prototype arrays.
*
* You should update it with structures specific to your mud if they've
* been changed from stock.
*/
#ifndef __STRUCTS_H__
#define __STRUCTS_H__
typedef signed char sbyte;
typedef unsigned char ubyte;
typedef signed short int sh_int;
typedef unsigned short int ush_int;
typedef signed char byte;
#if !defined(__cplusplus) /* Anyone know a portable method? */
typedef char bool;
#endif
#define SPECIAL(name) \
int (name)(struct char_data *ch, void *me, int cmd, char *argument)
#define NOWHERE (-1) /* nil reference for rooms */
#define NOTHING (-1) /* nil reference for objects */
#define NOBODY (-1) /* nil reference for mobiles */
#define IDXTYPE sh_int
#define APPLY_NONE 0 /* No effect */
#define LVL_IMPL 34
#define LVL_GRGOD 33
#define LVL_GOD 32
#define LVL_IMMORT 31
/* Level of the 'freeze' command */
#define LVL_FREEZE LVL_GRGOD
#define NUM_OF_DIRS 6 /* number of directions in a room (nsewud) */
#define NUM_CLASSES 4
#define MAX_STRING_LENGTH 8192
#define MAX_INPUT_LENGTH 256
#define MAX_PWD_LENGTH 10
#define MAX_TONGUE 3
#define NUM_WEARS 18
#define MAX_OBJ_AFFECT 6
#define MAX_SKILLS 200
#define MAX_SPELLS 130
#define TOP_SPELL_DEFINE 299
#define NUM_OF_DIRS 6
#define NORTH 0
#define EAST 1
#define SOUTH 2
#define WEST 3
#define UP 4
#define DOWN 5
/* Player conditions */
#define DRUNK (0)
#define FULL (1)
#define THIRST (2)
#define AUTH_NONE (0) /**< The char has no rights at all. */
#define AUTH_GUEST (1) /**< The char has guest rights. */
#define AUTH_PLAYER (2) /**< The char has player rights. */
#define AUTH_WIZARD (3) /**< The char has wizard rights. */
#define AUTH_OWNER (4) /**< The char has owner rights. */
#define POS_DEAD 0 /* dead */
#define POS_MORTALLYW 1 /* mortally wounded */
#define POS_INCAP 2 /* incapacitated */
#define POS_STUNNED 3 /* stunned */
#define POS_SLEEPING 4 /* sleeping */
#define POS_RESTING 5 /* resting */
#define POS_SITTING 6 /* sitting */
#define POS_FIGHTING 7 /* fighting */
#define POS_STANDING 8 /* standing */
/* Player flags: used by char_data.char_specials.act */
#define PLR_KILLER (1 << 0) /* Player is a player-killer */
#define PLR_THIEF (1 << 1) /* Player is a player-thief */
#define PLR_FROZEN (1 << 2) /* Player is frozen */
#define PLR_DONTSET (1 << 3) /* Don't EVER set (ISNPC bit) */
#define PLR_WRITING (1 << 4) /* Player writing (board/mail/olc) */
#define PLR_MAILING (1 << 5) /* Player is writing mail */
#define PLR_CRASH (1 << 6) /* Player needs to be crash-saved */
#define PLR_SITEOK (1 << 7) /* Player has been site-cleared */
#define PLR_NOSHOUT (1 << 8) /* Player not allowed to shout/goss */
#define PLR_NOTITLE (1 << 9) /* Player not allowed to set title */
#define PLR_DELETED (1 << 10) /* Player deleted - space reusable */
#define PLR_LOADROOM (1 << 11) /* Player uses nonstandard loadroom */
#define PLR_NOWIZLIST (1 << 12) /* Player shouldn't be on wizlist */
#define PLR_NODELETE (1 << 13) /* Player shouldn't be deleted */
#define PLR_INVSTART (1 << 14) /* Player should enter game wizinvis */
#define PLR_CRYO (1 << 15) /* Player is cryo-saved (purge prog) */
#define PLR_NOTDEADYET (1 << 16) /* (R) Player being extracted. */
#define ROOM_DARK (1 << 0) /* Dark */
#define ROOM_DEATH (1 << 1) /* Death trap */
#define ROOM_NOMOB (1 << 2) /* MOBs not allowed */
#define ROOM_INDOORS (1 << 3) /* Indoors */
#define ROOM_PEACEFUL (1 << 4) /* Violence not allowed */
#define ROOM_SOUNDPROOF (1 << 5) /* Shouts, gossip blocked */
#define ROOM_NOTRACK (1 << 6) /* Track won't go through */
#define ROOM_NOMAGIC (1 << 7) /* Magic not allowed */
#define ROOM_TUNNEL (1 << 8) /* room for only 1 pers */
#define ROOM_PRIVATE (1 << 9) /* Can't teleport in */
#define ROOM_GODROOM (1 << 10) /* LVL_GOD+ only allowed */
#define ROOM_HOUSE (1 << 11) /* (R) Room is a house */
#define ROOM_HOUSE_CRASH (1 << 12) /* (R) House needs saving */
#define ROOM_ATRIUM (1 << 13) /* (R) The door to a house */
#define ROOM_OLC (1 << 14) /* (R) Modifyable/!compress */
#define ROOM_BFS_MARK (1 << 15) /* (R) breath-first srch mrk */
#define EX_ISDOOR (1 << 0) /* Exit is a door */
#define EX_CLOSED (1 << 1) /* The door is closed */
#define EX_LOCKED (1 << 2) /* The door is locked */
#define EX_PICKPROOF (1 << 3) /* Lock can't be picked */
#define SECT_INSIDE 0 /* Indoors */
#define SECT_CITY 1 /* In a city */
#define SECT_FIELD 2 /* In a field */
#define SECT_FOREST 3 /* In a forest */
#define SECT_HILLS 4 /* In the hills */
#define SECT_MOUNTAIN 5 /* On a mountain */
#define SECT_WATER_SWIM 6 /* Swimmable water */
#define SECT_WATER_NOSWIM 7 /* Water - need a boat */
#define SECT_FLYING 8 /* Wheee! */
#define SECT_UNDERWATER 9 /* Underwater */
#define MOB_SPEC (1 << 0) /* Mob has a callable spec-proc */
#define MOB_SENTINEL (1 << 1) /* Mob should not move */
#define MOB_SCAVENGER (1 << 2) /* Mob picks up stuff on the ground */
#define MOB_ISNPC (1 << 3) /* (R) Automatically set on all Mobs */
#define MOB_AWARE (1 << 4) /* Mob can't be backstabbed */
#define MOB_AGGRESSIVE (1 << 5) /* Mob auto-attacks everybody nearby */
#define MOB_STAY_ZONE (1 << 6) /* Mob shouldn't wander out of zone */
#define MOB_WIMPY (1 << 7) /* Mob flees if severely injured */
#define MOB_AGGR_EVIL (1 << 8) /* Auto-attack any evil PC's */
#define MOB_AGGR_GOOD (1 << 9) /* Auto-attack any good PC's */
#define MOB_AGGR_NEUTRAL (1 << 10) /* Auto-attack any neutral PC's */
#define MOB_MEMORY (1 << 11) /* remember attackers if attacked */
#define MOB_HELPER (1 << 12) /* attack PCs fighting other NPCs */
#define MOB_NOCHARM (1 << 13) /* Mob can't be charmed */
#define MOB_NOSUMMON (1 << 14) /* Mob can't be summoned */
#define MOB_NOSLEEP (1 << 15) /* Mob can't be slept */
#define MOB_NOBASH (1 << 16) /* Mob can't be bashed (e.g. trees) */
#define MOB_NOBLIND (1 << 17) /* Mob can't be blinded */
#define MOB_NOTDEADYET (1 << 18) /* (R) Mob being extracted. */
#define PRF_BRIEF (1 << 0) /* Room descs won't normally be shown */
#define PRF_COMPACT (1 << 1) /* No extra CRLF pair before prompts */
#define PRF_DEAF (1 << 2) /* Can't hear shouts */
#define PRF_NOTELL (1 << 3) /* Can't receive tells */
#define PRF_DISPHP (1 << 4) /* Display hit points in prompt */
#define PRF_DISPMANA (1 << 5) /* Display mana points in prompt */
#define PRF_DISPMOVE (1 << 6) /* Display move points in prompt */
#define PRF_AUTOEXIT (1 << 7) /* Display exits in a room */
#define PRF_NOHASSLE (1 << 8) /* Aggr mobs won't attack */
#define PRF_QUEST (1 << 9) /* On quest */
#define PRF_SUMMONABLE (1 << 10) /* Can be summoned */
#define PRF_NOREPEAT (1 << 11) /* No repetition of comm commands */
#define PRF_HOLYLIGHT (1 << 12) /* Can see in dark */
#define PRF_COLOR_1 (1 << 13) /* Color (low bit) */
#define PRF_COLOR_2 (1 << 14) /* Color (high bit) */
#define PRF_NOWIZ (1 << 15) /* Can't hear wizline */
#define PRF_LOG1 (1 << 16) /* On-line System Log (low bit) */
#define PRF_LOG2 (1 << 17) /* On-line System Log (high bit) */
#define PRF_NOAUCT (1 << 18) /* Can't hear auction channel */
#define PRF_NOGOSS (1 << 19) /* Can't hear gossip channel */
#define PRF_NOGRATZ (1 << 20) /* Can't hear grats channel */
#define PRF_ROOMFLAGS (1 << 21) /* Can see room flags (ROOM_x) */
#define PRF_DISPAUTO (1 << 22) /* Show prompt HP, MP, MV when < 30%. */
#define ITEM_LIGHT 1 /* Item is a light source */
#define ITEM_SCROLL 2 /* Item is a scroll */
#define ITEM_WAND 3 /* Item is a wand */
#define ITEM_STAFF 4 /* Item is a staff */
#define ITEM_WEAPON 5 /* Item is a weapon */
#define ITEM_FIREWEAPON 6 /* Unimplemented */
#define ITEM_MISSILE 7 /* Unimplemented */
#define ITEM_TREASURE 8 /* Item is a treasure, not gold */
#define ITEM_ARMOR 9 /* Item is armor */
#define ITEM_POTION 10 /* Item is a potion */
#define ITEM_WORN 11 /* Unimplemented */
#define ITEM_OTHER 12 /* Misc object */
#define ITEM_TRASH 13 /* Trash - shopkeeps won't buy */
#define ITEM_TRAP 14 /* Unimplemented */
#define ITEM_CONTAINER 15 /* Item is a container */
#define ITEM_NOTE 16 /* Item is note */
#define ITEM_DRINKCON 17 /* Item is a drink container */
#define ITEM_KEY 18 /* Item is a key */
#define ITEM_FOOD 19 /* Item is food */
#define ITEM_MONEY 20 /* Item is money (gold) */
#define ITEM_PEN 21 /* Item is a pen */
#define ITEM_BOAT 22 /* Item is a boat */
#define ITEM_FOUNTAIN 23 /* Item is a fountain */
#define ITEM_WEAR_TAKE (1 << 0) /* Item can be takes */
#define ITEM_WEAR_FINGER (1 << 1) /* Can be worn on finger */
#define ITEM_WEAR_NECK (1 << 2) /* Can be worn around neck */
#define ITEM_WEAR_BODY (1 << 3) /* Can be worn on body */
#define ITEM_WEAR_HEAD (1 << 4) /* Can be worn on head */
#define ITEM_WEAR_LEGS (1 << 5) /* Can be worn on legs */
#define ITEM_WEAR_FEET (1 << 6) /* Can be worn on feet */
#define ITEM_WEAR_HANDS (1 << 7) /* Can be worn on hands */
#define ITEM_WEAR_ARMS (1 << 8) /* Can be worn on arms */
#define ITEM_WEAR_SHIELD (1 << 9) /* Can be used as a shield */
#define ITEM_WEAR_ABOUT (1 << 10) /* Can be worn about body */
#define ITEM_WEAR_WAIST (1 << 11) /* Can be worn around waist */
#define ITEM_WEAR_WRIST (1 << 12) /* Can be worn on wrist */
#define ITEM_WEAR_WIELD (1 << 13) /* Can be wielded */
#define ITEM_WEAR_HOLD (1 << 14) /* Can be held */
#define ITEM_GLOW (1 << 0) /* Item is glowing */
#define ITEM_HUM (1 << 1) /* Item is humming */
#define ITEM_NORENT (1 << 2) /* Item cannot be rented */
#define ITEM_NODONATE (1 << 3) /* Item cannot be donated */
#define ITEM_NOINVIS (1 << 4) /* Item cannot be made invis */
#define ITEM_INVISIBLE (1 << 5) /* Item is invisible */
#define ITEM_MAGIC (1 << 6) /* Item is magical */
#define ITEM_NODROP (1 << 7) /* Item is cursed: can't drop */
#define ITEM_BLESS (1 << 8) /* Item is blessed */
#define ITEM_ANTI_GOOD (1 << 9) /* Not usable by good people */
#define ITEM_ANTI_EVIL (1 << 10) /* Not usable by evil people */
#define ITEM_ANTI_NEUTRAL (1 << 11) /* Not usable by neutral people */
#define ITEM_ANTI_MAGIC_USER (1 << 12) /* Not usable by mages */
#define ITEM_ANTI_CLERIC (1 << 13) /* Not usable by clerics */
#define ITEM_ANTI_THIEF (1 << 14) /* Not usable by thieves */
#define ITEM_ANTI_WARRIOR (1 << 15) /* Not usable by warriors */
#define ITEM_NOSELL (1 << 16) /* Shopkeepers won't touch it */
typedef IDXTYPE room_vnum;
typedef IDXTYPE obj_vnum;
typedef IDXTYPE mob_vnum;
typedef IDXTYPE zone_vnum;
typedef IDXTYPE shop_vnum;
typedef IDXTYPE room_rnum;
typedef IDXTYPE obj_rnum;
typedef IDXTYPE mob_rnum;
typedef IDXTYPE zone_rnum;
typedef IDXTYPE shop_rnum;
/*
* Typedefs used bo CM^2
*/
typedef IDXTYPE roomVnum_t;
typedef IDXTYPE objVnum_t;
typedef IDXTYPE mobVnum_t;
typedef IDXTYPE zoneVnum_t;
typedef IDXTYPE shopVnum_t;
typedef IDXTYPE roomRnum_t;
typedef IDXTYPE objRnum_t;
typedef IDXTYPE mobRnum_t;
typedef IDXTYPE zoneRnum_t;
typedef IDXTYPE shopRnum_t;
typedef struct reset_com resetCommand_t;
typedef struct zone_data zoneData_t;
/*
* Extra Descriptions
*/
struct extra_descr_data {
char *keyword; /* Keyword in look/examine */
char *description; /* What to see */
struct extra_descr_data *next; /* Next in list */
};
/*
* Objects
*/
struct obj_flag_data {
int value[4]; /* Values of the item (see list) */
byte type_flag; /* Type of item */
int wear_flags; /* Where you can wear it */
int extra_flags; /* If it hums, glows, etc. */
int weight; /* Weigt what else */
int cost; /* Value when sold (gp.) */
int cost_per_day; /* Cost to keep pr. real day */
int timer; /* Timer for object */
long bitvector; /* To set chars bits */
};
struct obj_affected_type {
byte location; /* Which ability to change (APPLY_XXX) */
sbyte modifier; /* How much it changes by */
};
struct obj_data {
obj_vnum item_number; /* Where in data-base */
room_rnum in_room; /* In what room -1 when conta/carr */
struct obj_flag_data obj_flags;/* Object information */
struct obj_affected_type affected[MAX_OBJ_AFFECT]; /* affects */
char *name; /* Title of object :get etc. */
char *description; /* When in room */
char *short_description; /* when worn/carry/in cont. */
char *action_description; /* What to write when used */
struct extra_descr_data *ex_description; /* extra descriptions */
struct char_data *carried_by; /* Carried by :NULL in room/conta */
struct char_data *worn_by; /* Worn by? */
sh_int worn_on; /* Worn where? */
struct obj_data *in_obj; /* In what object NULL when none */
struct obj_data *contains; /* Contains objects */
struct obj_data *next_content; /* For 'contains' lists */
struct obj_data *next; /* For the object list */
};
/*
* Rooms
*/
struct room_direction_data {
char *general_description; /* When look DIR. */
char *keyword; /* for open/close */
sh_int exit_info; /* Exit info */
obj_vnum key; /* Key's number (-1 for no key) */
room_rnum to_room; /* Where direction leads (NOWHERE) */
};
struct room_data {
room_vnum number; /* Rooms number (vnum) */
zone_rnum zone; /* Room zone (for resetting) */
int sector_type; /* sector type (move/hide) */
char *name; /* Rooms name 'You are ...' */
char *description; /* Shown when entered */
struct extra_descr_data *ex_description; /* for examine/look */
struct room_direction_data *dir_option[NUM_OF_DIRS]; /* Directions */
int room_flags; /* DEATH,DARK ... etc */
byte light; /* Number of lightsources in room */
SPECIAL(*func);
struct obj_data *contents; /* List of items in room */
struct char_data *people; /* List of NPC / PC in room */
};
/*
* PC/NPC
*/
struct time_data {
time_t birth; /* This represents the characters age */
time_t logon; /* Time of the last logon (used to calculate played) */
int played; /* This is the total accumulated time played in secs */
};
struct memory_rec_struct {
long id;
struct memory_rec_struct *next;
};
typedef struct memory_rec_struct memory_rec;
struct char_player_data {
char passwd[MAX_PWD_LENGTH+1]; /* character's password */
char *name; /* PC / NPC s name (kill ... ) */
char *short_descr; /* for NPC 'actions' */
char *long_descr; /* for 'look' */
char *description; /* Extra descriptions */
char *title; /* PC / NPC's title */
byte sex; /* PC / NPC's sex */
byte chclass; /* PC / NPC's class */
byte level; /* PC / NPC's level */
byte auth;
sh_int hometown; /* PC s Hometown (zone) */
struct time_data time; /* PC's AGE in days */
ubyte weight; /* PC / NPC's weight */
ubyte height; /* PC / NPC's height */
};
struct char_ability_data {
sbyte str;
sbyte str_add; /* 000 - 100 if strength 18 */
sbyte intel;
sbyte wis;
sbyte dex;
sbyte con;
sbyte cha;
};
struct char_point_data {
sh_int mana;
sh_int max_mana; /* Max mana for PC/NPC */
sh_int hit;
sh_int max_hit; /* Max hit for PC/NPC */
sh_int move;
sh_int max_move; /* Max move for PC/NPC */
sh_int armor; /* Internal -100..100, external -10..10 AC */
int gold; /* Money carried */
int bank_gold; /* Gold the char has in a bank account */
int exp; /* The experience of the player */
sbyte hitroll; /* Any bonus or penalty to the hit roll */
sbyte damroll; /* Any bonus or penalty to the damage roll */
};
struct char_special_data_saved {
int alignment; /* +-1000 for alignments */
long idnum; /* player's idnum; -1 for mobiles */
long /*bitvector_t*/ act; /* act flag for NPC's; player flag for PC's */
long /*bitvector_t*/ affected_by;
/* Bitvector for spells/skills affected by */
sh_int apply_saving_throw[5]; /* Saving throw (Bonuses) */
};
struct char_special_data {
struct char_data *fighting; /* Opponent */
struct char_data *hunting; /* Char hunted by this char */
byte position; /* Standing, fighting, sleeping, etc. */
int carry_weight; /* Carried weight */
byte carry_items; /* Number of items carried */
int timer; /* Timer for update */
struct char_special_data_saved saved; /* constants saved in plrfile */
};
struct player_special_data_saved {
byte skills[MAX_SKILLS+1]; /* array of skills plus skill 0 */
byte PADDING0; /* used to be spells_to_learn */
bool talks[MAX_TONGUE]; /* PC s Tongues 0 for NPC */
int wimp_level; /* Below this # of hit points, flee! */
byte freeze_level; /* Level of god who froze char, if any */
byte freeze_auth;
sh_int invis_level; /* level of invisibility */
sh_int invis_auth;
room_vnum load_room; /* Which room to place char in */
long /*bitvector_t*/ pref; /* preference flags for PC's. */
ubyte bad_pws; /* number of bad password attemps */
sbyte conditions[3]; /* Drunk, full, thirsty */
/* spares below for future expansion. You can change the names from
'sparen' to something meaningful, but don't change the order. */
ubyte spare0;
ubyte spare1;
ubyte spare2;
ubyte spare3;
ubyte spare4;
ubyte spare5;
int spells_to_learn; /* How many can you learn yet this level*/
int spare7;
int spare8;
int spare9;
int spare10;
int spare11;
int spare12;
int spare13;
int spare14;
int spare15;
int spare16;
long spare17;
long spare18;
long spare19;
long spare20;
long spare21;
};
struct player_special_data {
struct player_special_data_saved saved;
char *poofin; /* Description on arrival of a god. */
char *poofout; /* Description upon a god's exit. */
struct alias_data *aliases; /* Character's aliases */
long last_tell; /* idnum of last tell from */
void *last_olc_targ; /* olc control */
int last_olc_mode; /* olc control */
};
struct mob_special_data {
memory_rec *memory; /* List of attackers to remember */
byte attack_type; /* The Attack Type Bitvector for NPC's */
byte default_pos; /* Default position for NPC */
byte damnodice; /* The number of damage dice's */
byte damsizedice; /* The size of the damage dice's */
};
struct char_data {
int pfilepos; /* playerfile pos */
mob_rnum nr; /* Mob's rnum */
room_rnum in_room; /* Location (real room number) */
room_rnum was_in_room; /* location for linkdead people */
int wait; /* wait for how many loops */
struct char_player_data player; /* Normal data */
struct char_ability_data real_abils; /* Abilities without modifiers */
struct char_ability_data aff_abils; /* Abils with spells/stones/etc */
struct char_point_data points; /* Points */
struct char_special_data char_specials; /* PC/NPC specials */
struct player_special_data *player_specials; /* PC specials */
struct mob_special_data mob_specials; /* NPC specials */
struct affected_type *affected; /* affected by what spells */
struct obj_data *equipment[NUM_WEARS];/* Equipment array */
struct obj_data *carrying; /* Head of list */
struct descriptor_data *desc; /* NULL for mobiles */
struct char_data *next_in_room; /* For room->people - list */
struct char_data *next; /* For either monster or ppl-list */
struct char_data *next_fighting; /* For fighting list */
struct follow_type *followers; /* List of chars followers */
struct char_data *master; /* Who is char following? */
};
/*
* Element in monster and object index-tables.
*
* NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum)
*/
struct index_data {
mob_vnum vnum; /* virtual number of this mob/obj */
int number; /* number of existing units of this mob/obj */
SPECIAL(*func);
};
#endif /* __STRUCTS_H__ */