summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc18
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.Hooks.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_char.sources.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.Hooks.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_login.sources.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc26
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc135
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.sources.inc2
-rw-r--r--src/plugins/mapcache.c23
14 files changed, 191 insertions, 37 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 89c9024cc..b2c3e80ac 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
@@ -2510,8 +2510,12 @@ typedef void (*HPMHOOK_pre_clif_pBGQueueRevokeReq) (int *fd, struct map_session_
typedef void (*HPMHOOK_post_clif_pBGQueueRevokeReq) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_pBGQueueBattleBeginAck) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd);
-typedef void (*HPMHOOK_pre_clif_pCashShopOpen) (int *fd, struct map_session_data **sd);
-typedef void (*HPMHOOK_post_clif_pCashShopOpen) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopOpen1) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopOpen1) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopOpen2) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopOpen2) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pCashShopLimitedReq) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pCashShopLimitedReq) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_pCashShopClose) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pCashShopClose) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_pCashShopReqTab) (int *fd, struct map_session_data **sd);
@@ -2526,6 +2530,8 @@ typedef void (*HPMHOOK_pre_clif_pGuildInvite2) (int *fd, struct map_session_data
typedef void (*HPMHOOK_post_clif_pGuildInvite2) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_cashShopBuyAck) (int *fd, struct map_session_data **sd, int *itemId, enum CASH_SHOP_BUY_RESULT *result);
typedef void (*HPMHOOK_post_clif_cashShopBuyAck) (int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result);
+typedef void (*HPMHOOK_pre_clif_cashShopOpen) (int *fd, struct map_session_data **sd, int *tab);
+typedef void (*HPMHOOK_post_clif_cashShopOpen) (int fd, struct map_session_data *sd, int tab);
typedef void (*HPMHOOK_pre_clif_pPartyBookingAddFilter) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pPartyBookingAddFilter) (int fd, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_pPartyBookingSubFilter) (int *fd, struct map_session_data **sd);
@@ -6418,8 +6424,8 @@ typedef void (*HPMHOOK_pre_pc_update_idle_time) (struct map_session_data **sd, e
typedef void (*HPMHOOK_post_pc_update_idle_time) (struct map_session_data *sd, enum e_battle_config_idletime type);
typedef int (*HPMHOOK_pre_pc_have_magnifier) (struct map_session_data **sd);
typedef int (*HPMHOOK_post_pc_have_magnifier) (int retVal___, struct map_session_data *sd);
-typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, unsigned short *chain_id);
-typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, unsigned short chain_id);
+typedef int (*HPMHOOK_pre_pc_have_item_chain) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id);
+typedef int (*HPMHOOK_post_pc_have_item_chain) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_id);
typedef bool (*HPMHOOK_pre_pc_process_chat_message) (struct map_session_data **sd, const char **message);
typedef bool (*HPMHOOK_post_pc_process_chat_message) (bool retVal___, struct map_session_data *sd, const char *message);
typedef int (*HPMHOOK_pre_pc_wis_message_to_gm) (const char **sender_name, int *permission, const char **message);
@@ -6436,6 +6442,8 @@ typedef bool (*HPMHOOK_pre_pc_has_second_costume) (struct map_session_data **sd)
typedef bool (*HPMHOOK_post_pc_has_second_costume) (bool retVal___, struct map_session_data *sd);
typedef bool (*HPMHOOK_pre_pc_expandInventory) (struct map_session_data **sd, int *adjustSize);
typedef bool (*HPMHOOK_post_pc_expandInventory) (bool retVal___, struct map_session_data *sd, int adjustSize);
+typedef bool (*HPMHOOK_pre_pc_auto_exp_insurance) (struct map_session_data **sd);
+typedef bool (*HPMHOOK_post_pc_auto_exp_insurance) (bool retVal___, struct map_session_data *sd);
#endif // MAP_PC_H
#ifdef MAP_NPC_H /* libpcre */
typedef pcre* (*HPMHOOK_pre_libpcre_compile) (const char **pattern, int *options, const char ***errptr, int **erroffset, const unsigned char **tableptr);
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
index cdba77e09..570e20968 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
index a6043756d..48f24fcab 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
index b25025b1d..49fe48aac 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_char.sources.inc b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
index 973f8aff3..9e723d83b 100644
--- a/src/plugins/HPMHooking/HPMHooking_char.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_char.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
index 556757d76..c81d42da8 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
index 65680e072..790c8a3a5 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
index 8f6076e2a..7eab86a08 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_login.sources.inc b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
index 510cb8bc4..576796779 100644
--- a/src/plugins/HPMHooking/HPMHooking_login.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_login.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 9c4fe9b6f..16de79ecb 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
@@ -2100,8 +2100,12 @@ struct {
struct HPMHookPoint *HP_clif_pBGQueueRevokeReq_post;
struct HPMHookPoint *HP_clif_pBGQueueBattleBeginAck_pre;
struct HPMHookPoint *HP_clif_pBGQueueBattleBeginAck_post;
- struct HPMHookPoint *HP_clif_pCashShopOpen_pre;
- struct HPMHookPoint *HP_clif_pCashShopOpen_post;
+ struct HPMHookPoint *HP_clif_pCashShopOpen1_pre;
+ struct HPMHookPoint *HP_clif_pCashShopOpen1_post;
+ struct HPMHookPoint *HP_clif_pCashShopOpen2_pre;
+ struct HPMHookPoint *HP_clif_pCashShopOpen2_post;
+ struct HPMHookPoint *HP_clif_pCashShopLimitedReq_pre;
+ struct HPMHookPoint *HP_clif_pCashShopLimitedReq_post;
struct HPMHookPoint *HP_clif_pCashShopClose_pre;
struct HPMHookPoint *HP_clif_pCashShopClose_post;
struct HPMHookPoint *HP_clif_pCashShopReqTab_pre;
@@ -2116,6 +2120,8 @@ struct {
struct HPMHookPoint *HP_clif_pGuildInvite2_post;
struct HPMHookPoint *HP_clif_cashShopBuyAck_pre;
struct HPMHookPoint *HP_clif_cashShopBuyAck_post;
+ struct HPMHookPoint *HP_clif_cashShopOpen_pre;
+ struct HPMHookPoint *HP_clif_cashShopOpen_post;
struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_pre;
struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_post;
struct HPMHookPoint *HP_clif_pPartyBookingSubFilter_pre;
@@ -5020,6 +5026,8 @@ struct {
struct HPMHookPoint *HP_pc_has_second_costume_post;
struct HPMHookPoint *HP_pc_expandInventory_pre;
struct HPMHookPoint *HP_pc_expandInventory_post;
+ struct HPMHookPoint *HP_pc_auto_exp_insurance_pre;
+ struct HPMHookPoint *HP_pc_auto_exp_insurance_post;
struct HPMHookPoint *HP_libpcre_compile_pre;
struct HPMHookPoint *HP_libpcre_compile_post;
struct HPMHookPoint *HP_libpcre_study_pre;
@@ -8937,8 +8945,12 @@ struct {
int HP_clif_pBGQueueRevokeReq_post;
int HP_clif_pBGQueueBattleBeginAck_pre;
int HP_clif_pBGQueueBattleBeginAck_post;
- int HP_clif_pCashShopOpen_pre;
- int HP_clif_pCashShopOpen_post;
+ int HP_clif_pCashShopOpen1_pre;
+ int HP_clif_pCashShopOpen1_post;
+ int HP_clif_pCashShopOpen2_pre;
+ int HP_clif_pCashShopOpen2_post;
+ int HP_clif_pCashShopLimitedReq_pre;
+ int HP_clif_pCashShopLimitedReq_post;
int HP_clif_pCashShopClose_pre;
int HP_clif_pCashShopClose_post;
int HP_clif_pCashShopReqTab_pre;
@@ -8953,6 +8965,8 @@ struct {
int HP_clif_pGuildInvite2_post;
int HP_clif_cashShopBuyAck_pre;
int HP_clif_cashShopBuyAck_post;
+ int HP_clif_cashShopOpen_pre;
+ int HP_clif_cashShopOpen_post;
int HP_clif_pPartyBookingAddFilter_pre;
int HP_clif_pPartyBookingAddFilter_post;
int HP_clif_pPartyBookingSubFilter_pre;
@@ -11857,6 +11871,8 @@ struct {
int HP_pc_has_second_costume_post;
int HP_pc_expandInventory_pre;
int HP_pc_expandInventory_post;
+ int HP_pc_auto_exp_insurance_pre;
+ int HP_pc_auto_exp_insurance_post;
int HP_libpcre_compile_pre;
int HP_libpcre_compile_post;
int HP_libpcre_study_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 99e3fd5a1..7b81bac49 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
@@ -1074,7 +1074,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->pBGQueueCheckState, HP_clif_pBGQueueCheckState) },
{ HP_POP(clif->pBGQueueRevokeReq, HP_clif_pBGQueueRevokeReq) },
{ HP_POP(clif->pBGQueueBattleBeginAck, HP_clif_pBGQueueBattleBeginAck) },
- { HP_POP(clif->pCashShopOpen, HP_clif_pCashShopOpen) },
+ { HP_POP(clif->pCashShopOpen1, HP_clif_pCashShopOpen1) },
+ { HP_POP(clif->pCashShopOpen2, HP_clif_pCashShopOpen2) },
+ { HP_POP(clif->pCashShopLimitedReq, HP_clif_pCashShopLimitedReq) },
{ HP_POP(clif->pCashShopClose, HP_clif_pCashShopClose) },
{ HP_POP(clif->pCashShopReqTab, HP_clif_pCashShopReqTab) },
{ HP_POP(clif->pCashShopSchedule, HP_clif_pCashShopSchedule) },
@@ -1082,6 +1084,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->pPartyTick, HP_clif_pPartyTick) },
{ HP_POP(clif->pGuildInvite2, HP_clif_pGuildInvite2) },
{ HP_POP(clif->cashShopBuyAck, HP_clif_cashShopBuyAck) },
+ { HP_POP(clif->cashShopOpen, HP_clif_cashShopOpen) },
{ HP_POP(clif->pPartyBookingAddFilter, HP_clif_pPartyBookingAddFilter) },
{ HP_POP(clif->pPartyBookingSubFilter, HP_clif_pPartyBookingSubFilter) },
{ HP_POP(clif->pPartyBookingReqVolunteer, HP_clif_pPartyBookingReqVolunteer) },
@@ -2568,6 +2571,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->isDeathPenaltyJob, HP_pc_isDeathPenaltyJob) },
{ HP_POP(pc->has_second_costume, HP_pc_has_second_costume) },
{ HP_POP(pc->expandInventory, HP_pc_expandInventory) },
+ { HP_POP(pc->auto_exp_insurance, HP_pc_auto_exp_insurance) },
/* pcre_interface */
{ HP_POP(libpcre->compile, HP_libpcre_compile) },
{ HP_POP(libpcre->study, HP_libpcre_study) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 147458d09..7873e544a 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
@@ -27370,13 +27370,13 @@ void HP_clif_pBGQueueBattleBeginAck(int fd, struct map_session_data *sd) {
}
return;
}
-void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) {
+void HP_clif_pCashShopOpen1(int fd, struct map_session_data *sd) {
int hIndex = 0;
- if (HPMHooks.count.HP_clif_pCashShopOpen_pre > 0) {
+ if (HPMHooks.count.HP_clif_pCashShopOpen1_pre > 0) {
void (*preHookFunc) (int *fd, struct map_session_data **sd);
*HPMforce_return = false;
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_pre; hIndex++) {
- preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_pre[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen1_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen1_pre[hIndex].func;
preHookFunc(&fd, &sd);
}
if (*HPMforce_return) {
@@ -27385,12 +27385,64 @@ void HP_clif_pCashShopOpen(int fd, struct map_session_data *sd) {
}
}
{
- HPMHooks.source.clif.pCashShopOpen(fd, sd);
+ HPMHooks.source.clif.pCashShopOpen1(fd, sd);
}
- if (HPMHooks.count.HP_clif_pCashShopOpen_post > 0) {
+ if (HPMHooks.count.HP_clif_pCashShopOpen1_post > 0) {
void (*postHookFunc) (int fd, struct map_session_data *sd);
- for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen_post; hIndex++) {
- postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen_post[hIndex].func;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen1_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen1_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
+void HP_clif_pCashShopOpen2(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_pCashShopOpen2_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen2_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pCashShopOpen2_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pCashShopOpen2(fd, sd);
+ }
+ if (HPMHooks.count.HP_clif_pCashShopOpen2_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopOpen2_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pCashShopOpen2_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
+void HP_clif_pCashShopLimitedReq(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_pCashShopLimitedReq_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopLimitedReq_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pCashShopLimitedReq_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pCashShopLimitedReq(fd, sd);
+ }
+ if (HPMHooks.count.HP_clif_pCashShopLimitedReq_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pCashShopLimitedReq_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pCashShopLimitedReq_post[hIndex].func;
postHookFunc(fd, sd);
}
}
@@ -27578,6 +27630,32 @@ void HP_clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, enu
}
return;
}
+void HP_clif_cashShopOpen(int fd, struct map_session_data *sd, int tab) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_cashShopOpen_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd, int *tab);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopOpen_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_cashShopOpen_pre[hIndex].func;
+ preHookFunc(&fd, &sd, &tab);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.cashShopOpen(fd, sd, tab);
+ }
+ if (HPMHooks.count.HP_clif_cashShopOpen_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd, int tab);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopOpen_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_cashShopOpen_post[hIndex].func;
+ postHookFunc(fd, sd, tab);
+ }
+ }
+ return;
+}
void HP_clif_pPartyBookingAddFilter(int fd, struct map_session_data *sd) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre > 0) {
@@ -66565,15 +66643,15 @@ int HP_pc_have_magnifier(struct map_session_data *sd) {
}
return retVal___;
}
-int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) {
+int HP_pc_have_item_chain(struct map_session_data *sd, enum e_chain_cache chain_cache_id) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_pc_have_item_chain_pre > 0) {
- int (*preHookFunc) (struct map_session_data **sd, unsigned short *chain_id);
+ int (*preHookFunc) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_pc_have_item_chain_pre[hIndex].func;
- retVal___ = preHookFunc(&sd, &chain_id);
+ retVal___ = preHookFunc(&sd, &chain_cache_id);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -66581,13 +66659,13 @@ int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id)
}
}
{
- retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id);
+ retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_cache_id);
}
if (HPMHooks.count.HP_pc_have_item_chain_post > 0) {
- int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id);
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_id);
for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_pc_have_item_chain_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, sd, chain_id);
+ retVal___ = postHookFunc(retVal___, sd, chain_cache_id);
}
}
return retVal___;
@@ -66813,6 +66891,33 @@ bool HP_pc_expandInventory(struct map_session_data *sd, int adjustSize) {
}
return retVal___;
}
+bool HP_pc_auto_exp_insurance(struct map_session_data *sd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_auto_exp_insurance_pre > 0) {
+ bool (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.auto_exp_insurance(sd);
+ }
+ if (HPMHooks.count.HP_pc_auto_exp_insurance_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd);
+ }
+ }
+ return retVal___;
+}
/* pcre_interface */
pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) {
int hIndex = 0;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
index 786b60288..53ee71a03 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2019 Hercules Dev Team
+ * Copyright (C) 2013-2020 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
diff --git a/src/plugins/mapcache.c b/src/plugins/mapcache.c
index 5e44492f6..208f39abb 100644
--- a/src/plugins/mapcache.c
+++ b/src/plugins/mapcache.c
@@ -281,7 +281,28 @@ bool mapcache_cache_map(const char *mapname)
if (rsw == NULL) {
water_height = NO_WATER;
} else {
- water_height = (int)GetFloat(rsw + 166);
+ if (memcmp(rsw, "GRSW", 4) != 0) {
+ ShowError("mapcache_cache_map: file %s is not in rsw format\n", filepath);
+ aFree(rsw);
+ return false;
+ }
+ int major_version = rsw[4];
+ int minor_version = rsw[5];
+ if (major_version > 2 || (major_version == 2 && minor_version > 2)) {
+ ShowError("mapcache_cache_map: Unsupported version %d.%d for rsw file %s\n", major_version, minor_version, filepath);
+ aFree(rsw);
+ return false;
+ }
+ if (major_version < 1 || (major_version == 1 && minor_version <= 4)) {
+ ShowError("mapcache_cache_map: Unsupported version %d.%d for rsw file %s\n", major_version, minor_version, filepath);
+ aFree(rsw);
+ return false;
+ }
+ int offset = 166;
+ if (major_version == 2 && minor_version >= 2) {
+ offset = 167;
+ }
+ water_height = (int)GetFloat(rsw + offset);
aFree(rsw);
}