summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-15 21:00:41 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-18 16:52:44 +0300
commitaba3d68747aed707bc78b451eac5d9ed76b853d5 (patch)
treeb7853002d5c89d1db9a6a2ee296faedcbad0e708
parentf26152a2f3fc1e9f21ee0d8d1bc0ea8e8c8ffabf (diff)
downloadhercules-aba3d68747aed707bc78b451eac5d9ed76b853d5.tar.gz
hercules-aba3d68747aed707bc78b451eac5d9ed76b853d5.tar.bz2
hercules-aba3d68747aed707bc78b451eac5d9ed76b853d5.tar.xz
hercules-aba3d68747aed707bc78b451eac5d9ed76b853d5.zip
Update HPM hooks.
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc54
3 files changed, 64 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index e35a4c81c..f3e3711c1 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3697,6 +3697,10 @@ struct {
struct HPMHookPoint *HP_pc_skill_post;
struct HPMHookPoint *HP_pc_insert_card_pre;
struct HPMHookPoint *HP_pc_insert_card_post;
+ struct HPMHookPoint *HP_pc_can_insert_card_pre;
+ struct HPMHookPoint *HP_pc_can_insert_card_post;
+ struct HPMHookPoint *HP_pc_can_insert_card_into_pre;
+ struct HPMHookPoint *HP_pc_can_insert_card_into_post;
struct HPMHookPoint *HP_pc_steal_item_pre;
struct HPMHookPoint *HP_pc_steal_item_post;
struct HPMHookPoint *HP_pc_steal_coin_pre;
@@ -8912,6 +8916,10 @@ struct {
int HP_pc_skill_post;
int HP_pc_insert_card_pre;
int HP_pc_insert_card_post;
+ int HP_pc_can_insert_card_pre;
+ int HP_pc_can_insert_card_post;
+ int HP_pc_can_insert_card_into_pre;
+ int HP_pc_can_insert_card_into_post;
int HP_pc_steal_item_pre;
int HP_pc_steal_item_post;
int HP_pc_steal_coin_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 6501c0943..4e23425ec 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1880,6 +1880,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->bonus5, HP_pc_bonus5) },
{ HP_POP(pc->skill, HP_pc_skill) },
{ HP_POP(pc->insert_card, HP_pc_insert_card) },
+ { HP_POP(pc->can_insert_card, HP_pc_can_insert_card) },
+ { HP_POP(pc->can_insert_card_into, HP_pc_can_insert_card_into) },
{ HP_POP(pc->steal_item, HP_pc_steal_item) },
{ HP_POP(pc->steal_coin, HP_pc_steal_coin) },
{ HP_POP(pc->modifybuyvalue, HP_pc_modifybuyvalue) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 04f31aea5..85f477bec 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -49461,6 +49461,60 @@ int HP_pc_insert_card(struct map_session_data *sd, int idx_card, int idx_equip)
}
return retVal___;
}
+bool HP_pc_can_insert_card(struct map_session_data *sd, int idx_card) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_pc_can_insert_card_pre ) {
+ bool (*preHookFunc) (struct map_session_data *sd, int *idx_card);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_pc_can_insert_card_pre[hIndex].func;
+ retVal___ = preHookFunc(sd, &idx_card);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.can_insert_card(sd, idx_card);
+ }
+ if( HPMHooks.count.HP_pc_can_insert_card_post ) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *idx_card);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_pc_can_insert_card_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, &idx_card);
+ }
+ }
+ return retVal___;
+}
+bool HP_pc_can_insert_card_into(struct map_session_data *sd, int idx_card, int idx_equip) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_pc_can_insert_card_into_pre ) {
+ bool (*preHookFunc) (struct map_session_data *sd, int *idx_card, int *idx_equip);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_pc_can_insert_card_into_pre[hIndex].func;
+ retVal___ = preHookFunc(sd, &idx_card, &idx_equip);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.can_insert_card_into(sd, idx_card, idx_equip);
+ }
+ if( HPMHooks.count.HP_pc_can_insert_card_into_post ) {
+ bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *idx_card, int *idx_equip);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_can_insert_card_into_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_pc_can_insert_card_into_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, &idx_card, &idx_equip);
+ }
+ }
+ return retVal___;
+}
int HP_pc_steal_item(struct map_session_data *sd, struct block_list *bl, uint16 skill_lv) {
int hIndex = 0;
int retVal___ = 0;