1stMUD4.0/bin/
1stMUD4.0/doc/MPDocs/
1stMUD4.0/player/
1stMUD4.0/win32/
1stMUD4.0/win32/rom/
/**************************************************************************
*  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
*  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
*                                                                         *
*  Merc Diku Mud improvements 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          *
*  benefiting.  We hope that you share your changes too.  What goes       *
*  around, comes around.                                                  *
***************************************************************************
*       ROM 2.4 is copyright 1993-1998 Russ Taylor                        *
*       ROM has been brought to you by the ROM consortium                 *
*           Russ Taylor (rtaylor@hypercube.org)                           *
*           Gabrielle Taylor (gtaylor@hypercube.org)                      *
*           Brian Moore (zump@rom.org)                                    *
*       By using this code, you have agreed to follow the terms of the    *
*       ROM license, in the file Rom24/doc/rom.license                    *
***************************************************************************
*       1stMUD ROM Derivative (c) 2001-2003 by Ryan Jennings              *
*            http://1stmud.dlmud.com/  <r-jenn@shaw.ca>                   *
***************************************************************************/
#if !defined(DEFINES_H)
#define DEFINES_H

#define DECLARE_DO_FUN( fun )		DO_FUN    fun
#define DECLARE_SPEC_FUN( fun )		SPEC_FUN  fun
#define DECLARE_SPELL_FUN( fun )	SPELL_FUN fun
#define DECLARE_LOOKUP_FUN( fun )	LOOKUP_F  fun
#define DECLARE_ED_FUN( fun )	    ED_FUN	   fun
#define DECLARE_VALIDATE_FUN(fun)	VALIDATE_FUN	fun
#define DECLARE_OBJ_FUN( fun )		OBJ_FUN	  fun
#define DECLARE_ROOM_FUN( fun )		ROOM_FUN  fun

#define	CH_CMD(name)            void name(CHAR_DATA * ch, const char *argument)
#define ED_FUN_DEC(blah)	bool blah ( const char * n_fun, CHAR_DATA *ch, const char *argument, void *arg, const void *par, VALIDATE_FUN *validator )
#define VALIDATE_FUN(fun)	bool fun(CHAR_DATA *ch, const void *arg)

#define EXTERN extern

/*
 * String and memory management parameters.
 */
#define	MAX_KEY_HASH		 1024
#define MAX_STRING_LENGTH	 4608
#define MAX_INPUT_LENGTH	  256
#define MAX_EXPLORE_HASH     8192

/* ea */
#define MSL MAX_STRING_LENGTH
#define MIL MAX_INPUT_LENGTH

#define MUD_NAME        "1stMUD"	// You're mud's name here

#define SECOND			   1
#define MINUTE			  (60 * SECOND)
#define HOUR			  (60 * MINUTE)
#define DAY			  (24 * HOUR)
#define WEEK			  (7 * DAY)

/*
 * Game parameters.
 * Increase the max'es if you add more of something.
 * Adjust the pulse numbers to suit yourself.
 */
#define MAX_IN_GROUP		   15
#define MAX_TZONE            25
#define MAX_ALIAS		    5
#define MAX_BUDDY           10
#define MAX_IGNORE          10
#define MAX_REMORT          2	// should never be higher than maxClass
#define MAX_MCLASS          (MAX_REMORT + 3)
#define MAX_DAMAGE_MESSAGE	   41
#define    MAX_RANK    6
#define    MAX_HOUSE_ROOMS            5
#define    MAX_VNUM                   60000
#define MAX_LEVEL		   60
#define LEVEL_IMMORTAL		   (MAX_LEVEL - 8)
#define MAX_MORTAL_LEVEL	   (MAX_LEVEL - 9)
#define LEVEL_HERO			   (MAX_MORTAL_LEVEL - MAX_REMORT)

#define PULSE_PER_SECOND	  (mud_info.pulsepersec)
#define PULSE_VIOLENCE		  ( 3 * PULSE_PER_SECOND)
#define PULSE_MOBILE		  ( 4 * PULSE_PER_SECOND)
#define PULSE_MUSIC		      ( 6 * PULSE_PER_SECOND)
#define PULSE_TICK		      (45 * PULSE_PER_SECOND)
#define PULSE_AREA		      (120 * PULSE_PER_SECOND)
#define PULSE_SENDSTAT            (10 * PULSE_PER_SECOND)

#define    AUCTION_LENGTH     (60 * PULSE_PER_SECOND)

#define IMPLEMENTOR		  MAX_LEVEL
#define	CREATOR			 (MAX_LEVEL - 1)
#define SUPREME			 (MAX_LEVEL - 2)
#define DEITY			 (MAX_LEVEL - 3)
#define GOD				 (MAX_LEVEL - 4)
#define IMMORTAL		 (MAX_LEVEL - 5)
#define DEMI			 (MAX_LEVEL - 6)
#define ANGEL			 (MAX_LEVEL - 7)
#define AVATAR			 (MAX_LEVEL - 8)
#define HERO			 LEVEL_HERO

#define SEASON      		(((time_info.month / 4) > 3) ? 3 : (time_info.month / 4))

/* MUD time */
#define NUM_DAYS   30
#define NUM_MONTHS 17

#define MAX_CLIMATE 5

typedef enum
{
	SUN_DARK,
	SUN_RISE,
	SUN_LIGHT,
	SUN_SET,
	SUN_NOON
}
sun_t;

/*
 * Connected state for a channel.
 */
typedef enum
{
	CON_PLAYING,
	CON_GET_NAME,
	CON_GET_OLD_PASSWORD,
	CON_CONFIRM_NEW_NAME,
	CON_GET_NEW_PASSWORD,
	CON_CONFIRM_NEW_PASSWORD,
	CON_GET_NEW_RACE,
	CON_GET_NEW_SEX,
	CON_GET_NEW_CLASS,
	CON_GET_ALIGNMENT,
	CON_GET_DEITY,
	CON_GET_TIMEZONE,
	CON_DEFAULT_CHOICE,
	CON_GEN_GROUPS,
	CON_PICK_WEAPON,
	CON_READ_IMOTD,
	CON_READ_MOTD,
	CON_BREAK_CONNECT,
	CON_GET_TERM,
	CON_COPYOVER_RECOVER,
	CON_NOTE_TO,
	CON_NOTE_SUBJECT,
	CON_NOTE_EXPIRE,
	CON_NOTE_TEXT,
	CON_NOTE_FINISH
}
connect_t;

/* 
 * MXP defines.
 */
/* strings */
#define MXP_BEG "\xFB"			/* becomes < */
#define MXP_END "\xFC"			/* becomes > */
#define MXP_AMP "\xFD"			/* becomes & */

/* characters */
#define MXP_BEGc '\xFB'			/* becomes < */
#define MXP_ENDc '\xFC'			/* becomes > */
#define MXP_AMPc '\xFD'			/* becomes & */

#define ESC "\033"				/* esc character */
#define MXPMODE(arg) ESC "[" #arg "z"

// constructs an MXP tag with < and > around it
#define MXPTAG(arg)     MXP_BEG arg MXP_END

/*
 * portal script language
 */
#define CL_SEND_SOUND		"AAA"	/* implemented */
#define CL_SEND_IMAGE		"AAB"	/* implemented */
#define CL_SEND_REBOOT		"AAC"
#define CL_SEND_MUSIC		"AAD"	/* implemented */
#define CL_SEND_UPTIME		"AAF"	/* implemented */
#define CL_SEND_AVI		    "AAG"
#define CL_DOWNLOAD_MEDIA	"AAH"	/* implemented */
#define CL_SEND_SPECIAL		"BAA"
#define CL_SEND_SPECIAL2	"BAC"
#define CL_SEND_TELL		"BAB"	/* implemented */
#define CL_SEND_ROOM		"BAD"
#define CL_SEND_MUDLAG		"BAE"
#define CL_SEND_EDIT		"BAF"
#define CL_GP1_MASK		    "BBA"	/* implemented */
#define CL_GP2_MASK		    "BBB"
#define CL_HP_MASK		    "BBC"	/* implemented */
#define CL_SP_MASK		    "BBD"	/* implemented */
#define CL_SEND_CAPTION		"CAP"	/* implemented */
#define CL_SEND_BEGIN_FILE	"CDF"
#define CL_SEND_CONT_FILE	"CCF"
#define CL_SEND_END_FILE	"CEF"
#define CL_SEND_CHAT		"CAA"	/* implemented */
#define CL_SEND_ROOMCODE    "DDD"	/* implemented */
#define CL_SEND_COMPOSITE	"FFF"

#define  CL_SEND_HP		    "A"	/* implemented */
#define  CL_SEND_MAXHP		"B"	/* implemented */
#define  CL_SEND_SP		    "C"	/* implemented */
#define  CL_SEND_MAXSP		"D"	/* implemented */
#define  CL_SEND_GP1		"E"	/* implemented */
#define  CL_SEND_MAXGP1		"F"	/* implemented */
#define  CL_SEND_GP2		"G"
#define  CL_SEND_MAXGP2		"H"
#define  CL_SEND_GLINE1		"I"	/* implemented */
#define  CL_SEND_GLINE2		"J"	/* implemented */
#define  CL_SEND_ATTACKER	"K"
#define  CL_SEND_ATTCOND	"L"	/* implemented */
#define  CL_SEND_ATTIMG		"M"

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

/*
 * Per-class stuff.
 */

#define MAX_GUILD 	2

#define MAX_STATS 	5

#define STAT_STR 	0
#define STAT_INT	1
#define STAT_WIS	2
#define STAT_DEX	3
#define STAT_CON	4
#define STAT_MAX    5

typedef enum
{
	GQUEST_OFF,
	GQUEST_WAITING,
	GQUEST_RUNNING
}
gquest_t;

/* where definitions */
typedef enum
{
	TO_AFFECTS,
	TO_OBJECT,
	TO_IMMUNE,
	TO_RESIST,
	TO_VULN,
	TO_WEAPON
}
where_t;

typedef enum
{
	CRS_NONE,
	CRS_REBOOT,
	CRS_SHUTDOWN,
	CRS_COPYOVER,
	CRS_COPYOVER_RECOVER
}
crs_t;

/*
 * Well known mob virtual numbers.
 * Defined in #MOBILES.
 */
#define MOB_VNUM_FIDO		   3090
#define MOB_VNUM_CITYGUARD	   3060
#define MOB_VNUM_VAMPIRE	   3404
#define	MOB_VNUM_WARMASTER     17601
#define MOB_VNUM_PATROLMAN	   2106
#define GROUP_VNUM_TROLLS	   2100
#define GROUP_VNUM_OGRES	   2101

#define	MOB_VNUM_REGISTAR      202

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

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

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

/* AC types */
#define AC_PIERCE			0
#define AC_BASH				1
#define AC_SLASH			2
#define AC_EXOTIC			3

/* dice */
#define DICE_NUMBER			0
#define DICE_TYPE			1
#define DICE_BONUS			2

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

/*
 * Well known object virtual numbers.
 * Defined in #OBJECTS.
 */
#define OBJ_VNUM_SILVER_ONE	      1
#define OBJ_VNUM_GOLD_ONE	      2
#define OBJ_VNUM_GOLD_SOME	      3
#define OBJ_VNUM_SILVER_SOME	      4
#define OBJ_VNUM_COINS		      5

#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_GUTS		     16
#define OBJ_VNUM_BRAINS		     17

#define OBJ_VNUM_MUSHROOM	     20
#define OBJ_VNUM_LIGHT_BALL	     21
#define OBJ_VNUM_SPRING		     22
#define OBJ_VNUM_DISC		     23
#define OBJ_VNUM_PORTAL		     25

#define OBJ_VNUM_ROSE		   1001

#define OBJ_VNUM_PIT		   3010

#define OBJ_VNUM_SCHOOL_MACE	   3700
#define OBJ_VNUM_SCHOOL_DAGGER	   3701
#define OBJ_VNUM_SCHOOL_SWORD	   3702
#define OBJ_VNUM_SCHOOL_SPEAR	   3717
#define OBJ_VNUM_SCHOOL_STAFF	   3718
#define OBJ_VNUM_SCHOOL_AXE	   3719
#define OBJ_VNUM_SCHOOL_FLAIL	   3720
#define OBJ_VNUM_SCHOOL_WHIP	   3721
#define OBJ_VNUM_SCHOOL_POLEARM    3722

#define OBJ_VNUM_SCHOOL_VEST	   3703
#define OBJ_VNUM_SCHOOL_SHIELD	   3704
#define OBJ_VNUM_SCHOOL_BANNER     3716
#define OBJ_VNUM_MAP		   3162

#define OBJ_VNUM_WHISTLE	   2116

#define OBJ_VNUM_TRIVIA_PILL   200

#define QUEST_AURA      201
#define QUEST_SWORD     203
#define QUEST_BPLATE    204
#define QUEST_BOOTS     205
#define QUEST_GLOVES    206
#define QUEST_FLAME     207
#define QUEST_HELM      208
#define QUEST_BAG       209
#define QUEST_SHIELD    210
#define QUEST_REGEN     211
#define QUEST_INVIS     212
#define QUEST_TRIVIA    OBJ_VNUM_TRIVIA_PILL

/*
 * Item types.
 * Used in #OBJECTS.
 */
#define    ITEM_NONE    0
#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_CLOTHING		     11
#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_PROTECT		     27
#define ITEM_MAP		     28
#define ITEM_PORTAL		     29
#define ITEM_WARP_STONE		     30
#define ITEM_ROOM_KEY		     31
#define ITEM_GEM		     32
#define ITEM_JEWELRY		     33
#define ITEM_JUKEBOX		     34

/* weapon class */
#define WEAPON_EXOTIC		0
#define WEAPON_SWORD		1
#define WEAPON_DAGGER		2
#define WEAPON_SPEAR		3
#define WEAPON_MACE		4
#define WEAPON_AXE		5
#define WEAPON_FLAIL		6
#define WEAPON_WHIP		7
#define WEAPON_POLEARM		8

/*
 * Apply types (for affects).
 * Used in #OBJECTS.
 */
typedef enum
{
	APPLY_NONE,
	APPLY_STR,
	APPLY_DEX,
	APPLY_INT,
	APPLY_WIS,
	APPLY_CON,
	APPLY_SEX,
	APPLY_CLASS,
	APPLY_LEVEL,
	APPLY_AGE,
	APPLY_HEIGHT,
	APPLY_WEIGHT,
	APPLY_MANA,
	APPLY_HIT,
	APPLY_MOVE,
	APPLY_GOLD,
	APPLY_EXP,
	APPLY_AC,
	APPLY_HITROLL,
	APPLY_DAMROLL,
	APPLY_SAVES,
	APPLY_SAVING_PARA,
	APPLY_SAVING_ROD,
	APPLY_SAVING_PETRI,
	APPLY_SAVING_BREATH,
	APPLY_SAVING_SPELL,
	APPLY_SPELL_AFFECT
}
apply_t;

/*
 * 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_WAITROOM     17600
#define ROOM_VNUM_MORGUE       2
#define ROOM_VNUM_DUEL_START   17596
#define ROOM_VNUM_DUEL_END     17597
#define ROOM_VNUM_DUEL_WINNER  17598
#define ROOM_VNUM_DUEL_LOSER   17599

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

/*
 * Sector types.
 * Used in #ROOMS.
 */
typedef enum
{
	SECT_INSIDE,
	SECT_CITY,
	SECT_FIELD,
	SECT_FOREST,
	SECT_HILLS,
	SECT_MOUNTAIN,
	SECT_WATER_SWIM,
	SECT_WATER_NOSWIM,
	SECT_UNUSED,
	SECT_AIR,
	SECT_DESERT,
	SECT_NONE,
	SECT_MAX
}
sector_t;

/*
 * Equpiment wear locations.
 * Used in #RESETS.
 */
typedef enum
{
	WEAR_NONE = -1,
	WEAR_LIGHT,
	WEAR_FINGER_L,
	WEAR_FINGER_R,
	WEAR_NECK_1,
	WEAR_NECK_2,
	WEAR_BODY,
	WEAR_HEAD,
	WEAR_LEGS,
	WEAR_FEET,
	WEAR_HANDS,
	WEAR_ARMS,
	WEAR_SHIELD,
	WEAR_ABOUT,
	WEAR_WAIST,
	WEAR_WRIST_L,
	WEAR_WRIST_R,
	WEAR_WIELD,
	WEAR_HOLD,
	WEAR_FLOAT,
	WEAR_SECONDARY,
	MAX_WEAR
}
wloc_t;

/***************************************************************************
 *                                                                         *
 *                   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
#define COND_HUNGER		      3

/*
 * Positions.
 */
typedef enum
{
	POS_DEAD,
	POS_MORTAL,
	POS_INCAP,
	POS_STUNNED,
	POS_SLEEPING,
	POS_RESTING,
	POS_SITTING,
	POS_FIGHTING,
	POS_STANDING,
	POS_NONE = -1
}
position_t;

/* 
 * Stances.
 */
#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_CURRENT               11
#define STANCE_AUTODROP              12
#define MAX_STANCE                   13

typedef enum
{
	WAR_OFF,
	WAR_WAITING,
	WAR_RUNNING
}
war_t;

#define PK_KILLS         0
#define MOB_KILLS        1
#define PK_DEATHS        2
#define MOB_DEATHS       3
#define MAX_GAMESTAT     4

/* Arena Defines */
typedef enum
{
	FIGHT_OPEN,
	FIGHT_START,
	FIGHT_BUSY,
	FIGHT_LOCK
}
arena_t;

typedef enum
{
	CHANNEL_NORMAL,
	CHANNEL_SOCIAL,
	CHANNEL_EMOTE,
	CHANNEL_THINK,
	CHANNEL_WHO
}
chanarg_t;

/*
 * Liquids.
 */
#define LIQ_WATER        0

/*
 * 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.
 */
typedef enum
{
	TAR_IGNORE,
	TAR_CHAR_OFFENSIVE,
	TAR_CHAR_DEFENSIVE,
	TAR_CHAR_SELF,
	TAR_OBJ_INV,
	TAR_OBJ_CHAR_DEF,
	TAR_OBJ_CHAR_OFF,
	TAR_NONE = -1
}
tar_t;

typedef enum
{
	TARGET_CHAR,
	TARGET_OBJ,
	TARGET_ROOM,
	TARGET_NONE
}
target_t;

typedef enum
{
	PRG_MPROG,
	PRG_OPROG,
	PRG_RPROG
}
prog_t;

/*
 * Object defined in limbo.are
 * Used in save.c to load objects that don't exist.
 */
#define OBJ_VNUM_DUMMY	30
#define MOB_VNUM_DUMMY	30

#define NO_FLAG  -99

#define MAX_DIR	6

#define AREA_VERSION    3

typedef enum
{
	STRING_NONE,
	STRING_FOUND,
	STRING_END
}
strshow_t;

#define DEFAULT_SCR_WIDTH       80
#define DEFAULT_SCR_HEIGHT      25

typedef enum
{
	RUNLEVEL_INIT,
	RUNLEVEL_BOOTING,
	RUNLEVEL_BOOT_NOEXIT,
	RUNLEVEL_MAIN_LOOP,
	RUNLEVEL_SHUTDOWN
}
runlevel_t;

#endif