diff --git a/src/map/atcommand.c b/src/map/atcommand.c index ea3a9ad0b2..d8d52b9ccc 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -80,6 +80,8 @@ static char atcmd_output[CHAT_SIZE_MAX]; static char atcmd_player_name[NAME_LENGTH]; const char *parent_cmd; +struct atcmd_binding_data** atcmd_binding; + static AtCommandInfo* get_atcommandinfo_byname(const char *name); // @help static const char* atcommand_checkalias(const char *aliasname); // @help static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand); // @help diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 6fd1bc0000..54d0ca3cfa 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -45,7 +45,7 @@ struct atcmd_binding_data { int level; int level2; }; -struct atcmd_binding_data** atcmd_binding; +extern struct atcmd_binding_data** atcmd_binding; struct atcmd_binding_data* get_atcommandbind_byname(const char* name); #ifdef __cplusplus diff --git a/src/map/chrif.h b/src/map/chrif.h index 70c5149f61..2c2aaec833 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -4,14 +4,14 @@ #ifndef _CHRIF_H_ #define _CHRIF_H_ -#ifdef __cplusplus -extern "C" { -#endif - #include "../common/cbasetypes.h" #include "../common/socket.h" // enum chrif_req_op #include +#ifdef __cplusplus +extern "C" { +#endif + enum sd_state { ST_LOGIN, ST_LOGOUT, ST_MAPCHANGE }; enum e_chrif_save_opt { diff --git a/src/map/clif.c b/src/map/clif.c index 4cb18fea1f..a2ad011540 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -58,6 +58,8 @@ static struct eri *delay_clearunit_ers; struct s_packet_db packet_db[MAX_PACKET_DB + 1]; int packet_db_ack[MAX_ACK_FUNC + 1]; +unsigned long color_table[COLOR_MAX]; + #include "clif_obfuscation.h" static bool clif_session_isValid(struct map_session_data *sd); diff --git a/src/map/clif.h b/src/map/clif.h index 874d871198..262078a1c6 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1027,7 +1027,7 @@ enum clif_colors { COLOR_LIGHT_GREEN, COLOR_MAX }; -unsigned long color_table[COLOR_MAX]; +extern unsigned long color_table[COLOR_MAX]; void clif_channel_msg(struct Channel *channel, const char *msg, unsigned long color); diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 27ecedec70..d581e5640b 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -22,6 +22,8 @@ static DBMap *itemdb_randomopt_group; /// Random option group DB struct item_data *dummy_item; /// This is the default dummy item used for non-existant items. [Skotlex] +struct s_roulette_db rd; + /** * Check if combo exists * @param combo_id diff --git a/src/map/itemdb.h b/src/map/itemdb.h index fe3171335a..b26b06a4bd 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -769,7 +769,7 @@ struct s_item_group_db }; /// Struct of Roulette db -struct s_roulette_db { +extern struct s_roulette_db { unsigned short *nameid[MAX_ROULETTE_LEVEL], /// Item ID *qty[MAX_ROULETTE_LEVEL]; /// Amount of Item ID int *flag[MAX_ROULETTE_LEVEL]; /// Whether the item is for loss or win diff --git a/src/map/map.cpp b/src/map/map.cpp index 5e1c1a0dbd..983c2e4fb9 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -162,6 +162,16 @@ char help2_txt[256] = "conf/help2.txt"; char charhelp_txt[256] = "conf/charhelp.txt"; char channel_conf[256] = "conf/channels.conf"; +const char *MSG_CONF_NAME_RUS; +const char *MSG_CONF_NAME_SPN; +const char *MSG_CONF_NAME_GRM; +const char *MSG_CONF_NAME_CHN; +const char *MSG_CONF_NAME_MAL; +const char *MSG_CONF_NAME_IDN; +const char *MSG_CONF_NAME_FRN; +const char *MSG_CONF_NAME_POR; +const char *MSG_CONF_NAME_THA; + char wisp_server_name[NAME_LENGTH] = "Server"; // can be modified in char-server configuration file struct s_map_default map_default; diff --git a/src/map/map.h b/src/map/map.h index d790b42fe7..fd5a6b0464 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -940,15 +940,15 @@ extern const char*SCRIPT_CONF_NAME; extern const char*MSG_CONF_NAME_EN; extern const char*GRF_PATH_FILENAME; //Other languages supported -const char*MSG_CONF_NAME_RUS; -const char*MSG_CONF_NAME_SPN; -const char*MSG_CONF_NAME_GRM; -const char*MSG_CONF_NAME_CHN; -const char*MSG_CONF_NAME_MAL; -const char*MSG_CONF_NAME_IDN; -const char*MSG_CONF_NAME_FRN; -const char*MSG_CONF_NAME_POR; -const char*MSG_CONF_NAME_THA; +extern const char*MSG_CONF_NAME_RUS; +extern const char*MSG_CONF_NAME_SPN; +extern const char*MSG_CONF_NAME_GRM; +extern const char*MSG_CONF_NAME_CHN; +extern const char*MSG_CONF_NAME_MAL; +extern const char*MSG_CONF_NAME_IDN; +extern const char*MSG_CONF_NAME_FRN; +extern const char*MSG_CONF_NAME_POR; +extern const char*MSG_CONF_NAME_THA; //Useful typedefs from jA [Skotlex] typedef struct map_session_data TBL_PC; diff --git a/src/map/mapreg.c b/src/map/mapreg.c index 500c42b57b..afb644c605 100644 --- a/src/map/mapreg.c +++ b/src/map/mapreg.c @@ -22,6 +22,7 @@ bool skip_insert = false; static char mapreg_table[32] = "mapreg"; static bool mapreg_dirty = false; // Whether there are modified regs to be saved +struct reg_db regs; #define MAPREG_AUTOSAVE_INTERVAL (300*1000) diff --git a/src/map/mapreg.h b/src/map/mapreg.h index b73b731fa6..b70282443e 100644 --- a/src/map/mapreg.h +++ b/src/map/mapreg.h @@ -20,7 +20,7 @@ struct mapreg_save { bool save; ///< Whether a save operation is pending }; -struct reg_db regs; +extern struct reg_db regs; extern bool skip_insert; void mapreg_reload(void); diff --git a/src/map/npc.c b/src/map/npc.c index 6821a84628..34fdd583cf 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -42,6 +42,8 @@ static int npc_mob=0; static int npc_delay_mob=0; static int npc_cache_mob=0; +struct eri *npc_sc_display_ers; + // Market Shop #if PACKETVER >= 20131223 struct s_npc_market { diff --git a/src/map/npc.h b/src/map/npc.h index 3bade6a106..67e799579f 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -106,7 +106,7 @@ struct npc_data { } progressbar; }; -struct eri *npc_sc_display_ers; +extern struct eri *npc_sc_display_ers; #define START_NPC_NUM 110000000 diff --git a/src/map/pc.c b/src/map/pc.c index b28eeea4ae..4161ad485f 100755 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -58,12 +58,16 @@ int night_timer_tid = INVALID_TIMER; struct eri *pc_sc_display_ers = NULL; struct eri *pc_itemgrouphealrate_ers = NULL; +struct eri *num_reg_ers; +struct eri *str_reg_ers; int pc_expiration_tid = INVALID_TIMER; struct fame_list smith_fame_list[MAX_FAME_LIST]; struct fame_list chemist_fame_list[MAX_FAME_LIST]; struct fame_list taekwon_fame_list[MAX_FAME_LIST]; +struct s_job_info job_info[CLASS_COUNT]; + #define MOTD_LINE_SIZE 128 static char motd_text[MOTD_LINE_SIZE][CHAT_SIZE_MAX]; // Message of the day buffer [Valaris] diff --git a/src/map/pc.h b/src/map/pc.h index 892872a4b3..d0ab0e3630 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -744,8 +744,8 @@ extern struct eri *pc_itemgrouphealrate_ers; /// Player's Item Group Heal Rate t /** * ERS for the bulk of pc vars **/ -struct eri *num_reg_ers; -struct eri *str_reg_ers; +extern struct eri *num_reg_ers; +extern struct eri *str_reg_ers; /* Global Expiration Timer ID */ extern int pc_expiration_tid; @@ -832,7 +832,7 @@ enum item_check { ITMCHK_ALL = ITMCHK_INVENTORY|ITMCHK_CART|ITMCHK_STORAGE, }; -struct { +extern struct s_job_info { unsigned int base_hp[MAX_LEVEL], base_sp[MAX_LEVEL]; //Storage for the first calculation with hp/sp factor and multiplicator int hp_factor, hp_multiplicator, sp_factor; int max_weight_base; diff --git a/src/map/script.c b/src/map/script.c index 5523eceb9b..099d4cf072 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -58,6 +58,12 @@ #include +struct eri *array_ers; +DBMap *st_db; +unsigned int active_scripts; +unsigned int next_id; +struct eri *st_ers; +struct eri *stack_ers; static bool script_rid2sd_( struct script_state *st, struct map_session_data** sd, const char *func ); diff --git a/src/map/script.h b/src/map/script.h index b47f00587b..338ffe0bb5 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -706,12 +706,12 @@ enum vip_status_type { /** * used to generate quick script_array entries **/ -struct eri *array_ers; -DBMap *st_db; -unsigned int active_scripts; -unsigned int next_id; -struct eri *st_ers; -struct eri *stack_ers; +extern struct eri *array_ers; +extern DBMap *st_db; +extern unsigned int active_scripts; +extern unsigned int next_id; +extern struct eri *st_ers; +extern struct eri *stack_ers; const char* skip_space(const char* p); void script_error(const char* src, const char* file, int start_line, const char* error_msg, const char* error_pos); diff --git a/src/map/status.c b/src/map/status.c index 4e56eb84f1..4d13b2da7b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -55,6 +55,14 @@ short current_equip_opt_index; /// Contains random option index of an equipped i unsigned int SCDisabled[SC_MAX]; ///< List of disabled SC on map zones. [Cydh] +sc_type SkillStatusChangeTable[MAX_SKILL]; +int StatusIconChangeTable[SC_MAX]; +unsigned int StatusChangeFlagTable[SC_MAX]; +int StatusSkillChangeTable[SC_MAX]; +int StatusRelevantBLTypes[SI_MAX]; +unsigned int StatusChangeStateTable[SC_MAX]; +unsigned int StatusDisplayType[SC_MAX]; + static unsigned short status_calc_str(struct block_list *,struct status_change *,int); static unsigned short status_calc_agi(struct block_list *,struct status_change *,int); static unsigned short status_calc_vit(struct block_list *,struct status_change *,int); diff --git a/src/map/status.h b/src/map/status.h index bab74f9602..d8d7f761e9 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2082,13 +2082,13 @@ struct weapon_atk { #endif }; -sc_type SkillStatusChangeTable[MAX_SKILL]; /// skill -> status -int StatusIconChangeTable[SC_MAX]; /// status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) -unsigned int StatusChangeFlagTable[SC_MAX]; /// status -> flags -int StatusSkillChangeTable[SC_MAX]; /// status -> skill -int StatusRelevantBLTypes[SI_MAX]; /// "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets) -unsigned int StatusChangeStateTable[SC_MAX]; /// status -> flags -unsigned int StatusDisplayType[SC_MAX]; +extern sc_type SkillStatusChangeTable[MAX_SKILL]; /// skill -> status +extern int StatusIconChangeTable[SC_MAX]; /// status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) +extern unsigned int StatusChangeFlagTable[SC_MAX]; /// status -> flags +extern int StatusSkillChangeTable[SC_MAX]; /// status -> skill +extern int StatusRelevantBLTypes[SI_MAX]; /// "icon" -> enum bl_type (for clif->status_change to identify for which bl types to send packets) +extern unsigned int StatusChangeStateTable[SC_MAX]; /// status -> flags +extern unsigned int StatusDisplayType[SC_MAX]; ///For holding basic status (which can be modified by status changes) struct status_data {