summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-01-15 23:57:23 +0000
committerGitHub <noreply@github.com>2019-01-15 23:57:23 +0000
commit85690028a05b76c3423ff5777fd545d7af04cf6d (patch)
tree77c994f19cbd2d1a887e0a711df580048b52d16f /src/plugins
parent21edafad0f74e85c408336274dd1e59db2fe3880 (diff)
parent828cbdc9e761499ba1336a2bb68267a161053d19 (diff)
downloadhercules-85690028a05b76c3423ff5777fd545d7af04cf6d.tar.gz
hercules-85690028a05b76c3423ff5777fd545d7af04cf6d.tar.bz2
hercules-85690028a05b76c3423ff5777fd545d7af04cf6d.tar.xz
hercules-85690028a05b76c3423ff5777fd545d7af04cf6d.zip
Merge pull request #2339 from 4144/updatepackets
Update packet up to 2019-01-09
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc28
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc32
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc227
4 files changed, 280 insertions, 15 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 4c706d652..cd28f9b0b 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -2658,6 +2658,12 @@ typedef bool (*HPMHOOK_pre_clif_enchant_equipment) (struct map_session_data **sd
typedef bool (*HPMHOOK_post_clif_enchant_equipment) (bool retVal___, struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId);
typedef void (*HPMHOOK_pre_clif_pReqRemainTime) (int *fd, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_pReqRemainTime) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_npc_barter_open) (struct map_session_data **sd, struct npc_data **nd);
+typedef void (*HPMHOOK_post_clif_npc_barter_open) (struct map_session_data *sd, struct npc_data *nd);
+typedef void (*HPMHOOK_pre_clif_pNPCBarterClosed) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNPCBarterClosed) (int fd, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_pNPCBarterPurchase) (int *fd, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_pNPCBarterPurchase) (int fd, struct map_session_data *sd);
#endif // MAP_CLIF_H
#ifdef COMMON_CORE_H /* cmdline */
typedef void (*HPMHOOK_pre_cmdline_init) (void);
@@ -5688,16 +5694,26 @@ typedef void (*HPMHOOK_pre_npc_trader_update) (int *master);
typedef void (*HPMHOOK_post_npc_trader_update) (int master);
typedef int (*HPMHOOK_pre_npc_market_buylist) (struct map_session_data **sd, struct itemlist **item_list);
typedef int (*HPMHOOK_post_npc_market_buylist) (int retVal___, struct map_session_data *sd, struct itemlist *item_list);
+typedef int (*HPMHOOK_pre_npc_barter_buylist) (struct map_session_data **sd, struct barteritemlist **item_list);
+typedef int (*HPMHOOK_post_npc_barter_buylist) (int retVal___, struct map_session_data *sd, struct barteritemlist *item_list);
typedef bool (*HPMHOOK_pre_npc_trader_open) (struct map_session_data **sd, struct npc_data **nd);
typedef bool (*HPMHOOK_post_npc_trader_open) (bool retVal___, struct map_session_data *sd, struct npc_data *nd);
typedef void (*HPMHOOK_pre_npc_market_fromsql) (void);
typedef void (*HPMHOOK_post_npc_market_fromsql) (void);
-typedef void (*HPMHOOK_pre_npc_market_tosql) (struct npc_data **nd, unsigned short *index);
-typedef void (*HPMHOOK_post_npc_market_tosql) (struct npc_data *nd, unsigned short index);
-typedef void (*HPMHOOK_pre_npc_market_delfromsql) (struct npc_data **nd, unsigned short *index);
-typedef void (*HPMHOOK_post_npc_market_delfromsql) (struct npc_data *nd, unsigned short index);
-typedef void (*HPMHOOK_pre_npc_market_delfromsql_sub) (const char **npcname, unsigned short *index);
-typedef void (*HPMHOOK_post_npc_market_delfromsql_sub) (const char *npcname, unsigned short index);
+typedef void (*HPMHOOK_pre_npc_market_tosql) (struct npc_data **nd, int *index);
+typedef void (*HPMHOOK_post_npc_market_tosql) (struct npc_data *nd, int index);
+typedef void (*HPMHOOK_pre_npc_market_delfromsql) (struct npc_data **nd, int *index);
+typedef void (*HPMHOOK_post_npc_market_delfromsql) (struct npc_data *nd, int index);
+typedef void (*HPMHOOK_pre_npc_market_delfromsql_sub) (const char **npcname, int *index);
+typedef void (*HPMHOOK_post_npc_market_delfromsql_sub) (const char *npcname, int index);
+typedef void (*HPMHOOK_pre_npc_barter_fromsql) (void);
+typedef void (*HPMHOOK_post_npc_barter_fromsql) (void);
+typedef void (*HPMHOOK_pre_npc_barter_tosql) (struct npc_data **nd, int *index);
+typedef void (*HPMHOOK_post_npc_barter_tosql) (struct npc_data *nd, int index);
+typedef void (*HPMHOOK_pre_npc_barter_delfromsql) (struct npc_data **nd, int *index);
+typedef void (*HPMHOOK_post_npc_barter_delfromsql) (struct npc_data *nd, int index);
+typedef void (*HPMHOOK_pre_npc_barter_delfromsql_sub) (const char **npcname, int *itemId, int *itemId2, int *amount2);
+typedef void (*HPMHOOK_post_npc_barter_delfromsql_sub) (const char *npcname, int itemId, int itemId2, int amount2);
typedef bool (*HPMHOOK_pre_npc_db_checkid) (const int *id);
typedef bool (*HPMHOOK_post_npc_db_checkid) (bool retVal___, const int id);
typedef void (*HPMHOOK_pre_npc_refresh) (struct npc_data **nd);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 485b3d53e..aa4efd5c3 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2250,6 +2250,12 @@ struct {
struct HPMHookPoint *HP_clif_enchant_equipment_post;
struct HPMHookPoint *HP_clif_pReqRemainTime_pre;
struct HPMHookPoint *HP_clif_pReqRemainTime_post;
+ struct HPMHookPoint *HP_clif_npc_barter_open_pre;
+ struct HPMHookPoint *HP_clif_npc_barter_open_post;
+ struct HPMHookPoint *HP_clif_pNPCBarterClosed_pre;
+ struct HPMHookPoint *HP_clif_pNPCBarterClosed_post;
+ struct HPMHookPoint *HP_clif_pNPCBarterPurchase_pre;
+ struct HPMHookPoint *HP_clif_pNPCBarterPurchase_post;
struct HPMHookPoint *HP_cmdline_init_pre;
struct HPMHookPoint *HP_cmdline_init_post;
struct HPMHookPoint *HP_cmdline_final_pre;
@@ -4260,6 +4266,8 @@ struct {
struct HPMHookPoint *HP_npc_trader_update_post;
struct HPMHookPoint *HP_npc_market_buylist_pre;
struct HPMHookPoint *HP_npc_market_buylist_post;
+ struct HPMHookPoint *HP_npc_barter_buylist_pre;
+ struct HPMHookPoint *HP_npc_barter_buylist_post;
struct HPMHookPoint *HP_npc_trader_open_pre;
struct HPMHookPoint *HP_npc_trader_open_post;
struct HPMHookPoint *HP_npc_market_fromsql_pre;
@@ -4270,6 +4278,14 @@ struct {
struct HPMHookPoint *HP_npc_market_delfromsql_post;
struct HPMHookPoint *HP_npc_market_delfromsql_sub_pre;
struct HPMHookPoint *HP_npc_market_delfromsql_sub_post;
+ struct HPMHookPoint *HP_npc_barter_fromsql_pre;
+ struct HPMHookPoint *HP_npc_barter_fromsql_post;
+ struct HPMHookPoint *HP_npc_barter_tosql_pre;
+ struct HPMHookPoint *HP_npc_barter_tosql_post;
+ struct HPMHookPoint *HP_npc_barter_delfromsql_pre;
+ struct HPMHookPoint *HP_npc_barter_delfromsql_post;
+ struct HPMHookPoint *HP_npc_barter_delfromsql_sub_pre;
+ struct HPMHookPoint *HP_npc_barter_delfromsql_sub_post;
struct HPMHookPoint *HP_npc_db_checkid_pre;
struct HPMHookPoint *HP_npc_db_checkid_post;
struct HPMHookPoint *HP_npc_refresh_pre;
@@ -8901,6 +8917,12 @@ struct {
int HP_clif_enchant_equipment_post;
int HP_clif_pReqRemainTime_pre;
int HP_clif_pReqRemainTime_post;
+ int HP_clif_npc_barter_open_pre;
+ int HP_clif_npc_barter_open_post;
+ int HP_clif_pNPCBarterClosed_pre;
+ int HP_clif_pNPCBarterClosed_post;
+ int HP_clif_pNPCBarterPurchase_pre;
+ int HP_clif_pNPCBarterPurchase_post;
int HP_cmdline_init_pre;
int HP_cmdline_init_post;
int HP_cmdline_final_pre;
@@ -10911,6 +10933,8 @@ struct {
int HP_npc_trader_update_post;
int HP_npc_market_buylist_pre;
int HP_npc_market_buylist_post;
+ int HP_npc_barter_buylist_pre;
+ int HP_npc_barter_buylist_post;
int HP_npc_trader_open_pre;
int HP_npc_trader_open_post;
int HP_npc_market_fromsql_pre;
@@ -10921,6 +10945,14 @@ struct {
int HP_npc_market_delfromsql_post;
int HP_npc_market_delfromsql_sub_pre;
int HP_npc_market_delfromsql_sub_post;
+ int HP_npc_barter_fromsql_pre;
+ int HP_npc_barter_fromsql_post;
+ int HP_npc_barter_tosql_pre;
+ int HP_npc_barter_tosql_post;
+ int HP_npc_barter_delfromsql_pre;
+ int HP_npc_barter_delfromsql_post;
+ int HP_npc_barter_delfromsql_sub_pre;
+ int HP_npc_barter_delfromsql_sub_post;
int HP_npc_db_checkid_pre;
int HP_npc_db_checkid_post;
int HP_npc_refresh_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 8a0ecfa97..8d031e140 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1149,6 +1149,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->item_preview, HP_clif_item_preview) },
{ HP_POP(clif->enchant_equipment, HP_clif_enchant_equipment) },
{ HP_POP(clif->pReqRemainTime, HP_clif_pReqRemainTime) },
+ { HP_POP(clif->npc_barter_open, HP_clif_npc_barter_open) },
+ { HP_POP(clif->pNPCBarterClosed, HP_clif_pNPCBarterClosed) },
+ { HP_POP(clif->pNPCBarterPurchase, HP_clif_pNPCBarterPurchase) },
/* cmdline_interface */
{ HP_POP(cmdline->init, HP_cmdline_init) },
{ HP_POP(cmdline->final, HP_cmdline_final) },
@@ -2182,11 +2185,16 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->trader_pay, HP_npc_trader_pay) },
{ HP_POP(npc->trader_update, HP_npc_trader_update) },
{ HP_POP(npc->market_buylist, HP_npc_market_buylist) },
+ { HP_POP(npc->barter_buylist, HP_npc_barter_buylist) },
{ HP_POP(npc->trader_open, HP_npc_trader_open) },
{ HP_POP(npc->market_fromsql, HP_npc_market_fromsql) },
{ HP_POP(npc->market_tosql, HP_npc_market_tosql) },
{ HP_POP(npc->market_delfromsql, HP_npc_market_delfromsql) },
{ HP_POP(npc->market_delfromsql_sub, HP_npc_market_delfromsql_sub) },
+ { HP_POP(npc->barter_fromsql, HP_npc_barter_fromsql) },
+ { HP_POP(npc->barter_tosql, HP_npc_barter_tosql) },
+ { HP_POP(npc->barter_delfromsql, HP_npc_barter_delfromsql) },
+ { HP_POP(npc->barter_delfromsql_sub, HP_npc_barter_delfromsql_sub) },
{ HP_POP(npc->db_checkid, HP_npc_db_checkid) },
{ HP_POP(npc->refresh, HP_npc_refresh) },
{ HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 3456af7cb..af1fc7bc4 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -29330,6 +29330,84 @@ void HP_clif_pReqRemainTime(int fd, struct map_session_data *sd) {
}
return;
}
+void HP_clif_npc_barter_open(struct map_session_data *sd, struct npc_data *nd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_npc_barter_open_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd, struct npc_data **nd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_barter_open_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_npc_barter_open_pre[hIndex].func;
+ preHookFunc(&sd, &nd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.npc_barter_open(sd, nd);
+ }
+ if (HPMHooks.count.HP_clif_npc_barter_open_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_barter_open_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_npc_barter_open_post[hIndex].func;
+ postHookFunc(sd, nd);
+ }
+ }
+ return;
+}
+void HP_clif_pNPCBarterClosed(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_pNPCBarterClosed_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCBarterClosed_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pNPCBarterClosed_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pNPCBarterClosed(fd, sd);
+ }
+ if (HPMHooks.count.HP_clif_pNPCBarterClosed_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCBarterClosed_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pNPCBarterClosed_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
+void HP_clif_pNPCBarterPurchase(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_pNPCBarterPurchase_pre > 0) {
+ void (*preHookFunc) (int *fd, struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCBarterPurchase_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_pNPCBarterPurchase_pre[hIndex].func;
+ preHookFunc(&fd, &sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pNPCBarterPurchase(fd, sd);
+ }
+ if (HPMHooks.count.HP_clif_pNPCBarterPurchase_post > 0) {
+ void (*postHookFunc) (int fd, struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCBarterPurchase_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_pNPCBarterPurchase_post[hIndex].func;
+ postHookFunc(fd, sd);
+ }
+ }
+ return;
+}
/* cmdline_interface */
void HP_cmdline_init(void) {
int hIndex = 0;
@@ -56611,6 +56689,33 @@ int HP_npc_market_buylist(struct map_session_data *sd, struct itemlist *item_lis
}
return retVal___;
}
+int HP_npc_barter_buylist(struct map_session_data *sd, struct barteritemlist *item_list) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_npc_barter_buylist_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct barteritemlist **item_list);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_buylist_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_npc_barter_buylist_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &item_list);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.barter_buylist(sd, item_list);
+ }
+ if (HPMHooks.count.HP_npc_barter_buylist_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct barteritemlist *item_list);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_buylist_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_npc_barter_buylist_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, item_list);
+ }
+ }
+ return retVal___;
+}
bool HP_npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
int hIndex = 0;
bool retVal___ = false;
@@ -56664,10 +56769,10 @@ void HP_npc_market_fromsql(void) {
}
return;
}
-void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
+void HP_npc_market_tosql(struct npc_data *nd, int index) {
int hIndex = 0;
if (HPMHooks.count.HP_npc_market_tosql_pre > 0) {
- void (*preHookFunc) (struct npc_data **nd, unsigned short *index);
+ void (*preHookFunc) (struct npc_data **nd, int *index);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_tosql_pre[hIndex].func;
@@ -56682,7 +56787,7 @@ void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
HPMHooks.source.npc.market_tosql(nd, index);
}
if (HPMHooks.count.HP_npc_market_tosql_post > 0) {
- void (*postHookFunc) (struct npc_data *nd, unsigned short index);
+ void (*postHookFunc) (struct npc_data *nd, int index);
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_tosql_post[hIndex].func;
postHookFunc(nd, index);
@@ -56690,10 +56795,10 @@ void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
}
return;
}
-void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
+void HP_npc_market_delfromsql(struct npc_data *nd, int index) {
int hIndex = 0;
if (HPMHooks.count.HP_npc_market_delfromsql_pre > 0) {
- void (*preHookFunc) (struct npc_data **nd, unsigned short *index);
+ void (*preHookFunc) (struct npc_data **nd, int *index);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_pre[hIndex].func;
@@ -56708,7 +56813,7 @@ void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
HPMHooks.source.npc.market_delfromsql(nd, index);
}
if (HPMHooks.count.HP_npc_market_delfromsql_post > 0) {
- void (*postHookFunc) (struct npc_data *nd, unsigned short index);
+ void (*postHookFunc) (struct npc_data *nd, int index);
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_delfromsql_post[hIndex].func;
postHookFunc(nd, index);
@@ -56716,10 +56821,10 @@ void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
}
return;
}
-void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
+void HP_npc_market_delfromsql_sub(const char *npcname, int index) {
int hIndex = 0;
if (HPMHooks.count.HP_npc_market_delfromsql_sub_pre > 0) {
- void (*preHookFunc) (const char **npcname, unsigned short *index);
+ void (*preHookFunc) (const char **npcname, int *index);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_pre[hIndex].func;
@@ -56734,7 +56839,7 @@ void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
HPMHooks.source.npc.market_delfromsql_sub(npcname, index);
}
if (HPMHooks.count.HP_npc_market_delfromsql_sub_post > 0) {
- void (*postHookFunc) (const char *npcname, unsigned short index);
+ void (*postHookFunc) (const char *npcname, int index);
for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_post[hIndex].func;
postHookFunc(npcname, index);
@@ -56742,6 +56847,110 @@ void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) {
}
return;
}
+void HP_npc_barter_fromsql(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_npc_barter_fromsql_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_fromsql_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_npc_barter_fromsql_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.barter_fromsql();
+ }
+ if (HPMHooks.count.HP_npc_barter_fromsql_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_fromsql_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_npc_barter_fromsql_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_npc_barter_tosql(struct npc_data *nd, int index) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_npc_barter_tosql_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *index);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_tosql_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_npc_barter_tosql_pre[hIndex].func;
+ preHookFunc(&nd, &index);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.barter_tosql(nd, index);
+ }
+ if (HPMHooks.count.HP_npc_barter_tosql_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_tosql_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_npc_barter_tosql_post[hIndex].func;
+ postHookFunc(nd, index);
+ }
+ }
+ return;
+}
+void HP_npc_barter_delfromsql(struct npc_data *nd, int index) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_npc_barter_delfromsql_pre > 0) {
+ void (*preHookFunc) (struct npc_data **nd, int *index);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_delfromsql_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_npc_barter_delfromsql_pre[hIndex].func;
+ preHookFunc(&nd, &index);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.barter_delfromsql(nd, index);
+ }
+ if (HPMHooks.count.HP_npc_barter_delfromsql_post > 0) {
+ void (*postHookFunc) (struct npc_data *nd, int index);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_delfromsql_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_npc_barter_delfromsql_post[hIndex].func;
+ postHookFunc(nd, index);
+ }
+ }
+ return;
+}
+void HP_npc_barter_delfromsql_sub(const char *npcname, int itemId, int itemId2, int amount2) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_npc_barter_delfromsql_sub_pre > 0) {
+ void (*preHookFunc) (const char **npcname, int *itemId, int *itemId2, int *amount2);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_delfromsql_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_npc_barter_delfromsql_sub_pre[hIndex].func;
+ preHookFunc(&npcname, &itemId, &itemId2, &amount2);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.barter_delfromsql_sub(npcname, itemId, itemId2, amount2);
+ }
+ if (HPMHooks.count.HP_npc_barter_delfromsql_sub_post > 0) {
+ void (*postHookFunc) (const char *npcname, int itemId, int itemId2, int amount2);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_barter_delfromsql_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_npc_barter_delfromsql_sub_post[hIndex].func;
+ postHookFunc(npcname, itemId, itemId2, amount2);
+ }
+ }
+ return;
+}
bool HP_npc_db_checkid(const int id) {
int hIndex = 0;
bool retVal___ = false;