summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc52
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HookingPoints.inc13
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Hooks.inc340
3 files changed, 399 insertions, 6 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
index 3303e93ae..4ae16ed88 100644
--- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
@@ -1291,6 +1291,10 @@ struct {
struct HPMHookPoint *HP_clif_delay_damage_post;
struct HPMHookPoint *HP_clif_delay_damage_sub_pre;
struct HPMHookPoint *HP_clif_delay_damage_sub_post;
+ struct HPMHookPoint *HP_clif_npc_market_open_pre;
+ struct HPMHookPoint *HP_clif_npc_market_open_post;
+ struct HPMHookPoint *HP_clif_npc_market_purchase_ack_pre;
+ struct HPMHookPoint *HP_clif_npc_market_purchase_ack_post;
struct HPMHookPoint *HP_clif_pWantToConnection_pre;
struct HPMHookPoint *HP_clif_pWantToConnection_post;
struct HPMHookPoint *HP_clif_pLoadEndAck_pre;
@@ -1731,6 +1735,12 @@ struct {
struct HPMHookPoint *HP_clif_pBankOpen_post;
struct HPMHookPoint *HP_clif_pBankClose_pre;
struct HPMHookPoint *HP_clif_pBankClose_post;
+ struct HPMHookPoint *HP_clif_pNPCShopClosed_pre;
+ struct HPMHookPoint *HP_clif_pNPCShopClosed_post;
+ struct HPMHookPoint *HP_clif_pNPCMarketClosed_pre;
+ struct HPMHookPoint *HP_clif_pNPCMarketClosed_post;
+ struct HPMHookPoint *HP_clif_pNPCMarketPurchase_pre;
+ struct HPMHookPoint *HP_clif_pNPCMarketPurchase_post;
struct HPMHookPoint *HP_duel_create_pre;
struct HPMHookPoint *HP_duel_create_post;
struct HPMHookPoint *HP_duel_invite_pre;
@@ -3339,6 +3349,22 @@ struct {
struct HPMHookPoint *HP_npc_debug_warps_sub_post;
struct HPMHookPoint *HP_npc_debug_warps_pre;
struct HPMHookPoint *HP_npc_debug_warps_post;
+ struct HPMHookPoint *HP_npc_trader_count_funds_pre;
+ struct HPMHookPoint *HP_npc_trader_count_funds_post;
+ struct HPMHookPoint *HP_npc_trader_pay_pre;
+ struct HPMHookPoint *HP_npc_trader_pay_post;
+ struct HPMHookPoint *HP_npc_trader_update_pre;
+ 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_trader_open_pre;
+ struct HPMHookPoint *HP_npc_trader_open_post;
+ struct HPMHookPoint *HP_npc_market_fromsql_pre;
+ struct HPMHookPoint *HP_npc_market_fromsql_post;
+ struct HPMHookPoint *HP_npc_market_tosql_pre;
+ struct HPMHookPoint *HP_npc_market_tosql_post;
+ struct HPMHookPoint *HP_npc_market_delfromsql_pre;
+ struct HPMHookPoint *HP_npc_market_delfromsql_post;
struct HPMHookPoint *HP_npc_secure_timeout_timer_pre;
struct HPMHookPoint *HP_npc_secure_timeout_timer_post;
struct HPMHookPoint *HP_party_init_pre;
@@ -6258,6 +6284,10 @@ struct {
int HP_clif_delay_damage_post;
int HP_clif_delay_damage_sub_pre;
int HP_clif_delay_damage_sub_post;
+ int HP_clif_npc_market_open_pre;
+ int HP_clif_npc_market_open_post;
+ int HP_clif_npc_market_purchase_ack_pre;
+ int HP_clif_npc_market_purchase_ack_post;
int HP_clif_pWantToConnection_pre;
int HP_clif_pWantToConnection_post;
int HP_clif_pLoadEndAck_pre;
@@ -6698,6 +6728,12 @@ struct {
int HP_clif_pBankOpen_post;
int HP_clif_pBankClose_pre;
int HP_clif_pBankClose_post;
+ int HP_clif_pNPCShopClosed_pre;
+ int HP_clif_pNPCShopClosed_post;
+ int HP_clif_pNPCMarketClosed_pre;
+ int HP_clif_pNPCMarketClosed_post;
+ int HP_clif_pNPCMarketPurchase_pre;
+ int HP_clif_pNPCMarketPurchase_post;
int HP_duel_create_pre;
int HP_duel_create_post;
int HP_duel_invite_pre;
@@ -8306,6 +8342,22 @@ struct {
int HP_npc_debug_warps_sub_post;
int HP_npc_debug_warps_pre;
int HP_npc_debug_warps_post;
+ int HP_npc_trader_count_funds_pre;
+ int HP_npc_trader_count_funds_post;
+ int HP_npc_trader_pay_pre;
+ int HP_npc_trader_pay_post;
+ int HP_npc_trader_update_pre;
+ int HP_npc_trader_update_post;
+ int HP_npc_market_buylist_pre;
+ int HP_npc_market_buylist_post;
+ int HP_npc_trader_open_pre;
+ int HP_npc_trader_open_post;
+ int HP_npc_market_fromsql_pre;
+ int HP_npc_market_fromsql_post;
+ int HP_npc_market_tosql_pre;
+ int HP_npc_market_tosql_post;
+ int HP_npc_market_delfromsql_pre;
+ int HP_npc_market_delfromsql_post;
int HP_npc_secure_timeout_timer_pre;
int HP_npc_secure_timeout_timer_post;
int HP_party_init_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
index 86e1cf53a..c016ca418 100644
--- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
@@ -655,6 +655,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->notify_bounditem, HP_clif_notify_bounditem) },
{ HP_POP(clif->delay_damage, HP_clif_delay_damage) },
{ HP_POP(clif->delay_damage_sub, HP_clif_delay_damage_sub) },
+ { HP_POP(clif->npc_market_open, HP_clif_npc_market_open) },
+ { HP_POP(clif->npc_market_purchase_ack, HP_clif_npc_market_purchase_ack) },
{ HP_POP(clif->pWantToConnection, HP_clif_pWantToConnection) },
{ HP_POP(clif->pLoadEndAck, HP_clif_pLoadEndAck) },
{ HP_POP(clif->pTickSend, HP_clif_pTickSend) },
@@ -875,6 +877,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->pBankCheck, HP_clif_pBankCheck) },
{ HP_POP(clif->pBankOpen, HP_clif_pBankOpen) },
{ HP_POP(clif->pBankClose, HP_clif_pBankClose) },
+ { HP_POP(clif->pNPCShopClosed, HP_clif_pNPCShopClosed) },
+ { HP_POP(clif->pNPCMarketClosed, HP_clif_pNPCMarketClosed) },
+ { HP_POP(clif->pNPCMarketPurchase, HP_clif_pNPCMarketPurchase) },
/* duel */
{ HP_POP(duel->create, HP_duel_create) },
{ HP_POP(duel->invite, HP_duel_invite) },
@@ -1696,6 +1701,14 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(npc->do_clear_npc, HP_npc_do_clear_npc) },
{ HP_POP(npc->debug_warps_sub, HP_npc_debug_warps_sub) },
{ HP_POP(npc->debug_warps, HP_npc_debug_warps) },
+ { HP_POP(npc->trader_count_funds, HP_npc_trader_count_funds) },
+ { 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->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->secure_timeout_timer, HP_npc_secure_timeout_timer) },
/* party */
{ HP_POP(party->init, HP_party_init) },
diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc
index c6f58a4c1..72b212b9e 100644
--- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc
@@ -16400,6 +16400,56 @@ int HP_clif_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
}
return retVal___;
}
+void HP_clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_npc_market_open_pre ) {
+ void (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_npc_market_open_pre[hIndex].func;
+ preHookFunc(sd, nd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.npc_market_open(sd, nd);
+ }
+ if( HPMHooks.count.HP_clif_npc_market_open_post ) {
+ void (*postHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_open_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_npc_market_open_post[hIndex].func;
+ postHookFunc(sd, nd);
+ }
+ }
+ return;
+}
+void HP_clif_npc_market_purchase_ack(struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_npc_market_purchase_ack_pre ) {
+ void (*preHookFunc) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char *response);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_pre[hIndex].func;
+ preHookFunc(sd, req, &response);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.npc_market_purchase_ack(sd, req, response);
+ }
+ if( HPMHooks.count.HP_clif_npc_market_purchase_ack_post ) {
+ void (*postHookFunc) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char *response);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_npc_market_purchase_ack_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_npc_market_purchase_ack_post[hIndex].func;
+ postHookFunc(sd, req, &response);
+ }
+ }
+ return;
+}
void HP_clif_pWantToConnection(int fd, struct map_session_data *sd) {
int hIndex = 0;
if( HPMHooks.count.HP_clif_pWantToConnection_pre ) {
@@ -21900,6 +21950,81 @@ void HP_clif_pBankClose(int fd, struct map_session_data *sd) {
}
return;
}
+void HP_clif_pNPCShopClosed(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_pNPCShopClosed_pre ) {
+ void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_pNPCShopClosed_pre[hIndex].func;
+ preHookFunc(&fd, sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pNPCShopClosed(fd, sd);
+ }
+ if( HPMHooks.count.HP_clif_pNPCShopClosed_post ) {
+ void (*postHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCShopClosed_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_pNPCShopClosed_post[hIndex].func;
+ postHookFunc(&fd, sd);
+ }
+ }
+ return;
+}
+void HP_clif_pNPCMarketClosed(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_pNPCMarketClosed_pre ) {
+ void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_pNPCMarketClosed_pre[hIndex].func;
+ preHookFunc(&fd, sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pNPCMarketClosed(fd, sd);
+ }
+ if( HPMHooks.count.HP_clif_pNPCMarketClosed_post ) {
+ void (*postHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketClosed_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_pNPCMarketClosed_post[hIndex].func;
+ postHookFunc(&fd, sd);
+ }
+ }
+ return;
+}
+void HP_clif_pNPCMarketPurchase(int fd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_clif_pNPCMarketPurchase_pre ) {
+ void (*preHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_clif_pNPCMarketPurchase_pre[hIndex].func;
+ preHookFunc(&fd, sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.pNPCMarketPurchase(fd, sd);
+ }
+ if( HPMHooks.count.HP_clif_pNPCMarketPurchase_post ) {
+ void (*postHookFunc) (int *fd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_pNPCMarketPurchase_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_clif_pNPCMarketPurchase_post[hIndex].func;
+ postHookFunc(&fd, sd);
+ }
+ }
+ return;
+}
/* duel */
int HP_duel_create(struct map_session_data *sd, const unsigned int maxpl) {
int hIndex = 0;
@@ -42354,14 +42479,14 @@ const char* HP_npc_skip_script(const char *start, const char *buffer, const char
}
return retVal___;
}
-const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, bool runOnInit) {
+const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int options) {
int hIndex = 0;
const char* retVal___ = NULL;
if( HPMHooks.count.HP_npc_parse_script_pre ) {
- const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, bool *runOnInit);
+ const char* (*preHookFunc) (char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options);
for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_npc_parse_script_pre[hIndex].func;
- retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, &runOnInit);
+ retVal___ = preHookFunc(w1, w2, w3, w4, start, buffer, filepath, &options);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -42369,13 +42494,13 @@ const char* HP_npc_parse_script(char *w1, char *w2, char *w3, char *w4, const ch
}
}
{
- retVal___ = HPMHooks.source.npc.parse_script(w1, w2, w3, w4, start, buffer, filepath, runOnInit);
+ retVal___ = HPMHooks.source.npc.parse_script(w1, w2, w3, w4, start, buffer, filepath, options);
}
if( HPMHooks.count.HP_npc_parse_script_post ) {
- const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, bool *runOnInit);
+ const char* (*postHookFunc) (const char* retVal___, char *w1, char *w2, char *w3, char *w4, const char *start, const char *buffer, const char *filepath, int *options);
for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_parse_script_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_npc_parse_script_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &runOnInit);
+ retVal___ = postHookFunc(retVal___, w1, w2, w3, w4, start, buffer, filepath, &options);
}
}
return retVal___;
@@ -42986,6 +43111,209 @@ void HP_npc_debug_warps(void) {
}
return;
}
+void HP_npc_trader_count_funds(struct npc_data *nd, struct map_session_data *sd) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_trader_count_funds_pre ) {
+ void (*preHookFunc) (struct npc_data *nd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_trader_count_funds_pre[hIndex].func;
+ preHookFunc(nd, sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.trader_count_funds(nd, sd);
+ }
+ if( HPMHooks.count.HP_npc_trader_count_funds_post ) {
+ void (*postHookFunc) (struct npc_data *nd, struct map_session_data *sd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_count_funds_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_trader_count_funds_post[hIndex].func;
+ postHookFunc(nd, sd);
+ }
+ }
+ return;
+}
+bool HP_npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int price, int points) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_trader_pay_pre ) {
+ bool (*preHookFunc) (struct npc_data *nd, struct map_session_data *sd, int *price, int *points);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_trader_pay_pre[hIndex].func;
+ retVal___ = preHookFunc(nd, sd, &price, &points);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.trader_pay(nd, sd, price, points);
+ }
+ if( HPMHooks.count.HP_npc_trader_pay_post ) {
+ bool (*postHookFunc) (bool retVal___, struct npc_data *nd, struct map_session_data *sd, int *price, int *points);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_pay_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_trader_pay_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, nd, sd, &price, &points);
+ }
+ }
+ return retVal___;
+}
+void HP_npc_trader_update(int master) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_trader_update_pre ) {
+ void (*preHookFunc) (int *master);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_trader_update_pre[hIndex].func;
+ preHookFunc(&master);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.trader_update(master);
+ }
+ if( HPMHooks.count.HP_npc_trader_update_post ) {
+ void (*postHookFunc) (int *master);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_update_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_trader_update_post[hIndex].func;
+ postHookFunc(&master);
+ }
+ }
+ return;
+}
+int HP_npc_market_buylist(struct map_session_data *sd, unsigned short list_size, struct packet_npc_market_purchase *p) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if( HPMHooks.count.HP_npc_market_buylist_pre ) {
+ int (*preHookFunc) (struct map_session_data *sd, unsigned short *list_size, struct packet_npc_market_purchase *p);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_market_buylist_pre[hIndex].func;
+ retVal___ = preHookFunc(sd, &list_size, p);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.market_buylist(sd, list_size, p);
+ }
+ if( HPMHooks.count.HP_npc_market_buylist_post ) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short *list_size, struct packet_npc_market_purchase *p);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_buylist_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_market_buylist_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, &list_size, p);
+ }
+ }
+ return retVal___;
+}
+bool HP_npc_trader_open(struct map_session_data *sd, struct npc_data *nd) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_npc_trader_open_pre ) {
+ bool (*preHookFunc) (struct map_session_data *sd, struct npc_data *nd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_trader_open_pre[hIndex].func;
+ retVal___ = preHookFunc(sd, nd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.npc.trader_open(sd, nd);
+ }
+ if( HPMHooks.count.HP_npc_trader_open_post ) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, struct npc_data *nd);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_trader_open_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_trader_open_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, nd);
+ }
+ }
+ return retVal___;
+}
+void HP_npc_market_fromsql(void) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_market_fromsql_pre ) {
+ void (*preHookFunc) (void);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_market_fromsql_pre[hIndex].func;
+ preHookFunc();
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.market_fromsql();
+ }
+ if( HPMHooks.count.HP_npc_market_fromsql_post ) {
+ void (*postHookFunc) (void);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_fromsql_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_npc_market_fromsql_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_npc_market_tosql(struct npc_data *nd, unsigned short index) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_market_tosql_pre ) {
+ void (*preHookFunc) (struct npc_data *nd, unsigned short *index);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_tosql_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_market_tosql_pre[hIndex].func;
+ preHookFunc(nd, &index);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.market_tosql(nd, index);
+ }
+ if( HPMHooks.count.HP_npc_market_tosql_post ) {
+ void (*postHookFunc) (struct npc_data *nd, unsigned short *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);
+ }
+ }
+ return;
+}
+void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) {
+ int hIndex = 0;
+ if( HPMHooks.count.HP_npc_market_delfromsql_pre ) {
+ void (*preHookFunc) (struct npc_data *nd, unsigned short *index);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_pre[hIndex].func;
+ preHookFunc(nd, &index);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.npc.market_delfromsql(nd, index);
+ }
+ if( HPMHooks.count.HP_npc_market_delfromsql_post ) {
+ void (*postHookFunc) (struct npc_data *nd, unsigned short *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);
+ }
+ }
+ return;
+}
int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;