diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 80 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 120 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 30 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 686 | ||||
-rw-r--r-- | src/plugins/db2sql.c | 330 |
5 files changed, 1151 insertions, 95 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index e0c30d6b0..c60946baf 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -176,8 +176,12 @@ typedef void (*HPMHOOK_pre_achievement_init_titles) (struct map_session_data **s typedef void (*HPMHOOK_post_achievement_init_titles) (struct map_session_data *sd); typedef bool (*HPMHOOK_pre_achievement_check_title) (struct map_session_data **sd, int *title_id); typedef bool (*HPMHOOK_post_achievement_check_title) (bool retVal___, struct map_session_data *sd, int title_id); -typedef void (*HPMHOOK_pre_achievement_get_rewards) (struct map_session_data **sd, const struct achievement_data **ad); -typedef void (*HPMHOOK_post_achievement_get_rewards) (struct map_session_data *sd, const struct achievement_data *ad); +typedef bool (*HPMHOOK_pre_achievement_get_rewards) (struct map_session_data **sd, const struct achievement_data **ad); +typedef bool (*HPMHOOK_post_achievement_get_rewards) (bool retVal___, struct map_session_data *sd, const struct achievement_data *ad); +typedef void (*HPMHOOK_pre_achievement_get_rewards_buffs) (struct map_session_data **sd, const struct achievement_data **ad); +typedef void (*HPMHOOK_post_achievement_get_rewards_buffs) (struct map_session_data *sd, const struct achievement_data *ad); +typedef void (*HPMHOOK_pre_achievement_get_rewards_items) (struct map_session_data **sd, const struct achievement_data **ad); +typedef void (*HPMHOOK_post_achievement_get_rewards_items) (struct map_session_data *sd, const struct achievement_data *ad); #endif // MAP_ACHIEVEMENT_H #ifdef MAP_ATCOMMAND_H /* atcommand */ typedef void (*HPMHOOK_pre_atcommand_init) (bool *minimal); @@ -1118,6 +1122,8 @@ typedef void (*HPMHOOK_pre_clif_delitem) (struct map_session_data **sd, int *n, typedef void (*HPMHOOK_post_clif_delitem) (struct map_session_data *sd, int n, int amount, short reason); typedef void (*HPMHOOK_pre_clif_takeitem) (struct block_list **src, struct block_list **dst); typedef void (*HPMHOOK_post_clif_takeitem) (struct block_list *src, struct block_list *dst); +typedef void (*HPMHOOK_pre_clif_item_movefailed) (struct map_session_data **sd, int *n); +typedef void (*HPMHOOK_post_clif_item_movefailed) (struct map_session_data *sd, int n); typedef void (*HPMHOOK_pre_clif_item_equip) (short *idx, struct EQUIPITEM_INFO **p, struct item **i, struct item_data **id, int *eqp_pos); typedef void (*HPMHOOK_post_clif_item_equip) (short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos); typedef void (*HPMHOOK_pre_clif_item_normal) (short *idx, struct NORMALITEM_INFO **p, struct item **i, struct item_data **id); @@ -1320,12 +1326,18 @@ typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *typ typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3); typedef void (*HPMHOOK_pre_clif_insert_card) (struct map_session_data **sd, int *idx_equip, int *idx_card, int *flag); typedef void (*HPMHOOK_post_clif_insert_card) (struct map_session_data *sd, int idx_equip, int idx_card, int flag); -typedef void (*HPMHOOK_pre_clif_inventorylist) (struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_inventorylist) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_equiplist) (struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_equiplist) (struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_cartlist) (struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_cartlist) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_inventoryList) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_inventoryList) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_inventoryItems) (struct map_session_data **sd, enum inventory_type *type); +typedef void (*HPMHOOK_post_clif_inventoryItems) (struct map_session_data *sd, enum inventory_type type); +typedef void (*HPMHOOK_pre_clif_equipList) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_equipList) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_equipItems) (struct map_session_data **sd, enum inventory_type *type); +typedef void (*HPMHOOK_post_clif_equipItems) (struct map_session_data *sd, enum inventory_type type); +typedef void (*HPMHOOK_pre_clif_cartList) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_cartList) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_cartItems) (struct map_session_data **sd, enum inventory_type *type); +typedef void (*HPMHOOK_post_clif_cartItems) (struct map_session_data *sd, enum inventory_type type); typedef void (*HPMHOOK_pre_clif_favorite_item) (struct map_session_data **sd, unsigned short *index); typedef void (*HPMHOOK_post_clif_favorite_item) (struct map_session_data *sd, unsigned short index); typedef void (*HPMHOOK_pre_clif_clearcart) (int *fd); @@ -1506,6 +1518,10 @@ typedef void (*HPMHOOK_pre_clif_specialeffect_single) (struct block_list **bl, i typedef void (*HPMHOOK_post_clif_specialeffect_single) (struct block_list *bl, int type, int fd); typedef void (*HPMHOOK_pre_clif_specialeffect_value) (struct block_list **bl, int *effect_id, int *num, send_target *target); typedef void (*HPMHOOK_post_clif_specialeffect_value) (struct block_list *bl, int effect_id, int num, send_target target); +typedef void (*HPMHOOK_pre_clif_removeSpecialEffect) (struct block_list **bl, int *effectId, enum send_target *target); +typedef void (*HPMHOOK_post_clif_removeSpecialEffect) (struct block_list *bl, int effectId, enum send_target target); +typedef void (*HPMHOOK_pre_clif_removeSpecialEffect_single) (struct block_list **bl, int *effectId, struct block_list **targetBl); +typedef void (*HPMHOOK_post_clif_removeSpecialEffect_single) (struct block_list *bl, int effectId, struct block_list *targetBl); typedef void (*HPMHOOK_pre_clif_millenniumshield) (struct block_list **bl, short *shields); typedef void (*HPMHOOK_post_clif_millenniumshield) (struct block_list *bl, short shields); typedef void (*HPMHOOK_pre_clif_spiritcharm) (struct map_session_data **sd); @@ -1568,6 +1584,8 @@ typedef void (*HPMHOOK_pre_clif_msgtable_skill) (struct map_session_data **sd, u typedef void (*HPMHOOK_post_clif_msgtable_skill) (struct map_session_data *sd, uint16 skill_id, enum clif_messages msg_id); typedef void (*HPMHOOK_pre_clif_msgtable_str) (struct map_session_data **sd, enum clif_messages *p1, const char **value); typedef void (*HPMHOOK_post_clif_msgtable_str) (struct map_session_data *sd, enum clif_messages p1, const char *value); +typedef void (*HPMHOOK_pre_clif_msgtable_str_color) (struct map_session_data **sd, enum clif_messages *p1, const char **value, uint32 *color); +typedef void (*HPMHOOK_post_clif_msgtable_str_color) (struct map_session_data *sd, enum clif_messages p1, const char *value, uint32 color); typedef void (*HPMHOOK_pre_clif_msgtable_color) (struct map_session_data **sd, enum clif_messages *p1, uint32 *color); typedef void (*HPMHOOK_post_clif_msgtable_color) (struct map_session_data *sd, enum clif_messages p1, uint32 color); typedef void (*HPMHOOK_pre_clif_message) (const int *fd, const char **mes); @@ -1618,8 +1636,16 @@ typedef void (*HPMHOOK_pre_clif_openvendingAck) (int *fd, int *result); typedef void (*HPMHOOK_post_clif_openvendingAck) (int fd, int result); typedef void (*HPMHOOK_pre_clif_vendingreport) (struct map_session_data **sd, int *index, int *amount, uint32 *char_id, int *zeny); typedef void (*HPMHOOK_post_clif_vendingreport) (struct map_session_data *sd, int index, int amount, uint32 char_id, int zeny); -typedef void (*HPMHOOK_pre_clif_storagelist) (struct map_session_data **sd, struct item **items, int *items_length); -typedef void (*HPMHOOK_post_clif_storagelist) (struct map_session_data *sd, struct item *items, int items_length); +typedef void (*HPMHOOK_pre_clif_storageList) (struct map_session_data **sd, struct item **items, int *items_length); +typedef void (*HPMHOOK_post_clif_storageList) (struct map_session_data *sd, struct item *items, int items_length); +typedef void (*HPMHOOK_pre_clif_guildStorageList) (struct map_session_data **sd, struct item **items, int *items_length); +typedef void (*HPMHOOK_post_clif_guildStorageList) (struct map_session_data *sd, struct item *items, int items_length); +typedef void (*HPMHOOK_pre_clif_storageItems) (struct map_session_data **sd, enum inventory_type *type, struct item **items, int *items_length); +typedef void (*HPMHOOK_post_clif_storageItems) (struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length); +typedef void (*HPMHOOK_pre_clif_inventoryStart) (struct map_session_data **sd, enum inventory_type *type, const char **name); +typedef void (*HPMHOOK_post_clif_inventoryStart) (struct map_session_data *sd, enum inventory_type type, const char *name); +typedef void (*HPMHOOK_pre_clif_inventoryEnd) (struct map_session_data **sd, enum inventory_type *type); +typedef void (*HPMHOOK_post_clif_inventoryEnd) (struct map_session_data *sd, enum inventory_type type); typedef void (*HPMHOOK_pre_clif_updatestorageamount) (struct map_session_data **sd, int *amount, int *max_amount); typedef void (*HPMHOOK_post_clif_updatestorageamount) (struct map_session_data *sd, int amount, int max_amount); typedef void (*HPMHOOK_pre_clif_storageitemadded) (struct map_session_data **sd, struct item **i, int *index, int *amount); @@ -1692,10 +1718,10 @@ typedef void (*HPMHOOK_pre_clif_guild_invite) (struct map_session_data **sd, str typedef void (*HPMHOOK_post_clif_guild_invite) (struct map_session_data *sd, struct guild *g); typedef void (*HPMHOOK_pre_clif_guild_inviteack) (struct map_session_data **sd, int *flag); typedef void (*HPMHOOK_post_clif_guild_inviteack) (struct map_session_data *sd, int flag); -typedef void (*HPMHOOK_pre_clif_guild_leave) (struct map_session_data **sd, const char **name, const char **mes); -typedef void (*HPMHOOK_post_clif_guild_leave) (struct map_session_data *sd, const char *name, const char *mes); -typedef void (*HPMHOOK_pre_clif_guild_expulsion) (struct map_session_data **sd, const char **name, const char **mes, int *account_id); -typedef void (*HPMHOOK_post_clif_guild_expulsion) (struct map_session_data *sd, const char *name, const char *mes, int account_id); +typedef void (*HPMHOOK_pre_clif_guild_leave) (struct map_session_data **sd, const char **name, int *char_id, const char **mes); +typedef void (*HPMHOOK_post_clif_guild_leave) (struct map_session_data *sd, const char *name, int char_id, const char *mes); +typedef void (*HPMHOOK_pre_clif_guild_expulsion) (struct map_session_data **sd, const char **name, int *char_id, const char **mes, int *account_id); +typedef void (*HPMHOOK_post_clif_guild_expulsion) (struct map_session_data *sd, const char *name, int char_id, const char *mes, int account_id); typedef void (*HPMHOOK_pre_clif_guild_positionchanged) (struct guild **g, int *idx); typedef void (*HPMHOOK_post_clif_guild_positionchanged) (struct guild *g, int idx); typedef void (*HPMHOOK_pre_clif_guild_memberpositionchanged) (struct guild **g, int *idx); @@ -1730,6 +1756,10 @@ typedef void (*HPMHOOK_pre_clif_guild_positioninfolist) (struct map_session_data typedef void (*HPMHOOK_post_clif_guild_positioninfolist) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_guild_expulsionlist) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_guild_expulsionlist) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_guild_set_position) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_guild_set_position) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_guild_position_selected) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_guild_position_selected) (struct map_session_data *sd); typedef bool (*HPMHOOK_pre_clif_validate_emblem) (const uint8 **emblem, unsigned long *emblem_len); typedef bool (*HPMHOOK_post_clif_validate_emblem) (bool retVal___, const uint8 *emblem, unsigned long emblem_len); typedef void (*HPMHOOK_pre_clif_bg_hp) (struct map_session_data **sd); @@ -2582,6 +2612,8 @@ typedef void (*HPMHOOK_pre_clif_stylist_send_rodexitem) (struct map_session_data typedef void (*HPMHOOK_post_clif_stylist_send_rodexitem) (struct map_session_data *sd, int itemid); typedef void (*HPMHOOK_pre_clif_pReqStyleChange) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pReqStyleChange) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pReqStyleChange2) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pReqStyleChange2) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_cz_req_style_change_sub) (struct map_session_data **sd, int *type, int16 *idx, bool *isitem); typedef void (*HPMHOOK_post_clif_cz_req_style_change_sub) (struct map_session_data *sd, int type, int16 idx, bool isitem); typedef void (*HPMHOOK_pre_clif_style_change_response) (struct map_session_data **sd, enum stylist_shop *flag); @@ -2592,6 +2624,12 @@ typedef void (*HPMHOOK_pre_clif_petEvolutionResult) (int *fd, enum pet_evolution typedef void (*HPMHOOK_post_clif_petEvolutionResult) (int fd, enum pet_evolution_result result); typedef void (*HPMHOOK_pre_clif_party_dead_notification) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_party_dead_notification) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pMemorialDungeonCommand) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pMemorialDungeonCommand) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_camera_showWindow) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_camera_showWindow) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_camera_change) (struct map_session_data **sd, float *range, float *rotation, float *latitude, enum send_target *target); +typedef void (*HPMHOOK_post_clif_camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -3118,6 +3156,8 @@ typedef bool (*HPMHOOK_pre_instance_valid) (int *instance_id); typedef bool (*HPMHOOK_post_instance_valid) (bool retVal___, int instance_id); typedef int (*HPMHOOK_pre_instance_destroy_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_instance_destroy_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef void (*HPMHOOK_pre_instance_force_destroy) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_instance_force_destroy) (struct map_session_data *sd); #endif // MAP_INSTANCE_H #ifdef CHAR_INT_ACHIEVEMENT_H /* inter_achievement */ typedef int (*HPMHOOK_pre_inter_achievement_sql_init) (void); @@ -3502,8 +3542,8 @@ typedef int (*HPMHOOK_pre_intif_request_registry) (struct map_session_data **sd, typedef int (*HPMHOOK_post_intif_request_registry) (int retVal___, struct map_session_data *sd, int flag); typedef void (*HPMHOOK_pre_intif_request_account_storage) (const struct map_session_data **sd); typedef void (*HPMHOOK_post_intif_request_account_storage) (const struct map_session_data *sd); -typedef void (*HPMHOOK_pre_intif_send_account_storage) (const struct map_session_data **sd); -typedef void (*HPMHOOK_post_intif_send_account_storage) (const struct map_session_data *sd); +typedef void (*HPMHOOK_pre_intif_send_account_storage) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_intif_send_account_storage) (struct map_session_data *sd); typedef int (*HPMHOOK_pre_intif_request_guild_storage) (int *account_id, int *guild_id); typedef int (*HPMHOOK_post_intif_request_guild_storage) (int retVal___, int account_id, int guild_id); typedef int (*HPMHOOK_pre_intif_send_guild_storage) (int *account_id, struct guild_storage **gstor); @@ -4422,6 +4462,8 @@ typedef void (*HPMHOOK_pre_map_zone_change) (int *m, struct map_zone_data **zone typedef void (*HPMHOOK_post_map_zone_change) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath); typedef void (*HPMHOOK_pre_map_zone_change2) (int *m, struct map_zone_data **zone); typedef void (*HPMHOOK_post_map_zone_change2) (int m, struct map_zone_data *zone); +typedef void (*HPMHOOK_pre_map_zone_reload) (void); +typedef void (*HPMHOOK_post_map_zone_reload) (void); typedef int (*HPMHOOK_pre_map_getcell) (int16 *m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk); typedef int (*HPMHOOK_post_map_getcell) (int retVal___, int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk); typedef void (*HPMHOOK_pre_map_setgatcell) (int16 *m, int16 *x, int16 *y, int *gat); @@ -5844,8 +5886,8 @@ typedef int (*HPMHOOK_pre_pc_search_inventory) (struct map_session_data **sd, in typedef int (*HPMHOOK_post_pc_search_inventory) (int retVal___, struct map_session_data *sd, int item_id); typedef int (*HPMHOOK_pre_pc_payzeny) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd); typedef int (*HPMHOOK_post_pc_payzeny) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd); -typedef int (*HPMHOOK_pre_pc_additem) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type); -typedef int (*HPMHOOK_post_pc_additem) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type); +typedef int (*HPMHOOK_pre_pc_additem) (struct map_session_data **sd, const struct item **item_data, int *amount, e_log_pick_type *log_type); +typedef int (*HPMHOOK_post_pc_additem) (int retVal___, struct map_session_data *sd, const struct item *item_data, int amount, e_log_pick_type log_type); typedef int (*HPMHOOK_pre_pc_getzeny) (struct map_session_data **sd, int *zeny, enum e_log_pick_type *type, struct map_session_data **tsd); typedef int (*HPMHOOK_post_pc_getzeny) (int retVal___, struct map_session_data *sd, int zeny, enum e_log_pick_type type, struct map_session_data *tsd); typedef int (*HPMHOOK_pre_pc_delitem) (struct map_session_data **sd, int *n, int *amount, int *type, short *reason, e_log_pick_type *log_type); @@ -6610,6 +6652,8 @@ typedef bool (*HPMHOOK_pre_script_config_read) (const char **filename, bool *imp typedef bool (*HPMHOOK_post_script_config_read) (bool retVal___, const char *filename, bool imported); typedef int (*HPMHOOK_pre_script_add_str) (const char **p); typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p); +typedef int (*HPMHOOK_pre_script_add_variable) (const char **varname); +typedef int (*HPMHOOK_post_script_add_variable) (int retVal___, const char *varname); typedef const char* (*HPMHOOK_pre_script_get_str) (int *id); typedef const char* (*HPMHOOK_post_script_get_str) (const char* retVal___, int id); typedef int (*HPMHOOK_pre_script_search_str) (const char **p); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 760f44c5e..2a2290d6f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -136,6 +136,10 @@ struct { struct HPMHookPoint *HP_achievement_check_title_post; struct HPMHookPoint *HP_achievement_get_rewards_pre; struct HPMHookPoint *HP_achievement_get_rewards_post; + struct HPMHookPoint *HP_achievement_get_rewards_buffs_pre; + struct HPMHookPoint *HP_achievement_get_rewards_buffs_post; + struct HPMHookPoint *HP_achievement_get_rewards_items_pre; + struct HPMHookPoint *HP_achievement_get_rewards_items_post; struct HPMHookPoint *HP_atcommand_init_pre; struct HPMHookPoint *HP_atcommand_init_post; struct HPMHookPoint *HP_atcommand_final_pre; @@ -710,6 +714,8 @@ struct { struct HPMHookPoint *HP_clif_delitem_post; struct HPMHookPoint *HP_clif_takeitem_pre; struct HPMHookPoint *HP_clif_takeitem_post; + struct HPMHookPoint *HP_clif_item_movefailed_pre; + struct HPMHookPoint *HP_clif_item_movefailed_post; struct HPMHookPoint *HP_clif_item_equip_pre; struct HPMHookPoint *HP_clif_item_equip_post; struct HPMHookPoint *HP_clif_item_normal_pre; @@ -912,12 +918,18 @@ struct { struct HPMHookPoint *HP_clif_status_change_post; struct HPMHookPoint *HP_clif_insert_card_pre; struct HPMHookPoint *HP_clif_insert_card_post; - struct HPMHookPoint *HP_clif_inventorylist_pre; - struct HPMHookPoint *HP_clif_inventorylist_post; - struct HPMHookPoint *HP_clif_equiplist_pre; - struct HPMHookPoint *HP_clif_equiplist_post; - struct HPMHookPoint *HP_clif_cartlist_pre; - struct HPMHookPoint *HP_clif_cartlist_post; + struct HPMHookPoint *HP_clif_inventoryList_pre; + struct HPMHookPoint *HP_clif_inventoryList_post; + struct HPMHookPoint *HP_clif_inventoryItems_pre; + struct HPMHookPoint *HP_clif_inventoryItems_post; + struct HPMHookPoint *HP_clif_equipList_pre; + struct HPMHookPoint *HP_clif_equipList_post; + struct HPMHookPoint *HP_clif_equipItems_pre; + struct HPMHookPoint *HP_clif_equipItems_post; + struct HPMHookPoint *HP_clif_cartList_pre; + struct HPMHookPoint *HP_clif_cartList_post; + struct HPMHookPoint *HP_clif_cartItems_pre; + struct HPMHookPoint *HP_clif_cartItems_post; struct HPMHookPoint *HP_clif_favorite_item_pre; struct HPMHookPoint *HP_clif_favorite_item_post; struct HPMHookPoint *HP_clif_clearcart_pre; @@ -1098,6 +1110,10 @@ struct { struct HPMHookPoint *HP_clif_specialeffect_single_post; struct HPMHookPoint *HP_clif_specialeffect_value_pre; struct HPMHookPoint *HP_clif_specialeffect_value_post; + struct HPMHookPoint *HP_clif_removeSpecialEffect_pre; + struct HPMHookPoint *HP_clif_removeSpecialEffect_post; + struct HPMHookPoint *HP_clif_removeSpecialEffect_single_pre; + struct HPMHookPoint *HP_clif_removeSpecialEffect_single_post; struct HPMHookPoint *HP_clif_millenniumshield_pre; struct HPMHookPoint *HP_clif_millenniumshield_post; struct HPMHookPoint *HP_clif_spiritcharm_pre; @@ -1160,6 +1176,8 @@ struct { struct HPMHookPoint *HP_clif_msgtable_skill_post; struct HPMHookPoint *HP_clif_msgtable_str_pre; struct HPMHookPoint *HP_clif_msgtable_str_post; + struct HPMHookPoint *HP_clif_msgtable_str_color_pre; + struct HPMHookPoint *HP_clif_msgtable_str_color_post; struct HPMHookPoint *HP_clif_msgtable_color_pre; struct HPMHookPoint *HP_clif_msgtable_color_post; struct HPMHookPoint *HP_clif_message_pre; @@ -1210,8 +1228,16 @@ struct { struct HPMHookPoint *HP_clif_openvendingAck_post; struct HPMHookPoint *HP_clif_vendingreport_pre; struct HPMHookPoint *HP_clif_vendingreport_post; - struct HPMHookPoint *HP_clif_storagelist_pre; - struct HPMHookPoint *HP_clif_storagelist_post; + struct HPMHookPoint *HP_clif_storageList_pre; + struct HPMHookPoint *HP_clif_storageList_post; + struct HPMHookPoint *HP_clif_guildStorageList_pre; + struct HPMHookPoint *HP_clif_guildStorageList_post; + struct HPMHookPoint *HP_clif_storageItems_pre; + struct HPMHookPoint *HP_clif_storageItems_post; + struct HPMHookPoint *HP_clif_inventoryStart_pre; + struct HPMHookPoint *HP_clif_inventoryStart_post; + struct HPMHookPoint *HP_clif_inventoryEnd_pre; + struct HPMHookPoint *HP_clif_inventoryEnd_post; struct HPMHookPoint *HP_clif_updatestorageamount_pre; struct HPMHookPoint *HP_clif_updatestorageamount_post; struct HPMHookPoint *HP_clif_storageitemadded_pre; @@ -1322,6 +1348,10 @@ struct { struct HPMHookPoint *HP_clif_guild_positioninfolist_post; struct HPMHookPoint *HP_clif_guild_expulsionlist_pre; struct HPMHookPoint *HP_clif_guild_expulsionlist_post; + struct HPMHookPoint *HP_clif_guild_set_position_pre; + struct HPMHookPoint *HP_clif_guild_set_position_post; + struct HPMHookPoint *HP_clif_guild_position_selected_pre; + struct HPMHookPoint *HP_clif_guild_position_selected_post; struct HPMHookPoint *HP_clif_validate_emblem_pre; struct HPMHookPoint *HP_clif_validate_emblem_post; struct HPMHookPoint *HP_clif_bg_hp_pre; @@ -2174,6 +2204,8 @@ struct { struct HPMHookPoint *HP_clif_stylist_send_rodexitem_post; struct HPMHookPoint *HP_clif_pReqStyleChange_pre; struct HPMHookPoint *HP_clif_pReqStyleChange_post; + struct HPMHookPoint *HP_clif_pReqStyleChange2_pre; + struct HPMHookPoint *HP_clif_pReqStyleChange2_post; struct HPMHookPoint *HP_clif_cz_req_style_change_sub_pre; struct HPMHookPoint *HP_clif_cz_req_style_change_sub_post; struct HPMHookPoint *HP_clif_style_change_response_pre; @@ -2184,6 +2216,12 @@ struct { struct HPMHookPoint *HP_clif_petEvolutionResult_post; struct HPMHookPoint *HP_clif_party_dead_notification_pre; struct HPMHookPoint *HP_clif_party_dead_notification_post; + struct HPMHookPoint *HP_clif_pMemorialDungeonCommand_pre; + struct HPMHookPoint *HP_clif_pMemorialDungeonCommand_post; + struct HPMHookPoint *HP_clif_camera_showWindow_pre; + struct HPMHookPoint *HP_clif_camera_showWindow_post; + struct HPMHookPoint *HP_clif_camera_change_pre; + struct HPMHookPoint *HP_clif_camera_change_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -2678,6 +2716,8 @@ struct { struct HPMHookPoint *HP_instance_valid_post; struct HPMHookPoint *HP_instance_destroy_timer_pre; struct HPMHookPoint *HP_instance_destroy_timer_post; + struct HPMHookPoint *HP_instance_force_destroy_pre; + struct HPMHookPoint *HP_instance_force_destroy_post; struct HPMHookPoint *HP_intif_parse_pre; struct HPMHookPoint *HP_intif_parse_post; struct HPMHookPoint *HP_intif_create_pet_pre; @@ -3352,6 +3392,8 @@ struct { struct HPMHookPoint *HP_map_zone_change_post; struct HPMHookPoint *HP_map_zone_change2_pre; struct HPMHookPoint *HP_map_zone_change2_post; + struct HPMHookPoint *HP_map_zone_reload_pre; + struct HPMHookPoint *HP_map_zone_reload_post; struct HPMHookPoint *HP_map_getcell_pre; struct HPMHookPoint *HP_map_getcell_post; struct HPMHookPoint *HP_map_setgatcell_pre; @@ -5132,6 +5174,8 @@ struct { struct HPMHookPoint *HP_script_config_read_post; struct HPMHookPoint *HP_script_add_str_pre; struct HPMHookPoint *HP_script_add_str_post; + struct HPMHookPoint *HP_script_add_variable_pre; + struct HPMHookPoint *HP_script_add_variable_post; struct HPMHookPoint *HP_script_get_str_pre; struct HPMHookPoint *HP_script_get_str_post; struct HPMHookPoint *HP_script_search_str_pre; @@ -6691,6 +6735,10 @@ struct { int HP_achievement_check_title_post; int HP_achievement_get_rewards_pre; int HP_achievement_get_rewards_post; + int HP_achievement_get_rewards_buffs_pre; + int HP_achievement_get_rewards_buffs_post; + int HP_achievement_get_rewards_items_pre; + int HP_achievement_get_rewards_items_post; int HP_atcommand_init_pre; int HP_atcommand_init_post; int HP_atcommand_final_pre; @@ -7265,6 +7313,8 @@ struct { int HP_clif_delitem_post; int HP_clif_takeitem_pre; int HP_clif_takeitem_post; + int HP_clif_item_movefailed_pre; + int HP_clif_item_movefailed_post; int HP_clif_item_equip_pre; int HP_clif_item_equip_post; int HP_clif_item_normal_pre; @@ -7467,12 +7517,18 @@ struct { int HP_clif_status_change_post; int HP_clif_insert_card_pre; int HP_clif_insert_card_post; - int HP_clif_inventorylist_pre; - int HP_clif_inventorylist_post; - int HP_clif_equiplist_pre; - int HP_clif_equiplist_post; - int HP_clif_cartlist_pre; - int HP_clif_cartlist_post; + int HP_clif_inventoryList_pre; + int HP_clif_inventoryList_post; + int HP_clif_inventoryItems_pre; + int HP_clif_inventoryItems_post; + int HP_clif_equipList_pre; + int HP_clif_equipList_post; + int HP_clif_equipItems_pre; + int HP_clif_equipItems_post; + int HP_clif_cartList_pre; + int HP_clif_cartList_post; + int HP_clif_cartItems_pre; + int HP_clif_cartItems_post; int HP_clif_favorite_item_pre; int HP_clif_favorite_item_post; int HP_clif_clearcart_pre; @@ -7653,6 +7709,10 @@ struct { int HP_clif_specialeffect_single_post; int HP_clif_specialeffect_value_pre; int HP_clif_specialeffect_value_post; + int HP_clif_removeSpecialEffect_pre; + int HP_clif_removeSpecialEffect_post; + int HP_clif_removeSpecialEffect_single_pre; + int HP_clif_removeSpecialEffect_single_post; int HP_clif_millenniumshield_pre; int HP_clif_millenniumshield_post; int HP_clif_spiritcharm_pre; @@ -7715,6 +7775,8 @@ struct { int HP_clif_msgtable_skill_post; int HP_clif_msgtable_str_pre; int HP_clif_msgtable_str_post; + int HP_clif_msgtable_str_color_pre; + int HP_clif_msgtable_str_color_post; int HP_clif_msgtable_color_pre; int HP_clif_msgtable_color_post; int HP_clif_message_pre; @@ -7765,8 +7827,16 @@ struct { int HP_clif_openvendingAck_post; int HP_clif_vendingreport_pre; int HP_clif_vendingreport_post; - int HP_clif_storagelist_pre; - int HP_clif_storagelist_post; + int HP_clif_storageList_pre; + int HP_clif_storageList_post; + int HP_clif_guildStorageList_pre; + int HP_clif_guildStorageList_post; + int HP_clif_storageItems_pre; + int HP_clif_storageItems_post; + int HP_clif_inventoryStart_pre; + int HP_clif_inventoryStart_post; + int HP_clif_inventoryEnd_pre; + int HP_clif_inventoryEnd_post; int HP_clif_updatestorageamount_pre; int HP_clif_updatestorageamount_post; int HP_clif_storageitemadded_pre; @@ -7877,6 +7947,10 @@ struct { int HP_clif_guild_positioninfolist_post; int HP_clif_guild_expulsionlist_pre; int HP_clif_guild_expulsionlist_post; + int HP_clif_guild_set_position_pre; + int HP_clif_guild_set_position_post; + int HP_clif_guild_position_selected_pre; + int HP_clif_guild_position_selected_post; int HP_clif_validate_emblem_pre; int HP_clif_validate_emblem_post; int HP_clif_bg_hp_pre; @@ -8729,6 +8803,8 @@ struct { int HP_clif_stylist_send_rodexitem_post; int HP_clif_pReqStyleChange_pre; int HP_clif_pReqStyleChange_post; + int HP_clif_pReqStyleChange2_pre; + int HP_clif_pReqStyleChange2_post; int HP_clif_cz_req_style_change_sub_pre; int HP_clif_cz_req_style_change_sub_post; int HP_clif_style_change_response_pre; @@ -8739,6 +8815,12 @@ struct { int HP_clif_petEvolutionResult_post; int HP_clif_party_dead_notification_pre; int HP_clif_party_dead_notification_post; + int HP_clif_pMemorialDungeonCommand_pre; + int HP_clif_pMemorialDungeonCommand_post; + int HP_clif_camera_showWindow_pre; + int HP_clif_camera_showWindow_post; + int HP_clif_camera_change_pre; + int HP_clif_camera_change_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -9233,6 +9315,8 @@ struct { int HP_instance_valid_post; int HP_instance_destroy_timer_pre; int HP_instance_destroy_timer_post; + int HP_instance_force_destroy_pre; + int HP_instance_force_destroy_post; int HP_intif_parse_pre; int HP_intif_parse_post; int HP_intif_create_pet_pre; @@ -9907,6 +9991,8 @@ struct { int HP_map_zone_change_post; int HP_map_zone_change2_pre; int HP_map_zone_change2_post; + int HP_map_zone_reload_pre; + int HP_map_zone_reload_post; int HP_map_getcell_pre; int HP_map_getcell_post; int HP_map_setgatcell_pre; @@ -11687,6 +11773,8 @@ struct { int HP_script_config_read_post; int HP_script_add_str_pre; int HP_script_add_str_post; + int HP_script_add_variable_pre; + int HP_script_add_variable_post; int HP_script_get_str_pre; int HP_script_get_str_post; int HP_script_search_str_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 59ebfd130..051e6fbe2 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -83,6 +83,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(achievement->init_titles, HP_achievement_init_titles) }, { HP_POP(achievement->check_title, HP_achievement_check_title) }, { HP_POP(achievement->get_rewards, HP_achievement_get_rewards) }, + { HP_POP(achievement->get_rewards_buffs, HP_achievement_get_rewards_buffs) }, + { HP_POP(achievement->get_rewards_items, HP_achievement_get_rewards_items) }, /* atcommand_interface */ { HP_POP(atcommand->init, HP_atcommand_init) }, { HP_POP(atcommand->final, HP_atcommand_final) }, @@ -379,6 +381,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->dropitem, HP_clif_dropitem) }, { HP_POP(clif->delitem, HP_clif_delitem) }, { HP_POP(clif->takeitem, HP_clif_takeitem) }, + { HP_POP(clif->item_movefailed, HP_clif_item_movefailed) }, { HP_POP(clif->item_equip, HP_clif_item_equip) }, { HP_POP(clif->item_normal, HP_clif_item_normal) }, { HP_POP(clif->arrowequip, HP_clif_arrowequip) }, @@ -480,9 +483,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->combo_delay, HP_clif_combo_delay) }, { HP_POP(clif->status_change, HP_clif_status_change) }, { HP_POP(clif->insert_card, HP_clif_insert_card) }, - { HP_POP(clif->inventorylist, HP_clif_inventorylist) }, - { HP_POP(clif->equiplist, HP_clif_equiplist) }, - { HP_POP(clif->cartlist, HP_clif_cartlist) }, + { HP_POP(clif->inventoryList, HP_clif_inventoryList) }, + { HP_POP(clif->inventoryItems, HP_clif_inventoryItems) }, + { HP_POP(clif->equipList, HP_clif_equipList) }, + { HP_POP(clif->equipItems, HP_clif_equipItems) }, + { HP_POP(clif->cartList, HP_clif_cartList) }, + { HP_POP(clif->cartItems, HP_clif_cartItems) }, { HP_POP(clif->favorite_item, HP_clif_favorite_item) }, { HP_POP(clif->clearcart, HP_clif_clearcart) }, { HP_POP(clif->item_identify_list, HP_clif_item_identify_list) }, @@ -573,6 +579,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->specialeffect, HP_clif_specialeffect) }, { HP_POP(clif->specialeffect_single, HP_clif_specialeffect_single) }, { HP_POP(clif->specialeffect_value, HP_clif_specialeffect_value) }, + { HP_POP(clif->removeSpecialEffect, HP_clif_removeSpecialEffect) }, + { HP_POP(clif->removeSpecialEffect_single, HP_clif_removeSpecialEffect_single) }, { HP_POP(clif->millenniumshield, HP_clif_millenniumshield) }, { HP_POP(clif->spiritcharm, HP_clif_spiritcharm) }, { HP_POP(clif->charm_single, HP_clif_charm_single) }, @@ -604,6 +612,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->msgtable_num, HP_clif_msgtable_num) }, { HP_POP(clif->msgtable_skill, HP_clif_msgtable_skill) }, { HP_POP(clif->msgtable_str, HP_clif_msgtable_str) }, + { HP_POP(clif->msgtable_str_color, HP_clif_msgtable_str_color) }, { HP_POP(clif->msgtable_color, HP_clif_msgtable_color) }, { HP_POP(clif->message, HP_clif_message) }, { HP_POP(clif->messageln, HP_clif_messageln) }, @@ -629,7 +638,11 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->openvending, HP_clif_openvending) }, { HP_POP(clif->openvendingAck, HP_clif_openvendingAck) }, { HP_POP(clif->vendingreport, HP_clif_vendingreport) }, - { HP_POP(clif->storagelist, HP_clif_storagelist) }, + { HP_POP(clif->storageList, HP_clif_storageList) }, + { HP_POP(clif->guildStorageList, HP_clif_guildStorageList) }, + { HP_POP(clif->storageItems, HP_clif_storageItems) }, + { HP_POP(clif->inventoryStart, HP_clif_inventoryStart) }, + { HP_POP(clif->inventoryEnd, HP_clif_inventoryEnd) }, { HP_POP(clif->updatestorageamount, HP_clif_updatestorageamount) }, { HP_POP(clif->storageitemadded, HP_clif_storageitemadded) }, { HP_POP(clif->storageitemremoved, HP_clif_storageitemremoved) }, @@ -685,6 +698,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->guild_positionnamelist, HP_clif_guild_positionnamelist) }, { HP_POP(clif->guild_positioninfolist, HP_clif_guild_positioninfolist) }, { HP_POP(clif->guild_expulsionlist, HP_clif_guild_expulsionlist) }, + { HP_POP(clif->guild_set_position, HP_clif_guild_set_position) }, + { HP_POP(clif->guild_position_selected, HP_clif_guild_position_selected) }, { HP_POP(clif->validate_emblem, HP_clif_validate_emblem) }, { HP_POP(clif->bg_hp, HP_clif_bg_hp) }, { HP_POP(clif->bg_xy, HP_clif_bg_xy) }, @@ -1111,11 +1126,15 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->style_change_validate_requirements, HP_clif_style_change_validate_requirements) }, { HP_POP(clif->stylist_send_rodexitem, HP_clif_stylist_send_rodexitem) }, { HP_POP(clif->pReqStyleChange, HP_clif_pReqStyleChange) }, + { HP_POP(clif->pReqStyleChange2, HP_clif_pReqStyleChange2) }, { HP_POP(clif->cz_req_style_change_sub, HP_clif_cz_req_style_change_sub) }, { HP_POP(clif->style_change_response, HP_clif_style_change_response) }, { HP_POP(clif->pPetEvolution, HP_clif_pPetEvolution) }, { HP_POP(clif->petEvolutionResult, HP_clif_petEvolutionResult) }, { HP_POP(clif->party_dead_notification, HP_clif_party_dead_notification) }, + { HP_POP(clif->pMemorialDungeonCommand, HP_clif_pMemorialDungeonCommand) }, + { HP_POP(clif->camera_showWindow, HP_clif_camera_showWindow) }, + { HP_POP(clif->camera_change, HP_clif_camera_change) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -1375,6 +1394,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(instance->set_timeout, HP_instance_set_timeout) }, { HP_POP(instance->valid, HP_instance_valid) }, { HP_POP(instance->destroy_timer, HP_instance_destroy_timer) }, + { HP_POP(instance->force_destroy, HP_instance_force_destroy) }, /* intif_interface */ { HP_POP(intif->parse, HP_intif_parse) }, { HP_POP(intif->create_pet, HP_intif_create_pet) }, @@ -1719,6 +1739,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->zone_apply, HP_map_zone_apply) }, { HP_POP(map->zone_change, HP_map_zone_change) }, { HP_POP(map->zone_change2, HP_map_zone_change2) }, + { HP_POP(map->zone_reload, HP_map_zone_reload) }, { HP_POP(map->getcell, HP_map_getcell) }, { HP_POP(map->setgatcell, HP_map_setgatcell) }, { HP_POP(map->cellfromcache, HP_map_cellfromcache) }, @@ -2629,6 +2650,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->setarray_pc, HP_script_setarray_pc) }, { HP_POP(script->config_read, HP_script_config_read) }, { HP_POP(script->add_str, HP_script_add_str) }, + { HP_POP(script->add_variable, HP_script_add_variable) }, { HP_POP(script->get_str, HP_script_get_str) }, { HP_POP(script->search_str, HP_script_search_str) }, { HP_POP(script->setd_sub, HP_script_setd_sub) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 3615f06ed..b177c12c0 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -1459,27 +1459,80 @@ bool HP_achievement_check_title(struct map_session_data *sd, int title_id) { } return retVal___; } -void HP_achievement_get_rewards(struct map_session_data *sd, const struct achievement_data *ad) { +bool HP_achievement_get_rewards(struct map_session_data *sd, const struct achievement_data *ad) { int hIndex = 0; + bool retVal___ = false; if (HPMHooks.count.HP_achievement_get_rewards_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); + bool (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_achievement_get_rewards_pre[hIndex].func; - preHookFunc(&sd, &ad); + retVal___ = preHookFunc(&sd, &ad); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.achievement.get_rewards(sd, ad); + retVal___ = HPMHooks.source.achievement.get_rewards(sd, ad); } if (HPMHooks.count.HP_achievement_get_rewards_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, const struct achievement_data *ad); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, const struct achievement_data *ad); for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_post; hIndex++) { postHookFunc = HPMHooks.list.HP_achievement_get_rewards_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, ad); + } + } + return retVal___; +} +void HP_achievement_get_rewards_buffs(struct map_session_data *sd, const struct achievement_data *ad) { + int hIndex = 0; + if (HPMHooks.count.HP_achievement_get_rewards_buffs_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_buffs_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_achievement_get_rewards_buffs_pre[hIndex].func; + preHookFunc(&sd, &ad); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.achievement.get_rewards_buffs(sd, ad); + } + if (HPMHooks.count.HP_achievement_get_rewards_buffs_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, const struct achievement_data *ad); + for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_buffs_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_achievement_get_rewards_buffs_post[hIndex].func; + postHookFunc(sd, ad); + } + } + return; +} +void HP_achievement_get_rewards_items(struct map_session_data *sd, const struct achievement_data *ad) { + int hIndex = 0; + if (HPMHooks.count.HP_achievement_get_rewards_items_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, const struct achievement_data **ad); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_items_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_achievement_get_rewards_items_pre[hIndex].func; + preHookFunc(&sd, &ad); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.achievement.get_rewards_items(sd, ad); + } + if (HPMHooks.count.HP_achievement_get_rewards_items_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, const struct achievement_data *ad); + for (hIndex = 0; hIndex < HPMHooks.count.HP_achievement_get_rewards_items_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_achievement_get_rewards_items_post[hIndex].func; postHookFunc(sd, ad); } } @@ -9239,6 +9292,32 @@ void HP_clif_takeitem(struct block_list *src, struct block_list *dst) { } return; } +void HP_clif_item_movefailed(struct map_session_data *sd, int n) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_item_movefailed_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *n); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_movefailed_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_item_movefailed_pre[hIndex].func; + preHookFunc(&sd, &n); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.item_movefailed(sd, n); + } + if (HPMHooks.count.HP_clif_item_movefailed_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int n); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_item_movefailed_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_item_movefailed_post[hIndex].func; + postHookFunc(sd, n); + } + } + return; +} void HP_clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *i, struct item_data *id, int eqp_pos) { int hIndex = 0; if (HPMHooks.count.HP_clif_item_equip_pre > 0) { @@ -11890,13 +11969,13 @@ void HP_clif_insert_card(struct map_session_data *sd, int idx_equip, int idx_car } return; } -void HP_clif_inventorylist(struct map_session_data *sd) { +void HP_clif_inventoryList(struct map_session_data *sd) { int hIndex = 0; - if (HPMHooks.count.HP_clif_inventorylist_pre > 0) { + if (HPMHooks.count.HP_clif_inventoryList_pre > 0) { void (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_inventorylist_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryList_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_inventoryList_pre[hIndex].func; preHookFunc(&sd); } if (*HPMforce_return) { @@ -11905,24 +11984,50 @@ void HP_clif_inventorylist(struct map_session_data *sd) { } } { - HPMHooks.source.clif.inventorylist(sd); + HPMHooks.source.clif.inventoryList(sd); } - if (HPMHooks.count.HP_clif_inventorylist_post > 0) { + if (HPMHooks.count.HP_clif_inventoryList_post > 0) { void (*postHookFunc) (struct map_session_data *sd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventorylist_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_inventorylist_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryList_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_inventoryList_post[hIndex].func; postHookFunc(sd); } } return; } -void HP_clif_equiplist(struct map_session_data *sd) { +void HP_clif_inventoryItems(struct map_session_data *sd, enum inventory_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_inventoryItems_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryItems_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_inventoryItems_pre[hIndex].func; + preHookFunc(&sd, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.inventoryItems(sd, type); + } + if (HPMHooks.count.HP_clif_inventoryItems_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryItems_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_inventoryItems_post[hIndex].func; + postHookFunc(sd, type); + } + } + return; +} +void HP_clif_equipList(struct map_session_data *sd) { int hIndex = 0; - if (HPMHooks.count.HP_clif_equiplist_pre > 0) { + if (HPMHooks.count.HP_clif_equipList_pre > 0) { void (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_equiplist_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipList_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_equipList_pre[hIndex].func; preHookFunc(&sd); } if (*HPMforce_return) { @@ -11931,24 +12036,50 @@ void HP_clif_equiplist(struct map_session_data *sd) { } } { - HPMHooks.source.clif.equiplist(sd); + HPMHooks.source.clif.equipList(sd); } - if (HPMHooks.count.HP_clif_equiplist_post > 0) { + if (HPMHooks.count.HP_clif_equipList_post > 0) { void (*postHookFunc) (struct map_session_data *sd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiplist_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_equiplist_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipList_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_equipList_post[hIndex].func; postHookFunc(sd); } } return; } -void HP_clif_cartlist(struct map_session_data *sd) { +void HP_clif_equipItems(struct map_session_data *sd, enum inventory_type type) { int hIndex = 0; - if (HPMHooks.count.HP_clif_cartlist_pre > 0) { + if (HPMHooks.count.HP_clif_equipItems_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipItems_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_equipItems_pre[hIndex].func; + preHookFunc(&sd, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.equipItems(sd, type); + } + if (HPMHooks.count.HP_clif_equipItems_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equipItems_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_equipItems_post[hIndex].func; + postHookFunc(sd, type); + } + } + return; +} +void HP_clif_cartList(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_cartList_pre > 0) { void (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_cartlist_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartList_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_cartList_pre[hIndex].func; preHookFunc(&sd); } if (*HPMforce_return) { @@ -11957,17 +12088,43 @@ void HP_clif_cartlist(struct map_session_data *sd) { } } { - HPMHooks.source.clif.cartlist(sd); + HPMHooks.source.clif.cartList(sd); } - if (HPMHooks.count.HP_clif_cartlist_post > 0) { + if (HPMHooks.count.HP_clif_cartList_post > 0) { void (*postHookFunc) (struct map_session_data *sd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartlist_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_cartlist_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartList_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_cartList_post[hIndex].func; postHookFunc(sd); } } return; } +void HP_clif_cartItems(struct map_session_data *sd, enum inventory_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_cartItems_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartItems_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_cartItems_pre[hIndex].func; + preHookFunc(&sd, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.cartItems(sd, type); + } + if (HPMHooks.count.HP_clif_cartItems_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cartItems_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_cartItems_post[hIndex].func; + postHookFunc(sd, type); + } + } + return; +} void HP_clif_favorite_item(struct map_session_data *sd, unsigned short index) { int hIndex = 0; if (HPMHooks.count.HP_clif_favorite_item_pre > 0) { @@ -14325,6 +14482,58 @@ void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, } return; } +void HP_clif_removeSpecialEffect(struct block_list *bl, int effectId, enum send_target target) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_removeSpecialEffect_pre > 0) { + void (*preHookFunc) (struct block_list **bl, int *effectId, enum send_target *target); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_removeSpecialEffect_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_removeSpecialEffect_pre[hIndex].func; + preHookFunc(&bl, &effectId, &target); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.removeSpecialEffect(bl, effectId, target); + } + if (HPMHooks.count.HP_clif_removeSpecialEffect_post > 0) { + void (*postHookFunc) (struct block_list *bl, int effectId, enum send_target target); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_removeSpecialEffect_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_removeSpecialEffect_post[hIndex].func; + postHookFunc(bl, effectId, target); + } + } + return; +} +void HP_clif_removeSpecialEffect_single(struct block_list *bl, int effectId, struct block_list *targetBl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_removeSpecialEffect_single_pre > 0) { + void (*preHookFunc) (struct block_list **bl, int *effectId, struct block_list **targetBl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_removeSpecialEffect_single_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_removeSpecialEffect_single_pre[hIndex].func; + preHookFunc(&bl, &effectId, &targetBl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.removeSpecialEffect_single(bl, effectId, targetBl); + } + if (HPMHooks.count.HP_clif_removeSpecialEffect_single_post > 0) { + void (*postHookFunc) (struct block_list *bl, int effectId, struct block_list *targetBl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_removeSpecialEffect_single_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_removeSpecialEffect_single_post[hIndex].func; + postHookFunc(bl, effectId, targetBl); + } + } + return; +} void HP_clif_millenniumshield(struct block_list *bl, short shields) { int hIndex = 0; if (HPMHooks.count.HP_clif_millenniumshield_pre > 0) { @@ -15131,6 +15340,32 @@ void HP_clif_msgtable_str(struct map_session_data *sd, enum clif_messages p1, co } return; } +void HP_clif_msgtable_str_color(struct map_session_data *sd, enum clif_messages p1, const char *value, uint32 color) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_msgtable_str_color_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum clif_messages *p1, const char **value, uint32 *color); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_str_color_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_msgtable_str_color_pre[hIndex].func; + preHookFunc(&sd, &p1, &value, &color); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.msgtable_str_color(sd, p1, value, color); + } + if (HPMHooks.count.HP_clif_msgtable_str_color_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum clif_messages p1, const char *value, uint32 color); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_msgtable_str_color_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_msgtable_str_color_post[hIndex].func; + postHookFunc(sd, p1, value, color); + } + } + return; +} void HP_clif_msgtable_color(struct map_session_data *sd, enum clif_messages p1, uint32 color) { int hIndex = 0; if (HPMHooks.count.HP_clif_msgtable_color_pre > 0) { @@ -15783,13 +16018,39 @@ void HP_clif_vendingreport(struct map_session_data *sd, int index, int amount, u } return; } -void HP_clif_storagelist(struct map_session_data *sd, struct item *items, int items_length) { +void HP_clif_storageList(struct map_session_data *sd, struct item *items, int items_length) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_storageList_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, struct item **items, int *items_length); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageList_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_storageList_pre[hIndex].func; + preHookFunc(&sd, &items, &items_length); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.storageList(sd, items, items_length); + } + if (HPMHooks.count.HP_clif_storageList_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, struct item *items, int items_length); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageList_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_storageList_post[hIndex].func; + postHookFunc(sd, items, items_length); + } + } + return; +} +void HP_clif_guildStorageList(struct map_session_data *sd, struct item *items, int items_length) { int hIndex = 0; - if (HPMHooks.count.HP_clif_storagelist_pre > 0) { + if (HPMHooks.count.HP_clif_guildStorageList_pre > 0) { void (*preHookFunc) (struct map_session_data **sd, struct item **items, int *items_length); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storagelist_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_storagelist_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guildStorageList_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guildStorageList_pre[hIndex].func; preHookFunc(&sd, &items, &items_length); } if (*HPMforce_return) { @@ -15798,17 +16059,95 @@ void HP_clif_storagelist(struct map_session_data *sd, struct item *items, int it } } { - HPMHooks.source.clif.storagelist(sd, items, items_length); + HPMHooks.source.clif.guildStorageList(sd, items, items_length); } - if (HPMHooks.count.HP_clif_storagelist_post > 0) { + if (HPMHooks.count.HP_clif_guildStorageList_post > 0) { void (*postHookFunc) (struct map_session_data *sd, struct item *items, int items_length); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storagelist_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_storagelist_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guildStorageList_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guildStorageList_post[hIndex].func; postHookFunc(sd, items, items_length); } } return; } +void HP_clif_storageItems(struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_storageItems_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type, struct item **items, int *items_length); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageItems_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_storageItems_pre[hIndex].func; + preHookFunc(&sd, &type, &items, &items_length); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.storageItems(sd, type, items, items_length); + } + if (HPMHooks.count.HP_clif_storageItems_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type, struct item *items, int items_length); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_storageItems_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_storageItems_post[hIndex].func; + postHookFunc(sd, type, items, items_length); + } + } + return; +} +void HP_clif_inventoryStart(struct map_session_data *sd, enum inventory_type type, const char *name) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_inventoryStart_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type, const char **name); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryStart_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_inventoryStart_pre[hIndex].func; + preHookFunc(&sd, &type, &name); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.inventoryStart(sd, type, name); + } + if (HPMHooks.count.HP_clif_inventoryStart_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type, const char *name); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryStart_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_inventoryStart_post[hIndex].func; + postHookFunc(sd, type, name); + } + } + return; +} +void HP_clif_inventoryEnd(struct map_session_data *sd, enum inventory_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_inventoryEnd_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, enum inventory_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryEnd_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_inventoryEnd_pre[hIndex].func; + preHookFunc(&sd, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.inventoryEnd(sd, type); + } + if (HPMHooks.count.HP_clif_inventoryEnd_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, enum inventory_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_inventoryEnd_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_inventoryEnd_post[hIndex].func; + postHookFunc(sd, type); + } + } + return; +} void HP_clif_updatestorageamount(struct map_session_data *sd, int amount, int max_amount) { int hIndex = 0; if (HPMHooks.count.HP_clif_updatestorageamount_pre > 0) { @@ -16745,14 +17084,14 @@ void HP_clif_guild_inviteack(struct map_session_data *sd, int flag) { } return; } -void HP_clif_guild_leave(struct map_session_data *sd, const char *name, const char *mes) { +void HP_clif_guild_leave(struct map_session_data *sd, const char *name, int char_id, const char *mes) { int hIndex = 0; if (HPMHooks.count.HP_clif_guild_leave_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, const char **name, const char **mes); + void (*preHookFunc) (struct map_session_data **sd, const char **name, int *char_id, const char **mes); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_guild_leave_pre[hIndex].func; - preHookFunc(&sd, &name, &mes); + preHookFunc(&sd, &name, &char_id, &mes); } if (*HPMforce_return) { *HPMforce_return = false; @@ -16760,25 +17099,25 @@ void HP_clif_guild_leave(struct map_session_data *sd, const char *name, const ch } } { - HPMHooks.source.clif.guild_leave(sd, name, mes); + HPMHooks.source.clif.guild_leave(sd, name, char_id, mes); } if (HPMHooks.count.HP_clif_guild_leave_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, const char *name, const char *mes); + void (*postHookFunc) (struct map_session_data *sd, const char *name, int char_id, const char *mes); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_leave_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_guild_leave_post[hIndex].func; - postHookFunc(sd, name, mes); + postHookFunc(sd, name, char_id, mes); } } return; } -void HP_clif_guild_expulsion(struct map_session_data *sd, const char *name, const char *mes, int account_id) { +void HP_clif_guild_expulsion(struct map_session_data *sd, const char *name, int char_id, const char *mes, int account_id) { int hIndex = 0; if (HPMHooks.count.HP_clif_guild_expulsion_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, const char **name, const char **mes, int *account_id); + void (*preHookFunc) (struct map_session_data **sd, const char **name, int *char_id, const char **mes, int *account_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_guild_expulsion_pre[hIndex].func; - preHookFunc(&sd, &name, &mes, &account_id); + preHookFunc(&sd, &name, &char_id, &mes, &account_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -16786,13 +17125,13 @@ void HP_clif_guild_expulsion(struct map_session_data *sd, const char *name, cons } } { - HPMHooks.source.clif.guild_expulsion(sd, name, mes, account_id); + HPMHooks.source.clif.guild_expulsion(sd, name, char_id, mes, account_id); } if (HPMHooks.count.HP_clif_guild_expulsion_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, const char *name, const char *mes, int account_id); + void (*postHookFunc) (struct map_session_data *sd, const char *name, int char_id, const char *mes, int account_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_expulsion_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_guild_expulsion_post[hIndex].func; - postHookFunc(sd, name, mes, account_id); + postHookFunc(sd, name, char_id, mes, account_id); } } return; @@ -17239,6 +17578,58 @@ void HP_clif_guild_expulsionlist(struct map_session_data *sd) { } return; } +void HP_clif_guild_set_position(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_guild_set_position_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_set_position_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guild_set_position_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.guild_set_position(sd); + } + if (HPMHooks.count.HP_clif_guild_set_position_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_set_position_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guild_set_position_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_guild_position_selected(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_guild_position_selected_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_position_selected_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_guild_position_selected_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.guild_position_selected(sd); + } + if (HPMHooks.count.HP_clif_guild_position_selected_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_guild_position_selected_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_guild_position_selected_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} bool HP_clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) { int hIndex = 0; bool retVal___ = false; @@ -28340,6 +28731,32 @@ void HP_clif_pReqStyleChange(int fd, struct map_session_data *sd) { } return; } +void HP_clif_pReqStyleChange2(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pReqStyleChange2_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqStyleChange2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pReqStyleChange2_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pReqStyleChange2(fd, sd); + } + if (HPMHooks.count.HP_clif_pReqStyleChange2_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pReqStyleChange2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pReqStyleChange2_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} void HP_clif_cz_req_style_change_sub(struct map_session_data *sd, int type, int16 idx, bool isitem) { int hIndex = 0; if (HPMHooks.count.HP_clif_cz_req_style_change_sub_pre > 0) { @@ -28470,6 +28887,84 @@ void HP_clif_party_dead_notification(struct map_session_data *sd) { } return; } +void HP_clif_pMemorialDungeonCommand(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pMemorialDungeonCommand_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMemorialDungeonCommand_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pMemorialDungeonCommand_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pMemorialDungeonCommand(fd, sd); + } + if (HPMHooks.count.HP_clif_pMemorialDungeonCommand_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pMemorialDungeonCommand_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pMemorialDungeonCommand_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_camera_showWindow(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_camera_showWindow_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_camera_showWindow_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_camera_showWindow_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.camera_showWindow(sd); + } + if (HPMHooks.count.HP_clif_camera_showWindow_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_camera_showWindow_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_camera_showWindow_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_camera_change(struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_camera_change_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, float *range, float *rotation, float *latitude, enum send_target *target); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_camera_change_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_camera_change_pre[hIndex].func; + preHookFunc(&sd, &range, &rotation, &latitude, &target); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.camera_change(sd, range, rotation, latitude, target); + } + if (HPMHooks.count.HP_clif_camera_change_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_camera_change_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_camera_change_post[hIndex].func; + postHookFunc(sd, range, rotation, latitude, target); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -35164,6 +35659,32 @@ int HP_instance_destroy_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } +void HP_instance_force_destroy(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_instance_force_destroy_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_force_destroy_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_instance_force_destroy_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.instance.force_destroy(sd); + } + if (HPMHooks.count.HP_instance_force_destroy_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_instance_force_destroy_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_instance_force_destroy_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} /* intif_interface */ int HP_intif_parse(int fd) { int hIndex = 0; @@ -35434,10 +35955,10 @@ void HP_intif_request_account_storage(const struct map_session_data *sd) { } return; } -void HP_intif_send_account_storage(const struct map_session_data *sd) { +void HP_intif_send_account_storage(struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_intif_send_account_storage_pre > 0) { - void (*preHookFunc) (const struct map_session_data **sd); + void (*preHookFunc) (struct map_session_data **sd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_account_storage_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_intif_send_account_storage_pre[hIndex].func; @@ -35452,7 +35973,7 @@ void HP_intif_send_account_storage(const struct map_session_data *sd) { HPMHooks.source.intif.send_account_storage(sd); } if (HPMHooks.count.HP_intif_send_account_storage_post > 0) { - void (*postHookFunc) (const struct map_session_data *sd); + void (*postHookFunc) (struct map_session_data *sd); for (hIndex = 0; hIndex < HPMHooks.count.HP_intif_send_account_storage_post; hIndex++) { postHookFunc = HPMHooks.list.HP_intif_send_account_storage_post[hIndex].func; postHookFunc(sd); @@ -44155,6 +44676,32 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) { } return; } +void HP_map_zone_reload(void) { + int hIndex = 0; + if (HPMHooks.count.HP_map_zone_reload_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_reload_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_map_zone_reload_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.map.zone_reload(); + } + if (HPMHooks.count.HP_map_zone_reload_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_reload_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_map_zone_reload_post[hIndex].func; + postHookFunc(); + } + } + return; +} int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) { int hIndex = 0; int retVal___ = 0; @@ -58690,11 +59237,11 @@ int HP_pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_type ty } return retVal___; } -int HP_pc_additem(struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type) { +int HP_pc_additem(struct map_session_data *sd, const struct item *item_data, int amount, e_log_pick_type log_type) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_pc_additem_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, struct item **item_data, int *amount, e_log_pick_type *log_type); + int (*preHookFunc) (struct map_session_data **sd, const struct item **item_data, int *amount, e_log_pick_type *log_type); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_additem_pre[hIndex].func; @@ -58709,7 +59256,7 @@ int HP_pc_additem(struct map_session_data *sd, struct item *item_data, int amoun retVal___ = HPMHooks.source.pc.additem(sd, item_data, amount, log_type); } if (HPMHooks.count.HP_pc_additem_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item *item_data, int amount, e_log_pick_type log_type); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, const struct item *item_data, int amount, e_log_pick_type log_type); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_additem_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_additem_post[hIndex].func; retVal___ = postHookFunc(retVal___, sd, item_data, amount, log_type); @@ -68365,6 +68912,33 @@ int HP_script_add_str(const char *p) { } return retVal___; } +int HP_script_add_variable(const char *varname) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_script_add_variable_pre > 0) { + int (*preHookFunc) (const char **varname); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_script_add_variable_pre[hIndex].func; + retVal___ = preHookFunc(&varname); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.script.add_variable(varname); + } + if (HPMHooks.count.HP_script_add_variable_post > 0) { + int (*postHookFunc) (int retVal___, const char *varname); + for (hIndex = 0; hIndex < HPMHooks.count.HP_script_add_variable_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_script_add_variable_post[hIndex].func; + retVal___ = postHookFunc(retVal___, varname); + } + } + return retVal___; +} const char* HP_script_get_str(int id) { int hIndex = 0; const char* retVal___ = NULL; diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 57e68432e..2ece501b2 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2018 Hercules Dev Team * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,6 +70,10 @@ bool mobdb2sql_torun = false; int (*itemdb_readdb_libconfig_sub) (struct config_setting_t *it, int n, const char *source); /// Backup of the original mob_db parser function pointer. int (*mob_read_db_sub) (struct config_setting_t *it, int n, const char *source); +bool (*mob_skill_db_libconfig_sub_skill) (struct config_setting_t *it, int n, int mob_id); + +// +void do_mobskilldb2sql(void); /** * Normalizes and appends a string to the output buffer. @@ -811,6 +815,330 @@ void do_mobdb2sql(void) if (tosql.buf[i].p) aFree(tosql.buf[i].p); } + + // Run mob_skill_db converter + do_mobskilldb2sql(); +} + +/** + * Converts Mob Skill State constant to string + */ +const char* mob_skill_state_tostring(enum MobSkillState mss) +{ + switch(mss) { + case MSS_ANY: + return "any"; + case MSS_IDLE: + return "idle"; + case MSS_WALK: + return "walk"; + case MSS_LOOT: + return "loot"; + case MSS_DEAD: + return "dead"; + case MSS_BERSERK: + return "attack"; + case MSS_ANGRY: + return "angry"; + case MSS_RUSH: + return "chase"; + case MSS_FOLLOW: + return "follow"; + case MSS_ANYTARGET: + return "anytarget"; + } + + return "unknown"; +} + +/** + * Converts Mob Skill Target constant to string + */ +const char* mob_skill_target_tostring(int target) +{ + switch(target) { + case MST_TARGET: + return "target"; + case MST_RANDOM: + return "randomtarget"; + case MST_SELF: + return "self"; + case MST_FRIEND: + return "friend"; + case MST_MASTER: + return "master"; + case MST_AROUND1: + return "around1"; + case MST_AROUND2: + return "around2"; + case MST_AROUND3: + return "around3"; + //case MST_AROUND: // same value as MST_AROUND4 + case MST_AROUND4: + return "around4"; + case MST_AROUND5: + return "around5"; + case MST_AROUND6: + return "around6"; + case MST_AROUND7: + return "around7"; + case MST_AROUND8: + return "around8"; + } + return "unknown"; +} + +/** + * Converts Mob Skill Condition constant to string + */ +const char* mob_skill_condition_tostring(int condition) +{ + switch(condition) { + case MSC_ALWAYS: + return "always"; + case MSC_MYHPLTMAXRATE: + return "myhpltmaxrate"; + case MSC_MYHPINRATE: + return "myhpinrate"; + case MSC_FRIENDHPLTMAXRATE: + return "friendhpltmaxrate"; + case MSC_FRIENDHPINRATE: + return "friendhpinrate"; + case MSC_MYSTATUSON: + return "mystatuson"; + case MSC_MYSTATUSOFF: + return "mystatusoff"; + case MSC_FRIENDSTATUSON: + return "friendstatuson"; + case MSC_FRIENDSTATUSOFF: + return "friendstatusoff"; + case MSC_ATTACKPCGT: + return "attackpcgt"; + case MSC_ATTACKPCGE: + return "attackpcge"; + case MSC_SLAVELT: + return "slavelt"; + case MSC_SLAVELE: + return "slavele"; + case MSC_CLOSEDATTACKED: + return "closedattacked"; + case MSC_LONGRANGEATTACKED: + return "longrangeattacked"; + case MSC_AFTERSKILL: + return "afterskill"; + case MSC_SKILLUSED: + return "skillused"; + case MSC_CASTTARGETED: + return "casttargeted"; + case MSC_RUDEATTACKED: + return "rudeattacked"; + case MSC_MASTERHPLTMAXRATE: + return "masterhpltmaxrate"; + case MSC_MASTERATTACKED: + return "masterattacked"; + case MSC_ALCHEMIST: + return "alchemist"; + case MSC_SPAWN: + return "onspawn"; + } + return "unknown"; +} + +/** + * Converts a Mob Skill DB entry to SQL. + * + * @see mob_skill_db_libconfig_sub_skill. + */ +bool mobskilldb2sql_sub(struct config_setting_t *it, int n, int mob_id) +{ + int i32 = 0, i; + StringBuf buf; + struct mob_db *md = mob->db(mob_id); + char valname[15]; + const char *name = config_setting_name(it); + + nullpo_retr(false, it); + Assert_retr(false, mob_id <= 0 || md != mob->dummy); + + StrBuf->Init(&buf); + + // MonsterID + StrBuf->Printf(&buf, "%d,", mob_id); + + // Info + StrBuf->Printf(&buf, "'%s@%s',", md->name, name); + + if (mob->lookup_const(it, "SkillState", &i32) && (i32 < MSS_ANY || i32 > MSS_ANYTARGET)) { + ShowWarning("mob_skill_db_libconfig_sub_skill: Invalid skill state %d for skill '%s' in monster %d, defaulting to MSS_ANY.\n", i32, name, mob_id); + i32 = MSS_ANY; + } + // State + StrBuf->Printf(&buf, "'%s',", mob_skill_state_tostring(i32)); + + // SkillID + if (!(i32 = skill->name2id(name))) { + ShowWarning("mob_skill_db_libconfig_sub_skill: Non existant skill id %d in monster %d, skipping.\n", i32, mob_id); + return false; + } + StrBuf->Printf(&buf, "%d,", i32); + + // SkillLv + if (!libconfig->setting_lookup_int(it, "SkillLevel", &i32) || i32 <= 0) + i32 = 1; + StrBuf->Printf(&buf, "%d,", i32); + + // Rate + i32 = 0; + libconfig->setting_lookup_int(it, "Rate", &i32); + StrBuf->Printf(&buf, "%d,", i32); + + // CastTime + i32 = 0; + libconfig->setting_lookup_int(it, "CastTime", &i32); + StrBuf->Printf(&buf, "%d,", i32); + + // Delay + i32 = 0; + libconfig->setting_lookup_int(it, "Delay", &i32); + StrBuf->Printf(&buf, "%d,", i32); + + // Cancelable + if (libconfig->setting_lookup_bool(it, "Cancelable", &i32)) { + StrBuf->Printf(&buf, "'%s',", ((i32 == 0) ? "no" : "yes")); + } else { + StrBuf->Printf(&buf, "'no',"); + } + + // Target + if (mob->lookup_const(it, "SkillTarget", &i32) && (i32 < MST_TARGET || i32 > MST_AROUND)) { + i32 = MST_TARGET; + } + StrBuf->Printf(&buf, "'%s',", mob_skill_target_tostring(i32)); + + // Condition + if (mob->lookup_const(it, "CastCondition", &i32) && (i32 < MSC_ALWAYS || i32 > MSC_SPAWN)) { + i32 = MSC_ALWAYS; + } + StrBuf->Printf(&buf, "'%s',", mob_skill_condition_tostring(i32)); + + // ConditionValue + i32 = 0; + if (mob->lookup_const(it, "ConditionData", &i32)) { + StrBuf->Printf(&buf, "'%d',", i32); + } else { + StrBuf->Printf(&buf, "NULL,"); + } + + // Val1-Val5 + for (i = 0; i < 5; i++) { + sprintf(valname, "val%1d", i); + if (libconfig->setting_lookup_int(it, valname, &i32)) { + StrBuf->Printf(&buf, "%d,", i32); + } else { + StrBuf->Printf(&buf, "NULL,"); + } + } + + // Emotion + if (libconfig->setting_lookup_int(it, "Emotion", &i32)) { + StrBuf->Printf(&buf, "'%d',", i32); + } else { + StrBuf->Printf(&buf, "NULL,"); + } + + if (libconfig->setting_lookup_int(it, "ChatMsgID", &i32) && i32 > 0 && i32 <= MAX_MOB_CHAT) { + StrBuf->Printf(&buf, "'%d'", i32); + } else { + StrBuf->Printf(&buf, "NULL"); + } + + fprintf(tosql.fp, "REPLACE INTO `%s` VALUES (%s);\n", tosql.db_name, StrBuf->Value(&buf)); + + StrBuf->Destroy(&buf); + + return true; + +} + + +/** + * Prints a SQL table header for the current mob_skill_db table. + */ +void mobskilldb2sql_tableheader(void) +{ + db2sql_fileheader(); + + fprintf(tosql.fp, + "--\n" + "-- Table structure for table `%s`\n" + "--\n" + "\n" + "DROP TABLE IF EXISTS `%s`;\n" + "CREATE TABLE `%s` (\n" + " `MOB_ID` SMALLINT(6) NOT NULL,\n" + " `INFO` TEXT NOT NULL,\n" + " `STATE` TEXT NOT NULL,\n" + " `SKILL_ID` SMALLINT(6) NOT NULL,\n" + " `SKILL_LV` TINYINT(4) NOT NULL,\n" + " `RATE` SMALLINT(4) NOT NULL,\n" + " `CASTTIME` MEDIUMINT(9) NOT NULL,\n" + " `DELAY` INT(9) NOT NULL,\n" + " `CANCELABLE` TEXT NOT NULL,\n" + " `TARGET` TEXT NOT NULL,\n" + " `CONDITION` TEXT NOT NULL,\n" + " `CONDITION_VALUE` TEXT,\n" + " `VAL1` INT(11) DEFAULT NULL,\n" + " `VAL2` INT(11) DEFAULT NULL,\n" + " `VAL3` INT(11) DEFAULT NULL,\n" + " `VAL4` INT(11) DEFAULT NULL,\n" + " `VAL5` INT(11) DEFAULT NULL,\n" + " `EMOTION` TEXT,\n" + " `CHAT` TEXT\n" + ") ENGINE=MyISAM;\n" + "\n", tosql.db_name, tosql.db_name, tosql.db_name); +} + +/** + * Mob Skill DB Conversion + */ +void do_mobskilldb2sql(void) +{ + int i; + struct convert_db_files { + const char *name; + const char *source; + const char *destination; + } files[] = { + {"mob_skill_db", DBPATH"mob_skill_db.conf", "sql-files/mob_skill_db" DBSUFFIX ".sql"}, + {"mob_skill_db2", "mob_skill_db2.conf", "sql-files/mob_skill_db2.sql"}, + }; + + /* link */ + mob_skill_db_libconfig_sub_skill = mob->skill_db_libconfig_sub_skill; + mob->skill_db_libconfig_sub_skill = mobskilldb2sql_sub; + + memset(&tosql.buf, 0, sizeof(tosql.buf)); + for (i = 0; i < ARRAYLENGTH(files); i++) { + if ((tosql.fp = fopen(files[i].destination, "wt+")) == NULL) { + ShowError("do_mobskilldb2sql: File not found \"%s\".\n", files[i].destination); + return; + } + + tosql.db_name = files[i].name; + mobskilldb2sql_tableheader(); + + mob->skill_db_libconfig(files[i].source, false); + + fclose(tosql.fp); + } + + /* unlink */ + mob->skill_db_libconfig_sub_skill = mob_skill_db_libconfig_sub_skill; + + for (i = 0; i < ARRAYLENGTH(tosql.buf); i++) { + if (tosql.buf[i].p) + aFree(tosql.buf[i].p); + } } /** |