diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/char/int_homun.c | 13 | ||||
-rw-r--r-- | src/char/int_rodex.c | 46 | ||||
-rw-r--r-- | src/common/mmo.h | 1 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/clif.c | 38 | ||||
-rw-r--r-- | src/map/clif.h | 14 | ||||
-rw-r--r-- | src/map/homunculus.c | 7 | ||||
-rw-r--r-- | src/map/npc.c | 2 | ||||
-rw-r--r-- | src/map/packets.h | 2 | ||||
-rw-r--r-- | src/map/skill.c | 9 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 16 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 40 |
15 files changed, 120 insertions, 83 deletions
diff --git a/src/char/int_homun.c b/src/char/int_homun.c index a15a095dd..edf737992 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -129,10 +129,10 @@ bool mapif_homunculus_create(struct s_homunculus *hd) SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH)); if (SQL_ERROR == SQL->Query(inter->sql_handle, "INSERT INTO `%s` " - "(`char_id`, `class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`, `rename_flag`, `vaporize`) " - "VALUES ('%d', '%d', '%d', '%s', '%d', '%u', '%u', '%d', '%d', %d, '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", + "(`char_id`, `class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`, `rename_flag`, `vaporize`, `autofeed`) " + "VALUES ('%d', '%d', '%d', '%s', '%d', '%u', '%u', '%d', '%d', %d, '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk, - hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize)) { + hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->autofeed)) { Sql_ShowDebug(inter->sql_handle); return false; } @@ -156,9 +156,9 @@ bool mapif_homunculus_save(const struct s_homunculus *hd) SQL->EscapeStringLen(inter->sql_handle, esc_name, hd->name, strnlen(hd->name, NAME_LENGTH)); - if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d' WHERE `homun_id`='%d'", + if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `char_id`='%d', `class`='%d',`prev_class`='%d',`name`='%s',`level`='%d',`exp`='%u',`intimacy`='%u',`hunger`='%d', `str`='%d', `agi`='%d', `vit`='%d', `int`='%d', `dex`='%d', `luk`='%d', `hp`='%d',`max_hp`='%d',`sp`='%d',`max_sp`='%d',`skill_point`='%d', `rename_flag`='%d', `vaporize`='%d', `autofeed`='%d' WHERE `homun_id`='%d'", homunculus_db, hd->char_id, hd->class_, hd->prev_class, esc_name, hd->level, hd->exp, hd->intimacy, hd->hunger, hd->str, hd->agi, hd->vit, hd->int_, hd->dex, hd->luk, - hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->hom_id)) { + hd->hp, hd->max_hp, hd->sp, hd->max_sp, hd->skillpts, hd->rename_flag, hd->vaporize, hd->autofeed, hd->hom_id)) { Sql_ShowDebug(inter->sql_handle); flag = false; } else { @@ -196,7 +196,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd) nullpo_ret(hd); memset(hd, 0, sizeof(*hd)); - if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize` FROM `%s` WHERE `homun_id`='%d'", homunculus_db, homun_id) ) + if (SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `homun_id`,`char_id`,`class`,`prev_class`,`name`,`level`,`exp`,`intimacy`,`hunger`, `str`, `agi`, `vit`, `int`, `dex`, `luk`, `hp`,`max_hp`,`sp`,`max_sp`,`skill_point`,`rename_flag`, `vaporize`, `autofeed` FROM `%s` WHERE `homun_id`='%d'", homunculus_db, homun_id)) { Sql_ShowDebug(inter->sql_handle); return false; @@ -236,6 +236,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd) SQL->GetData(inter->sql_handle, 19, &data, NULL); hd->skillpts = atoi(data); SQL->GetData(inter->sql_handle, 20, &data, NULL); hd->rename_flag = atoi(data); SQL->GetData(inter->sql_handle, 21, &data, NULL); hd->vaporize = atoi(data); + SQL->GetData(inter->sql_handle, 22, &data, NULL); hd->autofeed = atoi(data); SQL->FreeResult(inter->sql_handle); hd->intimacy = cap_value(hd->intimacy, 0, 100000); diff --git a/src/char/int_rodex.c b/src/char/int_rodex.c index 8e49da1b9..f5d036991 100644 --- a/src/char/int_rodex.c +++ b/src/char/int_rodex.c @@ -43,7 +43,7 @@ struct inter_rodex_interface *inter_rodex; // Loads new mails of this char_id/account_id static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 mail_id, struct rodex_maillist *mails) { - int i, count = 0; + int count = 0; struct rodex_message msg = { 0 }; struct SqlStmt *stmt; @@ -131,6 +131,7 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 struct item it = { 0 }; StringBuf buf; struct SqlStmt *stmt_items = SQL->StmtMalloc(inter->sql_handle); + int i; if (stmt_items == NULL) { SQL->StmtFreeResult(stmt); @@ -151,37 +152,38 @@ static int inter_rodex_fromsql(int char_id, int account_id, int8 opentype, int64 if (SQL_ERROR == SQL->StmtPrepareStr(stmt_items, StrBuf->Value(&buf)) || SQL_ERROR == SQL->StmtBindParam(stmt_items, 0, SQLDT_INT64, &msg.id, sizeof msg.id) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 0, SQLDT_SHORT, &it.nameid, sizeof it.nameid, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 1, SQLDT_SHORT, &it.amount, sizeof it.amount, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 2, SQLDT_UINT, &it.equip, sizeof it.equip, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 3, SQLDT_CHAR, &it.identify, sizeof it.identify, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 4, SQLDT_CHAR, &it.refine, sizeof it.refine, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 5, SQLDT_CHAR, &it.attribute, sizeof it.attribute, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 6, SQLDT_UINT, &it.expire_time, sizeof it.expire_time, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 7, SQLDT_UCHAR, &it.bound, sizeof it.bound, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 8, SQLDT_UINT64, &it.unique_id, sizeof it.unique_id, NULL, NULL) ) { SqlStmt_ShowDebug(stmt_items); } - for (i = 0; i < MAX_SLOTS; i++) { - if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + i, SQLDT_SHORT, &it.card[i], sizeof it.card[i], NULL, NULL)) - SqlStmt_ShowDebug(stmt_items); - } - for (i = 0; i < MAX_ITEM_OPTIONS; i++) { - if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].index, sizeof it.option[i].index, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 10 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].value, sizeof it.option[i].value, NULL, NULL) - ) { - SqlStmt_ShowDebug(stmt_items); - } - } // Read mails while (SQL_SUCCESS == SQL->StmtNextRow(stmt)) { if (msg.type & MAIL_TYPE_ITEM) { - if (SQL_ERROR == SQL->StmtExecute(stmt_items)) { + if (SQL_ERROR == SQL->StmtExecute(stmt_items) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 0, SQLDT_SHORT, &it.nameid, sizeof it.nameid, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 1, SQLDT_SHORT, &it.amount, sizeof it.amount, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 2, SQLDT_UINT, &it.equip, sizeof it.equip, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 3, SQLDT_CHAR, &it.identify, sizeof it.identify, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 4, SQLDT_CHAR, &it.refine, sizeof it.refine, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 5, SQLDT_CHAR, &it.attribute, sizeof it.attribute, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 6, SQLDT_UINT, &it.expire_time, sizeof it.expire_time, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 7, SQLDT_UCHAR, &it.bound, sizeof it.bound, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 8, SQLDT_UINT64, &it.unique_id, sizeof it.unique_id, NULL, NULL) + ) { SqlStmt_ShowDebug(stmt_items); } + for (i = 0; i < MAX_SLOTS; i++) { + if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + i, SQLDT_SHORT, &it.card[i], sizeof it.card[i], NULL, NULL)) + SqlStmt_ShowDebug(stmt_items); + } + for (i = 0; i < MAX_ITEM_OPTIONS; i++) { + if (SQL_ERROR == SQL->StmtBindColumn(stmt_items, 9 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].index, sizeof it.option[i].index, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt_items, 10 + MAX_SLOTS + i * 2, SQLDT_INT16, &it.option[i].value, sizeof it.option[i].value, NULL, NULL) + ) { + SqlStmt_ShowDebug(stmt_items); + } + } for (i = 0; i < RODEX_MAX_ITEM && SQL_SUCCESS == SQL->StmtNextRow(stmt_items); ++i) { msg.items[i].item = it; diff --git a/src/common/mmo.h b/src/common/mmo.h index 6a0e75ca5..3987ef48b 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -552,6 +552,7 @@ struct s_homunculus { //[orn] int luk_value; int8 spiritball; //for homun S [lighta] + int autofeed; }; struct s_mercenary { diff --git a/src/map/battle.c b/src/map/battle.c index 8983e93c9..70ebc4a08 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7308,6 +7308,7 @@ static const struct battle_data { { "boarding_halter_speed", &battle_config.boarding_halter_speed, 25, 0, 100, }, { "features/rodex", &battle_config.feature_rodex, 1, 0, 1, }, { "features/rodex_use_accountmail", &battle_config.feature_rodex_use_accountmail, 0, 0, 1, }, + { "features/enable_homun_autofeed", &battle_config.feature_enable_homun_autofeed, 1, 0, 1, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index 3ab3e2ddd..429249dca 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -560,6 +560,8 @@ struct Battle_Config { int feature_rodex; int feature_rodex_use_accountmail; + + int feature_enable_homun_autofeed; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 95a2d8f5d..5f7cf3b5d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9043,14 +9043,15 @@ void clif_feel_hate_reset(struct map_session_data *sd) clif->starskill(sd, "", 0, 0, 30); } -/// Equip window (un)tick ack (ZC_CONFIG). +/// Send configurations (ZC_CONFIG). /// 02d9 <type>.L <value>.L /// type: /// 0 = open equip window +/// 3 = homunculus autofeeding /// value: /// 0 = disabled /// 1 = enabled -void clif_equiptickack(struct map_session_data* sd, int flag) +void clif_zc_config(struct map_session_data* sd, int type, int flag) { int fd; nullpo_retv(sd); @@ -9058,7 +9059,7 @@ void clif_equiptickack(struct map_session_data* sd, int flag) WFIFOHEAD(fd, packet_len(0x2d9)); WFIFOW(fd, 0) = 0x2d9; - WFIFOL(fd, 2) = 0; + WFIFOL(fd, 2) = type; WFIFOL(fd, 6) = flag; WFIFOSET(fd, packet_len(0x2d9)); } @@ -15942,19 +15943,32 @@ void clif_parse_ViewPlayerEquip(int fd, struct map_session_data* sd) { clif->msgtable(sd, MSG_EQUIP_NOT_PUBLIC); } -void clif_parse_EquipTick(int fd, struct map_session_data* sd) __attribute__((nonnull (2))); -/// Request to change equip window tick (CZ_CONFIG). +void clif_parse_cz_config(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +/// Receive configurations (CZ_CONFIG). /// 02d8 <type>.L <value>.L /// type: /// 0 = open equip window +/// 3 = homunculus autofeeding /// value: /// 0 = disabled /// 1 = enabled -void clif_parse_EquipTick(int fd, struct map_session_data* sd) -{ - bool flag = (RFIFOL(fd,6) != 0) ? true : false; - sd->status.show_equip = flag; - clif->equiptickack(sd, flag); +void clif_parse_cz_config(int fd, struct map_session_data *sd) +{ + int type = RFIFOL(fd, 2); + int flag = RFIFOL(fd, 6); + + if (type == CZ_CONFIG_OPEN_EQUIPMENT_WINDOW) { + sd->status.show_equip = flag; + } else if (type == CZ_CONFIG_HOMUNCULUS_AUTOFEEDING) { + struct homun_data *hd; + hd = sd->hd; + nullpo_retv(hd); + hd->homunculus.autofeed = flag; + } else { + ShowWarning("clif_parse_cz_config: Unsupported type has been received (%d).", type); + return; + } + clif->zc_config(sd, type, flag); } void clif_parse_PartyTick(int fd, struct map_session_data* sd) __attribute__((nonnull (2))); @@ -20344,7 +20358,7 @@ void clif_defaults(void) { clif->mission_info = clif_mission_info; clif->feel_hate_reset = clif_feel_hate_reset; clif->partytickack = clif_partytickack; - clif->equiptickack = clif_equiptickack; + clif->zc_config = clif_zc_config; clif->viewequip_ack = clif_viewequip_ack; clif->equpcheckbox = clif_equpcheckbox; clif->displayexp = clif_displayexp; @@ -20869,7 +20883,7 @@ void clif_defaults(void) { clif->pAdopt_request = clif_parse_Adopt_request; clif->pAdopt_reply = clif_parse_Adopt_reply; clif->pViewPlayerEquip = clif_parse_ViewPlayerEquip; - clif->pEquipTick = clif_parse_EquipTick; + clif->p_cz_config = clif_parse_cz_config; clif->pquestStateAck = clif_parse_questStateAck; clif->pmercenary_action = clif_parse_mercenary_action; clif->pBattleChat = clif_parse_BattleChat; diff --git a/src/map/clif.h b/src/map/clif.h index 112db3dec..e348bbb08 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -563,7 +563,15 @@ enum clif_unittype { CLUT_MERCNARY = 0x9, CLUT_ELEMENTAL = 0xa, }; - +/** +* Receive configuration types +**/ +enum CZ_CONFIG { + CZ_CONFIG_OPEN_EQUIPMENT_WINDOW = 0, + // Unknown = 1, + CZ_CONFIG_PET_AUTOFEEDING = 2, + CZ_CONFIG_HOMUNCULUS_AUTOFEEDING = 3, +}; /** * Structures **/ @@ -781,7 +789,7 @@ struct clif_interface { void (*mission_info) (struct map_session_data *sd, int mob_id, unsigned char progress); void (*feel_hate_reset) (struct map_session_data *sd); void (*partytickack) (struct map_session_data* sd, bool flag); - void (*equiptickack) (struct map_session_data* sd, int flag); + void (*zc_config) (struct map_session_data *sd, int type, int flag); void (*viewequip_ack) (struct map_session_data* sd, struct map_session_data* tsd); void (*equpcheckbox) (struct map_session_data* sd); void (*displayexp) (struct map_session_data *sd, uint64 exp, char type, bool is_quest); @@ -1302,7 +1310,7 @@ struct clif_interface { void (*pAdopt_request) (int fd, struct map_session_data *sd); void (*pAdopt_reply) (int fd, struct map_session_data *sd); void (*pViewPlayerEquip) (int fd, struct map_session_data* sd); - void (*pEquipTick) (int fd, struct map_session_data* sd); + void (*p_cz_config) (int fd, struct map_session_data *sd); void (*pquestStateAck) (int fd, struct map_session_data * sd); void (*pmercenary_action) (int fd, struct map_session_data* sd); void (*pBattleChat) (int fd, struct map_session_data* sd); diff --git a/src/map/homunculus.c b/src/map/homunculus.c index ddaf3443a..9f5756885 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -683,7 +683,12 @@ int homunculus_hunger_timer(int tid, int64 tick, int id, intptr_t data) { } else if(hd->homunculus.hunger == 75) { clif->emotion(&hd->bl, E_OK); } - + if (battle_config.feature_enable_homun_autofeed != 0) { + if (hd->homunculus.autofeed) { + if (hd->homunculus.hunger < 30) + homun->feed(sd, hd); + } + } if(hd->homunculus.hunger < 0) { hd->homunculus.hunger = 0; // Delete the homunculus if intimacy <= 100 diff --git a/src/map/npc.c b/src/map/npc.c index 10ff4ebf2..d3dfb39d2 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2708,7 +2708,7 @@ struct npc_data *npc_create_npc(enum npc_subtype subtype, int m, int x, int y, u nd->area_size = AREA_SIZE + 1; nd->class_ = class_; nd->speed = 200; - nd->vd.class = 0; + nd->vd = npc_viewdb[0]; // Copy INVISIBLE_CLASS view data. Actual view data is set by npc->add_to_location() later. return nd; } diff --git a/src/map/packets.h b/src/map/packets.h index 3fcf1648a..b95ae65cf 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1151,7 +1151,7 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x02d5,2); packet(0x02d6,6,clif->pViewPlayerEquip,2); packet(0x02d7,-1); - packet(0x02d8,10,clif->pEquipTick,6); + packet(0x02d8,10,clif->p_cz_config,6); packet(0x02d9,10); packet(0x02da,3); packet(0x02db,-1,clif->pBattleChat,2,4); diff --git a/src/map/skill.c b/src/map/skill.c index 1bf1880e8..88a29b9a8 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -231,17 +231,20 @@ int skill_get_range(int skill_id, int skill_lv) int skill_get_splash(int skill_id, int skill_lv) { - int idx; + int idx, val; if (skill_id == 0) return 0; idx = skill->get_index(skill_id); Assert_ret(idx != 0); Assert_ret(skill_lv > 0); + val = skill->dbs->db[idx].splash[skill_get_lvl_idx(skill_lv)]; + if (val < 0) { + val = AREA_SIZE; + } if (skill_lv > MAX_SKILL_LEVEL) { - int val = skill->dbs->db[idx].splash[skill_get_lvl_idx(skill_lv)]; return skill_adjust_over_level(val, skill_lv, skill->dbs->db[idx].max); } - return skill->dbs->db[idx].splash[skill_get_lvl_idx(skill_lv)]; + return val; } int skill_get_hp(int skill_id, int skill_lv) diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 3948221c8..4204be2e4 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1174,8 +1174,8 @@ typedef void (*HPMHOOK_pre_clif_feel_hate_reset) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_feel_hate_reset) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_partytickack) (struct map_session_data **sd, bool *flag); typedef void (*HPMHOOK_post_clif_partytickack) (struct map_session_data *sd, bool flag); -typedef void (*HPMHOOK_pre_clif_equiptickack) (struct map_session_data **sd, int *flag); -typedef void (*HPMHOOK_post_clif_equiptickack) (struct map_session_data *sd, int flag); +typedef void (*HPMHOOK_pre_clif_zc_config) (struct map_session_data **sd, int *type, int *flag); +typedef void (*HPMHOOK_post_clif_zc_config) (struct map_session_data *sd, int type, int flag); typedef void (*HPMHOOK_pre_clif_viewequip_ack) (struct map_session_data **sd, struct map_session_data **tsd); typedef void (*HPMHOOK_post_clif_viewequip_ack) (struct map_session_data *sd, struct map_session_data *tsd); typedef void (*HPMHOOK_pre_clif_equpcheckbox) (struct map_session_data **sd); @@ -2132,8 +2132,8 @@ typedef void (*HPMHOOK_pre_clif_pAdopt_reply) (int *fd, struct map_session_data typedef void (*HPMHOOK_post_clif_pAdopt_reply) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pViewPlayerEquip) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pViewPlayerEquip) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_pEquipTick) (int *fd, struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_pEquipTick) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_p_cz_config) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_p_cz_config) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pquestStateAck) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pquestStateAck) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pmercenary_action) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 3f5d1096e..cc097aeae 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -810,8 +810,8 @@ struct { struct HPMHookPoint *HP_clif_feel_hate_reset_post; struct HPMHookPoint *HP_clif_partytickack_pre; struct HPMHookPoint *HP_clif_partytickack_post; - struct HPMHookPoint *HP_clif_equiptickack_pre; - struct HPMHookPoint *HP_clif_equiptickack_post; + struct HPMHookPoint *HP_clif_zc_config_pre; + struct HPMHookPoint *HP_clif_zc_config_post; struct HPMHookPoint *HP_clif_viewequip_ack_pre; struct HPMHookPoint *HP_clif_viewequip_ack_post; struct HPMHookPoint *HP_clif_equpcheckbox_pre; @@ -1768,8 +1768,8 @@ struct { struct HPMHookPoint *HP_clif_pAdopt_reply_post; struct HPMHookPoint *HP_clif_pViewPlayerEquip_pre; struct HPMHookPoint *HP_clif_pViewPlayerEquip_post; - struct HPMHookPoint *HP_clif_pEquipTick_pre; - struct HPMHookPoint *HP_clif_pEquipTick_post; + struct HPMHookPoint *HP_clif_p_cz_config_pre; + struct HPMHookPoint *HP_clif_p_cz_config_post; struct HPMHookPoint *HP_clif_pquestStateAck_pre; struct HPMHookPoint *HP_clif_pquestStateAck_post; struct HPMHookPoint *HP_clif_pmercenary_action_pre; @@ -7019,8 +7019,8 @@ struct { int HP_clif_feel_hate_reset_post; int HP_clif_partytickack_pre; int HP_clif_partytickack_post; - int HP_clif_equiptickack_pre; - int HP_clif_equiptickack_post; + int HP_clif_zc_config_pre; + int HP_clif_zc_config_post; int HP_clif_viewequip_ack_pre; int HP_clif_viewequip_ack_post; int HP_clif_equpcheckbox_pre; @@ -7977,8 +7977,8 @@ struct { int HP_clif_pAdopt_reply_post; int HP_clif_pViewPlayerEquip_pre; int HP_clif_pViewPlayerEquip_post; - int HP_clif_pEquipTick_pre; - int HP_clif_pEquipTick_post; + int HP_clif_p_cz_config_pre; + int HP_clif_p_cz_config_post; int HP_clif_pquestStateAck_pre; int HP_clif_pquestStateAck_post; int HP_clif_pmercenary_action_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 7cc9086ba..7caf25de6 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -427,7 +427,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->mission_info, HP_clif_mission_info) }, { HP_POP(clif->feel_hate_reset, HP_clif_feel_hate_reset) }, { HP_POP(clif->partytickack, HP_clif_partytickack) }, - { HP_POP(clif->equiptickack, HP_clif_equiptickack) }, + { HP_POP(clif->zc_config, HP_clif_zc_config) }, { HP_POP(clif->viewequip_ack, HP_clif_viewequip_ack) }, { HP_POP(clif->equpcheckbox, HP_clif_equpcheckbox) }, { HP_POP(clif->displayexp, HP_clif_displayexp) }, @@ -906,7 +906,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pAdopt_request, HP_clif_pAdopt_request) }, { HP_POP(clif->pAdopt_reply, HP_clif_pAdopt_reply) }, { HP_POP(clif->pViewPlayerEquip, HP_clif_pViewPlayerEquip) }, - { HP_POP(clif->pEquipTick, HP_clif_pEquipTick) }, + { HP_POP(clif->p_cz_config, HP_clif_p_cz_config) }, { HP_POP(clif->pquestStateAck, HP_clif_pquestStateAck) }, { HP_POP(clif->pmercenary_action, HP_clif_pmercenary_action) }, { HP_POP(clif->pBattleChat, HP_clif_pBattleChat) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9625d3e52..4340f8dbd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -10524,14 +10524,14 @@ void HP_clif_partytickack(struct map_session_data *sd, bool flag) { } return; } -void HP_clif_equiptickack(struct map_session_data *sd, int flag) { +void HP_clif_zc_config(struct map_session_data *sd, int type, int flag) { int hIndex = 0; - if (HPMHooks.count.HP_clif_equiptickack_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd, int *flag); + if (HPMHooks.count.HP_clif_zc_config_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *type, int *flag); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_equiptickack_pre[hIndex].func; - preHookFunc(&sd, &flag); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_zc_config_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_zc_config_pre[hIndex].func; + preHookFunc(&sd, &type, &flag); } if (*HPMforce_return) { *HPMforce_return = false; @@ -10539,13 +10539,13 @@ void HP_clif_equiptickack(struct map_session_data *sd, int flag) { } } { - HPMHooks.source.clif.equiptickack(sd, flag); + HPMHooks.source.clif.zc_config(sd, type, flag); } - if (HPMHooks.count.HP_clif_equiptickack_post > 0) { - void (*postHookFunc) (struct map_session_data *sd, int flag); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_equiptickack_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_equiptickack_post[hIndex].func; - postHookFunc(sd, flag); + if (HPMHooks.count.HP_clif_zc_config_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int type, int flag); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_zc_config_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_zc_config_post[hIndex].func; + postHookFunc(sd, type, flag); } } return; @@ -23005,13 +23005,13 @@ void HP_clif_pViewPlayerEquip(int fd, struct map_session_data *sd) { } return; } -void HP_clif_pEquipTick(int fd, struct map_session_data *sd) { +void HP_clif_p_cz_config(int fd, struct map_session_data *sd) { int hIndex = 0; - if (HPMHooks.count.HP_clif_pEquipTick_pre > 0) { + if (HPMHooks.count.HP_clif_p_cz_config_pre > 0) { void (*preHookFunc) (int *fd, struct map_session_data **sd); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_clif_pEquipTick_pre[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_p_cz_config_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_p_cz_config_pre[hIndex].func; preHookFunc(&fd, &sd); } if (*HPMforce_return) { @@ -23020,12 +23020,12 @@ void HP_clif_pEquipTick(int fd, struct map_session_data *sd) { } } { - HPMHooks.source.clif.pEquipTick(fd, sd); + HPMHooks.source.clif.p_cz_config(fd, sd); } - if (HPMHooks.count.HP_clif_pEquipTick_post > 0) { + if (HPMHooks.count.HP_clif_p_cz_config_post > 0) { void (*postHookFunc) (int fd, struct map_session_data *sd); - for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pEquipTick_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_clif_pEquipTick_post[hIndex].func; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_p_cz_config_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_p_cz_config_post[hIndex].func; postHookFunc(fd, sd); } } |