📄 merc.h
字号:
struct obj_index_data
{
OBJ_INDEX_DATA * next;
EXTRA_DESCR_DATA * extra_descr;
AFFECT_DATA * affected;
char * name;
char * short_descr;
char * description;
sh_int vnum;
sh_int item_type;
sh_int extra_flags;
sh_int wear_flags;
sh_int count;
sh_int weight;
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;
EXTRA_DESCR_DATA * extra_descr;
AFFECT_DATA * affected;
OBJ_INDEX_DATA * pIndexData;
ROOM_INDEX_DATA * in_room;
char * name;
char * short_descr;
char * description;
sh_int item_type;
sh_int extra_flags;
sh_int wear_flags;
sh_int wear_loc;
sh_int weight;
int cost;
sh_int level;
sh_int timer;
int value [4];
};
/*
* Exit data.
*/
struct exit_data
{
ROOM_INDEX_DATA * to_room;
sh_int vnum;
sh_int exit_info;
sh_int key;
char * keyword;
char * description;
};
/*
* 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;
sh_int arg1;
sh_int arg2;
sh_int arg3;
};
/*
* Area definition.
*/
struct area_data
{
AREA_DATA * next;
RESET_DATA * reset_first;
RESET_DATA * reset_last;
char * name;
sh_int age;
sh_int nplayer;
};
/*
* Room type.
*/
struct room_index_data
{
ROOM_INDEX_DATA * next;
CHAR_DATA * people;
OBJ_DATA * contents;
EXTRA_DESCR_DATA * extra_descr;
AREA_DATA * area;
EXIT_DATA * exit [6];
char * name;
char * description;
sh_int vnum;
sh_int room_flags;
sh_int light;
sh_int sector_type;
};
/*
* 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
/*
* Skills include spells as a particular case.
*/
struct skill_type
{
char * name; /* Name of skill */
sh_int skill_level[MAX_CLASS]; /* Level needed by class */
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_backstab;
extern sh_int gsn_dodge;
extern sh_int gsn_hide;
extern sh_int gsn_peek;
extern sh_int gsn_pick_lock;
extern sh_int gsn_sneak;
extern sh_int gsn_steal;
extern sh_int gsn_disarm;
extern sh_int gsn_enhanced_damage;
extern sh_int gsn_kick;
extern sh_int gsn_parry;
extern sh_int gsn_rescue;
extern sh_int gsn_second_attack;
extern sh_int gsn_third_attack;
extern sh_int gsn_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;
/*
* Psionicist gsn's.
*/
extern int gsn_chameleon;
extern int gsn_domination;
extern int gsn_heighten;
extern int gsn_shadow;
/*
* 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))
/*
* Character macros.
*/
#define IS_NPC(ch) (IS_SET((ch)->act, ACT_IS_NPC))
#define IS_IMMORTAL(ch) (get_trust(ch) >= LEVEL_IMMORTAL)
#define IS_HERO(ch) (get_trust(ch) >= LEVEL_HERO)
#define IS_AFFECTED(ch, sn) (IS_SET((ch)->affected_by, (sn)))
#define IS_GOOD(ch) (ch->alignment >= 350)
#define IS_EVIL(ch) (ch->alignment <= -350)
#define IS_NEUTRAL(ch) (!IS_GOOD(ch) && !IS_EVIL(ch))
#define IS_AWAKE(ch) (ch->position > POS_SLEEPING)
#define GET_AC(ch) ((ch)->armor \
+ ( IS_AWAKE(ch) \
? dex_app[get_curr_dex(ch)].defensive \
: 0 ))
#define GET_HITROLL(ch) ((ch)->hitroll+str_app[get_curr_str(ch)].tohit)
#define GET_DAMROLL(ch) ((ch)->damroll+str_app[get_curr_str(ch)].todam)
#define IS_OUTSIDE(ch) (!IS_SET( \
(ch)->in_room->room_flags, \
ROOM_INDOORS))
#define WAIT_STATE(ch, npulse) ((ch)->wait = UMAX((ch)->wait, (npulse)))
#define MANA_COST(ch, sn) (IS_NPC(ch) ? 0 : UMAX ( \
skill_table[sn].min_mana, \
100 / (2 + ch->level - \
skill_table[sn].skill_level[ch->class] ) ) )
/*
* Object macros.
*/
#define CAN_WEAR(obj, part) (IS_SET((obj)->wear_flags, (part)))
#define IS_OBJ_STAT(obj, stat) (IS_SET((obj)->extra_flags, (stat)))
/*
* Description macros.
*/
#define PERS(ch, looker) ( can_see( looker, (ch) ) ? \
( IS_NPC(ch) ? (ch)->short_descr \
: (ch)->name ) : "someone" )
/*
* Structure for a command in the command lookup table.
*/
struct cmd_type
{
char * const name;
DO_FUN * do_fun;
sh_int position;
sh_int level;
sh_int log;
};
/*
* Structure for a social in the socials table.
*/
struct social_type
{
char * const name;
char * const char_no_arg;
char * const others_no_arg;
char * const char_found;
char * const others_found;
char * const vict_found;
char * const char_auto;
char * const others_auto;
};
/*
* Global constants.
*/
extern const struct str_app_type str_app [26];
extern const struct int_app_type int_app [26];
extern const struct wis_app_type wis_app [26];
extern const struct dex_app_type dex_app [26];
extern const struct con_app_type con_app [26];
extern const struct class_type class_table [MAX_CLASS];
extern const struct race_type race_table [MAX_RACE];
extern const struct cmd_type cmd_table [];
extern const struct liq_type liq_table [LIQ_MAX];
extern const struct skill_type skill_table [MAX_SKILL];
extern const struct social_type social_table [];
extern char * const title_table [MAX_CLASS]
[MAX_LEVEL+1]
[2];
/*
* Global variables.
*/
extern HELP_DATA * help_first;
extern SHOP_DATA * shop_first;
extern BAN_DATA * ban_list;
extern CHAR_DATA * char_list;
extern DESCRIPTOR_DATA * descriptor_list;
extern NOTE_DATA * note_list;
extern OBJ_DATA * object_list;
extern AFFECT_DATA * affect_free;
extern BAN_DATA * ban_free;
extern CHAR_DATA * char_free;
extern DESCRIPTOR_DATA * descriptor_free;
extern EXTRA_DESCR_DATA * extra_descr_free;
extern NOTE_DATA * note_free;
extern OBJ_DATA * obj_free;
extern PC_DATA * pcdata_free;
extern char bug_buf [];
extern time_t current_time;
extern bool fLogAll;
extern FILE * fpReserve;
extern KILL_DATA kill_table [];
extern char log_buf [];
extern TIME_INFO_DATA time_info;
extern WEATHER_DATA weather_info;
/*
* Command functions.
* Defined in act_*.c (mostly).
*/
DECLARE_DO_FUN( do_advance );
DECLARE_DO_FUN( do_allow );
DECLARE_DO_FUN( do_answer );
DECLARE_DO_FUN( do_areas );
DECLARE_DO_FUN( do_at );
DECLARE_DO_FUN( do_auction );
DECLARE_DO_FUN( do_auto );
DECLARE_DO_FUN( do_autoexit );
DECLARE_DO_FUN( do_autoloot );
DECLARE_DO_FUN( do_autosac );
DECLARE_DO_FUN( do_backstab );
DECLARE_DO_FUN( do_bamfin );
DECLARE_DO_FUN( do_bamfout );
DECLARE_DO_FUN( do_ban );
DECLARE_DO_FUN( do_blank );
DECLARE_DO_FUN( do_brandish );
DECLARE_DO_FUN( do_brief );
DECLARE_DO_FUN( do_bug );
DECLARE_DO_FUN( do_buy );
DECLARE_DO_FUN( do_cast );
DECLARE_DO_FUN( do_channels );
DECLARE_DO_FUN( do_chat );
DECLARE_DO_FUN( do_close );
DECLARE_DO_FUN( do_combine );
DECLARE_DO_FUN( do_commands );
DECLARE_DO_FUN( do_compare );
DECLARE_DO_FUN( do_config );
DECLARE_DO_FUN( do_consider );
DECLARE_DO_FUN( do_credits );
DECLARE_DO_FUN( do_deny );
DECLARE_DO_FUN( do_description );
DECLARE_DO_FUN( do_disarm );
DECLARE_DO_FUN( do_disconnect );
DECLARE_DO_FUN( do_down );
DECLARE_DO_FUN( do_drink );
DECLARE_DO_FUN( do_drop );
DECLARE_DO_FUN( do_east );
DECLARE_DO_FUN( do_eat );
DECLARE_DO_FUN( do_echo );
DECLARE_DO_FUN( do_emote );
DECLARE_DO_FUN( do_equipment );
DECLARE_DO_FUN( do_examine );
DECLARE_DO_FUN( do_exits );
DECLARE_DO_FUN( do_fill );
DECLARE_DO_FUN( do_flee );
DECLARE_DO_FUN( do_follow );
DECLARE_DO_FUN( do_force );
DECLARE_DO_FUN( do_freeze );
DECLARE_DO_FUN( do_get );
DECLARE_DO_FUN( do_give );
DECLARE_DO_FUN( do_goto );
DECLARE_DO_FUN( do_group );
DECLARE_DO_FUN( do_gtell );
DECLARE_DO_FUN( do_help );
DECLARE_DO_FUN( do_hide );
DECLARE_DO_FUN( do_holylight );
DECLARE_DO_FUN( do_idea );
DECLARE_DO_FUN( do_identify ); // @@@ ###
DECLARE_DO_FUN( do_immtalk );
DECLARE_DO_FUN( do_inventory );
DECLARE_DO_FUN( do_invis );
DECLARE_DO_FUN( do_kick );
DECLARE_DO_FUN( do_kill );
DECLARE_DO_FUN( do_list );
DECLARE_DO_FUN( do_lock );
DECLARE_DO_FUN( do_log );
DECLARE_DO_FUN( do_look );
DECLARE_DO_FUN( do_memory );
DECLARE_DO_FUN( do_mfind );
DECLARE_DO_FUN( do_mload );
DECLARE_DO_FUN( do_mpasound );
DECLARE_DO_FUN( do_mpat );
DECLARE_DO_FUN( do_mpecho );
DECLARE_DO_FUN( do_mpechoaround );
DECLARE_DO_FUN( do_mpechoat );
DECLARE_DO_FUN( do_mpforce );
DECLARE_DO_FUN( do_mpgoto );
DECLARE_DO_FUN( do_mpjunk );
DECLARE_DO_FUN( do_mpkill );
DECLARE_DO_FUN( do_mpmload );
DECLARE_DO_FUN( do_mpoload );
DECLARE_DO_FUN( do_mppurge );
DECLARE_DO_FUN( do_mpstat );
DECLARE_DO_FUN( do_mptransfer );
DECLARE_DO_FUN( do_mset );
DECLARE_DO_FUN( do_mstat );
DECLARE_DO_FUN( do_mwhere );
DECLARE_DO_FUN( do_murde );
DECLARE_DO_FUN( do_murder );
DECLARE_DO_FUN( do_music );
DECLARE_DO_FUN( do_noemote );
DECLARE_DO_FUN( do_north );
DECLARE_DO_FUN( do_note );
DECLARE_DO_FUN( do_notell );
DECLARE_DO_FUN( do_ofind );
DECLARE_DO_FUN( do_oload );
DECLARE_DO_FUN( do_open );
DECLARE_DO_FUN( do_order );
DECLARE_DO_FUN( do_orphans );
DECLARE_DO_FUN( do_oset );
DECLARE_DO_FUN( do_ostat );
DECLARE_DO_FUN( do_owhere );
DECLARE_DO_FUN( do_pagelen );
DECLARE_DO_FUN( do_pardon );
DECLARE_DO_FUN( do_password );
DECLARE_DO_FUN( do_peace );
DECLARE_DO_FUN( do_pick );
DECLARE_DO_FUN( do_pose );
DECLARE_DO_FUN( do_practice );
DECLARE_DO_FUN( do_prompt );
DECLARE_DO_FUN( do_purge );
DECLARE_DO_FUN( do_put );
DECLARE_DO_FUN( do_quaff );
DECLARE_DO_FUN( do_question );
DECLARE_DO_FUN( do_qui );
DECLARE_DO_FUN( do_quit );
DECLARE_DO_FUN( do_reboo );
DECLARE_DO_FUN( do_reboot );
DECLARE_DO_FUN( do_recall );
DECLARE_DO_FUN( do_recho );
DECLARE_DO_FUN( do_recite );
DECLARE_DO_FUN( do_remove );
DECLARE_DO_FUN( do_rent );
DECLARE_DO_FUN( do_reply );
DECLARE_DO_FUN( do_report );
DECLARE_DO_FUN( do_rescue );
DECLARE_DO_FUN( do_rest );
DECLARE_DO_FUN( do_restore );
DECLARE_DO_FUN( do_return );
DECLARE_DO_FUN( do_rset );
DECLARE_DO_FUN( do_rstat );
DECLARE_DO_FUN( do_sacrifice );
DECLARE_DO_FUN( do_save );
DECLARE_DO_FUN( do_say );
DECLARE_DO_FUN( do_score );
DECLARE_DO_FUN( do_sell );
DECLARE_DO_FUN( do_shoplist );
DECLARE_DO_FUN( do_shout );
DECLARE_DO_FUN( do_shutdow );
DECLARE_DO_FUN( do_shutdown );
DECLARE_DO_FUN( do_silence );
DECLARE_DO_FUN( do_sla );
DECLARE_DO_FUN( do_slay );
DECLARE_DO_FUN( do_sleep );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -