mud.h
wolfpaw4.0-release/source/betasrc/mud.h · 185.8 KB
From the archive Wolfpaw4.0-Release.tgz
Download the archive « Back to the archive contents
/****************************************************************************e
* [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame | \\._.// *
* -----------------------------------------------------------| (0...0) *
* SMAUG (C) 1994, 1995, 1996 by Derek Snider | ).:.( *
* -----------------------------------------------------------| {o o} *
* SMAUG code team: Thoric, Narn, Scryn, Haus, Swordbearer, | / ' ' \ *
* Altrag, Grishnakh and Tricops |~'~.VxvxV.~'~*
* ------------------------------------------------------------------------ *
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* ------------------------------------------------------------------------ *
* Main mud header file *
****************************************************************************/
#include <stdlib.h>
#include <limits.h>
#include <sys/cdefs.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <signal.h>
/*
#include <malloc.h>
*/
typedef int ch_ret;
typedef int obj_ret;
/*
* Accommodate old non-Ansi compilers.
*/
#if defined(TRADITIONAL)
#define const
#define args( list ) ( )
#define DECLARE_DO_FUN( fun ) void fun( )
#define DECLARE_SPEC_FUN( fun ) bool fun( )
#define DECLARE_SPELL_FUN( fun ) ch_ret fun( )
#else
#define args( list ) list
#define DECLARE_DO_FUN( fun ) DO_FUN fun
#define DECLARE_SPEC_FUN( fun ) SPEC_FUN fun
#define DECLARE_SPELL_FUN( fun ) SPELL_FUN fun
#endif
/*
* Short scalar types.
* Diavolo reports AIX compiler has bugs with short types.
*/
#if !defined(FALSE)
#define FALSE 0
#endif
#if !defined(TRUE)
#define TRUE 1
#endif
#if !defined(BERR)
#define BERR 255
#endif
#if defined(_AIX)
#if !defined(const)
#define const
#endif
typedef int sh_int;
typedef int bool;
#define unix
#else
typedef short int sh_int;
typedef unsigned char bool;
#endif
/*
* Structure types.
*/
typedef struct disabled_data DISABLED_DATA;
typedef struct affect_data AFFECT_DATA;
typedef struct area_data AREA_DATA;
typedef struct auction_data AUCTION_DATA; /* auction data */
typedef struct ban_data BAN_DATA;
typedef struct ban_data PERMBAN_DATA;
typedef struct extracted_char_data EXTRACT_CHAR_DATA;
typedef struct char_data CHAR_DATA;
typedef struct hunt_hate_fear HHF_DATA;
typedef struct fighting_data FIGHT_DATA;
typedef struct descriptor_data DESCRIPTOR_DATA;
typedef struct exit_data EXIT_DATA;
typedef struct extra_descr_data EXTRA_DESCR_DATA;
typedef struct help_data HELP_DATA;
typedef struct menu_data MENU_DATA;
typedef struct mob_index_data MOB_INDEX_DATA;
typedef struct note_data NOTE_DATA;
typedef struct mail_data MAIL_DATA;
typedef struct mode_data MODE_DATA;
typedef struct comment_data COMMENT_DATA;
typedef struct board_data BOARD_DATA;
typedef struct obj_data OBJ_DATA;
typedef struct zone_data ZONE_DATA;
typedef struct refferal_data REFFERAL_DATA;
typedef struct kombat_data KOMBAT_DATA;
typedef struct colormap_data COLORMAP_DATA;
typedef struct cmap_data CMAP_DATA;
typedef struct personalsocial_data PSOCIAL_DATA;
typedef struct psocial_data PSOC_DATA;
typedef struct offline_data OFFLINE_DATA;
typedef struct limit_data LIMIT_DATA;
typedef struct vehicle_data VEHICLE_DATA;
typedef struct petition_data PETITION_DATA;
typedef struct acc_data ACC_DATA;
typedef struct challenge_data CHALLENGE_DATA;
typedef struct arena_data ARENA_DATA;
typedef struct warrent_data WARRENT_DATA;
typedef struct obj_index_data OBJ_INDEX_DATA;
typedef struct pc_data PC_DATA;
typedef struct reset_data RESET_DATA;
typedef struct map_index_data MAP_INDEX_DATA; /* maps */
typedef struct map_data MAP_DATA; /* maps */
typedef struct room_index_data ROOM_INDEX_DATA;
typedef struct shop_data SHOP_DATA;
typedef struct repairshop_data REPAIR_DATA;
typedef struct time_info_data TIME_INFO_DATA;
typedef struct hour_min_sec HOUR_MIN_SEC;
typedef struct weather_data WEATHER_DATA;
typedef struct clan_data CLAN_DATA;
typedef struct council_data COUNCIL_DATA;
typedef struct tourney_data TOURNEY_DATA;
typedef struct mob_prog_data MPROG_DATA;
typedef struct mob_prog_act_list MPROG_ACT_LIST;
typedef struct editor_data EDITOR_DATA;
typedef struct teleport_data TELEPORT_DATA;
typedef struct timer_data TIMER;
typedef struct godlist_data GOD_DATA;
typedef struct system_data SYSTEM_DATA;
typedef struct smaug_affect SMAUG_AFF;
typedef struct who_data WHO_DATA;
typedef struct skill_type SKILLTYPE;
typedef struct social_type SOCIALTYPE;
typedef struct cmd_type CMDTYPE;
typedef struct killed_data KILLED_DATA;
typedef struct deity_data DEITY_DATA;
typedef struct wizent WIZENT;
typedef struct extended_bitvector EXT_BV;
typedef struct web_descriptor WEB_DESCRIPTOR;
typedef struct pk_data PK_DATA;
typedef struct pk_list PK_LIST;
typedef struct approve_data APPROVE_DATA;
typedef struct topten_data TOPTEN_DATA;
typedef struct host_data HOST_DATA;
typedef struct secure_data SECURE_DATA;
typedef struct secure_name SECURE_NAME;
/*
* Function types.
*/
typedef void DO_FUN args( ( CHAR_DATA *ch, char *argument ) );
typedef bool SPEC_FUN args( ( CHAR_DATA *ch ) );
typedef ch_ret SPELL_FUN args( ( int sn, int level, CHAR_DATA *ch, void *vo ) );
#define DUR_CONV 23.333333333333333333333333
#define HIDDEN_TILDE '*'
#define BV00 (1 << 0)
#define BV01 (1 << 1)
#define BV02 (1 << 2)
#define BV03 (1 << 3)
#define BV04 (1 << 4)
#define BV05 (1 << 5)
#define BV06 (1 << 6)
#define BV07 (1 << 7)
#define BV08 (1 << 8)
#define BV09 (1 << 9)
#define BV10 (1 << 10)
#define BV11 (1 << 11)
#define BV12 (1 << 12)
#define BV13 (1 << 13)
#define BV14 (1 << 14)
#define BV15 (1 << 15)
#define BV16 (1 << 16)
#define BV17 (1 << 17)
#define BV18 (1 << 18)
#define BV19 (1 << 19)
#define BV20 (1 << 20)
#define BV21 (1 << 21)
#define BV22 (1 << 22)
#define BV23 (1 << 23)
#define BV24 (1 << 24)
#define BV25 (1 << 25)
#define BV26 (1 << 26)
#define BV27 (1 << 27)
#define BV28 (1 << 28)
#define BV29 (1 << 29)
#define BV30 (1 << 30)
#define BV31 (1 << 31)
/* 32 USED! DO NOT ADD MORE! SB */
/* Menu Looks like ... --GW*/
#define MENU \
"&W\n\r\x1B[7mWelcome to [SOMEONE DIDNT CHANGE THIS :)]!\x1B[0m\n\r\n\
0] Exit the server.\n\r\
1] Enter the game.\n\r\
Pick one: "
#define SLASH "\\" /* SLASH needed by MSP routine */
#define DEATH_MENU \
"&R YOU HAVE BEEN KILLED!\n\r\n\
&BYou have 2 Choices here:\n\r\n\
Type 'Y' to Ressurect yourself, and lose 1 Con point.\n\r\
or\n\r\
Type 'N' to Not Ressurect yourself, and lose 1 Level.\n\r\n\
NOTE: Loss of Link at this time will cause you to NOT Ressurect\n\r\n\
Make your Selection: "
/* Moved from old clans.c so all files can use them --GW */
#define MAX_NEST 100
CLAN_DATA * first_clan;
CLAN_DATA * last_clan;
COUNCIL_DATA * first_council;
COUNCIL_DATA * last_council;
/*
* String and memory management parameters.
*/
#define MAX_KEY_HASH 2048
#define MAX_STRING_LENGTH 4096 /* buf */
#define MAX_INPUT_LENGTH 1024 /* arg */
#define MAX_INBUF_SIZE 1024
#define HASHSTR /* use string hashing */
/* in make file now */
#define MAX_LAYERS 8 /* maximum clothing layers */
#define MAX_KILLTRACK 25 /* track mob vnums killed */
/* Requests */
#define REQUESTS
/* Ctf --GW */
/* Guard Vnums */
#define CTF_BLUE_GUARD 21441
#define CTF_RED_GUARD 21440
/* Base Rooms */
#define CTF_RED_BASE 21321
#define CTF_BLUE_BASE 21307
/* Teams */
#define TEAM_RED 1
#define TEAM_BLUE 2
#define RED_FLAG_CARRIER 3
#define BLUE_FLAG_CARRIER 4
/* Flags */
#define CTF_RED_FLAG 21400
#define CTF_BLUE_FLAG 21401
/*
* Psionicist gsn's (by Thelonius).
*/
extern int gsn_chameleon;
extern int gsn_domination;
extern int gsn_heighten;
extern int gsn_shadow;
/*
* Game parameters.
* Increase the max'es if you add more of something.
* Adjust the pulse numbers to suit yourself.
* adjust them in the DB (wolfpaw.dat) .. here doesnt matter for
* the ones marked DB.. it changes them. --GW
*/
#define MAXDATA 1024
#define MSL MAX_STRING_LENGTH
#define MIL MAX_INPUT_LENGTH
#define RESTART_COMMAND "/home/aota/aoa/src/AOTA"
#define MAX_EXP_WORTH 160000000
#define MIN_EXP_WORTH 1
#define MAX_REXITS 20 /* Maximum exits allowed in 1 room */
#define MAX_SKILL 400 /* DB Loaded */
#define MAX_CLASS 28 /* Increased to 28 for Mystic -GW*/
#define MAX_NPC_CLASS 44
#define MAX_RACE 24 /* Increased to 24 for new races GW*/
#define MAX_NPC_RACE 96
#define MAX_LEVEL 60
#define MAX_MOB_LEVEL 200
#define MAX_ALIAS 20 /* max alias */
#define MAX_IGNORE 20 /* max ignore */
#define MAX_CLAN 50
#define MAX_DEITY 50
#define MAX_CPD 16 /* Maximum council power level difference */
#define MAX_COM 10 /* maximum commands kept (for history)*/
#define MAX_HERB 20
#define WEBPORT 5002
#define MASTER_PASSWORD "GrKo6TakNHaFc"
#define LEVEL_OVERSEER MAX_LEVEL
#define LEVEL_HYPERION (MAX_LEVEL-1)
#define LEVEL_COUNCIL (MAX_LEVEL-2)
#define LEVEL_HEAD_GOD (MAX_LEVEL-3)
#define LEVEL_GOD (MAX_LEVEL-4)
#define LEVEL_FATE (MAX_LEVEL-5)
#define LEVEL_TITAN (MAX_LEVEL-6)
#define LEVEL_LORD (MAX_LEVEL-7)
#define LEVEL_WIZARD (MAX_LEVEL-8)
#define LEVEL_EMPATH (MAX_LEVEL-9)
#define LEVEL_IMMORTAL (MAX_LEVEL-9)
#define LEVEL_AVATAR (MAX_LEVEL-10)
#define LEVEL_LOG LEVEL_FATE
/*#define PULSE_PER_SECOND 4 -- in comm.c. now */
#define PULSE_VIOLENCE ( 3 * PULSE_PER_SECOND)
#define PULSE_MOBILE ( 4 * PULSE_PER_SECOND)
#define PULSE_TICK (35 * PULSE_PER_SECOND)
#define PULSE_AREA (60 * PULSE_PER_SECOND)
#define PULSE_AUCTION (10 * PULSE_PER_SECOND)
#define send_to_char send_to_char_color
#define send_to_pager send_to_pager_color
/*
* Command logging types.
*/
typedef enum
{
LOG_NORMAL, LOG_ALWAYS, LOG_NEVER, LOG_BUILD, LOG_HIGH, LOG_COMM, LOG_ALL
} log_types;
/*
* Return types for move_char, damage, greet_trigger, etc, etc
* Added by Thoric to get rid of bugs
*/
typedef enum
{
rNONE, rCHAR_DIED, rVICT_DIED, rBOTH_DIED, rCHAR_QUIT, rVICT_QUIT,
rBOTH_QUIT, rSPELL_FAILED, rOBJ_SCRAPPED, rOBJ_EATEN, rOBJ_EXPIRED,
rOBJ_TIMER, rOBJ_SACCED, rOBJ_QUAFFED, rOBJ_USED, rOBJ_EXTRACTED,
rOBJ_DRUNK, rCHAR_IMMUNE, rVICT_IMMUNE, rCHAR_AND_OBJ_EXTRACTED = 128,
rERROR = 255
} ret_types;
/* Echo types for echo_to_all */
#define ECHOTAR_ALL 0
#define ECHOTAR_PC 1
#define ECHOTAR_IMM 2
#define ECHOTAR_SOUND 3
/* defines for new do_who */
#define WT_MORTAL 0
#define WT_DEADLY 1
#define WT_IMM 2
/*
* Defines for extended bitvectors
*/
#ifndef INTBITS
#define INTBITS 32
#endif
#define XBM 31 /* extended bitmask ( INTBITS - 1 ) */
#define RSV 5 /* right-shift value ( sqrt(XBM+1) ) */
#define XBI 4 /* integers in an extended bitvector */
#define MAX_BITS XBI * INTBITS
/*
* Structure for extended bitvectors -- Thoric
*/
struct extended_bitvector
{
int bits[XBI];
};
/*
* do_who output structure -- Narn
*/
struct who_data
{
WHO_DATA *prev;
WHO_DATA *next;
char *text;
int type;
int ic;
};
/*
* Perm Site ban structure.
*/
/* ummm no, i don't think so.. what the hell is the point of this????
it's exactly the same as ban_data!!! pointless pointless pointless...
just add things to ban_data if needed for permbans, and ignore the
extra fields when doing normal bans... -- TRI
struct permban_data
{
PERMBAN_DATA * next;
PERMBAN_DATA * prev;
char * name;
int level;
char * ban_time;
char * ban_issuer;
};
*/
/*
* Site ban structure.
*/
struct ban_data
{
BAN_DATA * next;
BAN_DATA * prev;
char * name;
int level;
char * ban_time;
char * ban_issuer;
};
/*
* Time and weather stuff.
*/
typedef enum
{
SUN_DARK, SUN_RISE, SUN_LIGHT, SUN_SET
} sun_positions;
typedef enum
{
SKY_CLOUDLESS, SKY_CLOUDY, SKY_RAINING, SKY_LIGHTNING
} sky_conditions;
struct time_info_data
{
int hour;
int day;
int month;
int year;
};
struct hour_min_sec
{
int hour;
int min;
int sec;
int manual;
};
struct weather_data
{
int mmhg;
int change;
int sky;
int sunlight;
};
/*
* Structure used to build wizlist
*/
struct wizent
{
WIZENT * next;
WIZENT * last;
char * name;
sh_int level;
int flags;
};
/*
* Connected state for a channel.
*/
typedef enum
{
CON_GET_NAME = -100,
CON_GATEWAY,
CON_GET_ACC,
CON_GET_ACC_PASS,
CON_GET_OLD_PASSWORD,
CON_CONFIRM_NEW_NAME,
CON_GET_NEW_PASSWORD,
CON_CONFIRM_NEW_PASSWORD,
CON_GET_NEW_SEX,
CON_GET_NEW_CLASS,
CON_READ_MOTD,
CON_GET_NEW_RACE,
CON_GET_EMULATION,
CON_GET_WANT_RIPANSI,
CON_TITLE,
CON_PRESS_ENTER,
CON_WAIT_1,
CON_WAIT_2,
CON_WAIT_3,
CON_ACCEPTED,
CON_GET_PKILL,
CON_READ_IMOTD,
CON_COPYOVER_RECOVER,
CON_GET_NEW_REMORT_RACE,
CON_GET_NEW_REMORT_CLASS,
CON_PLAYER_MENU,
CON_GET_SELECTION,
CON_CHANGE_PASSWORD,
CON_DELETE_CHAR,
CON_CONFIRM_CHANGED_PASSWORD,
CON_CONFIRM_PASS,
CON_CONFIRM_DELETE,
CON_GET_EMAIL,
CON_GET_DEITY,
CON_CONFIRM_NEW_RACE,
CON_CONFIRM_NEW_CLASS,
CON_GET_REFFERAL,
CON_DEATH_SELECT,
CON_GREDITING,
CON_NMOTD_CONFIRM,
CON_GET_NAME_ENTER,
CON_PLAYING = 1,
CON_EDITING = -1
} connection_types;
/*
* Character substates
*/
typedef enum
{
SUB_NONE, SUB_PAUSE, SUB_PERSONAL_DESC, SUB_OBJ_SHORT, SUB_OBJ_LONG,
SUB_OBJ_EXTRA, SUB_MOB_LONG, SUB_MOB_DESC, SUB_ROOM_DESC, SUB_ROOM_EXTRA,
SUB_ROOM_EXIT_DESC, SUB_WRITING_NOTE, SUB_MPROG_EDIT, SUB_HELP_EDIT,
SUB_WRITING_MAP, SUB_PERSONAL_BIO, SUB_REPEATCMD, SUB_RESTRICTED,
SUB_DEITYDESC, SUB_REDIT_MAIN, SUB_REDIT_RNAME, SUB_REDIT_ROOMDESC,
SUB_REDIT_ROOMFLAGS, SUB_REDIT_SECTOR, SUB_REDIT_EXIT_N,
SUB_REDIT_EXIT_E, SUB_REDIT_EXIT_S, SUB_REDIT_EXIT_W, SUB_REDIT_EXIT_U,
SUB_REDIT_EXIT_D, SUB_REDIT_EXTRA_DESC,
/* timer types ONLY below this point */
SUB_TIMER_DO_ABORT = 128, SUB_TIMER_CANT_ABORT
} char_substates;
/*
* Descriptor (channel) structure.
*/
struct descriptor_data
{
DESCRIPTOR_DATA * next;
DESCRIPTOR_DATA * prev;
DESCRIPTOR_DATA * snoop_by;
CHAR_DATA * character;
CHAR_DATA * original;
char * host;
int port;
int descriptor;
sh_int connected;
sh_int idle;
sh_int lines;
sh_int scrlen;
bool fcommand;
char inbuf [MAX_INBUF_SIZE];
char incomm [MAX_INPUT_LENGTH];
char inlast [MAX_INPUT_LENGTH];
int repeat;
char * outbuf;
unsigned long outsize;
int outtop;
char * pagebuf;
unsigned long pagesize;
int pagetop;
char * pagepoint;
char pagecmd;
char pagecolor;
int auth_inc;
int auth_state;
char abuf[ 256 ];
int auth_fd;
char * user;
int atimes;
int newstate;
unsigned char prevcolor;
};
/*
* Attribute bonus structures.
*/
struct str_app_type
{
sh_int tohit;
sh_int todam;
sh_int carry;
sh_int wield;
};
struct int_app_type
{
sh_int learn;
};
struct wis_app_type
{
sh_int practice;
};
struct dex_app_type
{
sh_int defensive;
};
struct con_app_type
{
sh_int hitp;
sh_int shock;
};
struct cha_app_type
{
sh_int charm;
};
struct lck_app_type
{
sh_int luck;
};
/* the races */
#define RACE_HUMAN 0
#define RACE_ELF 1
#define RACE_DWARF 2
#define RACE_HALFLING 3
#define RACE_PIXIE 4
#define RACE_VAMPIRE 5
#define RACE_HALF_OGRE 6
#define RACE_HALF_ORC 7
#define RACE_HALF_TROLL 8
#define RACE_HALF_ELF 9
#define RACE_GITH 10
#define RACE_WAREWOLF 11
#define RACE_DRACONIAN 12
#define RACE_SATYR 13
#define RACE_WRAITH 14
#define RACE_CENTAUR 15
#define RACE_DRIDER 16
#define RACE_DROW 17
#define RACE_MINOTAUR 18
#define RACE_CYCLOPS 19
#define RACE_AREWYNDEL 20
#define RACE_BROWNIE 21
#define RACE_LEPRACHAUN 22
#define RACE_MRRSHAN 23
/* npc races */
#define RACE_DRAGON 31
#define CLASS_NONE -1 /* For skill/spells according to guild */
#define CLASS_MAGE 0
#define CLASS_CLERIC 1
#define CLASS_THIEF 2
#define CLASS_WARRIOR 3
#define CLASS_VAMPIRE 4
#define CLASS_DRUID 5
#define CLASS_RANGER 6
#define CLASS_AUGURER 7 /* 7-7-96 SB */
#define CLASS_PALADIN 8
#define CLASS_ASSASSIN 9
#define CLASS_WEREWOLF 10
#define CLASS_KINJU 11
#define CLASS_AVATAR 12
#define CLASS_PSIONICIST 13
#define CLASS_DRAGON 14
#define CLASS_BERSERKER 15
#define CLASS_ARCHMAGE 16
#define CLASS_BISHOP 17
#define CLASS_ALCHEMIST 18
#define CLASS_PROPHET 19
#define CLASS_CRUSADER 20
#define CLASS_SAMURAI 21
#define CLASS_WRAITH 22
#define CLASS_HUNTER 23
#define CLASS_ADEPT 24
#define CLASS_NINJA 25
#define CLASS_JACKEL 26
#define CLASS_MYSTIC 27
/*
* Languages -- Altrag
*/
#define LANG_COMMON BV00 /* Human base language */
#define LANG_ELVEN BV01 /* Elven base language */
#define LANG_DWARVEN BV02 /* Dwarven base language */
#define LANG_PIXIE BV03 /* Pixie/Fairy base language */
#define LANG_OGRE BV04 /* Ogre base language */
#define LANG_ORCISH BV05 /* Orc base language */
#define LANG_TROLLISH BV06 /* Troll base language */
#define LANG_LEPRACHAUN BV07 /* Was Rodent munched cuase it's never used */
#define LANG_INSECTOID BV08 /* Insects */
#define LANG_MAMMAL BV09 /* Larger mammals */
#define LANG_MRRSHAN BV10 /* Was Reptile munched for above reason */
#define LANG_DRAGON BV11 /* Large reptiles, Dragons */
#define LANG_SPIRITUAL BV12 /* Necromancers or undeads/spectres */
#define LANG_MAGICAL BV13 /* Spells maybe? Magical creatures */
#define LANG_GOBLIN BV14 /* Goblin base language */
#define LANG_GOD BV15 /* Clerics possibly? God creatures */
#define LANG_ANCIENT BV16 /* Prelude to a glyph read skill? */
#define LANG_HALFLING BV17 /* Halfling base language */
#define LANG_CLAN BV18 /* Clan language */
#define LANG_GITH BV19 /* Gith Language */
#define LANG_VAMPIRIC BV20 /* Vampire Language */
#define LANG_WOLFISH BV21 /* Werewolf Language */
#define LANG_DRACONIAN BV22 /* Draconian Language */
#define LANG_SATYR BV23 /* What is a satyr anyway */
#define LANG_WRAITH BV24 /* Wraith Language */
#define LANG_CENTAUR BV25 /* Centaur Language */
#define LANG_DRIDER BV26 /* Drider Language */
#define LANG_DROWISH BV27 /* Dark Elf Language */
#define LANG_MINOTAUR BV28 /* Minotaur Language */
#define LANG_CYCLOPS BV29 /* Cyclops Language */
#define LANG_AREWYNDEL BV30 /* Arewyndel Language */
#define LANG_BROWNIE BV31 /* Brownie Language */
#define LANG_UNKNOWN 0 /* Anything that doesnt fit a category */
/*
* This Wrapping error every compile is pising me off .. fixed it. -- GW
*/
#define V_L_1 ( LANG_COMMON | LANG_ELVEN | LANG_DWARVEN | LANG_PIXIE )
#define V_L_2 ( LANG_OGRE | LANG_ORCISH | LANG_TROLLISH | LANG_LEPRACHAUN )
#define V_L_3 ( LANG_MRRSHAN | LANG_GOBLIN | LANG_HALFLING | LANG_GITH )
#define V_L_4 ( LANG_VAMPIRIC | LANG_WOLFISH | LANG_DRACONIAN | LANG_SATYR )
#define V_L_5 ( LANG_WRAITH | LANG_CENTAUR | LANG_DRIDER | LANG_DROWISH )
#define V_L_6 ( LANG_MINOTAUR | LANG_CYCLOPS | LANG_AREWYNDEL | LANG_BROWNIE )
#define V_L_7 ( LANG_LEPRACHAUN | LANG_MRRSHAN )
#define VALID_LANGS ( V_L_1 | V_L_2 | V_L_3 | V_L_4 | V_L_5 | V_L_6 | V_L_7 )
/* 26 Languages */
/*
* TO types for act.
*/
#define TO_ROOM 0
#define TO_NOTVICT 1
#define TO_VICT 2
#define TO_CHAR 3
/*
* Real action "TYPES" for act.
*/
#define AT_BLACK 0
#define AT_BLOOD 1
#define AT_DGREEN 2
#define AT_ORANGE 3
#define AT_DBLUE 4
#define AT_PURPLE 5
#define AT_CYAN 6
#define AT_GREY 7
#define AT_DGREY 8
#define AT_RED 9
#define AT_GREEN 10
#define AT_YELLOW 11
#define AT_BLUE 12
#define AT_PINK 13
#define AT_LBLUE 14
#define AT_WHITE 15
#define AT_BLINK 16
#define AT_PLAIN AT_GREY
#define AT_ACTION AT_GREY
#define AT_SAY AT_LBLUE
#define AT_GOSSIP AT_LBLUE
#define AT_YELL AT_WHITE
#define AT_TELL AT_WHITE
#define AT_HIT AT_GREEN
#define AT_HITME AT_RED
#define AT_IMMORT AT_YELLOW
#define AT_HURT AT_RED + AT_BLINK
#define AT_FALLING AT_WHITE + AT_BLINK
#define AT_DANGER AT_RED + AT_BLINK
#define AT_MAGIC AT_BLUE
#define AT_CONSIDER AT_GREY
#define AT_REPORT AT_GREY
#define AT_POISON AT_GREEN
#define AT_SOCIAL AT_CYAN
#define AT_DYING AT_YELLOW
#define AT_DEAD AT_RED
#define AT_SKILL AT_GREEN
#define AT_CARNAGE AT_BLOOD
#define AT_DAMAGE AT_WHITE
#define AT_FLEE AT_YELLOW
#define AT_RMNAME AT_WHITE
#define AT_RMDESC AT_YELLOW
#define AT_OBJECT AT_GREEN
#define AT_PERSON AT_PINK
#define AT_LIST AT_BLUE
#define AT_BYE AT_GREEN
#define AT_GOLD AT_YELLOW
#define AT_GTELL AT_BLUE
#define AT_NOTE AT_GREEN
#define AT_HUNGRY AT_ORANGE
#define AT_THIRSTY AT_BLUE
#define AT_FIRE AT_RED
#define AT_SOBER AT_WHITE
#define AT_WEAROFF AT_YELLOW
#define AT_EXITS AT_WHITE
#define AT_SCORE AT_LBLUE
#define AT_RESET AT_DGREEN
#define AT_LOG AT_PURPLE
#define AT_DIEMSG AT_WHITE
#define AT_WARTALK AT_RED
/* INVERSE code .. and UNINVERSE --GW */
#define INVERSE "\x1B[7m"
#define UINVERSE "\x1B[0m"
#define INIT_WEAPON_CONDITION 12
#define MAX_ITEM_IMPACT 30
/* Martial Arts 'Ratings' */
#define MA_WHITE_SASH 0
#define MA_WHITE_YELLOW_SASH 1
#define MA_YELLOW_SASH 2
#define MA_YELLOW_GREEN_SASH 3
#define MA_GREEN_SASH 4
#define MA_GREEN_BLUE_SASH 5
#define MA_BLUE_SASH 6
#define MA_BLUE_RED_SASH 7
#define MA_RED_SASH 8
#define MA_RED_BLACK_SASH 9
#define MA_BLACK_SASH 10
#define MA_APPRENTICE_SASH 11
#define MA_ADEPT_SASH 12
#define MA_MASTERY_SASH 13
/*
* Help table types.
*/
struct help_data
{
HELP_DATA * next;
HELP_DATA * prev;
sh_int level;
char * keyword;
char * text;
char * update;
};
/*
* Shop types.
*/
#define MAX_TRADE 5
struct shop_data
{
SHOP_DATA * next; /* Next shop in list */
SHOP_DATA * prev; /* Previous shop in list */
int keeper; /* Vnum of shop keeper mob */
sh_int buy_type [MAX_TRADE]; /* Item types shop will buy */
sh_int profit_buy; /* Cost multiplier for buying */
sh_int profit_sell; /* Cost multiplier for selling */
sh_int open_hour; /* First opening hour */
sh_int close_hour; /* First closing hour */
};
#define MAX_FIX 4
#define SHOP_FIX 1
#define SHOP_RECHARGE 2
struct repairshop_data
{
REPAIR_DATA * next; /* Next shop in list */
REPAIR_DATA * prev; /* Previous shop in list */
int keeper; /* Vnum of shop keeper mob */
sh_int fix_type [MAX_FIX]; /* Item types shop will fix */
sh_int profit_fix; /* Cost multiplier for fixing */
sh_int shop_type; /* Repair shop type */
sh_int open_hour; /* First opening hour */
sh_int close_hour; /* First closing hour */
};
/* Mob program structures */
struct act_prog_data
{
struct act_prog_data *next;
void *vo;
};
struct mob_prog_act_list
{
MPROG_ACT_LIST * next;
char * buf;
CHAR_DATA * ch;
OBJ_DATA * obj;
void * vo;
};
struct mob_prog_data
{
MPROG_DATA * next;
int type;
bool triggered;
int resetdelay;
char * arglist;
char * comlist;
};
bool MOBtrigger;
#define CLASS_TYPE_MAGIC 0
#define CLASS_TYPE_FIGHTER 1
#define CLASS_TYPE_EXCLUDE 2
/* Ac types */
#define AC_TYPE_PURE_FIGHTER 0
#define AC_TYPE_PURE_MAGIC_USER 1
#define AC_TYPE_HALFLING 2
/*
* Per-class stuff.
*/
struct class_type
{
char * who_name; /* Name for 'who' */
char * filename; /* Filename --GW */
sh_int attr_prime; /* Prime attribute */
int weapon; /* First weapon */
int guild; /* Vnum of guild room */
sh_int skill_adept; /* Maximum skill level */
sh_int thac0_00; /* Thac0 for level 0 */
sh_int thac0_32; /* Thac0 for level 32 */
sh_int hp_min; /* Min hp gained on leveling */
sh_int hp_max; /* Max hp gained on leveling */
bool fMana; /* Class gains mana on level */
sh_int exp_base; /* Class base exp */
sh_int type; /* Class Type (Magic/Fighter) --GW */
};
/* race dedicated stuff */
struct race_type
{
char * race_name; /* Race name */
EXT_BV affected; /* Default affect bitvectors */
int number; /* race number */
sh_int str_plus; /* Str bonus/penalty */
sh_int dex_plus; /* Dex " */
sh_int wis_plus; /* Wis " */
sh_int int_plus; /* Int " */
sh_int con_plus; /* Con " */
sh_int cha_plus; /* Cha " */
sh_int lck_plus; /* Lck " */
sh_int hit;
sh_int mana;
sh_int resist;
sh_int suscept;
int class_restriction; /* Flags for illegal classes */
int language; /* Default racial language */
};
typedef enum {
CLAN_PLAIN, CLAN_VAMPIRE, CLAN_WARRIOR, CLAN_DRUID, CLAN_MAGE, CLAN_CELTIC,
CLAN_THIEF, CLAN_CLERIC, CLAN_UNDEAD, CLAN_CHAOTIC, CLAN_NEUTRAL, CLAN_LAWFUL,
CLAN_NOKILL, CLAN_ORDER, CLAN_GUILD } clan_types;
typedef enum { GROUP_CLAN, GROUP_COUNCIL, GROUP_GUILD } group_types;
/*
* Damage types from the attack_table[]
*/
typedef enum
{
DAM_HIT, DAM_SLICE, DAM_STAB, DAM_SLASH, DAM_WHIP, DAM_CLAW,
DAM_BLAST, DAM_POUND, DAM_CRUSH, DAM_GREP, DAM_BITE, DAM_PIERCE,
DAM_SUCTION, DAM_BOLT, DAM_ARROW, DAM_DART, DAM_STONE, DAM_PEA
} damage_types;
struct clan_data
{
CLAN_DATA * next; /* next clan in list */
CLAN_DATA * prev; /* previous clan in list */
char * filename; /* Clan filename */
char * name; /* Clan name */
char * fullname; /* FULL Name, for new clan member --GW */
char * whoname; /* Clan Who name -- GW */
char * motto; /* Clan motto */
char * description; /* A brief description of the clan */
char * deity; /* Clan's deity */
char * leader; /* Head clan leader */
char * associate; /* Associated Clans (chare hall and channel */
int pkills; /* Number of pkills on behalf of clan */
int pdeaths; /* Number of pkills against clan */
int mkills; /* Number of mkills on behalf of clan */
int mdeaths; /* Number of clan deaths due to mobs */
int illegal_pk; /* Number of illegal pk's by clan */
int score; /* Overall score */
sh_int clan_type; /* See clan type defines */
sh_int favour; /* Deities favour upon the clan */
sh_int strikes; /* Number of strikes against the clan */
sh_int members; /* Number of clan members */
sh_int alignment; /* Clan's general alignment */
int board; /* Vnum of clan board */
int clanobj1; /* Vnum of first clan obj (ring) */
int clanobj2; /* Vnum of second clan obj (shield) */
int clanobj3; /* Vnum of third clan obj (weapon) */
int recall; /* Vnum of clan's recall room */
int storeroom; /* Vnum of clan's store room */
int guard1; /* Vnum of clan guard type 1 */
int guard2; /* Vnum of clan guard type 2 */
int class; /* For guilds */
int morgue; /* for morgue's -Greywolf */
PK_DATA *pkdata; /* PK Records --GW */
};
struct pk_data
{
PK_LIST *first_clan;
PK_LIST *last_clan;
};
struct pk_list
{
PK_LIST *next;
PK_LIST *prev;
char *name;
int pkills;
};
struct council_data
{
COUNCIL_DATA * next; /* next council in list */
COUNCIL_DATA * prev; /* previous council in list */
char * filename; /* Council filename */
char * name; /* Council name */
char * description; /* A brief description of the council */
char * head; /* Council head */
char * powers; /* Council powers */
sh_int members; /* Number of council members */
int board; /* Vnum of council board */
int meeting; /* Vnum of council's meeting room */
};
struct deity_data
{
DEITY_DATA * next;
DEITY_DATA * prev;
char * filename;
char * name;
char * description;
sh_int alignment;
sh_int worshippers;
sh_int scorpse;
sh_int sdeityobj;
sh_int savatar;
sh_int recall;
sh_int flee;
sh_int flee_npcrace;
sh_int flee_npcfoe;
sh_int kill;
sh_int kill_magic;
sh_int kill_npcrace;
sh_int kill_npcfoe;
sh_int sac;
sh_int bury_corpse;
sh_int aid_spell;
sh_int aid;
sh_int backstab;
sh_int steal;
sh_int die;
sh_int die_npcrace;
sh_int die_npcfoe;
sh_int spell_aid;
sh_int dig_corpse;
int race;
int class;
int element;
int sex;
int avatar;
int deityobj;
EXT_BV affected;
int npcrace;
int npcfoe;
int suscept;
};
struct tourney_data
{
int open;
int low_level;
int hi_level;
};
/*
* Data structure for notes.
*/
struct note_data
{
NOTE_DATA * next;
NOTE_DATA * prev;
char * sender;
char * date;
char * to_list;
char * subject;
int voting;
char * yesvotes;
char * novotes;
char * abstentions;
char * text;
};
/*
* Game Mode Data --GW
*/
struct mode_data
{
MODE_DATA * next;
MODE_DATA * prev;
char * name;
char * desc;
char * long_desc;
char * who;
char * date;
int flags;
};
/*
* Data structure for mail system.
*/
struct mail_data
{
MAIL_DATA * next;
MAIL_DATA * prev;
char * sender;
char * date;
char * to;
char * subject;
char * text;
int read;
};
struct board_data
{
BOARD_DATA * next; /* Next board in list */
BOARD_DATA * prev; /* Previous board in list */
NOTE_DATA * first_note; /* First note on board */
NOTE_DATA * last_note; /* Last note on board */
char * note_file; /* Filename to save notes to */
char * read_group; /* Can restrict a board to a */
char * post_group; /* council, clan, guild etc */
char * extra_readers; /* Can give read rights to players */
char * extra_removers; /* Can give remove rights to players */
int board_obj; /* Vnum of board object */
sh_int num_posts; /* Number of notes on this board */
sh_int min_read_level; /* Minimum level to read a note */
sh_int min_post_level; /* Minimum level to post a note */
sh_int min_remove_level; /* Minimum level to remove a note */
sh_int max_posts; /* Maximum amount of notes allowed */
int type; /* Normal board or mail board? */
};
/*
* An affect.
*/
struct affect_data
{
AFFECT_DATA * next;
AFFECT_DATA * prev;
sh_int type;
sh_int duration;
sh_int location;
int modifier;
EXT_BV bitvector;
};
/*
* A SMAUG spell
*/
struct smaug_affect
{
SMAUG_AFF * next;
char * duration;
sh_int location;
char * modifier;
int bitvector;
};
/***************************************************************************
* *
* VALUES OF INTEREST TO AREA BUILDERS *
* (Start of section ... start here) *
* *
***************************************************************************/
/*
* Well known mob virtual numbers.
* Defined in #MOBILES.
*/
#define MOB_VNUM_CITYGUARD 30653
#define MOB_VNUM_VAMPIRE 3404
#define MOB_VNUM_ANIMATED_CORPSE 5
#define MOB_VNUM_POLY_WOLF 10
#define MOB_VNUM_POLY_MIST 11
#define MOB_VNUM_POLY_BAT 12
#define MOB_VNUM_POLY_HAWK 13
#define MOB_VNUM_POLY_CAT 14
#define MOB_VNUM_POLY_DOVE 15
#define MOB_VNUM_POLY_FISH 16
/*
* ACT bits for mobs.
* Used in #MOBILES.
*/
#define ACT_IS_NPC BV00 /* Auto set for mobs */
#define ACT_SENTINEL BV01 /* Stays in one room */
#define ACT_SCAVENGER BV02 /* Picks up objects */
#define ACT_AGGRESSIVE BV05 /* Attacks PC's */
#define ACT_STAY_AREA BV06 /* Won't leave area */
#define ACT_WIMPY BV07 /* Flees when hurt */
#define ACT_PET BV08 /* Auto set for pets */
#define ACT_POSTMASTER BV09 /* Can Accept/Give out mail */
#define ACT_PRACTICE BV10 /* Can practice PC's */
#define ACT_IMMORTAL BV11 /* Cannot be killed */
#define ACT_DEADLY BV12 /* Has a deadly poison */
#define ACT_META_AGGR BV13 /* Can Open Lockers */
#define ACT_LOCKER BV14 /* Extremely aggressive */
#define ACT_GUARDIAN BV15 /* Protects master */
#define ACT_RUNNING BV16 /* Hunts quickly */
#define ACT_NOWANDER BV17 /* Doesn't wander */
#define ACT_MOUNTABLE BV18 /* Can be mounted */
#define ACT_MOUNTED BV19 /* Is mounted */
#define ACT_SCHOLAR BV20 /* Can teach languages */
#define ACT_SECRETIVE BV21 /* actions aren't seen */
#define ACT_POLYMORPHED BV22 /* Mob is a ch */
#define ACT_MOBINVIS BV23 /* Like wizinvis */
#define ACT_NOASSIST BV24 /* Doesn't assist mobs */
#define ACT_QUESTTARGET BV25 /* is a quest target --GW */
#define ACT_NOTRACK BV26 /* no_track --GW */
#define ACT_SELL_TO_ALL BV27 /* sell to kilers --GW */
#define ACT_CREATE_LIFE_MOB BV28 /* Create Life Mobile --GW */
#define ACT_PROTOTYPE BV30 /* A prototype mob */
#define ACT_BANKER BV31
/* 20 acts */
/*
* ch->acttwo bits, FOR NPC MOBS ONLY!!! --GW
*/
#define ACT2_NONE BV00
#define ACT2_BWEST BV01
#define ACT2_BEAST BV02
#define ACT2_BNORTH BV03
#define ACT2_BSOUTH BV04
#define ACT2_BUP BV05
#define ACT2_BDOWN BV06
#define ACT2_SEVERED BV07
#define ACT2_SEE_CLOAK BV08
#define ACT2_ACID_REPAIR BV09
/* DONOT go past BV31 */
/*
* Bits for MOREPC_FLAGS -- PC ONLY --GW
*/
#define MOREPC_INCOG BV00
#define MOREPC_WAR BV01
#define MOREPC_OUTWAR BV02
#define MOREPC_SIGNEDPKILL BV03
#define MOREPC_SETSTART BV04
#define MOREPC_STARTINVIS BV05
#define MOREPC_SAFETY BV06
#define MOREPC_FREELOOT BV07
#define MOREPC_CORPSELOOTER BV08
#define MOREPC_LOCKERLOOTER BV09
#define MOREPC_TOWNOUTCAST BV10
#define MOREPC_ARRESTED BV11
#define MOREPC_NAME_SET BV12
#define MOREPC_ABDUCTING BV13
#define MOREPC_ALIENS BV14
#define MOREPC_ETERNAL_PK BV15
#define MOREPC_HOARDER BV16
#define MOREPC_IC BV17
#define MOREPC_OWNED BV18
#define MOREPC_SITE_LOCK BV19
#define MOREPC_CTF BV20
#define MOREPC_KNIGHT BV21
#define MOREPC_AFFMSGS BV22
#define MOREPC_NOSPAM BV23
#define MOREPC_NO_LIMIT_CNT BV24
/* donot go past 31! --GW */
/*
* Bits for 'affected_by'.
* Used in #MOBILES.
*/
typedef enum
{
AFF_BLIND,AFF_INVISIBLE,AFF_DETECT_EVIL,AFF_DETECT_INVIS,AFF_DETECT_MAGIC,
AFF_DETECT_HIDDEN,AFF_REFLECT_MAGIC,AFF_SANCTUARY,AFF_FAERIE_FIRE,AFF_INFRARED,
AFF_CURSE,AFF_BOUNTY,AFF_POISON,AFF_PROTECT,AFF_PARALYSIS,AFF_SNEAK,AFF_HIDE,
AFF_SLEEP,AFF_CHARM,AFF_FLYING,AFF_PASS_DOOR,AFF_FLOATING,AFF_TRUESIGHT,AFF_DETECTTRAPS,
AFF_SCRYING,AFF_FIRESHIELD,AFF_SHOCKSHIELD,AFF_CLOAK,AFF_ICESHIELD,AFF_POSSESS,
AFF_BERSERK,AFF_AQUA_BREATH,AFF_MERLINS_ROBE,AFF_GHOST,AFF_REFLECT_DAMAGE,
MAX_AFFECTED_BY
} affected_by_types;
/*
* Resistant Immune Susceptible flags
*/
#define RIS_FIRE BV00
#define RIS_COLD BV01
#define RIS_ELECTRICITY BV02
#define RIS_ENERGY BV03
#define RIS_BLUNT BV04
#define RIS_PIERCE BV05
#define RIS_SLASH BV06
#define RIS_ACID BV07
#define RIS_POISON BV08
#define RIS_DRAIN BV09
#define RIS_SLEEP BV10
#define RIS_CHARM BV11
#define RIS_HOLD BV12
#define RIS_NONMAGIC BV13
#define RIS_PLUS1 BV14
#define RIS_PLUS2 BV15
#define RIS_PLUS3 BV16
#define RIS_PLUS4 BV17
#define RIS_PLUS5 BV18
#define RIS_PLUS6 BV19
#define RIS_MAGIC BV20
#define RIS_PARALYSIS BV21
#define RIS_GAS_BREATH BV22
/* 21 RIS's*/
/*
* Attack types
*/
#define ATCK_BITE BV00
#define ATCK_CLAWS BV01
#define ATCK_TAIL BV02
#define ATCK_STING BV03
#define ATCK_PUNCH BV04
#define ATCK_KICK BV05
#define ATCK_TRIP BV06
#define ATCK_BASH BV07
#define ATCK_STUN BV08
#define ATCK_GOUGE BV09
#define ATCK_BACKSTAB BV10
#define ATCK_FEED BV11
#define ATCK_DRAIN BV12
#define ATCK_FIREBREATH BV13
#define ATCK_FROSTBREATH BV14
#define ATCK_ACIDBREATH BV15
#define ATCK_LIGHTNBREATH BV16
#define ATCK_GASBREATH BV17
#define ATCK_POISON BV18
#define ATCK_NASTYPOISON BV19
#define ATCK_GAZE BV20
#define ATCK_BLINDNESS BV21
#define ATCK_CAUSESERIOUS BV22
#define ATCK_EARTHQUAKE BV23
#define ATCK_CAUSECRITICAL BV24
#define ATCK_CURSE BV25
#define ATCK_FLAMESTRIKE BV26
#define ATCK_HARM BV27
#define ATCK_FIREBALL BV28
#define ATCK_COLORSPRAY BV29
#define ATCK_WEAKEN BV30
#define ATCK_SPIRALBLAST BV31
/* 32 USED! DO NOT ADD MORE! SB */
/*
* Defense types
*/
#define DFND_PARRY BV00
#define DFND_DODGE BV01
#define DFND_HEAL BV02
#define DFND_CURELIGHT BV03
#define DFND_CURESERIOUS BV04
#define DFND_CURECRITICAL BV05
#define DFND_DISPELMAGIC BV06
#define DFND_DISPELEVIL BV07
#define DFND_SANCTUARY BV08
#define DFND_FIRESHIELD BV09
#define DFND_SHOCKSHIELD BV10
#define DFND_SHIELD BV11
#define DFND_BLESS BV12
#define DFND_STONESKIN BV13
#define DFND_TELEPORT BV14
#define DFND_MONSUM1 BV15
#define DFND_MONSUM2 BV16
#define DFND_MONSUM3 BV17
#define DFND_MONSUM4 BV18
#define DFND_DISARM BV19
#define DFND_ICESHIELD BV20
#define DFND_GRIP BV21
/* 21 def's */
/*
* Body parts
*/
#define PART_HEAD BV00
#define PART_ARMS BV01
#define PART_LEGS BV02
#define PART_HEART BV03
#define PART_BRAINS BV04
#define PART_GUTS BV05
#define PART_HANDS BV06
#define PART_FEET BV07
#define PART_FINGERS BV08
#define PART_EAR BV09
#define PART_EYE BV10
#define PART_LONG_TONGUE BV11
#define PART_EYESTALKS BV12
#define PART_TENTACLES BV13
#define PART_FINS BV14
#define PART_WINGS BV15
#define PART_TAIL BV16
#define PART_SCALES BV17
/* for combat */
#define PART_CLAWS BV18
#define PART_FANGS BV19
#define PART_HORNS BV20
#define PART_TUSKS BV21
#define PART_TAILATTACK BV22
#define PART_SHARPSCALES BV23
#define PART_BEAK BV24
#define PART_HAUNCH BV25
#define PART_HOOVES BV26
#define PART_PAWS BV27
#define PART_FORELEGS BV28
#define PART_FEATHERS BV29
/*
* SMART Flags --GW
*/
#define SMART_ATTACK_WEAK BV00
#define SMART_LOOTSAC BV01
#define SMART_CORPSESAC BV02
#define SMART_LOOTER BV03
#define SMART_ARCHMAGE BV04
#define SMART_BLADEMASTER BV05
#define SMART_BISHOP BV06
#define SMART_WRAITH BV07
#define SMART_MYSTIC BV08
#define SMART_NO_GET BV09
/*
* Autosave flags
*/
#define SV_DEATH BV00
#define SV_KILL BV01
#define SV_PASSCHG BV02
#define SV_DROP BV03
#define SV_PUT BV04
#define SV_GIVE BV05
#define SV_AUTO BV06
#define SV_ZAPDROP BV07
#define SV_AUCTION BV08
#define SV_GET BV09
#define SV_RECEIVE BV10
#define SV_IDLE BV11
#define SV_BACKUP BV12
/*
* Pipe flags
*/
#define PIPE_TAMPED BV01
#define PIPE_LIT BV02
#define PIPE_HOT BV03
#define PIPE_DIRTY BV04
#define PIPE_FILTHY BV05
#define PIPE_GOINGOUT BV06
#define PIPE_BURNT BV07
#define PIPE_FULLOFASH BV08
/*
* Skill/Spell flags The minimum BV *MUST* be 11!
*/
#define SF_WATER BV11
#define SF_EARTH BV12
#define SF_AIR BV13
#define SF_ASTRAL BV14
#define SF_AREA BV15 /* is an area spell */
#define SF_DISTANT BV16 /* affects something far away */
#define SF_REVERSE BV17
#define SF_SAVE_HALF_DAMAGE BV18 /* save for half damage */
#define SF_SAVE_NEGATES BV19 /* save negates affect */
#define SF_ACCUMULATIVE BV20 /* is accumulative */
#define SF_RECASTABLE BV21 /* can be refreshed */
#define SF_NOSCRIBE BV22 /* cannot be scribed */
#define SF_NOBREW BV23 /* cannot be brewed */
#define SF_GROUPSPELL BV24 /* only affects group members */
#define SF_OBJECT BV25 /* directed at an object */
#define SF_CHARACTER BV26 /* directed at a character */
#define SF_SECRETSKILL BV27 /* hidden unless learned */
#define SF_PKSENSITIVE BV28 /* much harder for plr vs. plr */
#define SF_STOPONFAIL BV29 /* stops spell on first failure */
typedef enum { SS_NONE, SS_POISON_DEATH, SS_ROD_WANDS, SS_PARA_PETRI,
SS_BREATH, SS_SPELL_STAFF } save_types;
#define ALL_BITS INT_MAX
#define SDAM_MASK ALL_BITS & ~(BV00 | BV01 | BV02)
#define SACT_MASK ALL_BITS & ~(BV03 | BV04 | BV05)
#define SCLA_MASK ALL_BITS & ~(BV06 | BV07 | BV08)
#define SPOW_MASK ALL_BITS & ~(BV09 | BV10)
typedef enum { SD_NONE, SD_FIRE, SD_COLD, SD_ELECTRICITY, SD_ENERGY, SD_ACID,
SD_POISON, SD_DRAIN } spell_dam_types;
typedef enum { SA_NONE, SA_CREATE, SA_DESTROY, SA_RESIST, SA_SUSCEPT,
SA_DIVINATE, SA_OBSCURE, SA_CHANGE } spell_act_types;
typedef enum { SP_NONE, SP_MINOR, SP_GREATER, SP_MAJOR } spell_power_types;
typedef enum { SC_NONE, SC_LUNAR, SC_SOLAR, SC_TRAVEL, SC_SUMMON,
SC_LIFE, SC_DEATH, SC_ILLUSION } spell_class_types;
/*
* Sex.
* Used in #MOBILES.
*/
typedef enum { SEX_NEUTRAL, SEX_MALE, SEX_FEMALE } sex_types;
typedef enum {
TRAP_TYPE_POISON_GAS = 1, TRAP_TYPE_POISON_DART, TRAP_TYPE_POISON_NEEDLE,
TRAP_TYPE_POISON_DAGGER, TRAP_TYPE_POISON_ARROW, TRAP_TYPE_BLINDNESS_GAS,
TRAP_TYPE_SLEEPING_GAS, TRAP_TYPE_FLAME, TRAP_TYPE_EXPLOSION,
TRAP_TYPE_ACID_SPRAY, TRAP_TYPE_ELECTRIC_SHOCK, TRAP_TYPE_BLADE,
TRAP_TYPE_SEX_CHANGE } trap_types;
#define MAX_TRAPTYPE TRAP_TYPE_SEX_CHANGE
#define TRAP_ROOM BV00
#define TRAP_OBJ BV01
#define TRAP_ENTER_ROOM BV02
#define TRAP_LEAVE_ROOM BV03
#define TRAP_OPEN BV04
#define TRAP_CLOSE BV05
#define TRAP_GET BV06
#define TRAP_PUT BV07
#define TRAP_PICK BV08
#define TRAP_UNLOCK BV09
#define TRAP_N BV10
#define TRAP_S BV11
#define TRAP_E BV12
#define TRAP_W BV13
#define TRAP_U BV14
#define TRAP_D BV15
#define TRAP_EXAMINE BV16
#define TRAP_NE BV17
#define TRAP_NW BV18
#define TRAP_SE BV19
#define TRAP_SW BV20
/*
* Well known object virtual numbers.
* Defined in #OBJECTS.
*/
/* Currency */
#define COPPER 1
#define SILVER 2
#define GOLD 3
/* Copper */
#define OBJ_VNUM_MONEY_COPPER_ONE 4
#define OBJ_VNUM_MONEY_COPPER_SOME 5
/* Silver */
#define OBJ_VNUM_MONEY_SILVER_ONE 6
#define OBJ_VNUM_MONEY_SILVER_SOME 7
/* Gold */
#define OBJ_VNUM_MONEY_ONE 2
#define OBJ_VNUM_MONEY_SOME 3
/* Other */
#define OBJ_VNUM_CORPSE_NPC 10
#define OBJ_VNUM_CORPSE_PC 11
#define OBJ_VNUM_SEVERED_HEAD 12
#define OBJ_VNUM_TORN_HEART 13
#define OBJ_VNUM_SLICED_ARM 14
#define OBJ_VNUM_SLICED_LEG 15
#define OBJ_VNUM_SPILLED_GUTS 16
#define OBJ_VNUM_BLOOD 17
#define OBJ_VNUM_BLOODSTAIN 18
#define OBJ_VNUM_SCRAPS 19
#define OBJ_VNUM_MUSHROOM 20
#define OBJ_VNUM_LIGHT_BALL 21
#define OBJ_VNUM_SPRING 22
#define OBJ_VNUM_SLICE 24
#define OBJ_VNUM_SHOPPING_BAG 25
#define OBJ_VNUM_FIRE 30
#define OBJ_VNUM_TRAP 31
#define OBJ_VNUM_PORTAL 32
#define OBJ_VNUM_BLACK_POWDER 33
#define OBJ_VNUM_SCROLL_SCRIBING 34
#define OBJ_VNUM_FLASK_BREWING 35
#define OBJ_VNUM_NOTE 36
#define OBJ_VNUM_LOCKER 51
#define OBJ_VNUM_PKPIN 52
#define OBJ_VNUM_LEGS 53
/* Newbie eq */
#define OBJ_VNUM_SCHOOL_MACE 25507
#define OBJ_VNUM_SCHOOL_DAGGER 25508
#define OBJ_VNUM_SCHOOL_SWORD 25509
#define OBJ_VNUM_SCHOOL_VEST 25510
#define OBJ_VNUM_SCHOOL_SHIELD 25511
#define OBJ_VNUM_SCHOOL_CLOAK 25512
#define OBJ_VNUM_SCHOOL_HELMET 25513
#define OBJ_VNUM_SCHOOL_LEGGINGS 25514
#define OBJ_VNUM_SCHOOL_BOOTS 25515
#define OBJ_VNUM_SCHOOL_GLOVES 25516
#define OBJ_VNUM_SCHOOL_ARMBANDS 25517
#define OBJ_VNUM_SCHOOL_CAPE 25518
#define OBJ_VNUM_SCHOOL_BELT 25519
#define OBJ_VNUM_SCHOOL_BRACER 25520
/* Quest Items --GW */
#define OBJ_VNUM_QUEST_SWORD 59
#define OBJ_VNUM_QUEST_CROWN 60
#define OBJ_VNUM_QUEST_RING 61
#define OBJ_VNUM_QUEST_DAGGER 62
/* Object/character reference code, to avoid getting pointers to extracted
* objects in loops. IMO it's more elegant than the 'deleted' method of
* Envy.
*
* Copyright 1997 Oliver Jowett <oliver@jowett.manawatu.planet.co.nz>. You can
* freely use this code, so long as this notice remains intact.
*
*/
/* Structures for registering object/character pointers */
#define OBJ_NEXT 1
#define OBJ_NEXTCONTENT 2
#define OBJ_NULL 3
struct obj_ref_type
{
bool inuse;
struct obj_ref_type *next;
OBJ_DATA **var;
int type; /* OBJ_xxxx */
};
#define CHAR_NEXT 1
#define CHAR_NEXTROOM 2
#define CHAR_NULL 3
struct char_ref_type
{
bool inuse;
struct char_ref_type *next;
CHAR_DATA **var;
int type;
};
#define OREF(v, type) do { \
static struct obj_ref_type s={FALSE,NULL,NULL,type}; s.var=&v; \
obj_reference(&s); } while(0)
#define OUREF(var) obj_unreference(&var);
#define CREF(v, type) do { \
static struct char_ref_type s={FALSE,NULL,NULL,type}; s.var=&v; \
char_reference(&s); } while(0)
#define CUREF(var) char_unreference(&var);
void obj_reference(struct obj_ref_type *ref);
void obj_unreference(OBJ_DATA **var);
void char_reference(struct char_ref_type *ref);
void char_unreference(CHAR_DATA **var);
/*
* Item types.
* Used in #OBJECTS.
*/
typedef enum
{
ITEM_NONE, ITEM_LIGHT, ITEM_SCROLL, ITEM_WAND, ITEM_STAFF, ITEM_WEAPON,
ITEM_FIREWEAPON, ITEM_MISSILE, ITEM_TREASURE, ITEM_ARMOR, ITEM_POTION,
ITEM_WORN, ITEM_FURNITURE, ITEM_TRASH, ITEM_OLDTRAP, ITEM_CONTAINER,
ITEM_NOTE, ITEM_DRINK_CON, ITEM_KEY, ITEM_FOOD, ITEM_MONEY, ITEM_PEN,
ITEM_BOAT, ITEM_CORPSE_NPC, ITEM_CORPSE_PC, ITEM_FOUNTAIN, ITEM_PILL,
ITEM_BLOOD, ITEM_BLOODSTAIN, ITEM_SCRAPS, ITEM_PIPE, ITEM_HERB_CON,
ITEM_HERB, ITEM_INCENSE, ITEM_FIRE, ITEM_BOOK, ITEM_SWITCH, ITEM_LEVER,
ITEM_PULLCHAIN, ITEM_BUTTON, ITEM_DIAL, ITEM_RUNE, ITEM_RUNEPOUCH,
ITEM_MATCH, ITEM_TRAP, ITEM_MAP, ITEM_PORTAL, ITEM_PAPER,
ITEM_TINDER, ITEM_LOCKPICK, ITEM_SPIKE, ITEM_DISEASE, ITEM_OIL, ITEM_FUEL,
ITEM_MISSILE_WEAPON, ITEM_PROJECTILE, ITEM_QUIVER,
ITEM_SHOVEL, ITEM_SALVE, ITEM_SHRINE, ITEM_INSIG, ITEM_PK_BOOK,
ITEM_GUILD_STONE, ITEM_PK_CLAN_STONE, ITEM_NONPK_CLAN_STONE, ITEM_VEHICLE,
ITEM_LIFE_PROTECTION } item_types;
#define MAX_ITEM_TYPE ITEM_LIFE_PROTECTION
/*
* Extra flags.
* Used in #OBJECTS.
*/
#define ITEM_GLOW BV00
#define ITEM_HUM BV01
#define ITEM_DARK BV02
#define ITEM_LOYAL BV03
#define ITEM_EVIL BV04
#define ITEM_INVIS BV05
#define ITEM_MAGIC BV06
#define ITEM_NODROP BV07
#define ITEM_BLESS BV08
#define ITEM_ANTI_GOOD BV09
#define ITEM_ANTI_EVIL BV10
#define ITEM_ANTI_NEUTRAL BV11
#define ITEM_NOREMOVE BV12
#define ITEM_INVENTORY BV13
#define ITEM_MAGE_ONLY BV14
#define ITEM_THIEF_ONLY BV15
#define ITEM_WARRIOR_ONLY BV16
#define ITEM_CLERIC_ONLY BV17
#define ITEM_ORGANIC BV18
#define ITEM_METAL BV19
#define ITEM_DONATION BV20
#define ITEM_CLANOBJECT BV21
#define ITEM_CLANCORPSE BV22
#define ITEM_VAMPIRE_ONLY BV23
#define ITEM_DRUID_ONLY BV24
#define ITEM_HIDDEN BV25
#define ITEM_POISONED BV26
#define ITEM_COVERING BV27
#define ITEM_DEATHROT BV28
#define ITEM_BURRIED BV29 /* item is underground */
#define ITEM_PROTOTYPE BV30
#define ITEM_NO_RESTRING BV31
/* obj2 flags */
#define ITEM2_LIMITED BV00
#define ITEM2_NO_SAC BV01
#define ITEM2_NO_SCRAP BV02
#define ITEM2_DUAL_ONLY BV03
#define ITEM2_ADVANCED_ONLY BV04
#define ITEM2_DUAL_ADV_ONLY BV05
#define ITEM2_NOSAVE BV06
#define ITEM2_PERM BV07
#define ITEM2_RANGER_ONLY BV08
#define ITEM2_AUGURER_ONLY BV09
#define ITEM2_KINJU_ONLY BV10
#define ITEM2_PALADIN_ONLY BV11
#define ITEM2_ASSASSIN_ONLY BV12
#define ITEM2_PSI_ONLY BV13
#define ITEM2_WEREWOLF_ONLY BV14
#define ITEM2_AVATAR_ONLY BV15
#define ITEM2_DRAGON_ONLY BV16
#define ITEM2_BISHOP_ONLY BV17
#define ITEM2_ARCHMAGE_ONLY BV18
#define ITEM2_BLADEMASTER_ONLY BV19
#define ITEM2_ALCHEMIST_ONLY BV20
#define ITEM2_PROPHET_ONLY BV21
#define ITEM2_CRUSADER_ONLY BV22
#define ITEM2_SAMURAI_ONLY BV23
#define ITEM2_WRAITH_ONLY BV24
#define ITEM2_HUNTER_ONLY BV25
#define ITEM2_ADEPT_ONLY BV26
#define ITEM2_NINJA_ONLY BV27
#define ITEM2_JACKEL_ONLY BV28
#define ITEM2_AUTO_SAC BV29
#define ITEM2_PK_ONLY BV30
#define ITEM2_MYSTIC_ONLY BV31
/* Magic flags - extra extra_flags for objects that are used in spells */
#define ITEM_RETURNING BV00
#define ITEM_BACKSTABBER BV01
#define ITEM_BANE BV02
#define ITEM_LOYAL BV03
#define ITEM_HASTE BV04
#define ITEM_DRAIN BV05
#define ITEM_LIGHTNING_BLADE BV06
/* Ok im outta Bits .. im using these for normal now --GW */
#define ITEM_UPSTATED BV07
#define ITEM_DISSOLVE_IMM BV08
/* Lever/dial/switch/button/pullchain flags */
#define TRIG_UP BV00
#define TRIG_UNLOCK BV01
#define TRIG_LOCK BV02
#define TRIG_D_NORTH BV03
#define TRIG_D_SOUTH BV04
#define TRIG_D_EAST BV05
#define TRIG_D_WEST BV06
#define TRIG_D_UP BV07
#define TRIG_D_DOWN BV08
#define TRIG_DOOR BV09
#define TRIG_CONTAINER BV10
#define TRIG_OPEN BV11
#define TRIG_CLOSE BV12
#define TRIG_PASSAGE BV13
#define TRIG_OLOAD BV14
#define TRIG_MLOAD BV15
#define TRIG_TELEPORT BV16
#define TRIG_TELEPORTALL BV17
#define TRIG_TELEPORTPLUS BV18
#define TRIG_DEATH BV19
#define TRIG_CAST BV20
#define TRIG_FAKEBLADE BV21
#define TRIG_RAND4 BV22
#define TRIG_RAND6 BV23
#define TRIG_TRAPDOOR BV24
#define TRIG_ANOTHEROOM BV25
#define TRIG_USEDIAL BV26
#define TRIG_ABSOLUTEVNUM BV27
#define TRIG_SHOWROOMDESC BV28
#define TRIG_AUTORETURN BV29
#define TELE_SHOWDESC BV00
#define TELE_TRANSALL BV01
#define TELE_TRANSALLPLUS BV02
/*
* Wear flags.
* Used in #OBJECTS.
*/
#define ITEM_TAKE BV00
#define ITEM_WEAR_FINGER BV01
#define ITEM_WEAR_NECK BV02
#define ITEM_WEAR_BODY BV03
#define ITEM_WEAR_HEAD BV04
#define ITEM_WEAR_LEGS BV05
#define ITEM_WEAR_FEET BV06
#define ITEM_WEAR_HANDS BV07
#define ITEM_WEAR_ARMS BV08
#define ITEM_WEAR_SHIELD BV09
#define ITEM_WEAR_ABOUT BV10
#define ITEM_WEAR_WAIST BV11
#define ITEM_WEAR_WRIST BV12
#define ITEM_WIELD BV13
#define ITEM_HOLD BV14
#define ITEM_DUAL_WIELD BV15
#define ITEM_WEAR_EARS BV16
#define ITEM_WEAR_EYES BV17
#define ITEM_MISSILE_WIELD BV18
#define ITEM_WEAR_INSIG BV19
#define ITEM_WEAR_CHAMP BV20
#define ITEM_WEAR_CLUB BV21
/*
* LIMIT Adjustment Types --GW
*/
#define LOADED_ADJUST_UP 1
#define LOADED_ADJUST_DOWN 2
#define LIMIT_ADJUST_SET 3
#define LOADED_ADJUST_SET 4
/*
* Apply types (for affects).
* Used in #OBJECTS.
*/
typedef enum
{
APPLY_NONE, APPLY_STR, APPLY_DEX, APPLY_INT, APPLY_WIS, APPLY_CON,
APPLY_SEX, APPLY_CLASS, APPLY_LEVEL, APPLY_AGE, APPLY_HEIGHT, APPLY_WEIGHT,
APPLY_MANA, APPLY_HIT, APPLY_MOVE, APPLY_GOLD, APPLY_EXP, APPLY_AC,
APPLY_HITROLL, APPLY_DAMROLL, APPLY_SAVING_POISON, APPLY_SAVING_ROD,
APPLY_SAVING_PARA, APPLY_SAVING_BREATH, APPLY_SAVING_SPELL, APPLY_CHA,
APPLY_AFFECT, APPLY_RESISTANT, APPLY_IMMUNE, APPLY_SUSCEPTIBLE,
APPLY_WEAPONSPELL, APPLY_LCK, APPLY_BACKSTAB, APPLY_PICK, APPLY_TRACK,
APPLY_STEAL, APPLY_SNEAK, APPLY_HIDE, APPLY_PALM, APPLY_DETRAP, APPLY_DODGE,
APPLY_PEEK, APPLY_SCAN, APPLY_GOUGE, APPLY_SEARCH, APPLY_MOUNT, APPLY_DISARM,
APPLY_KICK, APPLY_PARRY, APPLY_BASH, APPLY_STUN, APPLY_PUNCH, APPLY_CLIMB,
APPLY_GRIP, APPLY_SCRIBE, APPLY_BREW, APPLY_WEARSPELL, APPLY_REMOVESPELL,
APPLY_EMOTION, APPLY_MENTALSTATE, APPLY_STRIPSN, APPLY_REMOVE, APPLY_DIG,
APPLY_FULL, APPLY_THIRST, APPLY_DRUNK, APPLY_BLOOD, APPLY_ALIGN,
APPLY_ROUND_STUN, APPLY_EGO, APPLY_EXT_AFFECT, MAX_APPLY_TYPE
} apply_types;
#define REVERSE_APPLY 1000
/*
* Values for containers (value[1]).
* Used in #OBJECTS.
*/
#define CONT_CLOSEABLE 1
#define CONT_PICKPROOF 2
#define CONT_CLOSED 4
#define CONT_LOCKED 8
/*
* Well known room virtual numbers.
* Defined in #ROOMS.
*/
#define ROOM_VNUM_LIMBO 2
#define ROOM_VNUM_POLY 3
#define ROOM_VNUM_CELL 7
#define ROOM_VNUM_CHAT 1200
#define ROOM_VNUM_TEMPLE 30601
#define ROOM_VNUM_CURSED 21700
#define ROOM_VNUM_ALTAR 30602
#define ROOM_VNUM_SCHOOL 25518
#define ROOM_AUTH_START 25518
#define ROOM_VNUM_MORGUE 30697
#define ROOM_VNUM_DONATE 30609
#define ROOM_VNUM_HOARDERS_VOID 19
#define BLACKJACK 30694 /* Room to play black jack in. */
/*
* Room flags. Holy cow! Talked about stripped away..
* Used in #ROOMS. Those merc guys know how to strip code down.
* Lets put it all back... ;)
*/
#define ROOM_DARK BV00
#define ROOM_DEATH BV01
#define ROOM_NO_MOB BV02
#define ROOM_INDOORS BV03
#define ROOM_LAWFUL BV04
#define ROOM_NEUTRAL BV05
#define ROOM_CHAOTIC BV06
#define ROOM_NO_MAGIC BV07
#define ROOM_TUNNEL BV08
#define ROOM_PRIVATE BV09
#define ROOM_SAFE BV10
#define ROOM_SOLITARY BV11
#define ROOM_PET_SHOP BV12
#define ROOM_NO_RECALL BV13
#define ROOM_DONATION BV14
#define ROOM_NODROPALL BV15
#define ROOM_SILENCE BV16
#define ROOM_LOGSPEECH BV17
#define ROOM_NODROP BV18
#define ROOM_CLANSTOREROOM BV19
#define ROOM_NO_SUMMON BV20
#define ROOM_NO_ASTRAL BV21
#define ROOM_TELEPORT BV22
#define ROOM_TELESHOWDESC BV23
#define ROOM_NOFLOOR BV24
#define ROOM_SAVE BV25
#define ROOM_NO_QUEST BV26
#define ROOM_HOT BV27
#define ROOM_COLD BV28
#define ROOM_PROTOTYPE BV30
#define ROOM_BANK BV31
/* 32 rflags :(*/
/*
* Directions.
* Used in #ROOMS.
*/
typedef enum
{
DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST, DIR_UP, DIR_DOWN,
DIR_NORTHEAST, DIR_NORTHWEST, DIR_SOUTHEAST, DIR_SOUTHWEST, DIR_SOMEWHERE
} dir_types;
#define MAX_DIR DIR_SOUTHWEST /* max for normal walking */
#define DIR_PORTAL DIR_SOMEWHERE /* portal direction */
/*
* Exit flags.
* Used in #ROOMS.
*/
#define EX_ISDOOR BV00
#define EX_CLOSED BV01
#define EX_LOCKED BV02
#define EX_SECRET BV03
#define EX_SWIM BV04
#define EX_PICKPROOF BV05
#define EX_FLY BV06
#define EX_CLIMB BV07
#define EX_DIG BV08
#define EX_RES1 BV09 /* are these res[1-4] important? */
#define EX_NOPASSDOOR BV10
#define EX_HIDDEN BV11
#define EX_PASSAGE BV12
#define EX_PORTAL BV13
#define EX_RES2 BV14
#define EX_RES3 BV15
#define EX_xCLIMB BV16
#define EX_xENTER BV17
#define EX_xLEAVE BV18
#define EX_xAUTO BV19
#define EX_RES4 BV20
#define EX_xSEARCHABLE BV21
#define EX_BASHED BV22
#define EX_BASHPROOF BV23
#define EX_NOMOB BV24
#define EX_WINDOW BV25
#define EX_xLOOK BV26
#define EX_xNO_LOOK BV27
#define MAX_EXFLAG 27
/*
* Sector types.
* Used in #ROOMS.
*/
typedef enum
{
SECT_INSIDE, SECT_CITY, SECT_FIELD, SECT_FOREST, SECT_HILLS, SECT_MOUNTAIN,
SECT_WATER_SWIM, SECT_WATER_NOSWIM, SECT_UNDERWATER, SECT_AIR, SECT_DESERT,
SECT_DUNNO, SECT_OCEANFLOOR, SECT_UNDERGROUND, SECT_RENT, SECT_RENTED, SECT_MAX
} sector_types;
/*
* Equpiment wear locations.
* Used in #RESETS.
*/
typedef enum
{
WEAR_NONE = -1, WEAR_LIGHT = 0, WEAR_FINGER_L, WEAR_FINGER_R, WEAR_NECK_1,
WEAR_NECK_2, WEAR_BODY, WEAR_HEAD, WEAR_LEGS, WEAR_FEET, WEAR_HANDS,
WEAR_ARMS, WEAR_SHIELD, WEAR_ABOUT, WEAR_WAIST, WEAR_WRIST_L, WEAR_WRIST_R,
WEAR_WIELD, WEAR_HOLD, WEAR_DUAL_WIELD, WEAR_EARS, WEAR_EYES,
WEAR_MISSILE_WIELD, WEAR_INSIG, WEAR_CHAMP, WEAR_CLUB, MAX_WEAR
} wear_locations;
/* Board Types */
typedef enum { BOARD_NOTE, BOARD_MAIL, BOARD_PK } board_types;
/* Auth Flags */
#define FLAG_WRAUTH 1
#define FLAG_AUTH 2
/***************************************************************************
* *
* VALUES OF INTEREST TO AREA BUILDERS *
* (End of this section ... stop here) *
* *
***************************************************************************/
/*
* Conditions.
*/
typedef enum
{
COND_DRUNK, COND_FULL, COND_THIRST, COND_BLOODTHIRST, MAX_CONDS
} conditions;
/*
* Positions.
*/
typedef enum
{
POS_DEAD, POS_MORTAL, POS_INCAP, POS_STUNNED, POS_SLEEPING, POS_RESTING,
POS_SITTING, POS_FIGHTING, POS_STANDING, POS_MOUNTED, POS_SHOVE, POS_DRAG
} positions;
/*
* ACT bits for players.
*/
#define PLR_IS_NPC BV00 /* Don't EVER set. */
#define PLR_BOUGHT_PET BV01
#define PLR_SHOVEDRAG BV02
#define PLR_AUTOEXIT BV03
#define PLR_AUTOLOOT BV04
#define PLR_AUTOSAC BV05
#define PLR_BLANK BV06
#define PLR_OUTCAST BV07
#define PLR_BRIEF BV08
#define PLR_COMBINE BV09
#define PLR_PROMPT BV10
#define PLR_TELNET_GA BV11
#define PLR_HOLYLIGHT BV12
#define PLR_WIZINVIS BV13
#define PLR_ROOMVNUM BV14
#define PLR_SILENCE BV15
#define PLR_NO_EMOTE BV16
#define PLR_ATTACKER BV17
#define PLR_NO_TELL BV18
#define PLR_LOG BV19
#define PLR_DENY BV20
#define PLR_FREEZE BV21
#define PLR_THIEF BV22
#define PLR_KILLER BV23
#define PLR_LITTERBUG BV24
#define PLR_ANSI BV25
#define PLR_RIP BV26
#define PLR_NICE BV27
#define PLR_FLEE BV28
#define PLR_AUTOGOLD BV29
#define PLR_AUTOMAP BV30
#define PLR_AFK BV31
/* Bits for pc_data->flags. */
#define PCFLAG_R1 BV00
#define PCFLAG_DEADLY BV01
#define PCFLAG_UNAUTHED BV02
#define PCFLAG_NORECALL BV03
#define PCFLAG_NOINTRO BV04
#define PCFLAG_GAG BV05
#define PCFLAG_RETIRED BV06
#define PCFLAG_GUEST BV07
#define PCFLAG_NOSUMMON BV08
#define PCFLAG_PAGERON BV09
#define PCFLAG_NOTITLE BV10
#define PCFLAG_CHALLENGED BV11
#define PCFLAG_CHALLENGER BV12
#define PCFLAG_WED BV13
#define PCFLAG_ENGAGED BV14
#define PCFLAG_ASSASSIN BV15
#define PCFLAG_TENNANT BV16
#define PCFLAG_OPEN_LOCKER BV17
#define PCFLAG_ADVANCED BV18
#define PCFLAG_NEWBIEHELP BV19
#define PCFLAG_SUSPENDED BV20
#define PCFLAG_SOUND BV21
#define PCFLAG_PLOG BV22
#define PCFLAG_CHEATER BV23
#define PCFLAG_NO_ECHO BV24
#define PCFLAG_KOMBAT BV25
#define PCFLAG_PKCHAMP BV26
#define PCFLAG_SEVERED BV27
#define PCFLAG_QUESTING BV28
#define PCFLAG_ADV_DUAL BV29
#define PCFLAG_CENSORED BV30
#define PCFLAG_OLD_DEATH BV31
/* Donto Add More! --GW */
/*
* Kombat bits --GW
*/
#define KOMBAT_ON BV00
#define KOMBAT_ACCEPT BV01
#define KOMBAT_DUAL BV02
#define KOMBAT_ADVANCED BV03
#define KOMBAT_NODRAGON BV04
#define KOMBAT_NOAVATAR BV05
/*
* Hoarder Types --GW
*/
#define HOARD_NONE 0
#define HOARD_SEND_TO_VOID 1
#define HOARD_DROP_TRIGGER 2
#define HOARD_SORTING_EQ 3
#define HOARD_DONE_SORTING 4
#define HOARD_IN_VOID 5
#define HOARD_AUCD_ITEM 6
/*
* Hoarder Check Types
*/
#define HCHECK_LOGIN 1
#define HCHECK_DROP 2
#define HCHECK_MOVE 3
#define HCHECK_AUCTION 4
#define IS_HOARDER(ch) ( !IS_NPC(ch) && (ch)->pcdata->hoard_status > HOARD_NONE)
/*
* Vehicle bits --GW
*/
#define VEHICLE_DARK BV00
typedef enum
{
TIMER_NONE, TIMER_RECENTFIGHT, TIMER_SHOVEDRAG, TIMER_DO_FUN,
TIMER_APPLIED, TIMER_PKILLED, TIMER_KOMBAT, TIMER_CTF } timer_types;
struct timer_data
{
TIMER * prev;
TIMER * next;
DO_FUN * do_fun;
int value;
sh_int type;
sh_int count;
};
/*
* Channel bits.
*/
#define CHANNEL_AUCTION BV00
#define CHANNEL_CHAT BV01
#define CHANNEL_QUEST BV02
#define CHANNEL_IMMTALK BV03
#define CHANNEL_MUSIC BV04
#define CHANNEL_ASK BV05
#define CHANNEL_SHOUT BV06
#define CHANNEL_YELL BV07
#define CHANNEL_MONITOR BV08
#define CHANNEL_LOG BV09
#define CHANNEL_HIGHGOD BV10
#define CHANNEL_CLAN BV11
#define CHANNEL_BUILD BV12
#define CHANNEL_HIGH BV13
#define CHANNEL_AVTALK BV14
#define CHANNEL_PRAY BV15
#define CHANNEL_COUNCIL BV16
#define CHANNEL_GUILD BV17
#define CHANNEL_COMM BV18
#define CHANNEL_TELLS BV19
#define CHANNEL_ORDER BV20
#define CHANNEL_NEWBIE BV21
#define CHANNEL_WARTALK BV22
#define CHANNEL_BEEP BV23
#define CHANNEL_AOTA BV24
#define CHANNEL_FLAME BV25
#define CHANNEL_KOMBAT BV26
#define CHANNEL_OLYMPUS BV27
#define CHANNEL_INFO BV28
#define CHANNEL_MOBLOG BV29 /* Added by Callinon - 11-16-98 */
#define CHANNEL_IC BV30
/* Area Version Info --GW */
#define AREA_VERSION_NUMBER 2
#define AREA_VERSION_NAME "AV-2-TXT-ZC"
/* Area defines - Scryn 8/11
*
*/
#define AREA_DELETED BV00
#define AREA_LOADED BV01
/* Area flags - Narn Mar/96 */
#define AFLAG_NOPKILL BV00
#define AFLAG_CLOSED BV01
#define AFLAG_LOCKED BV02
#define AFLAG_CLUB_HALL BV03
#define AFLAG_TOWN BV04
#define AFLAG_STARTED BV05
#define AFLAG_ALWAYS_START BV06
#define AFLAG_NEVER_START BV07
#define AFLAG_NO_QUEST BV08
#define AFLAG_LOW_DUAL BV09
#define AFLAG_LOW_ADV BV10
#define AFLAG_LOW_DUAL_ADV BV11
#define AFLAG_HIGH_SINGLE BV12
#define AFLAG_HIGH_DUAL BV13
#define AFLAG_HIGH_ADV BV14
#define AFLAG_HIGH_DUAL_ADV BV15
#define AFLAG_DRAGON_DROP BV16
/* Area Search Types --GW */
#define AREA_SEARCH_MOB 1
#define AREA_SEARCH_OBJ 2
#define AREA_SEARCH_ROOM 3
/*
* Prototype for a mob.
* This is the in-memory version of #MOBILES.
*/
struct mob_index_data
{
MOB_INDEX_DATA * next;
MOB_INDEX_DATA * next_sort;
SPEC_FUN * spec_fun;
SHOP_DATA * pShop;
REPAIR_DATA * rShop;
MPROG_DATA * mudprogs;
AREA_DATA * area;
int progtypes;
char * player_name;
char * short_descr;
char * long_descr;
char * description;
int vnum;
sh_int count;
sh_int killed;
sh_int sex;
sh_int level;
sh_int level2;
int act;
int acttwo;
int flags;
int smart; /* Smart Mob Flags --GW */
EXT_BV affected_by;
sh_int alignment;
sh_int mobthac0; /* Unused */
sh_int ac;
sh_int hitnodice;
sh_int hitsizedice;
int hitplus;
sh_int damnodice;
sh_int damsizedice;
sh_int damplus;
sh_int numattacks;
long gold;
long silver;
long real_gold;
long exp;
int xflags;
int resistant;
int immune;
int susceptible;
int attacks;
int defenses;
int speaks;
int speaking;
sh_int position;
sh_int defposition;
sh_int height;
sh_int weight;
sh_int race;
sh_int class;
sh_int hitroll;
sh_int damroll;
sh_int perm_str;
sh_int perm_int;
sh_int perm_wis;
sh_int perm_dex;
sh_int perm_con;
sh_int perm_cha;
sh_int perm_lck;
sh_int saving_poison_death;
sh_int saving_wand;
sh_int saving_para_petri;
sh_int saving_breath;
sh_int saving_spell_staff;
char * modified_by;
char * modified_date;
};
struct hunt_hate_fear
{
char * name;
CHAR_DATA * who;
};
struct fighting_data
{
CHAR_DATA * who;
int xp;
sh_int align;
sh_int duration;
sh_int timeskilled;
};
struct editor_data
{
sh_int numlines;
sh_int on_line;
sh_int size;
char line[49][81];
};
struct extracted_char_data
{
EXTRACT_CHAR_DATA * next;
CHAR_DATA * ch;
ROOM_INDEX_DATA * room;
ch_ret retcode;
bool extract;
};
/*
* One character (PC or NPC).
* (Shouldn't most of that build interface stuff use substate, dest_buf,
* spare_ptr and tempnum? Seems a little redundant)
*/
struct char_data
{
CHAR_DATA * next;
CHAR_DATA * prev;
CHAR_DATA * next_in_room;
CHAR_DATA * prev_in_room;
CHAR_DATA * master;
CHAR_DATA * leader;
FIGHT_DATA * fighting;
CHAR_DATA * mount;
HHF_DATA * hunting;
HHF_DATA * fearing;
HHF_DATA * hating;
SPEC_FUN * spec_fun;
AREA_DATA * area;
MPROG_ACT_LIST * mpact;
int mpactnum;
sh_int mpscriptpos;
MOB_INDEX_DATA * pIndexData;
AFFECT_DATA * first_affect;
AFFECT_DATA * last_affect;
OBJ_DATA * first_carrying;
OBJ_DATA * last_carrying;
ROOM_INDEX_DATA * in_room;
ROOM_INDEX_DATA * was_in_room;
ROOM_INDEX_DATA * last_to_room;
ZONE_DATA * was_in_zone;
PC_DATA * pcdata;
void * dest_buf;
void * spare_ptr;
int tempnum;
TIMER * first_timer;
TIMER * last_timer;
DESCRIPTOR_DATA * desc;
CHAR_DATA * switched;
char * name;
char * short_descr;
char * long_descr;
char * description;
sh_int num_fighting;
sh_int substate;
sh_int sex;
sh_int class;
sh_int class2;
sh_int advclass;
sh_int advclass2;
sh_int race;
sh_int level;
sh_int level2;
sh_int advlevel;
sh_int advlevel2;
sh_int timer;
sh_int wait;
int hit;
int max_hit;
int mana;
int max_mana;
int move;
int max_move;
sh_int practice;
sh_int numattacks;
long gold; /* Copper now .. just easier --GW */
long silver;
long real_gold;
long exp;
int act;
int acttwo;
int smart;
EXT_BV affected_by;
int carry_weight;
int carry_number;
int xflags;
int resistant;
int immune;
int susceptible;
int attacks;
int defenses;
int speaks;
int speaking;
sh_int saving_poison_death;
sh_int saving_wand;
sh_int saving_para_petri;
sh_int saving_breath;
sh_int saving_spell_staff;
sh_int alignment;
sh_int barenumdie;
sh_int baresizedie;
sh_int mobthac0;
sh_int hitroll;
sh_int damroll;
int hitplus;
sh_int damplus;
sh_int position;
sh_int defposition;
sh_int height;
sh_int weight;
sh_int armor;
sh_int magical_armor;
sh_int wimpy;
sh_int perm_str;
sh_int perm_int;
sh_int perm_wis;
sh_int perm_dex;
sh_int perm_con;
sh_int perm_cha;
sh_int perm_lck;
sh_int mod_str;
sh_int mod_int;
sh_int mod_wis;
sh_int mod_dex;
sh_int mod_con;
sh_int mod_cha;
sh_int mod_lck;
sh_int mental_state; /* simplified */
sh_int emotional_state; /* simplified */
int retran;
sh_int mobinvis; /* Mobinvis level SB */
sh_int stun_rounds;
bool deleted;
ROOM_INDEX_DATA *died_in_room;
};
struct killed_data
{
sh_int vnum;
char count;
};
/*
* Data which only PC's have.
*/
struct pc_data
{
CLAN_DATA * guild;
CLAN_DATA * clan;
COUNCIL_DATA * council;
AREA_DATA * area;
DEITY_DATA * deity;
VEHICLE_DATA * vehicle;
char * email;
char * homepage;
char * clan_name;
char * guild_name;
char * council_name;
char * deity_name;
char * pwd;
char * bamfin;
char * bamfout;
char * rank;
char * title;
char * stitle;
char * bestowments; /* Special bestowed commands */
char * rreply;
char * rreply_name;
char * alias[MAX_ALIAS];
char * alias_sub[MAX_ALIAS];
char * lastcom[MAX_COM];
char * comtrack[MAX_COM];
long imc_deaf;
long imc_allow;
long imc_deny;
int confirm_delete; /* delete status*/
int flags; /* Whether the player is deadly and whatever else we add. */
int pkills; /* Number of pkills on behalf of clan */
int pdeaths; /* Number of times pkilled (legally) */
int mkills; /* Number of mobs killed */
int mdeaths; /* Number of deaths due to mobs */
int illegal_pk; /* Number of illegal pk's committed */
int awins; /* Arena Wins */
int alosses; /* Arena Losses */
int plr_wager; /* Gamble Code Wager Amount */
long int outcast_time; /* The time at which the char was outcast */
long int restore_time; /* The last time the char did a restore all */
sh_int r_range_lo; /* room range */
sh_int r_range_hi;
sh_int m_range_lo; /* mob range */
sh_int m_range_hi;
sh_int o_range_lo; /* obj range */
sh_int o_range_hi;
sh_int wizinvis; /* wizinvis level */
sh_int min_snoop; /* minimum snoop level */
sh_int condition [MAX_CONDS];
sh_int incog_level; /* incognito level */
sh_int learned [MAX_SKILL];
KILLED_DATA killed [MAX_KILLTRACK];
sh_int quest_number; /* current *QUEST BEING DONE* DON'T REMOVE! */
sh_int quest_curr; /* current number of quest points */
int quest_accum; /* quest points accumulated in players life */
sh_int favor; /* deity favor */
int auth_state;
time_t release_date; /* Auto-helling.. Altrag */
char * helled_by;
char * bio; /* Personal Bio */
char * authed_by; /* what crazy imm authed this name ;) */
SKILLTYPE * special_skills[5]; /* personalized skills/spells */
char * prompt; /* User config prompts */
char * subprompt; /* Substate prompt */
sh_int pagerlen; /* For pager (NOT menus) */
bool openedtourney;
int rentroom;
char * spouse;
char * engaged;
int security; /* Creation Security for Cperm */
CHAR_DATA * irc_channel_master;
int num_kombats;
int num_kombatants;
int num_kombats_won;
int pkchamps;
int start_room;
int invis_start;
bool died_entrance;
char * challenge_char_name;
char * ignore[MAX_IGNORE];
CHAR_DATA * questgiver; /* who gave the quest quest */
int questpoints;
int nextquest;
int countdown;
int questobj;
int questmob;
int questinroom;
int ego;
int keeper_state;
int old_hp;
int old_mana;
int old_move;
int old_exp;
int clssdropped;
char * name;
int nat_hp;
int nat_mana;
sh_int minoraffects;
sh_int majoraffects;
sh_int minorresist;
sh_int majorresist;
sh_int skill100s;
sh_int glory_status;
sh_int pre_name_toggle;
char * arena_viewing;
COLORMAP_DATA * color_maps;
int colormap_settings;
PSOCIAL_DATA * personal_socials;
int psocials;
OFFLINE_DATA * offline;
int hoard_status;
/* Moved the Below from CHAR_DATA to conserve memory --GW */
CHAR_DATA * reply;
NOTE_DATA * pnote;
NOTE_DATA * comments;
EDITOR_DATA * editor;
DO_FUN * last_cmd;
DO_FUN * prev_cmd; /* mapping */
char * gladiator;
long bank;
long silver_bank;
long gold_bank;
sh_int cperm;
sh_int clevel;
sh_int guildlevel;
sh_int imc;
int delete; /*delete confirmation*/
sh_int clanwho;
sh_int trust;
int played;
time_t logon;
time_t save_time;
time_t update_time;
int flagstwo;
int deaf;
int bounty;
int regoto;
int pagelen; /* BUILD INTERFACE */
sh_int inter_page; /* BUILD INTERFACE */
sh_int inter_type; /* BUILD INTERFACE */
char *inter_editing; /* BUILD INTERFACE */
int inter_editing_vnum; /* BUILD INTERFACE */
sh_int inter_substate; /* BUILD INTERFACE */
int shares[4]; /* Shares --GW */
/* End of Move --GW */
HOST_DATA *first_host;
HOST_DATA *last_host;
long battle_xp;
char * ice_listen;
/* upstatted obj's */
int hit_bonus;
int dam_bonus;
int ac_bonus;
int mac_bonus;
/* rooms */
int warm_to_room;
char * mail_forward;
int team;
sh_int martial_arts_rating;
};
/*
* Liquids.
*/
#define LIQ_WATER 0
#define LIQ_MAX 20
struct liq_type
{
char * liq_name;
char * liq_color;
sh_int liq_affect[6];
};
/*
* Extra description data for a room or object.
*/
struct extra_descr_data
{
EXTRA_DESCR_DATA *next; /* Next in list */
EXTRA_DESCR_DATA *prev; /* Previous in list */
char *keyword; /* Keyword in look/examine */
char *description; /* What to see */
};
/*
* Prototype for an object.
*/
struct obj_index_data
{
OBJ_INDEX_DATA * next;
OBJ_INDEX_DATA * next_sort;
EXTRA_DESCR_DATA * first_extradesc;
EXTRA_DESCR_DATA * last_extradesc;
AFFECT_DATA * first_affect;
AFFECT_DATA * last_affect;
MPROG_DATA * mudprogs; /* objprogs */
AREA_DATA * area;
VEHICLE_DATA * vehicle; /* vehicles --GW */
int progtypes; /* objprogs */
char * name;
char * short_descr;
char * description;
char * action_desc;
int vnum;
sh_int item_type;
int extra_flags;
int second_flags; /* more bivectors for objs */
int magic_flags; /*Need more bitvectors for spells - Scryn*/
int wear_flags;
sh_int count;
sh_int weight;
int cost;
int value [6];
int serial;
sh_int layers;
int rent;
int level;
int minlevel;
int loaded;
int limit;
int has_moved;
int ego;
char * modified_by;
char * modified_date;
};
/* Personal Social Stuff --GW */
/*
* Persoanl Social Data --GW
*/
struct personalsocial_data
{
PSOC_DATA * first_social;
PSOC_DATA * last_social;
};
/*
* PSocial Info Structure --GW
*/
struct psocial_data
{
PSOC_DATA * next;
PSOC_DATA * prev;
char * name;
char * char_no_arg;
char * others_no_arg;
char * char_found;
char * others_found;
char * vict_found;
char * char_auto;
char * others_auto;
int flags;
};
/*
* PSocial Flags --GW
*/
#define PSOC_CNOARG BV01
#define PSOC_ONOARG BV02
#define PSOC_CFOUND BV03
#define PSOC_OFOUND BV04
#define PSOC_VFOUND BV05
#define PSOC_CAUTO BV06
#define PSOC_OAUTO BV07
/*
* Social Arg Types --GW
*/
#define SOCTYPE_CNOARG 1
#define SOCTYPE_ONOARG 2
#define SOCTYPE_CFOUND 3
#define SOCTYPE_OFOUND 4
#define SOCTYPE_VFOUND 5
#define SOCTYPE_CAUTO 6
#define SOCTYPE_OAUTO 7
/* End Psocials --GW */
/* Color Mapping Stuff --GW */
/*
* Color Map Data --GW
*/
struct colormap_data
{
CMAP_DATA *first_map;
CMAP_DATA *last_map;
};
/*
* Structure that holds the Color Mapping Info --GW
*/
struct cmap_data
{
CMAP_DATA *next;
CMAP_DATA *prev;
char * remap_string;
sh_int remap;
int mapped_color;
int map_type;
};
/*
* Color Map Types --GW
*/
#define CMAP_RUMOR 1
#define CMAP_TELL 2
#define CMAP_AUCTION 3
#define CMAP_PLAY 4
#define CMAP_INFO 5
#define CMAP_QUEST 6
#define CMAP_WAR 7
#define CMAP_MUSIC 8
#define CMAP_ASK 9
#define CMAP_FLAME 10
#define CMAP_SHOUT 11
#define CMAP_YELL 12
#define CMAP_CLAN 13
#define CMAP_COUNCIL 14
#define CMAP_AVATAR 15
/* Colors only below this line */
#define CMAP_TELLS 16
#define CMAP_ROOMDESC 17
#define CMAP_ROOMNAME 18
#define CMAP_SOCIALS 19
#define CMAP_EXITS 20
#define CMAP_OBJ 21
#define CMAP_MOB 22
/* End of Colors Only */
#define CMAP_IMMTALK 23
#define CMAP_IMP 24
#define CMAP_OLYMPUS 25
#define CMAP_NEWBIECHAT 26
#define CMAP_THINK 27
/*
* BV's to determine what cmaps are set on a char --GW
* ch->pcdata->colormap_settings
*/
#define SCMAP_RUMOR BV01
#define SCMAP_TELL BV02
#define SCMAP_AUCTION BV03
#define SCMAP_PLAY BV04
#define SCMAP_INFO BV05
#define SCMAP_QUEST BV06
#define SCMAP_WAR BV07
#define SCMAP_MUSIC BV08
#define SCMAP_ASK BV09
#define SCMAP_FLAME BV10
#define SCMAP_SHOUT BV11
#define SCMAP_YELL BV12
#define SCMAP_CLAN BV13
#define SCMAP_COUNCIL BV14
#define SCMAP_AVATAR BV15
#define SCMAP_TELLS BV16
#define SCMAP_ROOMDESC BV17
#define SCMAP_ROOMNAME BV18
#define SCMAP_SOCIALS BV19
#define SCMAP_EXITS BV20
#define SCMAP_OBJ BV21
#define SCMAP_MOB BV22
#define SCMAP_IMMTALK BV23
#define SCMAP_IMP BV24
#define SCMAP_OLYMPUS BV25
#define SCMAP_NEWBIECHAT BV26
#define SCMAP_THINK BV27
/*
* Color Map Colors --GW
*/
#define CMCOLOR_BLACK 1
#define CMCOLOR_BLOOD 2
#define CMCOLOR_GREEN 3
#define CMCOLOR_BROWN 4
#define CMCOLOR_DBLUE 5
#define CMCOLOR_PURPLE 6
#define CMCOLOR_CYAN 7
#define CMCOLOR_GREY 8
#define CMCOLOR_DGREY 9
#define CMCOLOR_LRED 10
#define CMCOLOR_LGREEN 11
#define CMCOLOR_YELLOW 12
#define CMCOLOR_BLUE 13
#define CMCOLOR_LBLUE 14
#define CMCOLOR_WHITE 15
#define CMCOLOR__BLACK 16
#define CMCOLOR__GREEN 17
#define CMCOLOR__BLUE 18
#define CMCOLOR__CYAN 19
#define CMCOLOR__RED 20
#define CMCOLOR__ORANGE 21
#define CMCOLOR__PURPLE 22
#define CMCOLOR__GREY 23
/* End Color Map Stuff --GW */
/*
* Kombat --GW
*/
struct kombat_data
{
int low_lev;
int hi_lev;
int bits;
};
/*
* Data stored for chars when they are NOT online --GW
*/
struct offline_data
{
char *name;
char *email_address;
char *last_site;
long gold;
long bank;
char *email_fw;
};
/*
* Data for Vehicles --GW
*/
struct vehicle_data
{
char *desc;
char *operator;
int obj_vnum;
OBJ_DATA *contents;
ROOM_INDEX_DATA *in_room;
int serial_number;
int vehicle_flags;
};
/*
* Challenge Data for Arena --GW
*/
struct challenge_data
{
CHALLENGE_DATA *next;
CHALLENGE_DATA *prev;
char * challenger;
char * challenged;
bool fight_in_progress;
int arena_number;
};
/*
* Data for Arena's --GW
*/
struct arena_data
{
ARENA_DATA *next;
ARENA_DATA *prev;
int char_room;
int vict_room;
bool in_use;
int arena_number;
};
/*
* Refferal Data --GW
*/
struct refferal_data
{
REFFERAL_DATA * next;
REFFERAL_DATA * prev;
char * name;
char * refferal;
char * site;
char * date;
char * email;
};
/*
* Warrent Data --GW
*/
struct warrent_data
{
WARRENT_DATA * next;
WARRENT_DATA * prev;
char * name;
char * offense;
sh_int executed;
char * date;
char * issuer;
};
/*
* Web Server Stuff --GW
*/
struct web_descriptor {
int fd;
char request[MAXDATA*2];
struct sockaddr_in *their_addr;
int sin_size;
WEB_DESCRIPTOR *next;
WEB_DESCRIPTOR *prev;
bool valid;
};
/*
* Limit Data --GW
*/
struct limit_data
{
LIMIT_DATA *next;
LIMIT_DATA *prev;
int vnum;
int zone;
int limit;
int loaded;
int checked_this_boot;
};
/*
* Zone Data -- GW
*/
struct zone_data
{
ZONE_DATA * next;
ZONE_DATA * prev;
ROOM_INDEX_DATA * room_index_hash[MAX_KEY_HASH];
OBJ_INDEX_DATA * obj_index_hash[MAX_KEY_HASH];
MOB_INDEX_DATA * mob_index_hash[MAX_KEY_HASH];
CHAR_DATA * first_mob;
CHAR_DATA * last_mob;
OBJ_DATA * first_obj;
OBJ_DATA * last_obj;
char * list_filename;
int number;
char * name;
char * filename;
int top_obj;
int top_mob;
int top_room;
};
struct petition_data
{
PETITION_DATA * next;
PETITION_DATA * prev;
char * owner;
char * info;
int signers;
};
/*
* One object.
*/
struct obj_data
{
OBJ_DATA * next;
OBJ_DATA * prev;
OBJ_DATA * next_content;
OBJ_DATA * prev_content;
OBJ_DATA * first_content;
OBJ_DATA * last_content;
OBJ_DATA * in_obj;
CHAR_DATA * carried_by;
EXTRA_DESCR_DATA * first_extradesc;
EXTRA_DESCR_DATA * last_extradesc;
AFFECT_DATA * first_affect;
AFFECT_DATA * last_affect;
OBJ_INDEX_DATA * pIndexData;
ROOM_INDEX_DATA * in_room;
AREA_DATA * area;
char * name;
char * spare_desc;
char * short_descr;
char * description;
char * action_desc;
sh_int item_type;
sh_int mpscriptpos;
int extra_flags;
int second_flags;
int magic_flags; /*Need more bitvectors for spells - Scryn*/
int wear_flags;
MPROG_ACT_LIST * mpact; /* mudprogs */
int mpactnum; /* mudprogs */
sh_int wear_loc;
sh_int weight;
int cost;
sh_int timer;
int value [6];
sh_int count; /* support for object grouping */
int serial; /* serial number */
int level;
int rent;
int minlevel;
int ego;
bool deleted;
char * modified_by;
char * modified_date;
char * loaded_by;
/* Upstatted Obj's --GW */
int dam_bonus;
int hit_bonus;
int ac_bonus;
int mac_bonus;
};
/*
* Exit data.
*/
struct exit_data
{
EXIT_DATA * prev; /* previous exit in linked list */
EXIT_DATA * next; /* next exit in linked list */
EXIT_DATA * rexit; /* Reverse exit pointer */
ROOM_INDEX_DATA * to_room; /* Pointer to destination room */
char * keyword; /* Keywords for exit or door */
char * description; /* Description of exit */
int vnum; /* Vnum of room exit leads to */
int rvnum; /* Vnum of room in opposite dir */
int exit_info; /* door states & other flags */
int key; /* Key vnum */
sh_int vdir; /* Physical "direction" */
sh_int distance; /* how far to the next room */
};
/*
* Reset commands:
* '*': comment
* 'M': read a mobile
* 'O': read an object
* 'P': put object in object
* 'G': give object to mobile
* 'E': equip object to mobile
* 'H': hide an object
* 'B': set a bitvector
* 'T': trap an object
* 'D': set state of door
* 'R': randomize room exits
* 'S': stop (end of list)
*/
/*
* Area-reset definition.
*/
struct reset_data
{
RESET_DATA * next;
RESET_DATA * prev;
char command;
int extra;
int arg1;
int arg2;
int arg3;
};
/* Constants for arg2 of 'B' resets. */
#define BIT_RESET_DOOR 0
#define BIT_RESET_OBJECT 1
#define BIT_RESET_MOBILE 2
#define BIT_RESET_ROOM 3
#define BIT_RESET_TYPE_MASK 0xFF /* 256 should be enough */
#define BIT_RESET_DOOR_THRESHOLD 8
#define BIT_RESET_DOOR_MASK 0xFF00 /* 256 should be enough */
#define BIT_RESET_SET BV30
#define BIT_RESET_TOGGLE BV31
#define BIT_RESET_FREEBITS 0x3FFF0000 /* For reference */
/*
* Area definition.
*/
struct area_data
{
AREA_DATA * next;
AREA_DATA * prev;
AREA_DATA * next_sort;
AREA_DATA * prev_sort;
RESET_DATA * first_reset;
RESET_DATA * last_reset;
char * name;
char * filename;
int flags;
sh_int status; /* h, 8/11 */
sh_int age;
sh_int nplayer;
sh_int reset_frequency;
int low_r_vnum;
int hi_r_vnum;
int low_o_vnum;
int hi_o_vnum;
sh_int low_m_vnum;
sh_int hi_m_vnum;
int low_soft_range;
int hi_soft_range;
int low_hard_range;
int hi_hard_range;
char * author; /* Scryn */
char * resetmsg; /* Rennard */
char * club;
RESET_DATA * last_mob_reset;
RESET_DATA * last_obj_reset;
sh_int max_players;
int mkills;
int mdeaths;
int pkills;
int pdeaths;
int gold_looted;
int illegal_pk;
int high_economy;
int low_economy;
int locklev;
int seclev;
ZONE_DATA * zone;
int version_number;
char * version_name;
char * map_file;
};
/*
* Load in the gods building data. -- Altrag
*/
struct godlist_data
{
GOD_DATA * next;
GOD_DATA * prev;
int level;
int low_r_vnum;
int hi_r_vnum;
int low_o_vnum;
int hi_o_vnum;
sh_int low_m_vnum;
sh_int hi_m_vnum;
};
/*
* Used to keep track of system settings and statistics -Thoric
*/
struct system_data
{
int maxplayers; /* Maximum players this boot */
int alltimemax; /* Maximum players ever */
char * time_of_max; /* Time of max ever */
bool NO_NAME_RESOLVING; /* Hostnames are not resolved */
bool DENY_NEW_PLAYERS; /* New players cannot connect */
bool WAIT_FOR_AUTH; /* New players must be auth'ed */
bool GAME_WIZLOCKED; /* Used to wizlock over reboots*/
int rent_ratio; /* Used to adjust rent online */
int max_hp; /* max hp a player can have */
int max_mana; /* max mana a player can have */
int maxaward; /* max glory someone can receive from a mob */
int segvio; /* segvio on or off? */
int webserv; /* Webserver on or off? --GW*/
char * entersound; /* Sound when you enter the game */
char * connectsound; /* Sound when you connect to the MUD --GW */
sh_int read_all_mail; /* Read all player mail(was 54)*/
sh_int read_mail_free; /* Read mail for free (was 51) */
sh_int write_mail_free; /* Write mail for free(was 51) */
sh_int take_others_mail; /* Take others mail (was 54) */
sh_int imc_mail_vnum; /* Board vnum for IMC mail */
sh_int muse_level; /* Level of muse channel */
sh_int think_level; /* Level of think channel LEVEL_HIGOD*/
sh_int build_level; /* Level of build channel LEVEL_BUILD*/
sh_int log_level; /* Level of log channel LEVEL LOG*/
sh_int level_modify_proto; /* Level to modify prototype stuff LEVEL_LESSER */
sh_int level_override_private; /* override private flag */
sh_int level_mset_player; /* Level to mset a player */
sh_int stun_plr_vs_plr; /* Stun mod player vs. player */
sh_int stun_regular; /* Stun difficult */
sh_int dam_plr_vs_plr; /* Damage mod player vs. player */
sh_int dam_plr_vs_mob; /* Damage mod player vs. mobile */
sh_int dam_mob_vs_plr; /* Damage mod mobile vs. player */
sh_int dam_mob_vs_mob; /* Damage mod mobile vs. mobile */
sh_int level_getobjnotake; /* Get objects without take flag */
sh_int level_forcepc; /* The level at which you can use force on players. */
sh_int max_sn; /* Max skills */
char *guild_overseer; /* Pointer to char containing the name of the */
char *guild_advisor; /* guild overseer and advisor. */
char *pkchamp; /* Player Kill Champ --GW */
time_t boottime; /* Saves boot time for Warmboot--GW */
int max_plrs_boot; /* Saves max Players this boot --GW */
int logins; /* Logins per Boot --GW */
int save_flags; /* Toggles for saving conditions */
sh_int save_frequency; /* How old to autosave someone */
APPROVE_DATA *first_approve; /* Password Approval System --GW*/
APPROVE_DATA *last_approve; /* Password Approval System --GW */
};
struct approve_data
{
APPROVE_DATA *next;
APPROVE_DATA *prev;
char *email;
char *password;
};
struct host_data
{
HOST_DATA *next;
HOST_DATA *prev;
char *site;
};
struct topten_data
{
TOPTEN_DATA *next;
TOPTEN_DATA *prev;
sh_int type;
char *plist[10];
long values[10];
};
/*
* Room type.
*/
struct room_index_data
{
ROOM_INDEX_DATA * next;
ROOM_INDEX_DATA * next_sort;
CHAR_DATA * first_person;
CHAR_DATA * last_person;
OBJ_DATA * first_content;
OBJ_DATA * last_content;
EXTRA_DESCR_DATA * first_extradesc;
EXTRA_DESCR_DATA * last_extradesc;
AREA_DATA * area;
EXIT_DATA * first_exit;
EXIT_DATA * last_exit;
char * name;
MAP_DATA * map; /* maps */
char * description;
int vnum;
int room_flags;
MPROG_ACT_LIST * mpact; /* mudprogs */
int mpactnum; /* mudprogs */
MPROG_DATA * mudprogs; /* mudprogs */
sh_int mpscriptpos;
int progtypes; /* mudprogs */
sh_int light;
sh_int sector_type;
int tele_vnum;
sh_int tele_delay;
sh_int tunnel; /* max people that will fit */
int level;
char * music; /* MSP enabled rooms */
char * modified_by;
char * modified_date;
int room_cnt;
};
/*
* Delayed teleport type.
*/
struct teleport_data
{
TELEPORT_DATA * next;
TELEPORT_DATA * prev;
ROOM_INDEX_DATA * room;
sh_int timer;
};
/*
* Types of skill numbers. Used to keep separate lists of sn's
* Must be non-overlapping with spell/skill types,
* but may be arbitrary beyond that.
*/
#define TYPE_UNDEFINED -1
#define TYPE_HIT 1000 /* allows for 1000 skills/spells */
#define TYPE_HERB 2000 /* allows for 1000 attack types */
#define TYPE_PERSONAL 3000 /* allows for 1000 herb types */
/*
* Target types.
*/
typedef enum
{
TAR_IGNORE, TAR_CHAR_OFFENSIVE, TAR_CHAR_DEFENSIVE, TAR_CHAR_SELF,
TAR_OBJ_INV
} target_types;
typedef enum
{
SKILL_UNKNOWN, SKILL_SPELL, SKILL_SKILL, SKILL_WEAPON, SKILL_TONGUE,
SKILL_HERB
} skill_types;
struct timerset
{
int num_uses;
struct timeval total_time;
struct timeval min_time;
struct timeval max_time;
};
/*
* Skills include spells as a particular case.
*/
struct skill_type
{
char * name; /* Name of skill */
sh_int skill_level[MAX_CLASS]; /* Level needed by class */
sh_int skill_adept[MAX_CLASS]; /* Max attainable % in this skill */
sh_int race_skill_level[MAX_RACE]; /* Needed for Race Skills--GW*/
sh_int race_skill_adept[MAX_RACE]; /* Needed for Race Skills--GW*/
SPELL_FUN * spell_fun; /* Spell pointer (for spells) */
DO_FUN * skill_fun; /* Skill pointer (for skills) */
sh_int target; /* Legal targets */
sh_int minimum_position; /* Position for caster / user */
sh_int slot; /* Slot for #OBJECT loading */
sh_int min_mana; /* Minimum mana used */
sh_int beats; /* Rounds required to use skill */
char * noun_damage; /* Damage message */
char * msg_off; /* Wear off message */
sh_int guild; /* Which guild the skill belongs to */
sh_int min_level; /* Minimum level to be able to cast */
sh_int type; /* Spell/Skill/Weapon/Tongue */
int info; /* Not to sure --GW */
int flags; /* extra stuff */
char * hit_char; /* Success message to caster */
char * hit_vict; /* Success message to victim */
char * hit_room; /* Success message to room */
char * miss_char; /* Failure message to caster */
char * miss_vict; /* Failure message to victim */
char * miss_room; /* Failure message to room */
char * die_char; /* Victim death msg to caster */
char * die_vict; /* Victim death msg to victim */
char * die_room; /* Victim death msg to room */
char * imm_char; /* Victim immune msg to caster */
char * imm_vict; /* Victim immune msg to victim */
char * imm_room; /* Victim immune msg to room */
char * dice; /* Dice roll */
int value; /* Misc value */
char saves; /* What saving spell applies */
char difficulty; /* Difficulty of casting/learning */
SMAUG_AFF * affects; /* Spell affects, if any */
char * components; /* Spell components, if any */
char * teachers; /* Skill requires a special teacher */
char participants; /* # of required participants */
struct timerset userec; /* Usage record */
};
struct auction_data
{
OBJ_DATA * item; /* a pointer to the item */
CHAR_DATA * seller; /* a pointer to the seller - which may NOT quit */
CHAR_DATA * buyer; /* a pointer to the buyer - which may NOT quit */
int bet; /* last bet - or 0 if noone has bet anything */
sh_int going; /* 1,2, sold */
sh_int pulse; /* how many pulses (.25 sec) until another call-out ? */
int starting;
int flags; /* Auction Flags --GW */
};
/* Auction Flags */
#define AUCTION_HOARD_AUC BV01
/*
* These are skill_lookup return values for common skills and spells.
*/
extern bool WEBSERVER_STATUS;
extern char last_function_call [MSL];
extern char last_command [MSL];
extern DISABLED_DATA * disabled_first;
extern sh_int gsn_missile_weapons;
extern sh_int gsn_detrap;
extern sh_int gsn_assassinate;
extern sh_int gsn_backstab;
extern sh_int gsn_circle;
extern sh_int gsn_dodge;
extern sh_int gsn_hide;
extern sh_int gsn_peek;
extern sh_int gsn_pick_lock;
extern sh_int gsn_scan;
extern sh_int gsn_sneak;
extern sh_int gsn_steal;
extern sh_int gsn_gouge;
extern sh_int gsn_track;
extern sh_int gsn_search;
extern sh_int gsn_dig;
extern sh_int gsn_mount;
extern sh_int gsn_bashdoor;
extern sh_int gsn_berserk;
extern sh_int gsn_hitall;
extern sh_int gsn_disarm;
extern sh_int gsn_enhanced_damage;
extern sh_int gsn_kick;
extern sh_int gsn_parry;
extern sh_int gsn_rescue;
extern sh_int gsn_second_attack;
extern sh_int gsn_third_attack;
extern sh_int gsn_fourth_attack;
extern sh_int gsn_fifth_attack;
extern sh_int gsn_sixth_attack;
extern sh_int gsn_seventh_attack;
extern sh_int gsn_dual_wield;
extern sh_int gsn_ancient_lore;
extern sh_int gsn_feed;
extern sh_int gsn_aid;
/* used to do specific lookups */
extern sh_int gsn_first_spell;
extern sh_int gsn_first_skill;
extern sh_int gsn_first_weapon;
extern sh_int gsn_first_tongue;
extern sh_int gsn_top_sn;
/* spells */
extern sh_int gsn_blindness;
extern sh_int gsn_charm_person;
extern sh_int gsn_aqua_breath;
extern sh_int gsn_curse;
extern sh_int gsn_invis;
extern sh_int gsn_mass_invis;
extern sh_int gsn_poison;
extern sh_int gsn_sleep;
extern sh_int gsn_possess;
extern sh_int gsn_fireball; /* for fireshield */
extern sh_int gsn_chill_touch; /* for iceshield */
extern sh_int gsn_lightning_bolt; /* for shockshield */
extern sh_int gsn_reflect_magic; /* for reflect magic */
/* newer attack skills */
extern sh_int gsn_punch;
extern sh_int gsn_bash;
extern sh_int gsn_stun;
extern sh_int gsn_bite;
extern sh_int gsn_claw;
extern sh_int gsn_sting;
extern sh_int gsn_tail;
extern sh_int gsn_poison_weapon;
extern sh_int gsn_scribe;
extern sh_int gsn_brew;
extern sh_int gsn_climb;
extern sh_int gsn_pugilism;
extern sh_int gsn_long_blades;
extern sh_int gsn_short_blades;
extern sh_int gsn_flexible_arms;
extern sh_int gsn_talonous_arms;
extern sh_int gsn_bludgeons;
extern sh_int gsn_grip;
extern sh_int gsn_slice;
/* Language gsns. -- Altrag */
extern sh_int gsn_common;
extern sh_int gsn_elven;
extern sh_int gsn_dwarven;
extern sh_int gsn_pixie;
extern sh_int gsn_ogre;
extern sh_int gsn_orcish;
extern sh_int gsn_trollish;
extern sh_int gsn_goblin;
extern sh_int gsn_halfling;
extern sh_int gsn_vampiric;
extern sh_int gsn_wolfish;
extern sh_int gsn_draconian;
extern sh_int gsn_satyr;
extern sh_int gsn_wraith;
extern sh_int gsn_centaur;
extern sh_int gsn_drider;
extern sh_int gsn_drowish;
extern sh_int gsn_minotaur;
extern sh_int gsn_cyclops;
extern sh_int gsn_arewyndel;
extern sh_int gsn_brownie;
extern sh_int gsn_leprachaun;
extern sh_int gsn_mrrshan;
/*
* Utility macros.
*/
#define UMIN(a, b) ((a) < (b) ? (a) : (b))
#define UMAX(a, b) ((a) > (b) ? (a) : (b))
#define URANGE(a, b, c) ((b) < (a) ? (a) : ((b) > (c) ? (c) : (b)))
#define LOWER(c) ((c) >= 'A' && (c) <= 'Z' ? (c)+'a'-'A' : (c))
#define UPPER(c) ((c) >= 'a' && (c) <= 'z' ? (c)+'A'-'a' : (c))
#define IS_SET(flag, bit) ((flag) & (bit))
#define SET_BIT(var, bit) ((var) |= (bit))
#define REMOVE_BIT(var, bit) ((var) &= ~(bit))
#define TOGGLE_BIT(var, bit) ((var) ^= (bit))
#define CH(d) ((d)->original ? (d)->original : (d)->character)
bool ext_is_empty args( ( EXT_BV *bits ) );
void ext_clear_bits args( ( EXT_BV *bits ) );
int ext_has_bits args( ( EXT_BV *var, EXT_BV *bits) );
bool ext_same_bits args( ( EXT_BV *var, EXT_BV *bits) );
void ext_set_bits args( ( EXT_BV *var, EXT_BV *bits) );
void ext_remove_bits args( ( EXT_BV *var, EXT_BV *bits) );
void ext_toggle_bits args( ( EXT_BV *var, EXT_BV *bits) );
/*
* Here are the extended bitvector macros:
*/
#define xIS_SET(var, bit) ((var).bits[(bit) >> RSV] & 1 << ((bit) & XBM))
#define xSET_BIT(var, bit) ((var).bits[(bit) >> RSV] |= 1 << ((bit) & XBM))
#define xSET_BITS(var, bit) (ext_set_bits(&(var), &(bit)))
#define xREMOVE_BIT(var, bit) ((var).bits[(bit) >> RSV] &= ~(1 << ((bit) & XBM)))
#define xREMOVE_BITS(var, bit) (ext_remove_bits(&(var), &(bit)))
#define xTOGGLE_BIT(var, bit) ((var).bits[(bit) >> RSV] ^= 1 << ((bit) & XBM))
#define xTOGGLE_BITS(var, bit) (ext_toggle_bits(&(var), &(bit)))
#define xCLEAR_BITS(var) (ext_clear_bits(&(var)))
#define xIS_EMPTY(var) (ext_is_empty(&(var)))
#define xHAS_BITS(var, bit) (ext_has_bits(&(var), &(bit)))
#define xSAME_BITS(var, bit) (ext_same_bits(&(var), &(bit)))
/*
* Fclose (gnulibc thing)
*/
#ifndef new_fclose
#define new_fclose(fp) \
do { \
if ( (fp) == NULL ) \
{ bug("Halting new_fclose call with NULL fp (%s:%d)",__FILE__,__LINE__); } \
if ( (fp) != NULL ) { \
fclose((fp)); } \
} while(0)
#endif
/*
* Memory allocation macros.
*/
#define CREATE(result, type, number) \
do \
{ \
if ( result ) \
{ bug("CREATING in non-NULL structure -- Destroying Previous (F: %s L: %d)",__FILE__,__LINE__); result=NULL; } \
\
if (!((result) = (type *) calloc ((number), sizeof(type)))) \
{ perror("malloc failure"); abort(); } \
} while(0)
#define RECREATE(result,type,number) \
do \
{ \
if (!((result) = (type *) realloc ((result), sizeof(type) * (number))))\
{ perror("realloc failure"); abort(); } \
} while(0)
#define DISPOSE(point) \
do \
{ \
sprintf(membuf,"DISPOSING: %s: %d\n",__FILE__,__LINE__); \
write_memlog_line(membuf); \
if (!(point)) \
{ \
bug( "Freeing null pointer" ); \
fprintf( stderr, "DISPOSEing NULL in %s, line %d\n", __FILE__, __LINE__ ); \
} \
else free(point); \
point = NULL; \
} while(0)
#ifdef HASHSTR
#define STRALLOC(point) str_alloc((point))
#define QUICKLINK(point) quick_link((point))
#define QUICKMATCH(p1, p2) (int) (p1) == (int) (p2)
#define STRFREE(point) \
do \
{ \
sprintf(membuf,"STRFREEing: %s: %d\n",__FILE__,__LINE__); \
write_memlog_line(membuf); \
if (!(point)) \
{ \
bug( "Freeing null pointer" ); \
fprintf( stderr, "STRFREEing NULL in %s, line %d\n", __FILE__, __LINE__ ); \
} \
else if (str_free((point))==-1) \
fprintf( stderr, "STRFREEing bad pointer in %s, line %d\n", __FILE__, __LINE__ ); \
point = NULL; \
} while(0)
#else
#define STRALLOC(point) str_dup((point))
#define QUICKLINK(point) str_dup((point))
#define QUICKMATCH(p1, p2) strcmp((p1), (p2)) == 0
#define STRFREE(point) \
do \
{ \
sprintf(membuf,"STRFREE: %s: %d\n",__FILE__,__LINE__); \
write_memlog_line(membuf); \
if (!(point)) \
{ \
bug( "Freeing null pointer" ); \
fprintf(stderr, "STRFREEing NULL in %s, line %d\n",__FILE__,__LINE__ ); \
} \
else free((point)); \
point = NULL; \
} while(0)
#endif
/* double-linked list handling macros -Thoric */
#define LINK(link, first, last, next, prev) \
do \
{ \
if ( !(first) ) \
(first) = (link); \
else \
(last)->next = (link); \
(link)->next = NULL; \
(link)->prev = (last); \
(last) = (link); \
} while(0)
#define INSERT(link, insert, first, next, prev) \
do \
{ \
(link)->prev = (insert)->prev; \
if ( !(insert)->prev ) \
(first) = (link); \
else \
(insert)->prev->next = (link); \
(insert)->prev = (link); \
(link)->next = (insert); \
} while(0)
#define UNLINK(link, first, last, next, prev) \
do \
{ \
if ( !(link)->prev ) \
(first) = (link)->next; \
else \
(link)->prev->next = (link)->next; \
if ( !(link)->next ) \
(last) = (link)->prev; \
else \
(link)->next->prev = (link)->prev; \
} while(0)
#define CHECK_LINKS(first, last, next, prev, type) \
do { \
type *ptr, *pptr = NULL; \
if ( !(first) && !(last) ) \
break; \
if ( !(first) ) \
{ \
bug( "CHECK_LINKS: last with NULL first! %s.", \
__STRING(first) ); \
for ( ptr = (last); ptr->prev; ptr = ptr->prev ); \
(first) = ptr; \
} \
else if ( !(last) ) \
{ \
bug( "CHECK_LINKS: first with NULL last! %s.", \
__STRING(first) ); \
for ( ptr = (first); ptr->next; ptr = ptr->next ); \
(last) = ptr; \
} \
if ( (first) ) \
{ \
for ( ptr = (first); ptr; ptr = ptr->next ) \
{ \
if ( ptr->prev != pptr ) \
{ \
bug( "CHECK_LINKS(%s): %p:->prev != %p. Fixing.", \
__STRING(first), ptr, pptr ); \
ptr->prev = pptr; \
} \
if ( ptr->prev && ptr->prev->next != ptr ) \
{ \
bug( "CHECK_LINKS(%s): %p:->prev->next != %p. Fixing.",\
__STRING(first), ptr, ptr ); \
ptr->prev->next = ptr; \
}Showing the first 100 KB of 185.8 KB. Download the archive for the full file.