merc.h

src/merc.h · 171.2 KB

From the archive GWLow1.tar.gz

Download the archive   « Back to the archive contents

/***************************************************************************
 *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,
*
 *  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
 *                                                                         *
 *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
 *  Chastain, Michael Quan, and Mitchell Tse.                              *
 *                                                                         *
 *  In order to use any part of this Merc Diku Mud, you must comply with   *
 *  both the original Diku license in 'license.doc' as well the Merc       *
 *  license in 'license.txt'.  In particular, you may not remove either of *
 *  these copyright notices.                                               *
 *                                                                         *
 *  Much time and thought has gone into this software and you are          *
 *  benefitting.  We hope that you share your changes too.  What goes      *
 *  around, comes around.                                                  *
 ***************************************************************************/

#include <stdlib.h>
#include <limits.h>
#include <sys/cdefs.h>
#include <sys/time.h>  
#include "monk.h"
#include "garou.h"

/*
 * 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 )        void 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(_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
#include "player.h"
#include "old.h"
/*
 * Structure types.
 */
typedef struct  affect_data             AFFECT_DATA;
typedef struct  area_data               AREA_DATA;
typedef struct  ban_data                BAN_DATA;
typedef struct  char_data               CHAR_DATA;

typedef struct  config_data             CONFIG_DATA;
typedef struct  editor_data             EDITOR_DATA;

typedef struct  balance_data            BALANCE_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  kill_data               KILL_DATA;
typedef struct  mob_index_data          MOB_INDEX_DATA;
typedef struct  kingdom_data            KINGDOM_DATA;
typedef struct  note_data               NOTE_DATA;
typedef struct  obj_data                OBJ_DATA;
typedef struct  obj_index_data          OBJ_INDEX_DATA;
typedef struct  pc_data                 PC_DATA;
typedef struct  reset_data              RESET_DATA;
typedef struct  room_index_data         ROOM_INDEX_DATA;
typedef struct  shop_data               SHOP_DATA;
typedef struct  time_info_data          TIME_INFO_DATA;
typedef struct  weather_data            WEATHER_DATA;

typedef struct  disabled_data                 DISABLED_DATA;

/* one disabled command */
struct disabled_data
{
      DISABLED_DATA *next; /* pointer to next node */
      struct cmd_type const *command; /* pointer to the command struct*/
      char *disabled_by; /* name of disabler */
      sh_int level; /* level of disabler */
};
extern                        DISABLED_DATA     *disabled_first;

struct form_type
{
    char *      lookname;
    char *      name;
    int         hit;
    int         dam;
    int         ac;
    int         hit_mod;
    bool        squishable;
    sh_int          size;
    bool            can_cast;
    bool            can_fly;
    bool            can_wear;
    int         carry_max;
    int         max_items;
    char *          say_word;
    char *          move_word;
    int     xp_bonus;
    int     polymorph_level;
    char *          in_room_desc;
    char *          short_desc;
    bool            can_use_claws;
};


struct clanrank_type
{
    char *      rank;                   /* rank name */
    int         min_level;              /* minimum level to gain that rank */
    char *      male_name;              /* rank name for males */
    char *      female_name;            /* use some imagination */
};

struct race_type
{
    char *      name;                   /* call name of the race */
    char *      ishname;                /* elvish, gnomish etc... */
    bool        pc_race;                /* can be chosen by pcs */
    long        act;                    /* act bits for the race */
    long        aff;                    /* aff bits for the race */
    long        off;                    /* off bits for the race */
    long        imm;                    /* imm bits for the race */
    long        res;                    /* res bits for the race */
    long        vuln;                   /* vuln bits for the race */
    long        form;                   /* default form flag for the race */
    long        parts;                  /* default parts for the race */
};

/*
 * Function types.
 */
typedef void DO_FUN     args( ( CHAR_DATA *ch, char *argument ) );
typedef bool SPEC_FUN   args( ( CHAR_DATA *ch ) );
typedef void SPELL_FUN  args( ( int sn, int level, CHAR_DATA *ch, void *vo ) );



/*
 * String and memory management parameters.
 */
#define MAX_KEY_HASH             1024
#define MAX_STRING_LENGTH        8192
#define MAX_INPUT_LENGTH          400

/* 
 * Rotains Gobal Procedures
 */
void clear_stats    args( (CHAR_DATA *ch) );
void room_is_total_darkness args( (ROOM_INDEX_DATA *pRoomIndex) );
void improve_wpn    args( (CHAR_DATA *ch,int dtype, int right_hand) );
void improve_stance args( (CHAR_DATA *ch) );
void skillstance    args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void show_spell     args( (CHAR_DATA *ch, int dtype) );
void fightaction    args( (CHAR_DATA *ch, CHAR_DATA *victim, int actype , \
int dtype, int wpntype) ); 
void crack_head     args( (CHAR_DATA *ch, OBJ_DATA *obj, char *argument) );
void critical_hit   args( (CHAR_DATA *ch, CHAR_DATA *victim, int dt, int dam) );

void take_item      args( (CHAR_DATA *ch, OBJ_DATA *obj) );
void raw_kill       args( (CHAR_DATA *victim) );
void trip           args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void disarm         args( (CHAR_DATA *ch, CHAR_DATA *victim) );
void make_corpse    args( (CHAR_DATA *ch) );
void one_hit        args( (CHAR_DATA *ch, CHAR_DATA *victim, int dt, \
                                int handtype) );
void make_part      args( (CHAR_DATA *ch, char *argument) );

void home_write             args( ( ) );

void behead                 args( (CHAR_DATA *victim) );
void paradox                args( (CHAR_DATA *ch) );

void load_bans  args( (void) );
void save_bans  args( (void) );
void load_kingdoms args( (void) );
void save_kingdoms args( (void) );

/* 
 * Godwars Game Parameters
 * By Rotain
 */

#define SKILL_ADEPT               100
#define SKILL_THAC0_32             18
#define SKILL_THAC0_00              6
#define VERSION_NUMBER              1
#define DONATION_ROOM_WEAPON     3207
#define DONATION_ROOM_ARMOR      3207
#define DONATION_ROOM_REST       3207
#define MAX_VAMPIRE_POWER           3 
#define MAX_CLAN                   11
#define MAX_DISCIPLINES            44
#define MAX_ART                    12
#define MAX_FORGET                 10
#define MAX_KINGDOM                 4


/*
 * Game parameters.
 * Increase the max'es if you add more of something.
 * Adjust the pulse numbers to suit yourself.
 */

#define PARADOX_TICK               30
#define MAX_SKILL                 173
#define MAX_SPELL                  70
#define MAX_LEVEL                  12
#define NO_WATCH                   10
#define NO_GODLESS                 (MAX_LEVEL - 2)
#define LEVEL_HERO                 (MAX_LEVEL - 9)
#define LEVEL_IMMORTAL             (MAX_LEVEL - 5)

#define LEVEL_MORTAL               (MAX_LEVEL - 10)
#define LEVEL_AVATAR               (MAX_LEVEL - 9)
#define LEVEL_APPRENTICE           (MAX_LEVEL - 8)
#define LEVEL_MAGE                 (MAX_LEVEL - 7)
#define LEVEL_ARCHMAGE             (MAX_LEVEL - 6)
#define LEVEL_NINJA                (MAX_LEVEL - 6)
#define LEVEL_MONK                 (MAX_LEVEL - 6)
#define LEVEL_BUILDER              (MAX_LEVEL - 5)
#define LEVEL_QUESTMAKER           (MAX_LEVEL - 4)
#define LEVEL_ENFORCER             (MAX_LEVEL - 3)
#define LEVEL_JUDGE                (MAX_LEVEL - 2)
#define LEVEL_HIGHJUDGE            (MAX_LEVEL - 1)
#define LEVEL_IMPLEMENTOR          (MAX_LEVEL)

#define PULSE_PER_SECOND            4
#define PULSE_VIOLENCE            ( 3 * PULSE_PER_SECOND)
#define OLOAD_30333                 1
/* Save the database - OLC 1.1b */
#define PULSE_DB_DUMP             (1800* PULSE_PER_SECOND ) /* 30 minutes  */


/* Status levels, change here to modify - Vic */
/*
#define STAT_AVATAR                      1
#define STAT_IMMORTAL                   20
#define STAT_GODLING                    40
#define STAT_DEMIGOD                    60
#define STAT_LESSER                     80
#define STAT_GREATER                   100
#define STAT_SUPREME                   100
*/

#define PULSE_EMBRACE             ( 4 * PULSE_PER_SECOND)
#define PULSE_MOBILE              ( 4 * PULSE_PER_SECOND)
#define PULSE_TICK                (30 * PULSE_PER_SECOND)
#define PULSE_AREA                (60 * PULSE_PER_SECOND)
#define PULSE_WW                  ( 4 * PULSE_PER_SECOND)



struct artifact_type
{
  char * player_name;
  int    object_vnum;
};

#include "board.h"

/*
 * Site ban structure.
 */
struct  ban_data
{
    BAN_DATA *  next;
    char *      name;
};



/*
 * Time and weather stuff.
 */
#define SUN_DARK                    0
#define SUN_RISE                    1
#define SUN_LIGHT                   2
#define SUN_SET                     3

#define SKY_CLOUDLESS               0
#define SKY_CLOUDY                  1
#define SKY_RAINING                 2
#define SKY_LIGHTNING               3

struct  time_info_data
{
    int         hour;
    int         day;
    int         month;
    int         year;
};

struct  weather_data
{
    int         mmhg;
    int         change;
    int         sky;
    int         sunlight;
};



/*
 * 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 SUB_NORTH DIR_NORTH
#define SUB_EAST  DIR_EAST
#define SUB_SOUTH DIR_SOUTH
#define SUB_WEST  DIR_WEST
#define SUB_UP    DIR_UP
#define SUB_DOWN  DIR_DOWN
#define SUB_NE    DIR_NORTHEAST
#define SUB_NW    DIR_NORTHWEST
#define SUB_SE    DIR_SOUTHEAST
#define SUB_SW    DIR_SOUTHWEST


/*
 * Connected state for a channel.
 */
#define CON_PLAYING                      0
#define CON_GET_NAME                     1
#define CON_GET_OLD_PASSWORD             2
#define CON_CONFIRM_NEW_NAME             3
#define CON_GET_NEW_PASSWORD             4
#define CON_CONFIRM_NEW_PASSWORD         5
#define CON_GET_NEW_SEX                  6
#define CON_GET_NEW_CLASS                7
#define CON_GET_NEW_VT102                8
#define CON_GET_NEW_ANSI                 9 
#define CON_READ_MOTD                    10
#define CON_NOT_PLAYING                  11
#define CON_EDITING                      12


/*
 * 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,
  /* timer types ONLY below this point */
  SUB_TIMER_DO_ABORT = 128, SUB_TIMER_CANT_ABORT
} char_substates;

/*
 * Timer macros.
 */

#define TIMER(ch, tmr)          ((ch)->tick_timer[(tmr)])
#define SET_TIMER(ch, tmr, tm)  ((ch)->tick_timer[(tmr)] = (tm))
#define ADD_TIMER(ch, tmr, tm)  ((ch)->tick_timer[(tmr)] += (tm))
#define SUB_TIMER(ch, tmr, tm)  ((ch)->tick_timer[(tmr)] -= (tm))
#define TIME_UP(ch, tmr)        ((ch)->tick_timer[(tmr)] == 0 ? TRUE : FALSE)

#define RTIMER(room, rtmr)       ((room)->tick_timer[(rtmr)])
#define SET_RTIMER(room, rtmr, rtm) ((room)->tick_timer[(rtmr)] = (rtm))
#define ADD_RTIMER(room, rtmr, rtm)  ((room)->tick_timer[(rtmr)] += (rtm))
#define SUB_RTIMER(room, rtmr, rtm)  ((room)->tick_timer[(rtmr)] -= (rtm))
#define RTIME_UP(room, rtmr)     ((room)->tick_timer[(rtmr)] == 0 ? TRUE : FALSE)

#define TIMER_LAYONHANDS        0
#define TIMER_WRENCH            1
#define TIMER_WRENCHED          2
#define TIMER_VAMPCALL          3
#define TIMER_UNCONCIOUS        4
#define TIMER_VAMP_INHABIT      5
#define TIMER_DAEMONIC_TRANSFORM 6
#define TIMER_MESMERISE         7
#define TIMER_MESMERISED        8
#define TIMER_FORAGE            9
#define TIMER_NO_ARBOREA        11
#define TIMER_TREE_WALK         12
#define TIMER_CAN_PRAC          13
#define TIMER_CAN_EAT_ARMS      14
#define TIMER_THIRD_ARM_GROWING 15
#define TIMER_FOURTH_ARM_GROWING 16
#define TIMER_THIRD_ARM_GOING   17
#define TIMER_FOURTH_ARM_GOING  18
#define TIMER_SCALPED           19
#define TIMER_CAN_CALL_ROCKS    20
#define TIMER_CANT_BE_TURNED    21
#define TIMER_CANT_TURN         22
#define TIMER_FIGHT_LAG         23
#define TIMER_CAN_CHANGE_HAWK   24
#define TIMER_CAN_CREATE_SHARD  25
#define TIMER_CAN_GUST          26
#define TIMER_CAN_ENTER_STASIS  27
#define TIMER_MAKE_SNOWMAN      28
#define TIMER_ENTOMB            29
#define TIMER_CAN_BREATHE_FROST 30
#define TIMER_HELLFIRE_SUMMON   31
#define TIMER_ON_SPEED          32
#define TIMER_ON_LSD            33
#define TIMER_ON_HASH           34
#define TIMER_CAN_CALL_WAR_HORSE 35
#define TIMER_WAR_HORSE_GO      36
#define TIMER_CAN_SPIT_VENOM    37
#define TIMER_CAN_GAIN_VOODOO   38
#define TIMER_CAN_FEATHER       39
#define TIMER_CAN_SHRIEK        40
#define TIMER_CAN_POLYMORPH     41
#define TIMER_DRAGON_GROW       42
#define TIMER_VAMPIRE_GROW      43
#define TIMER_SKILL_LEV1        44
#define TIMER_SKILL_LEV2        45
#define TIMER_CANT_SWARM        46
#define TIMER_CANT_BORROWLIFE   47
#define TIMER_TREE              48
#define TIMER_NEXUS_STUNNED     49
#define TIMER_GOLEM             50
#define TIMER_TAINT             51
#define TIMER_NEWBIE_IMM        52
#define TIMER_CAN_DO_NEXUS      53
#define TIMER_CAN_USE_HEALER    54
#define TIMER_DISCORD           55
#define TIMER_SPHINX_ROAR       56
#define TIMER_INFERNO           57
#define TIMER_CHAOSPORT         58
#define TIMER_CANMAJESTY        59
#define TIMER_MAJESTY           60

#define MAX_TIMER               61


#define RTIMER_STINKING_CLOUD   0
#define RTIMER_LIFE_VORTEX      1
#define RTIMER_DEATH_VORTEX     2
#define RTIMER_GLYPH_PROTECTION 3
#define RTIMER_HIDE_ROOM        4
#define RTIMER_SWARM_BEES       5
#define RTIMER_SWARM_RATS       6
#define RTIMER_SWARM_BATS       7
#define RTIMER_GHOST_LIGHT      8
#define RTIMER_NEXUS_FLAME      9
#define RTIMER_NEXUS_WATER      10
#define RTIMER_NEXUS_AIR        11
#define RTIMER_NEXUS_EARTH      12
#define RTIMER_NEXUS_ENTROPY    13
#define RTIMER_WALL_NORTH       14
#define RTIMER_WALL_EAST        15
#define RTIMER_WALL_SOUTH       16
#define RTIMER_WALL_WEST        17
#define RTIMER_WALL_UP          18
#define RTIMER_WALL_DOWN        19
#define RTIMER_DISCORD          20
#define RTIMER_DARK_ROOM        21
#define RTIMER_SILENCE          22
#define MAX_RTIMER              30



/*
 * Descriptor (channel) structure.
 */
struct  descriptor_data
{
    DESCRIPTOR_DATA *   next;
    DESCRIPTOR_DATA *   snoop_by;
    CHAR_DATA *         character;
    CHAR_DATA *         original;
    char *              host;
    sh_int              descriptor;
    sh_int              connected;
    bool                fcommand;
    bool                vt102;
    char                inbuf           [4 * MAX_INPUT_LENGTH];
    char                incomm          [MAX_INPUT_LENGTH];
    char                inlast          [MAX_INPUT_LENGTH];
    int                 repeat;
    char *              showstr_head;  /* From ENVY code to compile */
    char *              showstr_point; /* From ENVY code to compile */
    char *              outbuf;
    int                 outsize;
    int                 outtop; 
    void *              pEdit;          /* OLC */
    char **             pString;        /* OLC */
    int                 editor;         /* OLC */       
};



/*
 * 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;
};



/*
 * TO types for act.
 */
#define TO_ROOM             0
#define TO_NOTVICT          1
#define TO_VICT             2
#define TO_CHAR             3
#define TO_ALL              4

/*
 * Help table types.
 */
struct  help_data
{
    HELP_DATA * next;
    HELP_DATA * prev;
    AREA_DATA * area;
    sh_int      level;
    char *      keyword;
    char *      text;
};



/*
 * Shop types.
 */
#define MAX_TRADE        5

struct  shop_data
{
    SHOP_DATA * next;                   /* Next 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           */
};



/*
 * Data structure for notes.
 */
struct  note_data
{
    NOTE_DATA * next;
    char *      sender;
    char *      date;
    char *      to_list;
    char *      subject;
    char *      text;
    time_t      date_stamp;
    time_t      expire;
};



/*
 * An affect.
 */
struct  affect_data
{
    AFFECT_DATA *       next;
    sh_int              type;
    sh_int              duration;
    sh_int              location;
    sh_int              modifier;
    int                 bitvector;
};



/*
 * A kill structure (indexed by level).
 */
struct  kill_data
{
    sh_int              number;
    sh_int              killed;
};



/***************************************************************************
 *                                                                         *
 *                   VALUES OF INTEREST TO AREA BUILDERS                   *
 *                   (Start of section ... start here)                     *
 *                                                                         *
 ***************************************************************************/


/* ASCII conversions -- used so we can have letters in this file */

#define A                       1
#define B                       2
#define C                       4
#define D                       8
#define E                       16
#define F                       32
#define G                       64
#define H                       128

#define I                       256
#define J                       512
#define K                       1024
#define L                       2048
#define M                       4096
#define N                       8192
#define O                       16384
#define P                       32768

#define Q                       65536
#define R                       131072
#define S                       262144
#define T                       524288
#define U                       1048576
#define V                       2097152
#define W                       4194304
#define X                       8388608

#define Y                       16777216
#define Z                       33554432
#define aa                      67108864        /* doubled due to
conflicts */
#define bb                      134217728
#define cc                      268435456    
#define ddd                     536870912
#define ee                      1073741824
#define ff                      2147483648
#define gg                      4294967256


/* These are the good old dragon/werewolf types - same variable */
#define WERE_WOLF                         1
#define WERE_RAT                          2
#define WERE_TIGER                  3
#define WERE_BEAR                         4
#define WERE_SHARK                  5

#define DRAGON_RED                  1
#define DRAGON_WHITE                2
#define DRAGON_BLACK                3
#define DRAGON_GREEN                4
#define DRAGON_BLUE                 5
#define DRAGON_SILVER               6
#define DRAGON_GOLD                 7
#define DRAGON_SHADOW               8

/* size */
#define SIZE_TINY                       0
#define SIZE_SMALL                      1
#define SIZE_MEDIUM                     2
#define SIZE_LARGE                      3
#define SIZE_HUGE                       4
#define SIZE_GIANT                      5

/*
#define FRM_WOLF               1
#define FRM_BAT                2
#define FRM_MIST               3
#define FRM_DOLPHIN            4
#define FRM_FLAME              5
#define FRM_SPIDER             6
#define FRM_LIGHT              7
#define FRM_COCKROACH          8
#define FRM_RABBIT             9
#define FRM_BLOB               10
#define FRM_FROG               11
#define FRM_IDIOT              12
#define FRM_WHIRLWIND          13
#define FRM_CRIMSON            14
#define FRM_HAWK               15
#define FRM_WEREWOLF           16
#define FRM_FOX                17
#define FRM_WYVERN             18
#define FRM_GARGANTUA          19
#define FRM_PEASANT            20
#define FRM_WARRIOR            21
#define FRM_BARBARIAN          22
#define FRM_GIRL               23
*/

/* The demonic forms */
#define FRM_LEMURE             1
#define FRM_NUPPERIBO          2
#define FRM_SPINAGON           3
#define FRM_BARBAZU            4
#define FRM_ABISHAI            5
#define FRM_OSYLUTH            6
#define FRM_HAMATULA           7
#define FRM_ERINYES            8
#define FRM_AMNIZU             9
#define FRM_CORNUGON           10
#define FRM_GELUGON            11
#define FRM_PIT_FIEND          12
#define FRM_PIT_LORD           13
#define FRM_DROWSPIDER         14

/*
#define FRM_TREE               37

#define FRM_DRAGON_1           38
#define FRM_DRAGON_13          50
*/

#define FRM_WERE_RAT           1
#define FRM_WERE_BEAR          1
#define FRM_WERE_TIGER         1
#define FRM_WERE_SHARK         1
#define FRM_GOLEM              1
#define FRM_PIXIE              1

#define MAX_FORMS              15

/*
 * Bits for 'affected_by'.
 * Used in #MOBILES. flags2
 */

#define VAMP_ASHES              (A)
#define VAMP_CLONE              (B)
#define VAMP_OBJMASK            (C)
#define AFF_TOTALBLIND          (D)
#define AFF_SPIRITGUARD         (E)
#define AFF_CDONE               (F)

#define AFF_ALLOW_VAMP          (P)
#define AFF_ALLOW_WERE          (Q)
#define AFF_ALLOW_ELAD          (R)
#define AFF_ALLOW_DEMON         (S)
#define AFF_ALLOW_WARLOCK       (T)
#define AFF_CLAW                (L)
#define AFF_BITE                (M)
#define AFF_TAIL                (N)
#define AFF_WING                (O)

// flag3
#define AFF3_BLINK_1ST_RD       (A)
#define AFF3_BLINK_2ND_RD       (B)


/*
 * Well known mob virtual numbers.
 * Defined in #MOBILES.
 */
#define MOB_VNUM_CITYGUARD         3060
#define MOB_VNUM_VAMPIRE           3404


/*
 * Immunities, for players.  KaVir.
 */
#define IMM_SLASH             1 /* Resistance to slash, slice.          */
#define IMM_STAB              2 /* Resistance to stab, pierce.          */
#define IMM_SMASH             4 /* Resistance to blast, pound, crush.   */
#define IMM_ANIMAL            8 /* Resistance to bite, claw.            */
#define IMM_MISC             16 /* Resistance to grep, suck, whip.      */
#define IMM_CHARM            32 /* Immune to charm spell.               */
#define IMM_HEAT             64 /* Immune to fire/heat spells.          */
#define IMM_COLD            128 /* Immune to frost/cold spells.         */
#define IMM_LIGHTNING       256 /* Immune to lightning spells.          */
#define IMM_ACID            512 /* Immune to acid spells.               */
#define IMM_SUMMON         1024 /* Immune to being summoned.            */
#define IMM_VOODOO         2048 /* Immune to voodoo magic.              */
#define IMM_VAMPIRE        4096 /* Allow yourself to become a vampire.  */
#define IMM_STAKE          8192 /* Immune to being staked (vamps only). */
#define IMM_SUNLIGHT      16384 /* Immune to sunlight (vamps only).     */
#define IMM_SHIELDED      32768 /* For Obfuscate. Block scry, etc.      */
#define IMM_HURL          65536 /* Cannot be hurled.                    */
#define IMM_BACKSTAB     131072 /* Cannot be backstabbed.               */
#define IMM_KICK         262144 /* Cannot be kicked.                    */
#define IMM_DISARM       524288 /* Cannot be disarmed.                  */
#define IMM_STEAL       1048576 /* Cannot have stuff stolen.            */
#define IMM_SLEEP       2097152 /* Immune to sleep spell.               */
#define IMM_DRAIN       4194304 /* Immune to energy drain.              */
#define IMM_DEMON       8388608 /* Allow yourself to become a demon.    */
#define IMM_TRANSPORT  16777216 /* Objects can't be transported to you. */
#define IMM_TRAVEL     33554432

/*
 * ACT bits for mobs.
 * Used in #MOBILES.
 */
#define ACT_IS_NPC                    (A)       /* Auto set for mobs    */
#define ACT_SENTINEL                (B)         /* Stays in one room    */
#define ACT_SCAVENGER               (C)         /* Picks up objects     */
#define ACT_AGGRESSIVE              (D)         /* Attacks PC's         */
#define ACT_STAY_AREA               (E)         /* Won't leave area     */
#define ACT_WIMPY                   (F)         /* Flees when hurt      */
#define ACT_PET                     (G)         /* Auto set for pets    */
#define ACT_TRAIN                   (H)         /* Can train PC's       */
#define ACT_PRACTICE                (I)         /* Can practice PC's    */
#define ACT_MOUNT                   (J)         /* Can be mounted       */
#define ACT_NOPARTS                 (K)         /* Dead = no body parts */
#define ACT_NOEXP                   (L)         /* No exp for killing   */
#define ACT_PROTOTYPE               (M)
#define ACT_NOAUTOKILL                  (N)

/*
 * Thingers for Demon Warps
 */

#define WARP_CBODY                              1
#define WARP_SBODY                              2
#define WARP_STRONGARMS                         4
#define WARP_STRONGLEGS                         8
#define WARP_VENOMTONG                          16
#define WARP_SPIKETAIL                          32
#define WARP_BADBREATH                          64
#define WARP_QUICKNESS                          128
#define WARP_STAMINA                            256
#define WARP_HUNT                               512
#define WARP_DEVOUR                             1024
#define WARP_TERROR                             2048
#define WARP_REGENERATE                         4096
#define WARP_STEED                              8192
#define WARP_WEAPON                             16384
#define WARP_INFIRMITY                          32768
#define WARP_GBODY                              65536
#define WARP_SCARED                             131072
#define WARP_MAGMA                              262144
#define WARP_WEAK                               524288
#define WARP_SLOW                               1048576
#define WARP_VULNER                             2097152
#define WARP_SHARDS                             4194304
#define WARP_WINGS                              8388608
#define WARP_CLUMSY                             16777216
#define WARP_STUPID                             33554432
#define WARP_SPOON                              67108864
#define WARP_FORK                               134217728
#define WARP_KNIFE                              268435456
#define WARP_SALADBOWL                          536870912



/* Bits for the Discie thing Numbers.. really.. not bits */

#define DISC_VAMP_CELE                  2
#define DISC_VAMP_FORT                  3
#define DISC_VAMP_OBTE                  4
#define DISC_VAMP_PRES                  5
#define DISC_VAMP_QUIE                  6
#define DISC_VAMP_THAU                  7
#define DISC_VAMP_AUSP                  8
#define DISC_VAMP_DOMI                  9
#define DISC_VAMP_OBFU                  10
#define DISC_VAMP_POTE                  11
#define DISC_VAMP_PROT                  12
#define DISC_VAMP_SERP                  13
#define DISC_VAMP_VICI                  14
#define DISC_VAMP_DAIM                  15
#define DISC_VAMP_ANIM                  16

#define DISC_WERE_BEAR                  18
#define DISC_WERE_LYNX                  19
#define DISC_WERE_BOAR                  20
#define DISC_WERE_OWL                   21
#define DISC_WERE_SPID                  22
#define DISC_WERE_WOLF                  23
#define DISC_WERE_HAWK                  24
#define DISC_WERE_MANT                  25
#define DISC_WERE_RAPT                  26
#define DISC_WERE_LUNA                  27
#define DISC_WERE_PAIN                  28
#define DISC_WERE_CONG                  29

#define DISC_DAEM_HELL                  30
#define DISC_DAEM_ATTA                  31
#define DISC_DAEM_TEMP                  32
#define DISC_DAEM_MORP                  33
#define DISC_DAEM_CORR                  34
#define DISC_DAEM_GELU                  35
#define DISC_DAEM_DISC                  36
#define DISC_DAEM_NETH                  37
#define DISC_DAEM_IMMU                  38
#define DISC_VAMP_CHIM                  39
#define DISC_VAMP_THAN                  40
#define DISC_VAMP_OBEA                  41
#define DISC_VAMP_NECR                  42
#define DISC_VAMP_MELP                  43

/*
 * Bits for 'affected_by'.
 * Used in #MOBILES.
 */
#define AFF_BLIND                     1
#define AFF_INVISIBLE                 2
#define AFF_DETECT_EVIL               4
#define AFF_DETECT_INVIS              8
#define AFF_DETECT_MAGIC             16
#define AFF_DETECT_HIDDEN            32
#define AFF_SHADOWPLANE              64 /* Creatures in shadow plane - KaVir */
#define AFF_SANCTUARY               128
#define AFF_FAERIE_FIRE             256
#define AFF_INFRARED                512
#define AFF_CURSE                  1024
#define AFF_FLAMING                2048 /* For burning creatures - KaVir */
#define AFF_POISON                 4096
#define AFF_PROTECT                8192
#define AFF_ETHEREAL              16384 /* For ethereal creatures - KaVir */
#define AFF_SNEAK                 32768
#define AFF_HIDE                  65536
#define AFF_SLEEP                131072
#define AFF_CHARM                262144
#define AFF_FLYING               524288
#define AFF_PASS_DOOR           1048576
#define AFF_POLYMORPH           2097152 /* For polymorphed creatures -
KaVir */
#define AFF_SHADOWSIGHT         4194304 /* Can see between planes - KaVir */
#define AFF_WEBBED              8388608 /* Cannot move - KaVir */
#define AFF_TENDRILS           16777216 /* Cannot get pregnant - KaVir */
#define AFF_DROWFIRE           33554432 /* Drow Darkness - Rotain */   
#define AFF_ZULOFORM           67108864
#define AFF_SHIFT             134217728
#define AFF_PEACE             268435456
#define AFF_INFIRMITY         536870912
#define AFF_GODBLESS         1073741824 /* Monk and Paladin Bless */
#define AFF_STEELSHIELD      4294967296 /* Monk Peace */
#define MONKFLAMING          8589934592

/*
 * Bits for 'itemaffect'.
 * Used in #MOBILES.
 */
#define ITEMA_SHOCKSHIELD             1
#define ITEMA_FIRESHIELD              2
#define ITEMA_ICESHIELD               4
#define ITEMA_ACIDSHIELD              8
#define ITEMA_DBPASS                 16
#define ITEMA_CHAOSSHIELD            32
#define ITEMA_ARTIFACT               64
#define ITEMA_REGENERATE            128
#define ITEMA_SPEED                 256
#define ITEMA_VORPAL                512
#define ITEMA_PEACE                1024
#define ITEMA_RIGHT_SILVER         2048
#define ITEMA_LEFT_SILVER          4096
#define ITEMA_REFLECT              8192
#define ITEMA_RESISTANCE          16384
#define ITEMA_VISION              32768
#define ITEMA_STALKER             65536
#define ITEMA_VANISH             131072
#define ITEMA_RAGER              262144
#define ITEMA_HIGHLANDER         524288

/*
 * Newbie Pack Crap
 */
#define ITEM_NP_BREASTPLATE     30333
#define ITEM_NP_HELMET          30334
#define ITEM_NP_SLEEVES         30335
#define ITEM_NP_LEGGINGS        30336
#define ITEM_NP_GAUNTLETS       30337
#define ITEM_NP_BOOTS           30338
#define ITEM_NP_LONGSWORD       30340
#define ITEM_NP_BUCKLER         30341
#define ITEM_NP_RING            30342
#define ITEM_NP_COLLAR          30343
#define ITEM_NP_LANTERN         30344           
 





/*
 * Rune, Glyph and Sigil bits.
 */
#define RUNE_FIRE             1
#define RUNE_AIR              2
#define RUNE_EARTH            4
#define RUNE_WATER            8
#define RUNE_DARK             16
#define RUNE_LIGHT            32
#define RUNE_LIFE             64
#define RUNE_DEATH            128
#define RUNE_MIND             256
#define RUNE_SPIRIT           512
#define RUNE_MASTER           1024
#define GLYPH_CREATION        1
#define GLYPH_DESTRUCTION     2
#define GLYPH_SUMMONING       4
#define GLYPH_TRANSFORMATION  8
#define GLYPH_TRANSPORTATION  16
#define GLYPH_ENHANCEMENT     32
#define GLYPH_REDUCTION       64
#define GLYPH_CONTROL         128
#define GLYPH_PROTECTION      256
#define GLYPH_INFORMATION     512
#define SIGIL_SELF            1
#define SIGIL_TARGETING       2
#define SIGIL_AREA            4
#define SIGIL_OBJECT          8


/*
 * Advanced spells.
 */
#define ADV_DAMAGE            1
#define ADV_AFFECT            2
#define ADV_ACTION            4
#define ADV_AREA_AFFECT       8
#define ADV_VICTIM_TARGET    16
#define ADV_OBJECT_TARGET    32
#define ADV_GLOBAL_TARGET    64
#define ADV_NEXT_PAGE       128
#define ADV_PARAMETER       256
#define ADV_SPELL_FIRST     512
#define ADV_NOT_CASTER     1024
#define ADV_NO_PLAYERS     2048
#define ADV_SECOND_VICTIM  4096
#define ADV_SECOND_OBJECT  8192
#define ADV_REVERSED      16384
#define ADV_STARTED       32768
#define ADV_FINISHED      65536
#define ADV_FAILED       131072
#define ADV_MESSAGE_1    262144
#define ADV_MESSAGE_2    524288
#define ADV_MESSAGE_3   1048576 

/*
 * Advanced spell actions.
 */
#define ACTION_NONE           0
#define ACTION_MOVE           1
#define ACTION_MOB            2
#define ACTION_OBJECT         3

/*
 * Advanced spell affects.
 */
#define ADV_STR                       1
#define ADV_DEX                       2
#define ADV_INT                       4
#define ADV_WIS                       8
#define ADV_CON                      16
#define ADV_SEX                      32
#define ADV_MANA                     64
#define ADV_HIT                     128
#define ADV_MOVE                    256
#define ADV_AC                      512
#define ADV_HITROLL                1024
#define ADV_DAMROLL                2048
#define ADV_SAVING_SPELL           4096



/* Colour scale macros - added 12th Aug 1995 by Calamar */

#define NO_COLOUR       ""              /* Blank */
#define GREY            "[0;1;30m"     /* Dark Grey */
#define D_RED           "[0;0;31m"     /* Dark Red */
#define L_RED           "[0;1;31m"     /* Light Red */
#define D_GREEN         "[0;0;32m"     /* Dark Green */
#define L_GREEN         "[0;1;32m"     /* Light Green */
#define BROWN           "[0;0;33m"     /* Brown */
#define YELLOW          "[0;1;33m"     /* Yellow */
#define D_BLUE          "[0;0;34m"     /* Dark Blue */
#define L_BLUE          "[0;1;34m"     /* Light Blue */
#define MAGENTA         "[0;0;35m"     /* Magenta */
#define PINK            "[0;1;35m"     /* Pink */
#define D_CYAN          "[0;0;36m"     /* Dark Cyan */
#define L_CYAN          "[0;1;36m"     /* Light Cyan */
#define NORMAL          "[0;0;37m"     /* Light Grey */
#define WHITE           "[0;0;38m"     /* White */

#define ADD_COLOUR(_player,_str,_col) {char swh_temp[255]; \
if (!IS_NPC(_player) && IS_SET(_player->act, PLR_ANSI)) {swh_temp[0] = '\0'; \
strcpy(swh_temp, _col); strcat(swh_temp, _str); strcat(swh_temp, NORMAL); \
strcpy(_str, swh_temp);}} 

#define SCALE_COLS 4

#define COL_SCALE(_swh_str,_swh_ch,_swh_curr,_swh_max) \
        ADD_COLOUR(_swh_ch, _swh_str, \
        (_swh_curr < 1) ? L_RED : \
        (_swh_curr < _swh_max) ? \
        scale[(SCALE_COLS * _swh_curr) / ((_swh_max > 0) \
        ? _swh_max : 1)] : L_CYAN)

extern char *scale[SCALE_COLS];

/*
 * Bits for 'vampire'.
 * Used for player vampires.
 */
#define VAM_FANGS                     1
#define VAM_CLAWS                     2
#define VAM_NIGHTSIGHT                4
#define VAM_FLYING                    8 /* For flying creatures */
#define VAM_SONIC                    16 /* For creatures with full detect */
#define VAM_CHANGED                  32 /* Changed using a vampire power */

#define VAM_PROTEAN                  64 /* Claws, nightsight, and change */
#define VAM_CELERITY                128 /* 66%/33% chance 1/2 extra attacks */
#define VAM_FORTITUDE               256 /* 5 hp less per hit taken */
#define VAM_POTENCE                 512 /* Deal out 1.5 times normal damage */
#define VAM_OBFUSCATE              1024 /* Disguise and invis */
#define VAM_AUSPEX                 2048 /* Truesight, etc */
#define VAM_OBTENEBRATION          4096 /* Shadowplane/sight and shadowbody */
#define VAM_SERPENTIS              8192 /* Eyes/serpent, heart/darkness, etc */

#define VAM_DISGUISED             16384 /* For the Obfuscate disguise ability */
#define VAM_MORTAL                32768 /* For Obfuscate mortal ability. */

#define VAM_DOMINATE              65536 /* Evileye, command */

#define VAM_EVILEYE              131072 /* Evileye, command */

#define VAM_PRESENCE             262144 /* Presence discipline */
#define VAM_VICISSITUDE          524288 /* Vicissitude discipline */
#define VAM_THAU                1048576 /* Thaumaturgy discipline */
#define VAM_ANIMAL              2097152 /* Animalism discipline */
#define VAM_SHIFTED             4194304 /* Non-poly shift */
#define VAM_QUIETUS             8388608 /* Quietus discipline */
#define VAM_HEAD               16777216
#define VAM_TAIL               33554432
#define VAM_EXOSKELETON        67108864
#define VAM_HORNS             134217728
#define VAM_WINGS             268435456


/*
 * Bits for 'polymorph'.
 * Used for players.
 */
#define POLY_BAT                      1
#define POLY_WOLF                     2
#define POLY_MIST                     4
#define POLY_SERPENT                  8
#define POLY_RAVEN                   16
#define POLY_FISH                    32
#define POLY_FROG                    64
#define POLY_ZULOFORM               128
#define POLY_SHIFT                  256
#define POLY_SPIDER                 512

/*
 * Languages.
 */
#define LANG_COMMON                   0
#define DIA_OLDE                      1
#define DIA_BAD                       2
#define LANG_DARK                     4



/*
 * Score.
 */
#define SCORE_TOTAL_XP                0
#define SCORE_HIGH_XP                 1
#define SCORE_TOTAL_LEVEL             2
#define SCORE_HIGH_LEVEL              3
#define SCORE_QUEST                   4
#define SCORE_NUM_QUEST               5



/*
 * Zombie Lord.
 */
#define ZOMBIE_NOTHING                0
#define ZOMBIE_TRACKING               1
#define ZOMBIE_ANIMATE                2
#define ZOMBIE_CAST                   3
#define ZOMBIE_REST                   4



/*
 * Damcap values.
 */
#define DAM_CAP               0
#define DAM_CHANGE            1


/* return values for check_imm */
#define IS_NORMAL               0
#define IS_DIMMUNE              1
#define IS_RESISTANT            2
#define IS_VULNERABLE           3

/* damage classes */
#define DAM_NONE                0
#define DAM_BASH                1
#define DAM_PIERCE              2
#define DAM_SLASH               3
#define DAM_FIRE                4
#define DAM_COLD                5
#define DAM_LIGHTNING           6
#define DAM_ACID                7
#define DAM_POISON              8
#define DAM_NEGATIVE            9
#define DAM_HOLY                10
#define DAM_ENERGY              11
#define DAM_MENTAL              12
#define DAM_DISEASE             13
#define DAM_DROWNING            14
#define DAM_LIGHT               15
#define DAM_OTHER               16
#define DAM_HARM                17
#define DAM_CHARM               18
#define DAM_SOUND               19

/* IMM bits for mobs */
#define DIMM_SUMMON              (A)
#define DIMM_CHARM               (B)
#define DIMM_MAGIC               (C)
#define DIMM_WEAPON              (D)
#define DIMM_BASH                (E)
#define DIMM_PIERCE              (F)
#define DIMM_SLASH               (G)
#define DIMM_FIRE                (H)
#define DIMM_COLD                (I)
#define DIMM_LIGHTNING           (J)
#define DIMM_ACID                (K)
#define DIMM_POISON              (L)
#define DIMM_NEGATIVE            (M)
#define DIMM_HOLY                (N)
#define DIMM_ENERGY              (O)
#define DIMM_MENTAL              (P)
#define DIMM_DISEASE             (Q)
#define DIMM_DROWNING            (R)
#define DIMM_LIGHT               (S)
#define DIMM_SOUND               (T)
#define DIMM_WOOD                (X)
#define DIMM_SILVER              (Y)
#define DIMM_IRON                (Z)
 
/* RES bits for mobs */
#define RES_SUMMON              (A)
#define RES_CHARM               (B)
#define RES_MAGIC               (C)
#define RES_WEAPON              (D)
#define RES_BASH                (E)
#define RES_PIERCE              (F)
#define RES_SLASH               (G)
#define RES_FIRE                (H)
#define RES_COLD                (I)
#define RES_LIGHTNING           (J)
#define RES_ACID                (K)
#define RES_POISON              (L)
#define RES_NEGATIVE            (M)
#define RES_HOLY                (N)
#define RES_ENERGY              (O)
#define RES_MENTAL              (P)
#define RES_DISEASE             (Q)
#define RES_DROWNING            (R)
#define RES_LIGHT               (S)
#define RES_SOUND               (T)
#define RES_WOOD                (X)
#define RES_SILVER              (Y)
#define RES_IRON                (Z)
 
/* VULN bits for mobs */
#define VULN_SUMMON             (A)
#define VULN_CHARM              (B)
#define VULN_MAGIC              (C)
#define VULN_WEAPON             (D)
#define VULN_BASH               (E)
#define VULN_PIERCE             (F)
#define VULN_SLASH              (G)
#define VULN_FIRE               (H)
#define VULN_COLD               (I)
#define VULN_LIGHTNING          (J)
#define VULN_ACID               (K)
#define VULN_POISON             (L)
#define VULN_NEGATIVE           (M)
#define VULN_HOLY               (N)
#define VULN_ENERGY             (O)
#define VULN_MENTAL             (P)
#define VULN_DISEASE            (Q)
#define VULN_DROWNING           (R)
#define VULN_LIGHT              (S)
#define VULN_SOUND              (T)
#define VULN_WOOD               (X)
#define VULN_SILVER             (Y)
#define VULN_IRON               (Z)


/*
 * Bits for Demonic Champions.
 *
 * new demon fields in player.h and old ones in old.h
 */


/*
 * Mounts
 */
#define IS_ON_FOOT                    0
#define IS_MOUNT                      1
#define IS_RIDING                     2
#define IS_CARRIED                    4
#define IS_CARRYING                   8




/*
 * Sex.
 * Used in #MOBILES.
 */
#define SEX_NEUTRAL                   0
#define SEX_MALE                      1
#define SEX_FEMALE                    2



/*
 * Well known object virtual numbers.
 * Defined in #OBJECTS.
 */
#define OBJ_VNUM_MONEY_ONE            2
#define OBJ_VNUM_MONEY_SOME           3

/* Demonic Transformation */

#define OBJ_VNUM_DHELM               27924
#define OBJ_VNUM_DGREAVES            27925
#define OBJ_VNUM_DCLOAK              27926
#define OBJ_VNUM_DARMOR              27927
#define OBJ_VNUM_DRING               27928
#define OBJ_VNUM_DSWORD              27929
#define OBJ_VNUM_DSHIELD             27930

#define OBJ_VNUM_BROD                30073
#define OBJ_VNUM_LKLAIVE             29696
#define OBJ_VNUM_STAKE               30011
#define OBJ_VNUM_MEDAL               29521
#define OBJ_VNUM_KHORNE              29664
#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_FINAL_TURD          16

#define OBJ_VNUM_MUSHROOM            20
#define OBJ_VNUM_LIGHT_BALL          21
#define OBJ_VNUM_SPRING              22
#define OBJ_VNUM_BLOOD_SPRING        23

#define OBJ_VNUM_SCHOOL_MACE       3700
#define OBJ_VNUM_SCHOOL_DAGGER     3701
#define OBJ_VNUM_SCHOOL_SWORD      3702
#define OBJ_VNUM_SCHOOL_VEST       3703
#define OBJ_VNUM_SCHOOL_SHIELD     3704
#define OBJ_VNUM_SCHOOL_BANNER     3716

/* For KaVir's stuff */
#define OBJ_VNUM_SOULBLADE        30000
#define OBJ_VNUM_GATE             30042
#define OBJ_VNUM_GATE2            30072
#define OBJ_VNUM_PORTAL           30001
#define OBJ_VNUM_EGG              30002
#define OBJ_VNUM_EMPTY_EGG        30003
#define OBJ_VNUM_SPILLED_ENTRAILS 30004
#define OBJ_VNUM_QUIVERING_BRAIN  30005
#define OBJ_VNUM_SQUIDGY_EYEBALL  30006
#define OBJ_VNUM_SPILT_BLOOD      30007
#define OBJ_VNUM_VOODOO_DOLL      30010
#define OBJ_VNUM_RIPPED_FACE      30012
#define OBJ_VNUM_TORN_WINDPIPE    30013
#define OBJ_VNUM_CRACKED_HEAD     30014
#define OBJ_VNUM_SLICED_EAR       30025
#define OBJ_VNUM_SLICED_NOSE      30026
#define OBJ_VNUM_KNOCKED_TOOTH    30027
#define OBJ_VNUM_TORN_TONGUE      30028
#define OBJ_VNUM_SEVERED_HAND     30029
#define OBJ_VNUM_SEVERED_FOOT     30030
#define OBJ_VNUM_SEVERED_THUMB    30031
#define OBJ_VNUM_SEVERED_INDEX    30032
#define OBJ_VNUM_SEVERED_MIDDLE   30033
#define OBJ_VNUM_SEVERED_RING     30034
#define OBJ_VNUM_SEVERED_LITTLE   30035
#define OBJ_VNUM_SEVERED_TOE      30036
#define OBJ_VNUM_PROTOPLASM       30037
#define OBJ_VNUM_QUESTCARD        30039
#define OBJ_VNUM_QUESTMACHINE     30040
#define OBJ_VNUM_COPPER           30049
#define OBJ_VNUM_IRON             30050
#define OBJ_VNUM_STEEL            30051
#define OBJ_VNUM_ADAMANTITE       30052

#define MOB_VNUM_GUARDIAN         30001
#define MOB_VNUM_SERVANT          30002
#define MOB_VNUM_MOUNT            6
#define MOB_VNUM_FROG             7
#define MOB_VNUM_RAVEN            8
#define MOB_VNUM_CAT              9
#define MOB_VNUM_DOG              10
#define MOB_VNUM_EYE              12
#define MOB_VNUM_WRAITH		  13
#define MOB_VNUM_SATAN            30003
#define MOB_VNUM_DEMON            30005
#define MOB_VNUM_SERPENT          30006
#define MOB_VNUM_ILLUSION         30007

/*
 * Item types.
 * Used in #OBJECTS.
 */
#define ITEM_LIGHT                    1
#define ITEM_SCROLL                   2
#define ITEM_WAND                     3
#define ITEM_STAFF                    4
#define ITEM_WEAPON                   5
#define ITEM_TREASURE                 8
#define ITEM_ARMOR                    9
#define ITEM_POTION                  10
#define ITEM_FURNITURE               12
#define ITEM_TRASH                   13
#define ITEM_CONTAINER               15
#define ITEM_DRINK_CON               17
#define ITEM_KEY                     18
#define ITEM_FOOD                    19
#define ITEM_MONEY                   20
#define ITEM_BOAT                    22
#define ITEM_CORPSE_NPC              23
#define ITEM_CORPSE_PC               24
#define ITEM_FOUNTAIN                25
#define ITEM_PILL                    26
#define ITEM_PORTAL                  27
#define ITEM_EGG                     28
#define ITEM_VOODOO                  29
#define ITEM_STAKE                   30
#define ITEM_MISSILE                 31 /* Ammo vnum, cur, max, type */
#define ITEM_AMMO                    32 /* ???, dam min, dam max, type */
#define ITEM_QUEST                   33
#define ITEM_QUESTCARD               34
#define ITEM_QUESTMACHINE            35
#define ITEM_SYMBOL                  36
#define ITEM_BOOK                    37
#define ITEM_PAGE                    38
#define ITEM_TOOL                    39
#define ITEM_WALL                    40
#define ITEM_COPPER                  41
#define ITEM_IRON                    42
#define ITEM_STEEL                   43
#define ITEM_ADAMANTITE              44
#define ITEM_GEMSTONE                45
#define ITEM_HILT                    46
#define ITEM_DTOKEN                  47
#define ITEM_HEAD                    48
#define ITEM_KINGDOM_POWER           50

/*
 * Weapon Stats
 */

#define WEAPON_FLAMING          (A)
#define WEAPON_FROST            (B)
#define WEAPON_VAMPIRIC         (C)
#define WEAPON_SHARP            (D)
#define WEAPON_VORPAL           (E)
#define WEAPON_TWO_HANDS        (F)
#define WEAPON_SHOCKING         (G)
#define WEAPON_POISON           (H)
#define WEAPON_SUNBLADE         (I)
#define WEAPON_DRAGONLANCE      (J)
#define WEAPON_SILVER           (K)
#define WEAPON_RUNE_FORCE_BOLT  (L)
#define WEAPON_RUNE_SMITE_EVIL  (M)
#define WEAPON_RUNE_BLAZE       (N)
#define WEAPON_RUNE_LIGHTNING   (O)
#define WEAPON_RUNE_DANCING     (P)
#define WEAPON_ELE_FLAME        (Q)
#define WEAPON_ELE_WATER        (R)
#define WEAPON_ELE_EARTH        (S)
#define WEAPON_ELE_AIR          (T)


/*
 * Extra flags.
 * Used in #OBJECTS.
 */
#define ITEM_GLOW                     1
#define ITEM_HUM                      2
#define ITEM_THROWN                   4
#define ITEM_KEEP                     8
#define ITEM_VANISH                  16
#define ITEM_INVIS                   32
#define ITEM_MAGIC                   64
#define ITEM_NODROP                 128
#define ITEM_BLESS                  256
#define ITEM_ANTI_GOOD              512
#define ITEM_ANTI_EVIL             1024
#define ITEM_ANTI_NEUTRAL          2048
#define ITEM_NOREMOVE              4096
#define ITEM_INVENTORY             8192
#define ITEM_LOYAL                16384
#define ITEM_SHADOWPLANE          32768
#define ITEM_PROTOTYPE              (L)

/* Item extra flags II, the return of the item flags!  */

#define ITEM_ARM                  (A)
#define ITEM_NYSTUL               (B)
#define ITEM_NO_INTERRUPT         (C)
#define ITEM_DAEMONSEED           (D)
#define ITEM_JUJU_BAG             (F)
#define ITEM_VOO_HEAD             (G)
#define ITEM_VOO_DEAD             (H)
#define ITEM_VOO_BODY             (I)
#define ITEM_VOO_THREAD           (J)
#define ITEM_INGRED_GLOIN         (K)
#define ITEM_INGRED_FROGBREATH    (L)
#define ITEM_INGRED_PAPACOCO      (M)
#define ITEM_INGRED_MULDALEAF     (N)
#define ITEM_INGRED_SCULLYWEED    (O)
#define ITEM_INGRED_WORMWART      (P)
#define ITEM_INGRED_TILLIFREEN    (Q)
#define ITEM_INGRED_BAJUJU        (R)
#define ITEM_ATTACK_GOOD          (S)
#define ITEM_ITEMHIDE             (T)
#define ITEM_ICE                  (U)

/* artifact and relic flags */

#define ITEM_TELEPORTS             (W)  /* teleports upon owner death */
#define ITEM_DESTROYED             (X)  /* destroyed upon owner death */
#define ITEM_UNIQUE                (Y)  /* only 1 in game ever */
#define ITEM_DESIRED               (Z)  /* you can't let go of it ever */
#define ITEM_INDESTRUCTABLE        (aa) /* guess */
#define ITEM_TELEPORT_PROTECTION   (bb) /* teleports when attempts to destroy it */
#define ITEM_KNOW_OWNER            (cc) /* owner displayed on artifact command */

#define ITEM_FLYING                (dd)
#define ITEM_FORM_MELDED           (ee)



/*
 * Wear flags.
 * Used in #OBJECTS.
 */
#define ITEM_TAKE                     1
#define ITEM_WEAR_FINGER              2
#define ITEM_WEAR_NECK                4
#define ITEM_WEAR_BODY                8
#define ITEM_WEAR_HEAD               16
#define ITEM_WEAR_LEGS               32
#define ITEM_WEAR_FEET               64
#define ITEM_WEAR_HANDS             128 
#define ITEM_WEAR_ARMS              256
#define ITEM_WEAR_SHIELD            512
#define ITEM_WEAR_ABOUT            1024 
#define ITEM_WEAR_WAIST            2048
#define ITEM_WEAR_WRIST            4096
#define ITEM_WIELD                 8192
#define ITEM_HOLD                 16384
#define ITEM_WEAR_FACE            32768



/*
 * Special types.
 * Used in #OBJECTS for special items - KaVir.
 */
#define SITEM_ACTIVATE                1
#define SITEM_TWIST                   2
#define SITEM_PRESS                   4
#define SITEM_PULL                    8
#define SITEM_TARGET                  16
#define SITEM_SPELL                   32
#define SITEM_TRANSPORTER             64
#define SITEM_TELEPORTER              128
#define SITEM_DELAY1                  256
#define SITEM_DELAY2                  512
#define SITEM_OBJECT                 1024
#define SITEM_MOBILE                 2048
#define SITEM_ACTION                 4096
#define SITEM_MORPH                  8192
#define SITEM_SILVER                16384
#define SITEM_WOLFWEAPON            32768
#define SITEM_DROW                  65536
#define SITEM_CHAMPWEAPON          131072
#define SITEM_DEMONIC              262144
#define SITEM_HIGHLANDER           524288
#define SITEM_COPPER              1048576
#define SITEM_IRON                2097152
#define SITEM_STEEL               4194304
#define SITEM_ADAMANTITE          8388608
#define SITEM_GEMSTONE           16777216
#define SITEM_HILT               33554432
#define SITEM_PDEMONIC           67108864
#define SITEM_MONK              134217728 
/*
 * Apply types (for quest affects).
 * Used in #OBJECTS.
 */
#define QUEST_STR                     1
#define QUEST_DEX                     2
#define QUEST_INT                     4
#define QUEST_WIS                     8
#define QUEST_CON                    16
#define QUEST_HITROLL                32
#define QUEST_DAMROLL                64
#define QUEST_HIT                   128
#define QUEST_MANA                  256
#define QUEST_MOVE                  512
#define QUEST_AC                   1024

#define QUEST_NAME                 2048
#define QUEST_SHORT                4096
#define QUEST_LONG                 8192
#define QUEST_FREENAME            16384

#define QUEST_ENCHANTED           32768
#define QUEST_SPELLPROOF          65536
#define QUEST_ARTIFACT           131072
#define QUEST_IMPROVED           262144
#define QUEST_MASTER_RUNE        524288
#define QUEST_RELIC             1048576
#define QUEST_BLOODA            2097152
#define QUEST_CLONED            4194304
#define QUEST_ZOMBIE            8388608
#define QUEST_FORGE            16777216

/*
 * Tool types.
 */
#define TOOL_PEN                      1
#define TOOL_PLIERS                   2
#define TOOL_SCALPEL                  4



/*
 * Apply types (for affects).
 * Used in #OBJECTS.
 */
#define APPLY_NONE                    0
#define APPLY_STR                     1
#define APPLY_DEX                     2
#define APPLY_INT                     3
#define APPLY_WIS                     4
#define APPLY_CON                     5
#define APPLY_SEX                     6
#define APPLY_CLASS                   7
#define APPLY_LEVEL                   8
#define APPLY_AGE                     9
#define APPLY_HEIGHT                 10
#define APPLY_WEIGHT                 11
#define APPLY_MANA                   12
#define APPLY_HIT                    13
#define APPLY_MOVE                   14
#define APPLY_GOLD                   15
#define APPLY_EXP                    16
#define APPLY_AC                     17
#define APPLY_HITROLL                18
#define APPLY_DAMROLL                19
#define APPLY_SAVING_PARA            20
#define APPLY_SAVING_ROD             21
#define APPLY_SAVING_PETRI           22
#define APPLY_SAVING_BREATH          23
#define APPLY_SAVING_SPELL           24
#define APPLY_POLY                   25



/*
 * 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_CHAT             1200
#define ROOM_VNUM_TEMPLE           3001
#define ROOM_VNUM_ALTAR            3054
#define ROOM_VNUM_SCHOOL           3700
#define ROOM_VNUM_HELL            30000
#define ROOM_VNUM_CRYPT           30001
#define ROOM_VNUM_DISCONNECTION   3
#define ROOM_VNUM_IN_OBJECT       30008
#define ROOM_VNUM_AWINNER            70
#define ROOM_VNUM_ALOSER             69
#define ROOM_VNUM_CAINE           27000
#define ROOM_VNUM_DEVOUR          30006

/*
 * Room flags.
 * Used in #ROOMS.
 */
#define ROOM_DARK                     1
#define ROOM_NO_OTRANS                2
#define ROOM_NO_MOB                   4
#define ROOM_INDOORS                  8
#define ROOM_PRIVATE                512
#define ROOM_SAFE                  1024
#define ROOM_SOLITARY              2048
#define ROOM_PET_SHOP              4096
#define ROOM_NO_RECALL             8192
#define ROOM_NO_TELEPORT          16384
#define ROOM_TOTAL_DARKNESS       32768
#define ROOM_BLADE_BARRIER        65536
#define ROOM_ARENA               131072
#define ROOM_FLAMING             262144
#define ROOM_SILENCE             524288
#define ROOM_PROTOTYPE              (P)
#define ROOM_WRESTLING              (Q)
/*
 * Room text flags (KaVir).
 * Used in #ROOMS.
 */
#define RT_LIGHTS                     1 /* Toggles lights on/off */
#define RT_SAY                        2 /* Use this if no others powers */
#define RT_ENTER                      4
#define RT_CAST                       8
#define RT_THROWOUT                  16 /* Erm...can't remember ;) */
#define RT_OBJECT                    32 /* Creates an object */
#define RT_MOBILE                    64 /* Creates a mobile */
#define RT_LIGHT                    128 /* Lights on ONLY */
#define RT_DARK                     256 /* Lights off ONLY */
#define RT_OPEN_LIFT                512 /* Open lift */
#define RT_CLOSE_LIFT              1024 /* Close lift */
#define RT_MOVE_LIFT               2048 /* Move lift */
#define RT_SPELL                   4096 /* Cast a spell */
#define RT_PORTAL                  8192 /* Creates a one-way portal */
#define RT_TELEPORT               16384 /* Teleport player to room */

#define RT_ACTION                 32768
#define RT_BLANK_1                65536
#define RT_BLANK_2               131072

#define RT_RETURN               1048576 /* Perform once */
#define RT_PERSONAL             2097152 /* Only shows message to char */
#define RT_TIMER                4194304 /* Sets object timer to 1 tick */



/*
 * Directions.
 * Used in #ROOMS.
 */
#define DIR_NORTH                     0
#define DIR_EAST                      1
#define DIR_SOUTH                     2
#define DIR_WEST                      3
#define DIR_UP                        4
#define DIR_DOWN                      5



/*
 * Exit flags.
 * Used in #ROOMS.
 */
#define EX_ISDOOR                     1
#define EX_CLOSED                     2
#define EX_LOCKED                     4
#define EX_PICKPROOF                 32
#define EX_NOPASS                     (G)
#define EX_EASY                       (H)
#define EX_HARD                       (I)
#define EX_INFURIATING                (J)
#define EX_NOCLOSE                    (K)
#define EX_NOLOCK                     (L)

#define EX_ICE_WALL                   (M)
#define EX_FIRE_WALL                  (N)
#define EX_SWORD_WALL                 (O)
#define EX_PRISMATIC_WALL             (P)
#define EX_IRON_WALL                  (Q)
#define EX_MUSHROOM_WALL              (R)
#define EX_CALTROP_WALL               (S)
#define EX_ASH_WALL                   (T)

#define EX_WARDING                    (U)

#define MAX_EXFLAG                    20
#define MAX_WALL                       8



/*
 * Sector types.
 * Used in #ROOMS.
 */
#define SECT_INSIDE                   0
#define SECT_CITY                     1
#define SECT_FIELD                    2
#define SECT_FOREST                   3
#define SECT_HILLS                    4
#define SECT_MOUNTAIN                 5
#define SECT_WATER_SWIM               6
#define SECT_WATER_NOSWIM             7
#define SECT_UNUSED                   8
#define SECT_AIR                      9
#define SECT_DESERT                  10
#define SECT_MAX                     11



/*
 * Equipment wear locations.
 * Used in #RESETS.
 */
#define WEAR_NONE                    -1
#define WEAR_LIGHT                    0
#define WEAR_FINGER_L                 1
#define WEAR_FINGER_R                 2
#define WEAR_NECK_1                   3
#define WEAR_NECK_2                   4
#define WEAR_BODY                     5
#define WEAR_HEAD                     6
#define WEAR_LEGS                     7
#define WEAR_FEET                     8
#define WEAR_HANDS                    9
#define WEAR_ARMS                    10
#define WEAR_SHIELD                  11
#define WEAR_ABOUT                   12
#define WEAR_WAIST                   13
#define WEAR_WRIST_L                 14
#define WEAR_WRIST_R                 15
#define WEAR_WIELD                   16
#define WEAR_HOLD                    17
#define WEAR_THIRD                   18
#define WEAR_FOURTH                  19
#define WEAR_FACE                    20
#define WEAR_SCABBARD_L              21
#define WEAR_SCABBARD_R              22
#define MAX_WEAR                     23




/*
 * Locations for damage.
 */
#define LOC_HEAD                      0
#define LOC_BODY                      1
#define LOC_ARM_L                     2
#define LOC_ARM_R                     3
#define LOC_LEG_L                     4
#define LOC_LEG_R                     5

/*
 * For Head
 */
#define LOST_EYE_L                     1
#define LOST_EYE_R                     2
#define LOST_EAR_L                     4
#define LOST_EAR_R                     8
#define LOST_NOSE                     16
#define BROKEN_NOSE                   32
#define BROKEN_JAW                    64
#define BROKEN_SKULL                 128
#define LOST_HEAD                    256
#define LOST_TOOTH_1                 512 /* These should be added..... */
#define LOST_TOOTH_2                1024 /* ...together to caculate... */
#define LOST_TOOTH_4                2048 /* ...the total number of.... */
#define LOST_TOOTH_8                4096 /* ...teeth lost.  Total..... */
#define LOST_TOOTH_16               8192 /* ...possible is 31 teeth.   */
#define LOST_TONGUE                16384

/*
 * For Body
 */
#define BROKEN_RIBS_1                  1 /* Remember there are a total */
#define BROKEN_RIBS_2                  2 /* of 12 pairs of ribs in the */
#define BROKEN_RIBS_4                  4 /* human body, so not all of  */
#define BROKEN_RIBS_8                  8 /* these bits should be set   */
#define BROKEN_RIBS_16                16 /* at the same time.          */
#define BROKEN_SPINE                  32
#define BROKEN_NECK                   64
#define CUT_THROAT                   128
#define CUT_STOMACH                  256
#define CUT_CHEST                    512

/*
 * For Arms
 */
#define BROKEN_ARM                     1
#define LOST_ARM                       2
#define LOST_HAND                      4
#define LOST_FINGER_I                  8 /* Index finger */
#define LOST_FINGER_M                 16 /* Middle finger */
#define LOST_FINGER_R                 32 /* Ring finger */
#define LOST_FINGER_L                 64 /* Little finger */
#define LOST_THUMB                   128
#define BROKEN_FINGER_I              256 /* Index finger */
#define BROKEN_FINGER_M              512 /* Middle finger */
#define BROKEN_FINGER_R             1024 /* Ring finger */
#define BROKEN_FINGER_L             2048 /* Little finger */
#define BROKEN_THUMB                4096

/*
 * For Legs
 */
#define BROKEN_LEG                     1
#define LOST_LEG                       2
#define LOST_FOOT                      4
#define LOST_TOE_A                     8
#define LOST_TOE_B                    16
#define LOST_TOE_C                    32
#define LOST_TOE_D                    64 /* Smallest toe */
#define LOST_TOE_BIG                 128
#define BROKEN_TOE_A                 256
#define BROKEN_TOE_B                 512
#define BROKEN_TOE_C                1024
#define BROKEN_TOE_D                2048 /* Smallest toe */
#define BROKEN_TOE_BIG              4096

/*
 * For Bleeding
 */
#define BLEEDING_HEAD                  1
#define BLEEDING_THROAT                2
#define BLEEDING_ARM_L                 4
#define BLEEDING_ARM_R                 8
#define BLEEDING_HAND_L               16
#define BLEEDING_HAND_R               32
#define BLEEDING_LEG_L                64
#define BLEEDING_LEG_R               128
#define BLEEDING_FOOT_L              256
#define BLEEDING_FOOT_R              512


/*
 * For Spec powers on players
 */
#define EYE_SPELL                      1 /* Spell when they look at you */
#define EYE_SELFACTION                 2 /* You do action when they look */
#define EYE_ACTION                     4 /* Others do action when they look */




/***************************************************************************
 *                                                                         *
 *                   VALUES OF INTEREST TO AREA BUILDERS                   *
 *                   (End of this section ... stop here)                   *
 *                                                                         *
 ***************************************************************************/

/*
 * Conditions.
 */
#define COND_DRUNK                    0
#define COND_FULL                     1
#define COND_THIRST                   2



/*
 * Stats - KaVir.
 */
#define STAT_STR                      0
#define STAT_END                      1
#define STAT_REF                      2
#define STAT_FLE                      2



/*
 * Positions.
 */
#define POS_DEAD                      0
#define POS_MORTAL                    1
#define POS_INCAP                     2
#define POS_STUNNED                   3
#define POS_SLEEPING                  4
#define POS_MEDITATING                5
#define POS_SITTING                   6
#define POS_RESTING                   7
#define POS_FIGHTING                  8
#define POS_STANDING                  9
/* Status of Arena */

#define FIGHT_OPEN                    0
#define FIGHT_START                   1
#define FIGHT_BUSY                    2
#define FIGHT_LOCK                    3


/* Wrestling, by Zaphonite
 * Very similar to arena,
 * some arena code used,
 * not much though
 */
#define WRESTLE_OPEN                  0
#define WRESTLE_START                 1
#define WRESTLE_BUSY                  2
#define WRESTLE_LOCK                  3
#define WRESTLE_TOURNAMENT            4
#define WRESTLE_TOURNMATCH            5

/*
 * ACT bits for players.
 */
/*
#define PLR_EMBRACING                 4 
#define PLR_EMBRACED                256 
Seriosly bugged bits for some reason dont enable them they arent used*/
#define PLR_IS_NPC                    1         /* Don't EVER set.      */
#define PLR_AUTOEXIT                  8
#define PLR_AUTOLOOT                 16
#define PLR_AUTOSAC                  32
#define PLR_BLANK                    64
#define PLR_BRIEF                   128
#define PLR_COMBINE                 512
#define PLR_PROMPT                 1024
#define PLR_TELNET_GA              2048

#define PLR_HOLYLIGHT              4096
#define PLR_WIZINVIS               8192
#define PLR_ANSI                  16384

#define PLR_SILENCE               32768
#define PLR_VT102                 65536
#define PLR_INCOG                131072
#define PLR_NO_TELL              262144
#define PLR_LOG                  524288
#define PLR_DENY                1048576
#define PLR_FREEZE              2097152
#define PLR_GODLESS            16777216
#define PLR_WATCHER            33554432
#define PLR_ACID               67108864
#define PLR_CHALLENGER        134217728
#define PLR_CHALLENGED        268435456
#define PLR_TAG               536870912
#define PLR_NOTAG            1073741824

/*New bits for playrs (Infidel)*/

#define NEW_SLAM       1
#define NEW_QUILLS     2
#define NEW_JAWLOCK    4
#define NEW_PERCEPTION 8
#define NEW_SKIN       16
#define NEW_TIDE       32
#define NEW_COIL       64
#define NEW_REND       128
#define NEW_MONKFLAME  256
#define NEW_SCLAWS     512
#define NEW_LWRATH    1024
#define NEW_MONKCLOAK 2048
#define NEW_MONKADAM  4096
#define NEW_MONKSKIN  8192
#define NEW_MONKFAVOR 16384
#define NEW_CLOAK     32768
#define NEW_DROWHATE  65536
#define NEW_DARKNESS  131072
#define THIRD_HAND    262144
#define FOURTH_HAND   524288
#define NEW_CLANNABLE 1048576
#define NEWBIE_PACK   2097152 // Sigh Sage you make things hard :)
#define NEW_NATURAL   4194304
#define NEW_POWER     8388608
#define NEW_CLASSTRUST 16777216
/*
 * EXTRA bits for players. (KaVir)
 */
                                /*    1 */
                                /*    2 */
#define EXTRA_TRUSTED                 4
#define EXTRA_NEWPASS                 8
#define EXTRA_OSWITCH                16
#define EXTRA_SWITCH                 32
#define EXTRA_FAKE_CON               64
#define TIED_UP                     128
#define GAGGED                      256
#define BLINDFOLDED                 512
#define EXTRA_STANCE               1024 
#define EXTRA_DONE                 2048
#define EXTRA_EXP                  4096
#define EXTRA_PREGNANT             8192
#define EXTRA_LABOUR              16384
#define EXTRA_BORN                32768
#define EXTRA_PROMPT              65536
#define EXTRA_MARRIED            131072
#define EXTRA_AFK                262144
#define EXTRA_DRAGON             524288 
#define EXTRA_CALL_ALL          1048576
#define EXTRA_ANTI_GODLESS      2097152
#define EXTRA_BSD               4194304
#define EXTRA_EARTHMELD         8388608
#define EXTRA_PLASMA           16777216
#define EXTRA_POTENCY          33554432
#define EXTRA_AWE              67108864
#define EXTRA_ROT             134217728
#define EXTRA_ZOMBIE          268435456
#define EXTRA_BAAL            536870912
#define EXTRA_FLASH          1073741824
/*
  SAGE YOU STUPID IDIOT. STOP USING EXTRA_BITS DAMNIT
   YER MAKIN THE NUMBERS TOO DAMN BIG. I'M GOING TO KILL YOU
#define EXTRA_BSD            2147483648 
*/

/* 
* AGE Bits.
 */
#define AGE_CHILDE                    0
#define AGE_NEONATE                   1
#define AGE_ANCILLA                   2
#define AGE_ELDER                     3
#define AGE_METHUSELAH                4


/*
 * Stances for combat
 */
#define STANCE_NONE                  -1
#define STANCE_NORMAL                 0
#define STANCE_VIPER                  1
#define STANCE_CRANE                  2
#define STANCE_CRAB                   3
#define STANCE_MONGOOSE               4
#define STANCE_BULL                   5
#define STANCE_MANTIS                 6
#define STANCE_DRAGON                 7
#define STANCE_TIGER                  8
#define STANCE_MONKEY                 9
#define STANCE_SWALLOW               10
#define STANCE_WOLF                  11
#define STANCE_KOZUDO                12
#define STANCE_LYNX                  13
#define STANCE_PHEONIX               14
#define STANCE_WYVERN                15

/* other shit */
#define COMM_NOARENA            0
#define COMM_AFK                1
#define COMM_NORESTORE          2
#define SHL_INVISIBLE           3

/*
 * Obsolete bits.
 */
#if 0
#define PLR_NO_SHOUT             131072 /* Obsolete     */
#endif



/*
 * Channel bits.
 */
#define CHANNEL_AUCTION               1
#define CHANNEL_CHAT                  2
#define CHANNEL_HACKER                4
#define CHANNEL_IMMTALK               8
#define CHANNEL_MUSIC                16
#define CHANNEL_QUESTION             32
#define CHANNEL_SHOUT                64
#define CHANNEL_YELL                128
#define CHANNEL_VAMPTALK            256
#define CHANNEL_HOWL                512
#define CHANNEL_LOG                1024
#define CHANNEL_PRAY               2048
#define CHANNEL_INFO               4096
#define CHANNEL_SPARE              8192
#define CHANNEL_TELL              16384
#define CHANNEL_MAGETALK          32768
#define CHANNEL_HIGHTALK          65536
#define CHANNEL_KTALK            131072
#define CHANNEL_SIGN             262144
#define CHANNEL_MONK             524288
#define CHANNEL_MIKTALK         1048576 

struct kingdom_data
{
        OBJ_DATA *object;
        int num;
        char *name;
        char *who_name;
        char *leader_name;
        int pk;
        int pd;
        int recall;
        int altar;
};


/*
 * Prototype for a mob.
 * This is the in-memory version of #MOBILES.
 */
struct  mob_index_data
{
    MOB_INDEX_DATA *    next;
    SPEC_FUN *          spec_fun;
    SHOP_DATA *         pShop;
    CHAR_DATA *         mount;
    CHAR_DATA *         wizard;
    AREA_DATA *         area;           /* OLC */
    char *              hunting;
    char *              player_name;
    char *              short_descr;
    char *              long_descr;
    char *              description;
    char *              lord;
    char *              morph;
    char *              createtime;
    char *              pload;
    char *              lasttime;
    char *              lasthost;
    char *              powertype;
    char *              poweraction;
    char *              prompt;
    char *              cprompt;
    sh_int              spectype;
    sh_int              specpower;
    int                 loc_hp  [7];
    int                 vnum;
    sh_int              count;
    sh_int              killed;
    sh_int              sex;
    sh_int              mounted;
    sh_int              home;
    int                 level;
    int                 immune;
    int                 polyaff;
    int                 vampaff;
    int                 itemaffect;
    int                 vamppass;
    int                 form;
    int                 act;
    int                 extra;
    int affected_by;
    sh_int              alignment;
    sh_int              hitroll;                /* Unused */
    sh_int              ac;                     /* Unused */
    sh_int              hitnodice;              /* Unused */
    sh_int              hitsizedice;            /* Unused */
    sh_int              hitplus;                /* Unused */
    sh_int              damnodice;              /* Unused */
    sh_int              damsizedice;            /* Unused */
    sh_int              damplus;                /* Unused */
    int                 gold;                   /* Unused */
   /*int                 special;
    int                 class; */
};

struct balance_data
{
    int                 pkills;
    int                 pkilled;
    int                 members;
    int                 total_score;
    int                 position;
    int                 total_gen;
    int                 num_tertiary;
    int                 total_alignment;
};

struct  editor_data
{
    sh_int              numlines;
    sh_int              on_line;
    sh_int              size;
    char                line[49][81];
};

struct config_data
{
    int         demons;
    int         mages;
    int         vampires;
    int         werewolves;
    int         drow;
    int         monks;  
    int         ninjas;
};



/*
 * One character (PC or NPC).
 */
struct  char_data
{
    CHAR_DATA *         next;
    CHAR_DATA *         prev_in_room;
    CHAR_DATA *         next_in_room;
    CHAR_DATA *         master;
    CHAR_DATA *         leader;
    CHAR_DATA *         fighting;
    CHAR_DATA *         embracing;
    CHAR_DATA *         embraced;
    CHAR_DATA *         blinkykill;
    CHAR_DATA *         reply;
    CHAR_DATA *         mount;
    CHAR_DATA *         wizard;
    CHAR_DATA *         challenger; /*  person who challenged you */
    CHAR_DATA *         challenged; /*  person who you challenged */
    CHAR_DATA *         gladiator;  /*  ARENA player wagered on */
    SPEC_FUN *          spec_fun;
    MOB_INDEX_DATA *    pIndexData;
    DESCRIPTOR_DATA *   desc;
    AFFECT_DATA *       affected;
    OBJ_DATA *          carrying;
    ROOM_INDEX_DATA *   in_room;
    ROOM_INDEX_DATA *   was_in_room;
    PC_DATA *           pcdata;
    DO_FUN *            last_cmd;
    DO_FUN *            prev_cmd;   /* mapping */
    char *              hunting;
    char *              name;
    char *              pload;
    char *              short_descr;
    char *              long_descr;
    char *              description;
    char *              lord;
    char *              morph;
    char *              createtime;
    char *              lasttime;
    char *              lasthost;
    char *              poweraction;
    char *              powertype;
    char *              prompt;
    char *              cprompt;
    char *              prefix;
    sh_int              sex;
    sh_int              race;
    sh_int              class;
    int                 immune;
    int                 polyaff;
    int                 vampaff_a;
    int                 fight_timer;
    int                 itemaffect;
    int                 vamppass_a;
    int                 form;
    int                 warp;
    int                 explevel;
    int                 expgained;
    int                 levelexp;
    int                 power[MAX_DISCIPLINES];
    int                 xhitroll;
    int                 xdamroll;

/* SMAUUUUUUUUUUUG */
    void *              dest_buf;
    void *              spare_ptr;
    int                 tempnum;
    EDITOR_DATA *       editor;
    sh_int              substate;
    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 */
/* End O' Smaug */

    /* Dh Flags */
    int         cclan;
    int         flag2;
    int         flag3;
    int         flag4;
    sh_int            generation;
    sh_int              primary;
    sh_int              proper_size;
    sh_int              size;
    sh_int              cur_form;
    sh_int              dragtype;
    sh_int              rage;
    sh_int              siltol;
/* end */
    sh_int              tick_timer[MAX_TIMER];
    sh_int              warpcount;
    sh_int              vampgen_a;
    sh_int              spectype;
    sh_int              specpower;
    sh_int              loc_hp  [7];
    sh_int              wpn     [13];
    sh_int              spl     [5];
    sh_int              cmbt    [8];
    sh_int              stance  [15];
    sh_int              beast;
    sh_int              mounted;
    sh_int              home;
    sh_int              level;
    sh_int              trust;
    int                 played;
    time_t              logon;
    time_t              save_time;
    sh_int              timer;
    sh_int              wait;
    int                 pkill;
    int                 pdeath;
    int                 mkill;
    int                 mdeath;
    int                 hit;
    int                 max_hit;
    sh_int              mana;
    sh_int              max_mana;
    sh_int              move;
    sh_int              max_move;
    int                 gold;
    int                 exp;
    int                 act;
    int                 extra;
    int                 newbits;
    int                 special;
    int affected_by;
    sh_int              position;
    sh_int              practice;
    sh_int              carry_weight;
    sh_int              carry_number;
    sh_int              saving_throw;
    sh_int              alignment;
    sh_int              hitroll;
    sh_int              damroll;
    sh_int              armor;
    sh_int              wimpy;
    sh_int              deaf;
    sh_int              paradox         [3];
    sh_int              damcap          [2];
    int                 monkstuff;
    int                 monkcrap;
    int                 monkab [4];
    sh_int              chi [2];
    char *              clan;
    int                 gifts[21];
    int                 garou1;
    int                 garou2;
    sh_int              gnosis[2];
    CHAR_DATA *         unveil;
    char *              objdesc;
    sh_int              monkblock;
    sh_int              focus[2];
};



/*
 * Data which only PC's have.
 */
struct  pc_data
{
    PC_DATA *           next;
    CHAR_DATA *         familiar;
    CHAR_DATA *         partner;
    CHAR_DATA *         propose;
    OBJ_DATA *          chobj;
    OBJ_DATA *          memorised;
    BOARD_DATA *        board; /* The current board */
    time_t              last_note[MAX_BOARD]; /* last note for the boards */
    NOTE_DATA *         in_progress;
    char *              pwd;
    char *              bamfin;
    char *              bamfout;
    char *              title;
    char *              conception;
    char *              parents;
    char *              cparents;
    char *              marriage;
    char *              email;
    char *              forget[MAX_FORGET];
    char *              switchname;
    char *              custom_enter_room;
    char *              enter_room;
    char *              subprompt;      /* Substate prompt */
    sh_int              souls;
    sh_int              perm_str;
    sh_int              perm_int;
    sh_int              perm_wis;
    sh_int              perm_dex;
    sh_int              perm_con;
    sh_int              mod_str;
    sh_int              mod_int;
    sh_int              mod_wis;
    sh_int              mod_dex;
    sh_int              mod_con;
    int                 quest;
    int                 kingdom;
    int                 pagelen;
    int                 gentick;
    int                 powers[20];
    int                 stats[12];
    int                 disc_points;
    int                 disc_research;
    bool                lwrgen;
    sh_int              wolf;
    sh_int              rank;
    sh_int              demonic_a;
    int                 language[2];
    sh_int              stage[3];
    sh_int              wolfform[2];
    int                 score[6];
    sh_int              runes[4];
    sh_int              disc_a[11];
    int                 genes[10];
    sh_int              fake_skill;
    sh_int              fake_stance;
    sh_int              fake_hit;
    sh_int              fake_dam;
    sh_int              fake_hp;
    sh_int              fake_mana;
    sh_int              fake_move;
    int                 fake_ac;
    int                 obj_vnum;
    sh_int              condition       [3];
    sh_int              learned         [MAX_SKILL];
    sh_int              stat_ability    [4];
    sh_int              stat_amount     [4];
    sh_int              stat_duration   [4];
    sh_int              exhaustion;
    sh_int              followers;
    int                 plr_wager; /*  ARENA amount wagered     */
    int                 awins;     /*  ARENA number of wins     */
    int                 alosses;   /*  ARENA number of losses  */
    int                 comm;
    int                 security;       /* OLC - Builder security */
    int                 bounty;
    int                 ww_researching [1];
    int                 ww_completed [1];
    int			wwins; /* Wrestling wins */
    int 		wlosses; /* Wrestling Losses */
};



/*
 * Liquids.
 */
#define LIQ_WATER        0
#define LIQ_MAX         16

struct  liq_type
{
    char *      liq_name;
    char *      liq_color;
    sh_int      liq_affect[3];
};



/*
 * Extra description data for a room or object.
 */
struct  extra_descr_data
{
    EXTRA_DESCR_DATA *next;     /* Next in list                     */
    EXTRA_DESCR_DATA *prev;     /* Previous                         */
    char *keyword;              /* Keyword in look/examine          */
    char *description;          /* What to see                      */
};



/*
 * Prototype for an object.
 */
struct  obj_index_data
{
    OBJ_INDEX_DATA *    next;
    EXTRA_DESCR_DATA *  extra_descr;
    EXTRA_DESCR_DATA *  first_extradesc;
    EXTRA_DESCR_DATA *  last_extradesc;
    AFFECT_DATA *       first_affect;
    AFFECT_DATA *       last_affect; 
    AFFECT_DATA *       affected;
    AREA_DATA *         area;           /* OLC */
    char *              name;
    char *              short_descr;
    char *              description;
    char *              chpoweron;
    char *              chpoweroff;
    char *              chpoweruse;
    char *              victpoweron;
    char *              victpoweroff;
    char *              victpoweruse;
    char *              questmaker;
    char *              questowner;
    int                 vnum;
    sh_int              item_type;
    sh_int              extra_flags;
    sh_int              extra_flags2;
    sh_int              wear_flags;
    sh_int              count;
    sh_int              weight;
    sh_int              weapflags;
    int                 spectype;
    int                 specpower;
    sh_int              condition;
    sh_int              toughness;
    sh_int              resistance;
    int                 quest;
    sh_int              points;
    int                 cost;                   /* Unused */
    int                 value   [4];
};



/*
 * One object.
 */
struct  obj_data
{
    OBJ_DATA *          next;
    OBJ_DATA *          next_content;
    OBJ_DATA *          contains;
    OBJ_DATA *          in_obj;
    CHAR_DATA *         carried_by;
    CHAR_DATA *         chobj;
    EXTRA_DESCR_DATA *  extra_descr;
    EXTRA_DESCR_DATA *  first_extradesc;
    EXTRA_DESCR_DATA *  last_extradesc;
    AFFECT_DATA *       first_affect;
    AFFECT_DATA *       last_affect;
    AFFECT_DATA *       affected;
    OBJ_INDEX_DATA *    pIndexData;
    ROOM_INDEX_DATA *   in_room;
    char *              name;
    char *              short_descr;
    char *              description;
    char *              chpoweron;
    char *              chpoweroff;
    char *              chpoweruse;
    char *              victpoweron;
    char *              victpoweroff;
    char *              victpoweruse;
    char *              questmaker;
    char *              questowner;
    sh_int              item_type;
    sh_int              extra_flags;
    sh_int              extra_flags2;
    sh_int              wear_flags;
    sh_int              wear_loc;
    sh_int              weight;
    sh_int              weapflags;
    int                 spectype;
    int                 specpower;
    sh_int              condition;
    sh_int              toughness;
    sh_int              resistance;
    int                 quest;
    sh_int              points;
    int                 cost;
    sh_int              level;
    sh_int              timer;
    int                 value   [4];
};



/*
 * 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;           /* 0,5 N\E\S\W\U\D shit         */
    int                 rs_flags;       /* OLC */
    int                 orig_door;      /* OLC */

};



/*
 * Room text checking data.
 */
typedef struct roomtext_data
{
    int                         type;
    int                         power;
    int                         mob;
    char *                      input;
    char *                      output;
    char *                      choutput;
    char *                      name;
    struct roomtext_data        *next;
} ROOMTEXT_DATA;



/*
 * 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
 *   'D': set state of door
 *   'R': randomize room exits
 *   'S': stop (end of list)
 */

/*
 * Area-reset definition.
 */
struct  reset_data
{
    RESET_DATA *        next;
    char                command;
    int         arg1;
    int         arg2;
    int         arg3;
};



/*
 * Area definition.
 */
struct  area_data   
{
    AREA_DATA *         next;
    char *              name;
    int                 recall;
    int                 age;
    int                 nplayer;
    char *              filename;       /* OLC */
    char *              builders;       /* OLC - Listing of builders */
    int                 security;       /* OLC - Value 0-infinity  */
    int                 lvnum;          /* OLC - Lower vnum */
    int                 uvnum;          /* OLC - Upper vnum */
    int                 vnum;           /* OLC - Area vnum  */
    int                 area_flags;     /* OLC */
};


/*
 * Room type.
 */
struct  room_index_data
{
    ROOM_INDEX_DATA *   next;
    ROOM_INDEX_DATA *   next_room;
    CHAR_DATA *         people;
    CHAR_DATA *         first_person;
    CHAR_DATA *         last_person;
    OBJ_DATA *          contents;
    OBJ_DATA *          first_content;
    OBJ_DATA *          last_content;
    EXTRA_DESCR_DATA *  extra_descr;
    EXTRA_DESCR_DATA *  first_extradesc;
    EXTRA_DESCR_DATA *  last_extradesc;
    AREA_DATA *         area;
    EXIT_DATA *         exit      [6];
    EXIT_DATA *         first_exit;
    EXIT_DATA *         last_exit;
    ROOMTEXT_DATA *     roomtext;
    RESET_DATA *        reset_first;    /* OLC */
    RESET_DATA *        reset_last;     /* OLC */

    char *              track     [5];
    char *              name;
    char *              description;
    int                 vnum;
    int                 room_flags;
    sh_int              light;
    sh_int              blood;
    sh_int              track_dir [5];
    sh_int              sector_type;
    sh_int              tick_timer[MAX_RTIMER];
};



/*
 * Types of attacks.
 * Must be non-overlapping with spell/skill types,
 * but may be arbitrary beyond that.
 */
#define TYPE_UNDEFINED               -1
#define TYPE_HIT                     1000



/*
 *  Target types.
 */
#define TAR_IGNORE                  0
#define TAR_CHAR_OFFENSIVE          1
#define TAR_CHAR_DEFENSIVE          2
#define TAR_CHAR_SELF               3
#define TAR_OBJ_INV                 4

#define TAR_OBJ_CHAR_DEF            5
#define TAR_OBJ_CHAR_OFF            6
#define TAR_OBJ_ROOM                7
#define TAR_EXIT                    8
#define TAR_CHAR_WORLD              9

#define TARGET_CHAR                 0
#define TARGET_OBJ                  1
#define TARGET_ROOM                 2
#define TARGET_NONE                 3

#define PURPLE_MAGIC                0
#define RED_MAGIC                   1
#define BLUE_MAGIC                  2
#define GREEN_MAGIC                 3
#define YELLOW_MAGIC                4



/*
 * Skills include spells as a particular case.
 */
struct  skill_type
{
    char *      name;                   /* Name of skill                */
    sh_int      skill_level;            /* Level needed by class        */
    SPELL_FUN * spell_fun;              /* Spell pointer (for spells)   */
    sh_int      target;                 /* Legal targets                */
    sh_int      minimum_position;       /* Position for caster / user   */
    sh_int *    pgsn;                   /* Pointer to associated gsn    */
    sh_int      slot;                   /* Slot for #OBJECT loading     */
    sh_int      min_mana;               /* Minimum mana used            */
    sh_int      beats;                  /* Waiting time after use       */
    char *      noun_damage;            /* Damage message               */
    char *      msg_off;                /* Wear off message             */
};



/*
 * These are skill_lookup return values for common skills and spells.
 */

extern  sh_int    gsn_quills;
extern  sh_int    gsn_cheapshot;
extern  sh_int    gsn_shred;

extern  sh_int  gsn_venomtong;
extern  sh_int  gsn_spiketail;
extern  sh_int  gsn_badbreath;
extern  sh_int  gsn_magma;
extern  sh_int  gsn_shards;
extern  sh_int  gsn_spiderform;
extern  sh_int  gsn_garotte;
extern  sh_int  gsn_backstab;
extern  sh_int  gsn_hide;
extern  sh_int  gsn_peek;
extern  sh_int  gsn_pick_lock;
extern  sh_int  gsn_sneak;
extern  sh_int  gsn_steal;
extern  sh_int  gsn_godbless;  /* Vic - Monks */
extern  sh_int  gsn_totalblind; /* Vic - Monks */
extern  sh_int  gsn_tendrils;
extern  sh_int  gsn_berserk;
extern  sh_int  gsn_punch;
extern  sh_int  gsn_headbutt;
extern sh_int gsn_shiroken;
extern  sh_int  gsn_blinky;
extern  sh_int  gsn_inferno;
extern  sh_int  gsn_fangs;
extern  sh_int  gsn_buffet;
extern  sh_int  gsn_rfangs;
extern  sh_int  gsn_sweep;
extern  sh_int  gsn_knee;
extern  sh_int  gsn_spinkick;
extern  sh_int  gsn_backfist;
extern  sh_int  gsn_jumpkick;
extern  sh_int  gsn_monksweep;
extern  sh_int  gsn_thrustkick;
extern  sh_int  gsn_spinkick;
extern  sh_int  gsn_elbow;
extern  sh_int  gsn_palmstrike;
extern  sh_int  gsn_shinkick;
extern  sh_int  gsn_lightningkick;
extern  sh_int  gsn_tornadokick;
extern  sh_int  gsn_disarm;
extern  sh_int  gsn_hurl;
extern  sh_int  gsn_kick;
extern sh_int gsn_circle;
extern  sh_int  gsn_rescue;
extern  sh_int  gsn_track;
extern  sh_int  gsn_polymorph;
extern  sh_int  gsn_web;
extern  sh_int  gsn_infirmity;
extern sh_int   gsn_drowfire;
extern  sh_int  gsn_blindness;
extern  sh_int  gsn_charm_person;
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_paradox;
extern sh_int gsn_spew;
extern  sh_int  gsn_darkness;
extern  sh_int  gsn_laser;
extern  sh_int  gsn_stuntubes;

/*
 * 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 COLOUR(ch,color,bit)    (ADD_COLOUR((ch),(bit),(color));)


/*
 * Memory allocation macros.
 */

#define CREATE(result, type, number)                            \
do                                                              \
{                                                               \
   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                                                              \
{                                                               \
  if (!(point))                                                 \
  {                                                             \
        bug( "Freeing null pointer",0 ); \
        fprintf( stderr, "DISPOSEing NULL in %s, line %d\n", __FILE__, __LINE__ ); \
  }                                                             \
  else free(point);                                             \
  point = NULL;                                                 \
} while(0)

#ifdef HASHSTR
#define STRALLOC(point)         str_dup((point))
#define QUICKLINK(point)        quick_link((point))
#define QUICKMATCH(p1, p2)      (int) (p1) == (int) (p2)
#define STRFREE(point)                                          \
do                                                              \
{                                                               \
  if (!(point))                                                 \
  {                                                             \
        bug( "Freeing null pointer",0 );                        \
  }                                                             \
  else if (str_free((point))==-1)                               \
    fprintf( stderr, "STRFREEing bad pointer in %s, line %d\n", __FILE__, __LINE__ ); \
} 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                                                              \
{                                                               \
  if (point == NULL)                                            \
  {                                                             \
        bug( "Freeing null pointer",0 );                        \
  }                                                             \
  else free_string((point));                                    \
} while(0)
#endif

/* double-linked list handling macros -Thoric */

#define LINK(link, first, last, next, prev)                     \
do                                                              \
{                                                               \
    if ( !(first) )                                             \
      (first)                   = (link

Showing the first 100 KB of 171.2 KB. Download the archive for the full file.

Site Stats

Snippets: 1791
Codebases: 571