From 781011398ba501a50e120d6ad8dc86d155c8ce9e Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sun, 24 Feb 2019 17:27:32 -0300 Subject: Regenerate HPM Hook --- src/common/HPMDataCheck.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 2e961bff6..02d6c9631 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -591,8 +591,12 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "mob_chat", sizeof(struct mob_chat), SERVER_TYPE_MAP }, { "mob_data", sizeof(struct mob_data), SERVER_TYPE_MAP }, { "mob_db", sizeof(struct mob_db), SERVER_TYPE_MAP }, + { "mob_drop", sizeof(struct mob_drop), SERVER_TYPE_MAP }, { "mob_interface", sizeof(struct mob_interface), SERVER_TYPE_MAP }, { "mob_skill", sizeof(struct mob_skill), SERVER_TYPE_MAP }, + { "optdrop_group", sizeof(struct optdrop_group), SERVER_TYPE_MAP }, + { "optdrop_group_option", sizeof(struct optdrop_group_option), SERVER_TYPE_MAP }, + { "optdrop_group_optslot", sizeof(struct optdrop_group_optslot), SERVER_TYPE_MAP }, { "spawn_info", sizeof(struct spawn_info), SERVER_TYPE_MAP }, #else #define MAP_MOB_H -- cgit v1.2.3-70-g09d2 From 617ab72478b02fe514c70c8ea9b35f38f3047053 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Sun, 21 Apr 2019 17:13:57 +0100 Subject: Update MSVC version naming in console info --- src/common/sysinfo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index b8cb2a90a..e3977f440 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2019 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -221,8 +221,12 @@ enum windows_ver_suite { #define SYSINFO_COMPILER "Microsoft Visual C++ 2012 (v" EXPAND_AND_QUOTE(_MSC_VER) ")" #elif _MSC_VER >= 1800 && _MSC_VER < 1900 #define SYSINFO_COMPILER "Microsoft Visual C++ 2013 (v" EXPAND_AND_QUOTE(_MSC_VER) ")" -#elif _MSC_VER >= 1900 && _MSC_VER < 2000 +#elif _MSC_VER >= 1900 && _MSC_VER < 1910 #define SYSINFO_COMPILER "Microsoft Visual C++ 2015 (v" EXPAND_AND_QUOTE(_MSC_VER) ")" +#elif _MSC_VER >= 1910 && _MSC_VER < 1920 +#define SYSINFO_COMPILER "Microsoft Visual C++ 2017 (v" EXPAND_AND_QUOTE(_MSC_VER) ")" +#elif _MSC_VER >= 1920 && _MSC_VER < 2000 +#define SYSINFO_COMPILER "Microsoft Visual C++ 2019 (v" EXPAND_AND_QUOTE(_MSC_VER) ")" #else // < 1300 || >= 2000 #define SYSINFO_COMPILER "Microsoft Visual C++ v" EXPAND_AND_QUOTE(_MSC_VER) #endif -- cgit v1.2.3-70-g09d2 From bfb71659256c92846ace82692f55b164da56c792 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 10 Apr 2019 19:12:21 +0300 Subject: Update packets table to 2019-05-02 --- src/common/packets/packets2019_len_main.h | 25 +++++++++++--- src/common/packets/packets2019_len_re.h | 25 +++++++++++--- src/common/packets/packets2019_len_zero.h | 54 ++++++++++++++++++++++++++++--- 3 files changed, 92 insertions(+), 12 deletions(-) (limited to 'src/common') diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index 79c8d3f51..f55db7cd0 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -3793,7 +3793,7 @@ packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES // Packet: 0x0a48 -packetLen(0x0a48, 2) +packetLen(0x0a48, 2) // CZ_STYLE_CLOSE // Packet: 0x0a49 packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST @@ -3949,7 +3949,7 @@ packetLen(0x0a86, -1) packetLen(0x0a87, -1) // Packet: 0x0a88 -packetLen(0x0a88, 2) +packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET // Packet: 0x0a89 packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE @@ -4210,7 +4210,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT // Packet: 0x0adf -packetLen(0x0adf, 58) // ZC_ACK_REQNAME +packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE // Packet: 0x0ae0 packetLen(0x0ae0, 30) @@ -4426,11 +4426,28 @@ packetLen(0x0b22, 6) #endif // Packet: 0x0b23 -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190417 +packetLen(0x0b23, 6) +#elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 packetLen(0x0b23, 10) #endif +// Packet: 0x0b24 +#if PACKETVER >= 20190417 +packetLen(0x0b24, 6) +#endif + +// Packet: 0x0b25 +#if PACKETVER >= 20190417 +packetLen(0x0b25, 6) +#endif + +// Packet: 0x0b26 +#if PACKETVER >= 20190417 +packetLen(0x0b26, 18) +#endif + #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index c43b65cd9..2f68261cd 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -3799,7 +3799,7 @@ packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES // Packet: 0x0a48 -packetLen(0x0a48, 2) +packetLen(0x0a48, 2) // CZ_STYLE_CLOSE // Packet: 0x0a49 packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST @@ -3955,7 +3955,7 @@ packetLen(0x0a86, -1) packetLen(0x0a87, -1) // Packet: 0x0a88 -packetLen(0x0a88, 2) +packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET // Packet: 0x0a89 packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE @@ -4216,7 +4216,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT // Packet: 0x0adf -packetLen(0x0adf, 58) // ZC_ACK_REQNAME +packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE // Packet: 0x0ae0 packetLen(0x0ae0, 30) @@ -4432,11 +4432,28 @@ packetLen(0x0b22, 6) #endif // Packet: 0x0b23 -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190417 +packetLen(0x0b23, 6) +#elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 packetLen(0x0b23, 10) #endif +// Packet: 0x0b24 +#if PACKETVER >= 20190417 +packetLen(0x0b24, 6) +#endif + +// Packet: 0x0b25 +#if PACKETVER >= 20190417 +packetLen(0x0b25, 6) +#endif + +// Packet: 0x0b26 +#if PACKETVER >= 20190417 +packetLen(0x0b26, 18) +#endif + #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 85098505a..24abdb7bd 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -3793,7 +3793,7 @@ packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES // Packet: 0x0a48 -packetLen(0x0a48, 2) +packetLen(0x0a48, 2) // CZ_STYLE_CLOSE // Packet: 0x0a49 packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST @@ -3946,10 +3946,10 @@ packetLen(0x0a85, 82) packetLen(0x0a86, -1) // Packet: 0x0a87 -packetLen(0x0a87, -1) +packetLen(0x0a87, -1) // ZC_BAN_LIST // Packet: 0x0a88 -packetLen(0x0a88, 2) +packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET // Packet: 0x0a89 packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE @@ -4210,7 +4210,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT // Packet: 0x0adf -packetLen(0x0adf, 58) // ZC_ACK_REQNAME +packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE // Packet: 0x0ae0 packetLen(0x0ae0, 30) @@ -4417,5 +4417,51 @@ packetLen(0x0b21, 13) packetLen(0x0b22, 5) #endif +// Packet: 0x0b23 +#if PACKETVER >= 20190410 +packetLen(0x0b23, 6) +#endif + +// Packet: 0x0b24 +#if PACKETVER >= 20190424 +packetLen(0x0b24, 6) +#endif + +// Packet: 0x0b25 +#if PACKETVER >= 20190424 +packetLen(0x0b25, 6) +#endif + +// Packet: 0x0b26 +#if PACKETVER >= 20190424 +packetLen(0x0b26, 16) +#endif + +// Packet: 0x0b27 +#if PACKETVER >= 20190502 +packetLen(0x0b27, -1) +#elif PACKETVER >= 20190424 +packetLen(0x0b27, 2) +#endif + +// Packet: 0x0b28 +#if PACKETVER >= 20190502 +packetLen(0x0b28, 22) +#elif PACKETVER >= 20190424 +packetLen(0x0b28, -1) +#endif + +// Packet: 0x0b29 +#if PACKETVER >= 20190502 +packetLen(0x0b29, 6) +#elif PACKETVER >= 20190424 +packetLen(0x0b29, 3) +#endif + +// Packet: 0x0b2a +#if PACKETVER >= 20190502 +packetLen(0x0b2a, 6) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ -- cgit v1.2.3-70-g09d2 From 4a47644d930184ed8eb6c23291d2d37b3cba9ac1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Apr 2019 20:19:10 +0300 Subject: Update HPM --- src/common/HPMDataCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 02d6c9631..506881467 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -671,6 +671,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ACK_OPEN_WRITE_MAIL", sizeof(struct PACKET_ZC_ACK_OPEN_WRITE_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REMOVE_ITEM_MAIL", sizeof(struct PACKET_ZC_ACK_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQMAKINGITEM", sizeof(struct PACKET_ZC_ACK_REQMAKINGITEM), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_REQNAMEALL", sizeof(struct PACKET_ZC_ACK_REQNAMEALL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_SCHEDULER_CASHITEM", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_TOUSESKILL", sizeof(struct PACKET_ZC_ACK_TOUSESKILL), SERVER_TYPE_MAP }, @@ -799,7 +800,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_quest_update_header", sizeof(struct packet_quest_update_header), SERVER_TYPE_MAP }, { "packet_quest_update_hunt", sizeof(struct packet_quest_update_hunt), SERVER_TYPE_MAP }, { "packet_reqname_ack", sizeof(struct packet_reqname_ack), SERVER_TYPE_MAP }, - { "packet_reqnameall_ack", sizeof(struct packet_reqnameall_ack), SERVER_TYPE_MAP }, { "packet_roulette_close_ack", sizeof(struct packet_roulette_close_ack), SERVER_TYPE_MAP }, { "packet_roulette_generate_ack", sizeof(struct packet_roulette_generate_ack), SERVER_TYPE_MAP }, { "packet_roulette_info_ack", sizeof(struct packet_roulette_info_ack), SERVER_TYPE_MAP }, -- cgit v1.2.3-70-g09d2 From 7a95d8dfe44a37759dab2bef67c65ef5f1786ff4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Apr 2019 02:09:46 +0300 Subject: Add char_id into struct guild_expulsion Also use char_id in packet ZC_BAN_LIST. --- src/char/int_guild.c | 12 +++++++----- src/common/mmo.h | 1 + src/map/clif.c | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/char/int_guild.c b/src/char/int_guild.c index aabf562a2..8e05c76e2 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -319,8 +319,8 @@ static int inter_guild_tosql(struct guild *g, int flag) SQL->EscapeStringLen(inter->sql_handle, esc_name, e->name, strnlen(e->name, NAME_LENGTH)); SQL->EscapeStringLen(inter->sql_handle, esc_mes, e->mes, strnlen(e->mes, sizeof(e->mes))); - if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`guild_id`,`account_id`,`name`,`mes`) " - "VALUES ('%d','%d','%s','%s')", guild_expulsion_db, g->guild_id, e->account_id, esc_name, esc_mes) ) + if( SQL_ERROR == SQL->Query(inter->sql_handle, "REPLACE INTO `%s` (`guild_id`,`account_id`, `char_id`, `name`,`mes`) " + "VALUES ('%d','%d','%d','%s','%s')", guild_expulsion_db, g->guild_id, e->account_id, e->char_id, esc_name, esc_mes) ) Sql_ShowDebug(inter->sql_handle); } } @@ -494,7 +494,7 @@ static struct guild *inter_guild_fromsql(int guild_id) } //printf("- Read guild_expulsion %d from sql \n",guild_id); - if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `account_id`,`name`,`mes` FROM `%s` WHERE `guild_id`='%d'", guild_expulsion_db, guild_id) ) + if( SQL_ERROR == SQL->Query(inter->sql_handle, "SELECT `account_id`,`char_id`,`name`,`mes` FROM `%s` WHERE `guild_id`='%d'", guild_expulsion_db, guild_id) ) { Sql_ShowDebug(inter->sql_handle); aFree(g); @@ -505,8 +505,9 @@ static struct guild *inter_guild_fromsql(int guild_id) struct guild_expulsion *e = &g->expulsion[i]; SQL->GetData(inter->sql_handle, 0, &data, NULL); e->account_id = atoi(data); - SQL->GetData(inter->sql_handle, 1, &data, &len); memcpy(e->name, data, min(len, NAME_LENGTH)); - SQL->GetData(inter->sql_handle, 2, &data, &len); memcpy(e->mes, data, min(len, sizeof(e->mes))); + SQL->GetData(inter->sql_handle, 1, &data, NULL); e->char_id = atoi(data); + SQL->GetData(inter->sql_handle, 2, &data, &len); memcpy(e->name, data, min(len, NAME_LENGTH)); + SQL->GetData(inter->sql_handle, 3, &data, &len); memcpy(e->mes, data, min(len, sizeof(e->mes))); } //printf("- Read guild_skill %d from sql \n",guild_id); @@ -1044,6 +1045,7 @@ static bool inter_guild_leave(int guild_id, int account_id, int char_id, int fla } // Save the expulsion entry g->expulsion[j].account_id = account_id; + g->expulsion[j].char_id = char_id; safestrncpy(g->expulsion[j].name, g->member[i].name, NAME_LENGTH); safestrncpy(g->expulsion[j].mes, mes, 40); } diff --git a/src/common/mmo.h b/src/common/mmo.h index a29b0f2db..aafa54008 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -856,6 +856,7 @@ struct guild_expulsion { char name[NAME_LENGTH]; char mes[40]; int account_id; + int char_id; }; struct guild_skill { diff --git a/src/map/clif.c b/src/map/clif.c index a7bcc5801..336bbb752 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8405,6 +8405,7 @@ static void clif_guild_expulsion(struct map_session_data *sd, const char *name, #endif safestrncpy(&p.reason[0], mes, 40); +// version unconfirmed #if PACKETVER < 20100803 memset(&p.account_name, 0, NAME_LENGTH); // account name (not used for security reasons) #endif @@ -8437,7 +8438,7 @@ static void clif_guild_expulsionlist(struct map_session_data *sd) if (e->account_id > 0) { #if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO) - packet->chars[c].char_id = 0; // for now char_id unknown [4144] + packet->chars[c].char_id = e->char_id; // version unconfirmed #elif PACKETVER >= 20100803 memcpy(packet->chars[c].char_name, e->name, NAME_LENGTH); -- cgit v1.2.3-70-g09d2 From b8ce5e9e1352abc45b08f92eb50890f202b1b230 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 May 2019 01:13:24 +0300 Subject: Disable packet validation in socket_datasync --- src/common/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/socket.c b/src/common/socket.c index dc5b06da0..8ee4f06e2 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1856,7 +1856,7 @@ static void socket_datasync(int fd, bool send) WFIFOL(fd, 4 + ( i * 4 ) ) = data_list[i].length; } - WFIFOSET(fd, p_len); + WFIFOSET2(fd, p_len); } else { for( i = 0; i < alen; i++ ) { if( RFIFOL(fd, 4 + (i * 4) ) != data_list[i].length ) { @@ -1865,7 +1865,7 @@ static void socket_datasync(int fd, bool send) WFIFOW(fd, 0) = 0x2b0a; WFIFOW(fd, 2) = 8; WFIFOL(fd, 4) = 0; - WFIFOSET(fd, 8); + WFIFOSET2(fd, 8); sockt->flush(fd); /* shut down */ ShowFatalError("Servers are out of sync! recompile from scratch (%d)\n",i); -- cgit v1.2.3-70-g09d2 From 5ec0ae118f30823a83818ac912457b92541cb570 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 5 May 2019 23:23:53 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/common/HPMDataCheck.h | 4 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 36 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 72 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 18 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 468 +++++++++++++++++++++ 5 files changed, 598 insertions(+) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 506881467..966e63d29 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -671,6 +671,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ACK_OPEN_WRITE_MAIL", sizeof(struct PACKET_ZC_ACK_OPEN_WRITE_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REMOVE_ITEM_MAIL", sizeof(struct PACKET_ZC_ACK_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQMAKINGITEM", sizeof(struct PACKET_ZC_ACK_REQMAKINGITEM), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_REQNAME_TITLE", sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQNAMEALL", sizeof(struct PACKET_ZC_ACK_REQNAMEALL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_SCHEDULER_CASHITEM", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub), SERVER_TYPE_MAP }, @@ -682,6 +683,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_ZC_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_ITEM_TO_STORE", sizeof(struct PACKET_ZC_ADD_ITEM_TO_STORE), SERVER_TYPE_MAP }, { "PACKET_ZC_ADD_MEMBER_TO_GROUP", sizeof(struct PACKET_ZC_ADD_MEMBER_TO_GROUP), SERVER_TYPE_MAP }, + { "PACKET_ZC_BAN_LIST", sizeof(struct PACKET_ZC_BAN_LIST), SERVER_TYPE_MAP }, + { "PACKET_ZC_BAN_LIST_sub", sizeof(struct PACKET_ZC_BAN_LIST_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_CASH_ITEM_DELETE", sizeof(struct PACKET_ZC_CASH_ITEM_DELETE), SERVER_TYPE_MAP }, { "PACKET_ZC_CASH_TIME_COUNTER", sizeof(struct PACKET_ZC_CASH_TIME_COUNTER), SERVER_TYPE_MAP }, { "PACKET_ZC_CHECKNAME", sizeof(struct PACKET_ZC_CHECKNAME), SERVER_TYPE_MAP }, @@ -730,6 +733,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_REMOVE_EFFECT", sizeof(struct PACKET_ZC_REMOVE_EFFECT), SERVER_TYPE_MAP }, { "PACKET_ZC_REPAIRITEMLIST", sizeof(struct PACKET_ZC_REPAIRITEMLIST), SERVER_TYPE_MAP }, { "PACKET_ZC_REPAIRITEMLIST_sub", sizeof(struct PACKET_ZC_REPAIRITEMLIST_sub), SERVER_TYPE_MAP }, + { "PACKET_ZC_ROLE_CHANGE", sizeof(struct PACKET_ZC_ROLE_CHANGE), SERVER_TYPE_MAP }, { "PACKET_ZC_SEARCH_STORE_INFO_ACK", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_SEARCH_STORE_INFO_ACK_sub", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 374a1bcc4..715e19a48 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1380,6 +1380,30 @@ typedef void (*HPMHOOK_pre_clif_changed_dir) (struct block_list **bl, enum send_ typedef void (*HPMHOOK_post_clif_changed_dir) (struct block_list *bl, enum send_target target); typedef void (*HPMHOOK_pre_clif_blname_ack) (int *fd, struct block_list **bl); typedef void (*HPMHOOK_post_clif_blname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_pcname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_pcname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_homname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_homname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_mername_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_mername_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_petname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_petname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_npcname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_npcname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_mobname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_mobname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_mobname_guardian_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_mobname_guardian_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_mobname_additional_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_mobname_additional_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_mobname_normal_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_mobname_normal_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_chatname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_chatname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_elemname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_elemname_ack) (int fd, struct block_list *bl); +typedef void (*HPMHOOK_pre_clif_unknownname_ack) (int *fd, struct block_list **bl); +typedef void (*HPMHOOK_post_clif_unknownname_ack) (int fd, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_monster_hp_bar) (struct mob_data **md, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_monster_hp_bar) (struct mob_data *md, struct map_session_data *sd); typedef int (*HPMHOOK_pre_clif_hpmeter) (struct map_session_data **sd); @@ -1566,6 +1590,8 @@ typedef void (*HPMHOOK_pre_clif_addchat) (struct chat_data **cd, struct map_sess typedef void (*HPMHOOK_post_clif_addchat) (struct chat_data *cd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_changechatowner) (struct chat_data **cd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_changechatowner) (struct chat_data *cd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_chatRoleChange) (struct chat_data **cd, struct map_session_data **sd, struct block_list **bl, int *isNotOwner); +typedef void (*HPMHOOK_post_clif_chatRoleChange) (struct chat_data *cd, struct map_session_data *sd, struct block_list *bl, int isNotOwner); typedef void (*HPMHOOK_pre_clif_clearchat) (struct chat_data **cd, int *fd); typedef void (*HPMHOOK_post_clif_clearchat) (struct chat_data *cd, int fd); typedef void (*HPMHOOK_pre_clif_leavechat) (struct chat_data **cd, struct map_session_data **sd, bool *flag); @@ -2024,6 +2050,8 @@ typedef bool (*HPMHOOK_pre_clif_parse_roulette_db) (void); typedef bool (*HPMHOOK_post_clif_parse_roulette_db) (bool retVal___); typedef void (*HPMHOOK_pre_clif_roulette_generate_ack) (struct map_session_data **sd, enum GENERATE_ROULETTE_ACK *result, short *stage, short *prizeIdx, int *bonusItemID); typedef void (*HPMHOOK_post_clif_roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); +typedef void (*HPMHOOK_pre_clif_roulette_close) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_roulette_close) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_openmergeitem) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_openmergeitem) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_cancelmergeitem) (int *fd, struct map_session_data **sd); @@ -2032,6 +2060,8 @@ typedef int (*HPMHOOK_pre_clif_comparemergeitem) (const void **a, const void **b typedef int (*HPMHOOK_post_clif_comparemergeitem) (int retVal___, const void *a, const void *b); typedef void (*HPMHOOK_pre_clif_ackmergeitems) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_ackmergeitems) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_mergeitems) (int *fd, struct map_session_data **sd, int *index, int *amount, enum mergeitem_reason *reason); +typedef void (*HPMHOOK_post_clif_mergeitems) (int fd, struct map_session_data *sd, int index, int amount, enum mergeitem_reason reason); typedef bool (*HPMHOOK_pre_clif_isdisguised) (struct block_list **bl); typedef bool (*HPMHOOK_post_clif_isdisguised) (bool retVal___, struct block_list *bl); typedef void (*HPMHOOK_pre_clif_navigate_to) (struct map_session_data **sd, const char **mapname, uint16 *x, uint16 *y, uint8 *flag, bool *hideWindow, uint16 *mob_id); @@ -2476,6 +2506,8 @@ typedef void (*HPMHOOK_pre_clif_pPartyTick) (int *fd, struct map_session_data ** typedef void (*HPMHOOK_post_clif_pPartyTick) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pGuildInvite2) (int *fd, struct map_session_data **sd); 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_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); @@ -2666,6 +2698,10 @@ typedef int (*HPMHOOK_pre_clif_pingTimerSub) (struct map_session_data **sd, va_l typedef int (*HPMHOOK_post_clif_pingTimerSub) (int retVal___, struct map_session_data *sd, va_list ap); typedef void (*HPMHOOK_pre_clif_pResetCooldown) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pResetCooldown) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_loadConfirm) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_loadConfirm) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_send_selforarea) (int *fd, struct block_list **bl, const void **buf, int *len); +typedef void (*HPMHOOK_post_clif_send_selforarea) (int fd, struct block_list *bl, const void *buf, int len); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index d3b4ff504..671d8ad8a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -970,6 +970,30 @@ struct { struct HPMHookPoint *HP_clif_changed_dir_post; struct HPMHookPoint *HP_clif_blname_ack_pre; struct HPMHookPoint *HP_clif_blname_ack_post; + struct HPMHookPoint *HP_clif_pcname_ack_pre; + struct HPMHookPoint *HP_clif_pcname_ack_post; + struct HPMHookPoint *HP_clif_homname_ack_pre; + struct HPMHookPoint *HP_clif_homname_ack_post; + struct HPMHookPoint *HP_clif_mername_ack_pre; + struct HPMHookPoint *HP_clif_mername_ack_post; + struct HPMHookPoint *HP_clif_petname_ack_pre; + struct HPMHookPoint *HP_clif_petname_ack_post; + struct HPMHookPoint *HP_clif_npcname_ack_pre; + struct HPMHookPoint *HP_clif_npcname_ack_post; + struct HPMHookPoint *HP_clif_mobname_ack_pre; + struct HPMHookPoint *HP_clif_mobname_ack_post; + struct HPMHookPoint *HP_clif_mobname_guardian_ack_pre; + struct HPMHookPoint *HP_clif_mobname_guardian_ack_post; + struct HPMHookPoint *HP_clif_mobname_additional_ack_pre; + struct HPMHookPoint *HP_clif_mobname_additional_ack_post; + struct HPMHookPoint *HP_clif_mobname_normal_ack_pre; + struct HPMHookPoint *HP_clif_mobname_normal_ack_post; + struct HPMHookPoint *HP_clif_chatname_ack_pre; + struct HPMHookPoint *HP_clif_chatname_ack_post; + struct HPMHookPoint *HP_clif_elemname_ack_pre; + struct HPMHookPoint *HP_clif_elemname_ack_post; + struct HPMHookPoint *HP_clif_unknownname_ack_pre; + struct HPMHookPoint *HP_clif_unknownname_ack_post; struct HPMHookPoint *HP_clif_monster_hp_bar_pre; struct HPMHookPoint *HP_clif_monster_hp_bar_post; struct HPMHookPoint *HP_clif_hpmeter_pre; @@ -1156,6 +1180,8 @@ struct { struct HPMHookPoint *HP_clif_addchat_post; struct HPMHookPoint *HP_clif_changechatowner_pre; struct HPMHookPoint *HP_clif_changechatowner_post; + struct HPMHookPoint *HP_clif_chatRoleChange_pre; + struct HPMHookPoint *HP_clif_chatRoleChange_post; struct HPMHookPoint *HP_clif_clearchat_pre; struct HPMHookPoint *HP_clif_clearchat_post; struct HPMHookPoint *HP_clif_leavechat_pre; @@ -1614,6 +1640,8 @@ struct { struct HPMHookPoint *HP_clif_parse_roulette_db_post; struct HPMHookPoint *HP_clif_roulette_generate_ack_pre; struct HPMHookPoint *HP_clif_roulette_generate_ack_post; + struct HPMHookPoint *HP_clif_roulette_close_pre; + struct HPMHookPoint *HP_clif_roulette_close_post; struct HPMHookPoint *HP_clif_openmergeitem_pre; struct HPMHookPoint *HP_clif_openmergeitem_post; struct HPMHookPoint *HP_clif_cancelmergeitem_pre; @@ -1622,6 +1650,8 @@ struct { struct HPMHookPoint *HP_clif_comparemergeitem_post; struct HPMHookPoint *HP_clif_ackmergeitems_pre; struct HPMHookPoint *HP_clif_ackmergeitems_post; + struct HPMHookPoint *HP_clif_mergeitems_pre; + struct HPMHookPoint *HP_clif_mergeitems_post; struct HPMHookPoint *HP_clif_isdisguised_pre; struct HPMHookPoint *HP_clif_isdisguised_post; struct HPMHookPoint *HP_clif_navigate_to_pre; @@ -2066,6 +2096,8 @@ struct { struct HPMHookPoint *HP_clif_pPartyTick_post; struct HPMHookPoint *HP_clif_pGuildInvite2_pre; struct HPMHookPoint *HP_clif_pGuildInvite2_post; + struct HPMHookPoint *HP_clif_cashShopBuyAck_pre; + struct HPMHookPoint *HP_clif_cashShopBuyAck_post; struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_pre; struct HPMHookPoint *HP_clif_pPartyBookingAddFilter_post; struct HPMHookPoint *HP_clif_pPartyBookingSubFilter_pre; @@ -2256,6 +2288,10 @@ struct { struct HPMHookPoint *HP_clif_pingTimerSub_post; struct HPMHookPoint *HP_clif_pResetCooldown_pre; struct HPMHookPoint *HP_clif_pResetCooldown_post; + struct HPMHookPoint *HP_clif_loadConfirm_pre; + struct HPMHookPoint *HP_clif_loadConfirm_post; + struct HPMHookPoint *HP_clif_send_selforarea_pre; + struct HPMHookPoint *HP_clif_send_selforarea_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -7679,6 +7715,30 @@ struct { int HP_clif_changed_dir_post; int HP_clif_blname_ack_pre; int HP_clif_blname_ack_post; + int HP_clif_pcname_ack_pre; + int HP_clif_pcname_ack_post; + int HP_clif_homname_ack_pre; + int HP_clif_homname_ack_post; + int HP_clif_mername_ack_pre; + int HP_clif_mername_ack_post; + int HP_clif_petname_ack_pre; + int HP_clif_petname_ack_post; + int HP_clif_npcname_ack_pre; + int HP_clif_npcname_ack_post; + int HP_clif_mobname_ack_pre; + int HP_clif_mobname_ack_post; + int HP_clif_mobname_guardian_ack_pre; + int HP_clif_mobname_guardian_ack_post; + int HP_clif_mobname_additional_ack_pre; + int HP_clif_mobname_additional_ack_post; + int HP_clif_mobname_normal_ack_pre; + int HP_clif_mobname_normal_ack_post; + int HP_clif_chatname_ack_pre; + int HP_clif_chatname_ack_post; + int HP_clif_elemname_ack_pre; + int HP_clif_elemname_ack_post; + int HP_clif_unknownname_ack_pre; + int HP_clif_unknownname_ack_post; int HP_clif_monster_hp_bar_pre; int HP_clif_monster_hp_bar_post; int HP_clif_hpmeter_pre; @@ -7865,6 +7925,8 @@ struct { int HP_clif_addchat_post; int HP_clif_changechatowner_pre; int HP_clif_changechatowner_post; + int HP_clif_chatRoleChange_pre; + int HP_clif_chatRoleChange_post; int HP_clif_clearchat_pre; int HP_clif_clearchat_post; int HP_clif_leavechat_pre; @@ -8323,6 +8385,8 @@ struct { int HP_clif_parse_roulette_db_post; int HP_clif_roulette_generate_ack_pre; int HP_clif_roulette_generate_ack_post; + int HP_clif_roulette_close_pre; + int HP_clif_roulette_close_post; int HP_clif_openmergeitem_pre; int HP_clif_openmergeitem_post; int HP_clif_cancelmergeitem_pre; @@ -8331,6 +8395,8 @@ struct { int HP_clif_comparemergeitem_post; int HP_clif_ackmergeitems_pre; int HP_clif_ackmergeitems_post; + int HP_clif_mergeitems_pre; + int HP_clif_mergeitems_post; int HP_clif_isdisguised_pre; int HP_clif_isdisguised_post; int HP_clif_navigate_to_pre; @@ -8775,6 +8841,8 @@ struct { int HP_clif_pPartyTick_post; int HP_clif_pGuildInvite2_pre; int HP_clif_pGuildInvite2_post; + int HP_clif_cashShopBuyAck_pre; + int HP_clif_cashShopBuyAck_post; int HP_clif_pPartyBookingAddFilter_pre; int HP_clif_pPartyBookingAddFilter_post; int HP_clif_pPartyBookingSubFilter_pre; @@ -8965,6 +9033,10 @@ struct { int HP_clif_pingTimerSub_post; int HP_clif_pResetCooldown_pre; int HP_clif_pResetCooldown_post; + int HP_clif_loadConfirm_pre; + int HP_clif_loadConfirm_post; + int HP_clif_send_selforarea_pre; + int HP_clif_send_selforarea_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 51ea6a44e..b33cc6f4e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -509,6 +509,18 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->mvp_noitem, HP_clif_mvp_noitem) }, { HP_POP(clif->changed_dir, HP_clif_changed_dir) }, { HP_POP(clif->blname_ack, HP_clif_blname_ack) }, + { HP_POP(clif->pcname_ack, HP_clif_pcname_ack) }, + { HP_POP(clif->homname_ack, HP_clif_homname_ack) }, + { HP_POP(clif->mername_ack, HP_clif_mername_ack) }, + { HP_POP(clif->petname_ack, HP_clif_petname_ack) }, + { HP_POP(clif->npcname_ack, HP_clif_npcname_ack) }, + { HP_POP(clif->mobname_ack, HP_clif_mobname_ack) }, + { HP_POP(clif->mobname_guardian_ack, HP_clif_mobname_guardian_ack) }, + { HP_POP(clif->mobname_additional_ack, HP_clif_mobname_additional_ack) }, + { HP_POP(clif->mobname_normal_ack, HP_clif_mobname_normal_ack) }, + { HP_POP(clif->chatname_ack, HP_clif_chatname_ack) }, + { HP_POP(clif->elemname_ack, HP_clif_elemname_ack) }, + { HP_POP(clif->unknownname_ack, HP_clif_unknownname_ack) }, { HP_POP(clif->monster_hp_bar, HP_clif_monster_hp_bar) }, { HP_POP(clif->hpmeter, HP_clif_hpmeter) }, { HP_POP(clif->hpmeter_single, HP_clif_hpmeter_single) }, @@ -602,6 +614,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->joinchatok, HP_clif_joinchatok) }, { HP_POP(clif->addchat, HP_clif_addchat) }, { HP_POP(clif->changechatowner, HP_clif_changechatowner) }, + { HP_POP(clif->chatRoleChange, HP_clif_chatRoleChange) }, { HP_POP(clif->clearchat, HP_clif_clearchat) }, { HP_POP(clif->leavechat, HP_clif_leavechat) }, { HP_POP(clif->changechatstatus, HP_clif_changechatstatus) }, @@ -831,10 +844,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->npc_market_purchase_ack, HP_clif_npc_market_purchase_ack) }, { HP_POP(clif->parse_roulette_db, HP_clif_parse_roulette_db) }, { HP_POP(clif->roulette_generate_ack, HP_clif_roulette_generate_ack) }, + { HP_POP(clif->roulette_close, HP_clif_roulette_close) }, { HP_POP(clif->openmergeitem, HP_clif_openmergeitem) }, { HP_POP(clif->cancelmergeitem, HP_clif_cancelmergeitem) }, { HP_POP(clif->comparemergeitem, HP_clif_comparemergeitem) }, { HP_POP(clif->ackmergeitems, HP_clif_ackmergeitems) }, + { HP_POP(clif->mergeitems, HP_clif_mergeitems) }, { HP_POP(clif->isdisguised, HP_clif_isdisguised) }, { HP_POP(clif->navigate_to, HP_clif_navigate_to) }, { HP_POP(clif->bl_type, HP_clif_bl_type) }, @@ -1057,6 +1072,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pCashShopBuy, HP_clif_pCashShopBuy) }, { HP_POP(clif->pPartyTick, HP_clif_pPartyTick) }, { HP_POP(clif->pGuildInvite2, HP_clif_pGuildInvite2) }, + { HP_POP(clif->cashShopBuyAck, HP_clif_cashShopBuyAck) }, { HP_POP(clif->pPartyBookingAddFilter, HP_clif_pPartyBookingAddFilter) }, { HP_POP(clif->pPartyBookingSubFilter, HP_clif_pPartyBookingSubFilter) }, { HP_POP(clif->pPartyBookingReqVolunteer, HP_clif_pPartyBookingReqVolunteer) }, @@ -1152,6 +1168,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pingTimer, HP_clif_pingTimer) }, { HP_POP(clif->pingTimerSub, HP_clif_pingTimerSub) }, { HP_POP(clif->pResetCooldown, HP_clif_pResetCooldown) }, + { HP_POP(clif->loadConfirm, HP_clif_loadConfirm) }, + { HP_POP(clif->send_selforarea, HP_clif_send_selforarea) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 7978909eb..4bfa46abe 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -12645,6 +12645,318 @@ void HP_clif_blname_ack(int fd, struct block_list *bl) { } return; } +void HP_clif_pcname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pcname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pcname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pcname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_pcname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pcname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pcname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_homname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_homname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_homname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.homname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_homname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_homname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_homname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_mername_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mername_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mername_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mername_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mername_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_mername_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mername_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mername_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_petname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_petname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_petname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_petname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.petname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_petname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_petname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_petname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_npcname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_npcname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_npcname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.npcname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_npcname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_npcname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_npcname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_mobname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mobname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mobname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mobname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_mobname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mobname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_mobname_guardian_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mobname_guardian_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_guardian_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mobname_guardian_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mobname_guardian_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_mobname_guardian_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_guardian_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mobname_guardian_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_mobname_additional_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mobname_additional_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_additional_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mobname_additional_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mobname_additional_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_mobname_additional_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_additional_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mobname_additional_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_mobname_normal_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mobname_normal_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_normal_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mobname_normal_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mobname_normal_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_mobname_normal_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mobname_normal_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mobname_normal_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_chatname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_chatname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_chatname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_chatname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.chatname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_chatname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_chatname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_chatname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_elemname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_elemname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_elemname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.elemname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_elemname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_elemname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_elemname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} +void HP_clif_unknownname_ack(int fd, struct block_list *bl) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_unknownname_ack_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_unknownname_ack_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_unknownname_ack_pre[hIndex].func; + preHookFunc(&fd, &bl); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.unknownname_ack(fd, bl); + } + if (HPMHooks.count.HP_clif_unknownname_ack_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_unknownname_ack_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_unknownname_ack_post[hIndex].func; + postHookFunc(fd, bl); + } + } + return; +} void HP_clif_monster_hp_bar(struct mob_data *md, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_monster_hp_bar_pre > 0) { @@ -15080,6 +15392,32 @@ void HP_clif_changechatowner(struct chat_data *cd, struct map_session_data *sd) } return; } +void HP_clif_chatRoleChange(struct chat_data *cd, struct map_session_data *sd, struct block_list *bl, int isNotOwner) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_chatRoleChange_pre > 0) { + void (*preHookFunc) (struct chat_data **cd, struct map_session_data **sd, struct block_list **bl, int *isNotOwner); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_chatRoleChange_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_chatRoleChange_pre[hIndex].func; + preHookFunc(&cd, &sd, &bl, &isNotOwner); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.chatRoleChange(cd, sd, bl, isNotOwner); + } + if (HPMHooks.count.HP_clif_chatRoleChange_post > 0) { + void (*postHookFunc) (struct chat_data *cd, struct map_session_data *sd, struct block_list *bl, int isNotOwner); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_chatRoleChange_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_chatRoleChange_post[hIndex].func; + postHookFunc(cd, sd, bl, isNotOwner); + } + } + return; +} void HP_clif_clearchat(struct chat_data *cd, int fd) { int hIndex = 0; if (HPMHooks.count.HP_clif_clearchat_pre > 0) { @@ -21049,6 +21387,32 @@ void HP_clif_roulette_generate_ack(struct map_session_data *sd, enum GENERATE_RO } return; } +void HP_clif_roulette_close(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_roulette_close_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_close_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_roulette_close_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.roulette_close(sd); + } + if (HPMHooks.count.HP_clif_roulette_close_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_roulette_close_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_roulette_close_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} void HP_clif_openmergeitem(int fd, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_openmergeitem_pre > 0) { @@ -21154,6 +21518,32 @@ void HP_clif_ackmergeitems(int fd, struct map_session_data *sd) { } return; } +void HP_clif_mergeitems(int fd, struct map_session_data *sd, int index, int amount, enum mergeitem_reason reason) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_mergeitems_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd, int *index, int *amount, enum mergeitem_reason *reason); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mergeitems_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_mergeitems_pre[hIndex].func; + preHookFunc(&fd, &sd, &index, &amount, &reason); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.mergeitems(fd, sd, index, amount, reason); + } + if (HPMHooks.count.HP_clif_mergeitems_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd, int index, int amount, enum mergeitem_reason reason); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_mergeitems_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_mergeitems_post[hIndex].func; + postHookFunc(fd, sd, index, amount, reason); + } + } + return; +} bool HP_clif_isdisguised(struct block_list *bl) { int hIndex = 0; bool retVal___ = false; @@ -26928,6 +27318,32 @@ void HP_clif_pGuildInvite2(int fd, struct map_session_data *sd) { } return; } +void HP_clif_cashShopBuyAck(int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_cashShopBuyAck_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd, int *itemId, enum CASH_SHOP_BUY_RESULT *result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopBuyAck_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_cashShopBuyAck_pre[hIndex].func; + preHookFunc(&fd, &sd, &itemId, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.cashShopBuyAck(fd, sd, itemId, result); + } + if (HPMHooks.count.HP_clif_cashShopBuyAck_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_cashShopBuyAck_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_cashShopBuyAck_post[hIndex].func; + postHookFunc(fd, sd, itemId, result); + } + } + return; +} void HP_clif_pPartyBookingAddFilter(int fd, struct map_session_data *sd) { int hIndex = 0; if (HPMHooks.count.HP_clif_pPartyBookingAddFilter_pre > 0) { @@ -29413,6 +29829,58 @@ void HP_clif_pResetCooldown(int fd, struct map_session_data *sd) { } return; } +void HP_clif_loadConfirm(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_loadConfirm_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_loadConfirm_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_loadConfirm_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.loadConfirm(sd); + } + if (HPMHooks.count.HP_clif_loadConfirm_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_loadConfirm_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_loadConfirm_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_send_selforarea(int fd, struct block_list *bl, const void *buf, int len) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_send_selforarea_pre > 0) { + void (*preHookFunc) (int *fd, struct block_list **bl, const void **buf, int *len); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_selforarea_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_send_selforarea_pre[hIndex].func; + preHookFunc(&fd, &bl, &buf, &len); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.send_selforarea(fd, bl, buf, len); + } + if (HPMHooks.count.HP_clif_send_selforarea_post > 0) { + void (*postHookFunc) (int fd, struct block_list *bl, const void *buf, int len); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_send_selforarea_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_send_selforarea_post[hIndex].func; + postHookFunc(fd, bl, buf, len); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; -- cgit v1.2.3-70-g09d2 From 8fa081b6b4ad26851f3ab8f485ba76f3e4338762 Mon Sep 17 00:00:00 2001 From: Ibrahim Zidan Date: Wed, 17 Apr 2019 07:29:18 +0200 Subject: Implement Refinery UI Signed-off-by: Ibrahim Zidan --- conf/map/battle/feature.conf | 10 + conf/messages.conf | 3 +- db/pre-re/refine_db.conf | 179 +++++++++++ db/re/refine_db.conf | 598 ++++++++++++++++++++++++++++++++++++ doc/script_commands.txt | 6 + npc/merchants/advanced_refiner.txt | 19 +- npc/merchants/hd_refine.txt | 15 + npc/merchants/refine.txt | 17 +- npc/re/merchants/hd_refiner.txt | 11 + npc/re/merchants/refine.txt | 11 + npc/re/merchants/shadow_refiner.txt | 10 +- src/common/mmo.h | 8 + src/map/atcommand.c | 17 + src/map/battle.c | 14 + src/map/battle.h | 2 + src/map/clif.c | 87 ++++++ src/map/clif.h | 6 + src/map/itemdb.h | 1 + src/map/map.c | 1 + src/map/packets.h | 6 + src/map/packets_struct.h | 70 +++++ src/map/pc.h | 5 +- src/map/refine.c | 388 ++++++++++++++++++++++- src/map/refine.h | 35 +++ src/map/refine.p.h | 66 +++- src/map/script.c | 20 ++ 26 files changed, 1582 insertions(+), 23 deletions(-) (limited to 'src/common') diff --git a/conf/map/battle/feature.conf b/conf/map/battle/feature.conf index 5e40f2898..0cb293d60 100644 --- a/conf/map/battle/feature.conf +++ b/conf/map/battle/feature.conf @@ -88,4 +88,14 @@ features: { // true: enable (Default) // false: disable enable_achievement_system: true + + // Enable Refinery UI (requires 2016-10-05Ragexe/RE) + // true: enable (Default) + // false: disable + enable_refinery_ui: false + + // Replace Refine NPCs with Refinery UI + // true: enable + // false: disable (default) + replace_refine_npcs: false } diff --git a/conf/messages.conf b/conf/messages.conf index 772b882c9..2788f264d 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -449,7 +449,8 @@ // Return pet to egg message 451: You can't return your pet because your inventory is full. 452: usage @camerainfo range rotation latitude -//453-497 FREE +453: Refinery UI is not available +//454-497 FREE // Messages of others (not for GM commands) // ---------------------------------------- diff --git a/db/pre-re/refine_db.conf b/db/pre-re/refine_db.conf index dd3bcdb41..5896e49f6 100644 --- a/db/pre-re/refine_db.conf +++ b/db/pre-re/refine_db.conf @@ -37,6 +37,24 @@ Armors/WeaponLevel1~4: { // Specifies weap RandomBonusStartLevel: (int) // This value specifies the start point for those levels that give a random bonus value (usually the first unsafe upgrade). // - RandomBonusStartLevel is only applied for weapons, and not displayed client-side. RandomBonusValue: (int) // A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past. + RefineryUISettings: ( + { + Level: (int or array of int) // Holds either the individule refine level meant for this setting or an array defining a range + of Low to Max level + BlacksmithBlessing: (int) (optional) // How many Blacksmith Blessing required for this range to be safe from breaking + Items: { + AegisName: { + Type: "(string)" // The type to determine the chances used for this item, REFINE_CHANCE_TYPE_* + constants are used in here + Cost: (int) (optional) // Amount of zeny required + FailureBehavior: "(string)" (optional) // The expected behvaior on failure for this item, the following strings are used in here + Destroy (default) sets the item to be destroyed on failure + Keep keeps the item after failure + Downgrade downgrades the item by one level on failure + } + } + } + ) Rates: { // Per level configuration of the refine rates. Lv1~10: { // Lv1 ~ Lv10. NormalChance: (int) // (optional, defaults to 100) Chance of successful refine using normal ores (100 = 100%). @@ -54,6 +72,39 @@ Armors: { StatsPerLevel: 66 RandomBonusStartLevel: 0 RandomBonusValue: 0 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + } + }, + { + Level: [8, 10] + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + HD_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv5: { NormalChance: 60 @@ -97,6 +148,38 @@ WeaponLevel1: { StatsPerLevel: 200 RandomBonusStartLevel: 8 RandomBonusValue: 300 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + } + }, + { + Level: [8, 10] + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + } + }, + ) Rates: { Lv8: { NormalChance: 60 @@ -122,6 +205,38 @@ WeaponLevel2: { StatsPerLevel: 300 RandomBonusStartLevel: 7 RandomBonusValue: 500 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + } + }, + { + Level: [8, 10] + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + } + }, + ) Rates: { Lv7: { NormalChance: 60 @@ -153,6 +268,38 @@ WeaponLevel3: { StatsPerLevel: 500 RandomBonusStartLevel: 6 RandomBonusValue: 800 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + } + }, + { + Level: [8, 10] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + } + }, + ) Rates: { Lv6: { NormalChance: 60 @@ -190,6 +337,38 @@ WeaponLevel4: { StatsPerLevel: 700 RandomBonusStartLevel: 5 RandomBonusValue: 1300 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + } + }, + { + Level: [8, 10] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + } + }, + ) Rates: { Lv5: { NormalChance: 60 diff --git a/db/re/refine_db.conf b/db/re/refine_db.conf index 4974e0033..31335fffd 100644 --- a/db/re/refine_db.conf +++ b/db/re/refine_db.conf @@ -37,6 +37,24 @@ Armors/WeaponLevel1~4: { // Specifies weap RandomBonusStartLevel: (int) // This value specifies the start point for those levels that give a random bonus value (usually the first unsafe upgrade). // - RandomBonusStartLevel is only applied for weapons, and not displayed client-side. RandomBonusValue: (int) // A random number between 0 and (Random bonus start level - Upgrade level + 1) * this value is applied for all upgrades past. + RefineryUISettings: ( + { + Level: (int or array of int) // Holds either the individule refine level meant for this setting or an array defining a range + of Low to Max level + BlacksmithBlessing: (int) (optional) // How many Blacksmith Blessing required for this range to be safe from breaking + Items: { + AegisName: { + Type: "(string)" // The type to determine the chances used for this item, REFINE_CHANCE_TYPE_* + constants are used in here + Cost: (int) (optional) // Amount of zeny required + FailureBehavior: "(string)" (optional) // The expected behvaior on failure for this item, the following strings are used in here + Destroy (default) sets the item to be destroyed on failure + Keep keeps the item after failure + Downgrade downgrades the item by one level on failure + } + } + } + ) Rates: { // Per level configuration of the refine rates. Lv1~20: { // Lv1 ~ Lv20. NormalChance: (int) // (optional, defaults to 100) Chance of successful refine using normal ores (100 = 100%). @@ -54,6 +72,122 @@ Armors: { StatsPerLevel: 0 RandomBonusStartLevel: 0 RandomBonusValue: 0 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + } + }, + { + Level: 8 + BlacksmithBlessing: 1 + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + HD_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 9 + BlacksmithBlessing: 2 + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + HD_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 10 + BlacksmithBlessing: 4 + Items: { + Elunium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 2000 + } + Enriched_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 2000 + } + HD_Elunium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 11 + BlacksmithBlessing: 7 + Items: { + Carnium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Carnium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 12 + BlacksmithBlessing: 11 + Items: { + Carnium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Carnium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: [13, 20] + Items: { + Carnium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Carnium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv1: { Bonus: 100 @@ -175,6 +309,122 @@ WeaponLevel1: { StatsPerLevel: 200 RandomBonusStartLevel: 8 RandomBonusValue: 300 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + } + }, + { + Level: 8 + BlacksmithBlessing: 1 + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 9 + BlacksmithBlessing: 2 + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 10 + BlacksmithBlessing: 4 + Items: { + Phracon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 50 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 50 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 11 + BlacksmithBlessing: 7 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 12 + BlacksmithBlessing: 11 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: [13, 20] + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv8: { NormalChance: 60 @@ -255,6 +505,122 @@ WeaponLevel2: { StatsPerLevel: 300 RandomBonusStartLevel: 7 RandomBonusValue: 500 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + } + }, + { + Level: 8 + BlacksmithBlessing: 1 + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 9 + BlacksmithBlessing: 2 + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 10 + BlacksmithBlessing: 4 + Items: { + Emveretarcon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 200 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 200 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 11 + BlacksmithBlessing: 7 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 12 + BlacksmithBlessing: 11 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: [13, 20] + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv7: { NormalChance: 60 @@ -341,6 +707,122 @@ WeaponLevel3: { StatsPerLevel: 500 RandomBonusStartLevel: 6 RandomBonusValue: 800 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + } + }, + { + Level: 8 + BlacksmithBlessing: 1 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 9 + BlacksmithBlessing: 2 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 10 + BlacksmithBlessing: 4 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 5000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 5000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 11 + BlacksmithBlessing: 7 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 12 + BlacksmithBlessing: 11 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: [13, 20] + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv6: { NormalChance: 60 @@ -433,6 +915,122 @@ WeaponLevel4: { StatsPerLevel: 700 RandomBonusStartLevel: 5 RandomBonusValue: 1400 + RefineryUISettings: ( + { + Level: [1, 7] + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 20000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + } + }, + { + Level: 8 + BlacksmithBlessing: 1 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 20000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 9 + BlacksmithBlessing: 2 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 20000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 10 + BlacksmithBlessing: 4 + Items: { + Oridecon: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 20000 + } + Enriched_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + } + HD_Oridecon: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 11 + BlacksmithBlessing: 7 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: 12 + BlacksmithBlessing: 11 + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + { + Level: [13, 20] + Items: { + Bradium: { + Type: "REFINE_CHANCE_TYPE_NORMAL" + Cost: 100000 + } + HD_Bradium: { + Type: "REFINE_CHANCE_TYPE_ENRICHED" + Cost: 20000 + FailureBehavior: "Downgrade" + } + } + }, + ) Rates: { Lv5: { NormalChance: 60 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 4d8053da0..516454365 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -10463,3 +10463,9 @@ Force close roulette window. Works for 20141008 main clients, 20140903 re, any zero. --------------------------------------- +*openrefineryui() + +Opens refinery user interface for the player +returns true on success and false on failure + +--------------------------------------- diff --git a/npc/merchants/advanced_refiner.txt b/npc/merchants/advanced_refiner.txt index 9632f95f7..ec263e192 100644 --- a/npc/merchants/advanced_refiner.txt +++ b/npc/merchants/advanced_refiner.txt @@ -44,14 +44,19 @@ //========================================================================= payon,157,146,6 script Suhnbi#cash 4_M_03,{ - disable_items; - mes "[Suhnbi]"; - mes "I am the Armsmith"; - mes "I can refine all kinds of weapons,"; - mes "armor and equipment, so let me"; - mes "know what you want to refine."; - next; + mes("[Suhnbi]"); + mes("I am the Armsmith"); + mes("I can refine all kinds of weapons,"); + mes("armor and equipment, so let me"); + mes("know what you want to refine."); + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + + disable_items; setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; .@menu$ = ""; for(.@i = 1; .@i<=10; ++.@i) { diff --git a/npc/merchants/hd_refine.txt b/npc/merchants/hd_refine.txt index a7fc5e922..1a5a43621 100644 --- a/npc/merchants/hd_refine.txt +++ b/npc/merchants/hd_refine.txt @@ -39,6 +39,17 @@ //== Blacksmith Mighty Hammer (+7~9) ======================= - script ::MightyHammer FAKE_NPC,{ + mes("[Blacksmith Mighty Hammer]"); + mes("I'm a blacksmith skilled in refining weapons and armors."); + mes("I can refine an item of your choice among the items you are equipped with."); + mes("Which item do you want to refine?"); + + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + disable_items; mes "[Blacksmith Mighty Hammer]"; mes "Unlike others, I am a blacksmith who refines a very limited number of items."; @@ -179,6 +190,10 @@ lhz_in02,280,19,3 duplicate(MightyHammer) Mighty Hammer#lhz 4_M_DWARF //== Basta (+10 and up) ==================================== - script ::Basta FAKE_NPC,{ + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + end(); + } disable_items; mes "[Basta]"; mes "I'm the best Blacksmith in the whole world, Basta."; diff --git a/npc/merchants/refine.txt b/npc/merchants/refine.txt index 7f1b4d9a3..19ebf4a8e 100644 --- a/npc/merchants/refine.txt +++ b/npc/merchants/refine.txt @@ -589,14 +589,19 @@ lhz_in02,282,20,7 script Fulerr 4_M_LGTMAN,{ // If you enable this function, be sure to edit the value of .@safe to the max // safe refine in refine_db.txt as well. function script refinemain { + mesf("[%s]", getarg(0)); + mes("I'm the Armsmith."); + mes("I can refine all kinds of weapons, armor and equipment, so let me"); + mes("know what you want me to refine."); + + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + disable_items; .@features = getarg(1); - mes "[" + getarg(0) + "]"; - mes "I'm the Armsmith."; - mes "I can refine all kinds of weapons, armor and equipment, so let me"; - mes "know what you want me to refine."; - next; - setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3"; .@menu$ = ""; for(.@i = 1; .@i <= 10; ++.@i) { diff --git a/npc/re/merchants/hd_refiner.txt b/npc/re/merchants/hd_refiner.txt index 17979642e..2dcc74bae 100644 --- a/npc/re/merchants/hd_refiner.txt +++ b/npc/re/merchants/hd_refiner.txt @@ -39,6 +39,17 @@ //== Blacksmith Mighty Hammer (+7~9) ======================= - script ::MightyHammer FAKE_NPC,{ + mes("[Blacksmith Mighty Hammer]"); + mes("I'm a blacksmith skilled in refining weapons and armors."); + mes("I can refine an item of your choice among the items you are equipped with."); + mes("Which item do you want to refine?"); + + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + disable_items; mes "[Blacksmith Mighty Hammer]"; mes "Unlike others, I am a blacksmith who refines a very limited number of items."; diff --git a/npc/re/merchants/refine.txt b/npc/re/merchants/refine.txt index 6356acfca..879e9a5f1 100644 --- a/npc/re/merchants/refine.txt +++ b/npc/re/merchants/refine.txt @@ -56,6 +56,17 @@ payon_in01,18,132,3 script Vestri#pay 4_M_DWARF,{ // On official servers, if an item is unsuccessfully refined it will break at a // 20% rate and downgrade at an 80% rate. function script refinenew { + mesf("[%s]", getarg(0)); + mes("I'm a blacksmith skilled in refining weapons and armors."); + mes("I can refine an item of your choice among the items you are equipped with."); + mes("Which item do you want to refine?"); + + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + disable_items; mes "["+ getarg(0) +"]"; mes "I am the best Armsmith ever!"; diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt index f03d348b2..db9668b6d 100644 --- a/npc/re/merchants/shadow_refiner.txt +++ b/npc/re/merchants/shadow_refiner.txt @@ -39,11 +39,17 @@ itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{ .@npc_name$ = "[Shadow Blacksmith]"; .@zeny_cost = 20000; // Amount of zeny to be charged for refining. - disable_items; mesf("%s", .@npc_name$); mes("Do you want to refine a Shadow item?"); mes("Please choose the part you want to refine."); - next; + + if (getbattleflag("features/replace_refine_npcs") == 1) { + if (openrefineryui()) + close(); + } + next(); + + disable_items; setarray(.@position$[0],"Armor","Weapon","Shield","Shoes","Earring","Pendant"); for (.@i=EQI_SHADOW_ARMOR; .@i <= EQI_SHADOW_ACC_L; .@i++){ .@menu$ = .@menu$ + (getequipisequiped(.@i) ? getequipname(.@i) : ("^8C8C8C" + .@position$[.@i-EQI_SHADOW_ARMOR] + " [Not Equipped]^000000" + ":")); diff --git a/src/common/mmo.h b/src/common/mmo.h index aafa54008..eb74d62b3 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -1366,6 +1366,10 @@ enum questinfo_type { #define MAX_ITEMLIST MAX_STORAGE #endif +#ifndef MAX_REFINE_REQUIREMENTS + #define MAX_REFINE_REQUIREMENTS 4 +#endif + // sanity checks... #if MAX_ZENY > INT_MAX #error MAX_ZENY is too big @@ -1379,4 +1383,8 @@ enum questinfo_type { #error MAX_SKILL has been replaced by MAX_SKILL_DB. Please update your custom definitions. #endif +#if MAX_REFINE_REQUIREMENTS > 4 +#error MAX_REFINE_REQUIREMENTS is bigger than allowed, this is a hardcoded limit in the client +#endif + #endif /* COMMON_MMO_H */ diff --git a/src/map/atcommand.c b/src/map/atcommand.c index e97822e69..09303912b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -9829,6 +9829,22 @@ ACMD(camerainfo) return true; } +ACMD(refineryui) +{ +#if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) + if (battle_config.enable_refinery_ui == 0) { + clif->message(fd, msg_fd(fd, 453)); + return false; + } + + clif->OpenRefineryUI(sd); + return true; +#else + clif->message(fd, msg_fd(fd, 453)); + return false; +#endif +} + /** * Fills the reference of available commands in atcommand DBMap **/ @@ -10112,6 +10128,7 @@ static void atcommand_basecommands(void) ACMD_DEF(reloadclans), ACMD_DEF(setzone), ACMD_DEF(camerainfo), + ACMD_DEF(refineryui), }; int i; diff --git a/src/map/battle.c b/src/map/battle.c index b06de267d..2f33e2ea9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7419,6 +7419,8 @@ static const struct battle_data { { "ping_time", &battle_config.ping_time, 20, 0, 99999999, }, { "option_drop_max_loop", &battle_config.option_drop_max_loop, 10, 1, 100000, }, { "drop_connection_on_quit", &battle_config.drop_connection_on_quit, 0, 0, 1, }, + {"features/enable_refinery_ui", &battle_config.enable_refinery_ui, 1, 0, 1, }, + {"features/replace_refine_npcs", &battle_config.replace_refine_npcs, 1, 0, 1, }, }; static bool battle_set_value_sub(int index, int value) @@ -7544,6 +7546,18 @@ static void battle_adjust_conf(void) } #endif +#if !(PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO)) + if (battle_config.enable_refinery_ui == 1) { + ShowWarning("conf/map/battle/feature.conf refinery ui is enabled but it requires PACKETVER 2016-11-09 RagexeRE/2016-11-30 Ragexe or newer, disabling...\n"); + battle_config.enable_refinery_ui = 0; + } + + if (battle_config.replace_refine_npcs == 1) { + ShowWarning("conf/map/battle/feature.conf replace refine npcs is enabled but it requires PACKETVER 2016-11-09 RagexeRE/2016-11-30 Ragexe or newer, disabling...\n"); + battle_config.replace_refine_npcs = 0; + } +#endif + #ifndef CELL_NOSTACK if (battle_config.custom_cell_stack_limit != 1) ShowWarning("Battle setting 'custom_cell_stack_limit' takes no effect as this server was compiled without Cell Stack Limit support.\n"); diff --git a/src/map/battle.h b/src/map/battle.h index 8743274ee..1640a4e7f 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -587,6 +587,8 @@ struct Battle_Config { int option_drop_max_loop; int drop_connection_on_quit; + int enable_refinery_ui; + int replace_refine_npcs; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 299c69a1c..b8a54166a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -49,6 +49,7 @@ #include "map/pet.h" #include "map/quest.h" #include "map/rodex.h" +#include "map/refine.h" #include "map/script.h" #include "map/skill.h" #include "map/status.h" @@ -22492,6 +22493,87 @@ static void clif_parse_ResetCooldown(int fd, struct map_session_data *sd) atcommand->exec(fd, sd, cmd, true); } +static void clif_OpenRefineryUI(struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) + nullpo_retv(sd); + + if (battle_config.enable_refinery_ui == 0) + return; + + struct PACKET_ZC_REFINE_OPEN_WINDOW p; + p.packetType = HEADER_ZC_REFINE_OPEN_WINDOW; + clif->send(&p, sizeof(p), &sd->bl, SELF); + + sd->state.refine_ui = 1; +#endif +} + +static void clif_parse_AddItemRefineryUI(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +static void clif_parse_AddItemRefineryUI(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) + if (battle_config.enable_refinery_ui == 0) + return; + + const struct PACKET_CZ_REFINE_ADD_ITEM *p = RFIFO2PTR(fd); + refine->refinery_add_item(sd, p->index - 2); +#endif +} + +static void clif_AddItemRefineryUIAck(struct map_session_data *sd, int item_index, struct s_refine_requirement *req) +{ +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) + nullpo_retv(sd); + nullpo_retv(req); + Assert_retv(item_index >= 0 && item_index < sd->status.inventorySize); + + if (battle_config.enable_refinery_ui == 0) + return; + + char buf[sizeof(struct PACKET_ZC_REFINE_ADD_ITEM) + sizeof(struct PACKET_ZC_REFINE_ADD_ITEM_SUB) * MAX_REFINE_REQUIREMENTS]; + struct PACKET_ZC_REFINE_ADD_ITEM *p = (struct PACKET_ZC_REFINE_ADD_ITEM *)buf; + + p->packetType = HEADER_ZC_REFINE_ADD_ITEM; + p->packtLength = sizeof(*p) + sizeof(p->req[0]) * req->req_count; + p->itemIndex = item_index + 2; + p->blacksmithBlessing = req->blacksmith_blessing; + + int weapon_level = itemdb_wlv(sd->status.inventory[item_index].nameid); + for (int i = 0; i < req->req_count; ++i) { + p->req[i].chance = refine->get_refine_chance(weapon_level, sd->status.inventory[item_index].refine, req->req[i].type); + p->req[i].itemId = req->req[i].nameid; + p->req[i].zeny = req->req[i].cost; + } + + clif->send(p, p->packtLength, &sd->bl, SELF); +#endif +} + +static void clif_parse_RefineryUIRefine(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +static void clif_parse_RefineryUIRefine(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) + if (battle_config.enable_refinery_ui == 0) + return; + + const struct PACKET_CZ_REFINE_ITEM_REQUEST *p = RFIFO2PTR(fd); + refine->refinery_refine_request(sd, p->index - 2, p->itemId, (p->blacksmithBlessing == 1) ? true : false); +#endif +} + +static void clif_parse_RefineryUIClose(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); +static void clif_parse_RefineryUIClose(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) + if (battle_config.enable_refinery_ui == 0) + return; + + sd->state.refine_ui = 0; + return; +#endif +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -23705,4 +23787,9 @@ void clif_defaults(void) clif->pResetCooldown = clif_parse_ResetCooldown; clif->loadConfirm = clif_loadConfirm; clif->send_selforarea = clif_send_selforarea; + clif->OpenRefineryUI = clif_OpenRefineryUI; + clif->pAddItemRefineryUI = clif_parse_AddItemRefineryUI; + clif->AddItemRefineryUIAck = clif_AddItemRefineryUIAck; + clif->pRefineryUIClose = clif_parse_RefineryUIClose; + clif->pRefineryUIRefine = clif_parse_RefineryUIRefine; } diff --git a/src/map/clif.h b/src/map/clif.h index aaf053274..0515fbd05 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -55,6 +55,7 @@ struct skill_unit; struct unit_data; struct view_data; struct achievement_data; // map/achievement.h +struct s_refine_requirement; enum clif_messages; enum rodex_add_item; @@ -1611,6 +1612,11 @@ struct clif_interface { void (*pResetCooldown) (int fd, struct map_session_data *sd); void (*loadConfirm) (struct map_session_data *sd); void (*send_selforarea) (int fd, struct block_list *bl, const void *buf, int len); + void (*OpenRefineryUI) (struct map_session_data *sd); + void (*pAddItemRefineryUI) (int fd, struct map_session_data *sd); + void (*AddItemRefineryUIAck) (struct map_session_data *sd, int item_index, struct s_refine_requirement *req); + void (*pRefineryUIClose) (int fd, struct map_session_data *sd); + void (*pRefineryUIRefine) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 315787993..e032def0c 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -130,6 +130,7 @@ enum item_itemid { ITEMID_INDIGO_PTS = 6361, ITEMID_YELLOW_WISH_PTS = 6362, ITEMID_LIME_GREEN_PTS = 6363, + ITEMID_BLACKSMITH_BLESSING = 6635, ITEMID_STONE = 7049, ITEMID_FIRE_BOTTLE = 7135, ITEMID_ACID_BOTTLE = 7136, diff --git a/src/map/map.c b/src/map/map.c index d34d421d7..2b95ec27a 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -6409,6 +6409,7 @@ static void map_load_defaults(void) npc_chat_defaults(); rodex_defaults(); stylist_defaults(); + refine_defaults(); } /** * --run-once handler diff --git a/src/map/packets.h b/src/map/packets.h index 99404cbe3..bffec4f43 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1805,6 +1805,12 @@ packet(0x96e,clif->ackmergeitems); packet(0x0a88,clif->pResetCooldown); #endif +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) + packet(0x0aa1, clif->pAddItemRefineryUI); + packet(0x0aa3, clif->pRefineryUIRefine); + packet(0x0aa4, clif->pRefineryUIClose); +#endif + // 2017-02-28aRagexeRE #if PACKETVER >= 20170228 // new packets diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 45683596f..33b7759ce 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3319,6 +3319,76 @@ struct PACKET_ZC_SE_PC_BUY_CASHITEM_RESULT { DEFINE_PACKET_HEADER(ZC_SE_PC_BUY_CASHITEM_RESULT, 0x0849); #endif +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) +struct PACKET_ZC_REFINE_OPEN_WINDOW { + int16 packetType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_REFINE_OPEN_WINDOW, 0x0aa0); +#endif + +#if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) +struct PACKET_CZ_REFINE_ADD_ITEM { + int16 packetType; + int16 index; +}; +DEFINE_PACKET_HEADER(CZ_REFINE_ADD_ITEM, 0x0aa1); +#endif + +#if PACKETVER_MAIN_NUM >= 20161130 || PACKETVER_RE_NUM >= 20161109 || defined(PACKETVER_ZERO) +struct PACKET_ZC_REFINE_ADD_ITEM_SUB { +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + int8 chance; + int32 zeny; +} __attribute__((packed)); + +struct PACKET_ZC_REFINE_ADD_ITEM { + int16 packetType; + int16 packtLength; + int16 itemIndex; + int8 blacksmithBlessing; + struct PACKET_ZC_REFINE_ADD_ITEM_SUB req[]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_REFINE_ADD_ITEM, 0x0aa2); +#endif + +#if PACKETVER_MAIN_NUM >= 20161005 || PACKETVER_RE_NUM >= 20161005 || defined(PACKETVER_ZERO) +struct PACKET_CZ_REFINE_ITEM_REQUEST { + int16 packetType; + int16 index; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + int8 blacksmithBlessing; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_REFINE_ITEM_REQUEST, 0x0aa3); + +struct PACKET_CZ_REFINE_WINDOW_CLOSE { + int16 packetType; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(CZ_REFINE_WINDOW_CLOSE, 0x0aa4); +#endif + +#if PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO) +struct PACKET_ZC_REFINE_STATUS { + int16 packetType; + char name[NAME_LENGTH]; +#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114 + uint32 itemId; +#else + uint16 itemId; +#endif + int8 refine_level; + int8 status; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_REFINE_STATUS, 0x0ada); +#endif + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris diff --git a/src/map/pc.h b/src/map/pc.h index b2069d4df..42c9d204e 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -237,6 +237,7 @@ struct map_session_data { unsigned int standalone : 1;/* [Ind/Hercules <3] */ unsigned int loggingout : 1; unsigned int warp_clean : 1; + unsigned int refine_ui : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -660,10 +661,10 @@ END_ZEROED_BLOCK; #define pc_issit(sd) ( (sd)->vd.dead_sit == 2 ) #define pc_isidle(sd) ( (sd)->chat_id != 0 || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) -#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) +#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1) /* equals pc_cant_act except it doesn't check for chat rooms */ -#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) +#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1) #define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) ) #define pc_setchatid(sd,n) ( (sd)->chat_id = (n) ) diff --git a/src/map/refine.c b/src/map/refine.c index 5d0517d7d..96d37141d 100644 --- a/src/map/refine.c +++ b/src/map/refine.c @@ -22,14 +22,19 @@ #include "refine.p.h" #include "common/cbasetypes.h" -#include "common/mmo.h" #include "common/nullpo.h" +#include "common/random.h" #include "common/showmsg.h" #include "common/strlib.h" +#include "common/utils.h" +#include "map/itemdb.h" #include "map/map.h" +#include "map/pc.h" +#include "map/script.h" #include #include +#include /** @file * Implementation of the refine interface. @@ -40,6 +45,151 @@ static struct refine_interface_private refine_p; static struct refine_interface_dbs refine_dbs; struct refine_interface *refine; +/// @copydoc refine_interface::refinery_refine_request() +static void refine_refinery_refine_request(struct map_session_data *sd, int item_index, int material_id, bool use_blacksmith_blessing) +{ + nullpo_retv(sd); + + if (item_index < 0 || item_index >= sd->status.inventorySize) + return; + + if (!refine->p->is_refinable(sd, item_index)) + return; + + int weapon_level = itemdb_wlv(sd->status.inventory[item_index].nameid), + refine_level = sd->status.inventory[item_index].refine, + i = 0; + const struct s_refine_requirement *req = &refine->p->dbs->refine_info[weapon_level].refine_requirements[refine_level]; + ARR_FIND(0, req->req_count, i, req->req[i].nameid == material_id); + + if (i == req->req_count) + return; + + if (use_blacksmith_blessing && req->blacksmith_blessing == 0) + return; + + if (sd->status.zeny < req->req[i].cost) + return; + + if (use_blacksmith_blessing) { + int count = 0; + for (int k = 0; k < sd->status.inventorySize; ++k) { + if (sd->status.inventory[k].nameid == ITEMID_BLACKSMITH_BLESSING) + count += sd->status.inventory[k].amount; + } + + if (count < req->blacksmith_blessing) + return; + } + + int idx; + if ((idx = pc->search_inventory(sd, req->req[i].nameid)) == INDEX_NOT_FOUND) + return; + + if (use_blacksmith_blessing) { + int amount = req->blacksmith_blessing; + for (int k = 0; k < sd->status.inventorySize; ++k) { + if (sd->status.inventory[k].nameid != ITEMID_BLACKSMITH_BLESSING) + continue; + + int delamount = (amount < sd->status.inventory[k].amount) ? amount : sd->status.inventory[k].amount; + if (pc->delitem(sd, k, delamount, 0, DELITEM_NORMAL, LOG_TYPE_REFINE) != 0) + break; + + amount -= delamount; + if (amount == 0) + break; + } + } + + if (pc->delitem(sd, idx, 1, 0, DELITEM_NORMAL, LOG_TYPE_REFINE) != 0) + return; + + if (pc->payzeny(sd, req->req[i].cost, LOG_TYPE_REFINE, NULL) != 0) + return; + + int refine_chance = refine->get_refine_chance(weapon_level, refine_level, req->req[i].type); + if (rnd() % 100 >= refine_chance) { + clif->misceffect(&sd->bl, 2); + + int failure_behabior = (use_blacksmith_blessing) ? REFINE_FAILURE_BEHAVIOR_KEEP : req->req[i].failure_behavior; + switch (failure_behabior) { + case REFINE_FAILURE_BEHAVIOR_KEEP: + clif->refine(sd->fd, 1, 0, sd->status.inventory[item_index].refine); + refine->refinery_add_item(sd, item_index); + break; + case REFINE_FAILURE_BEHAVIOR_DOWNGRADE: + sd->status.inventory[item_index].refine -= 1; + sd->status.inventory[item_index].refine = cap_value(sd->status.inventory[item_index].refine, 0, MAX_REFINE); + clif->refine(sd->fd, 2, item_index, sd->status.inventory[item_index].refine); + logs->pick_pc(sd, LOG_TYPE_REFINE, 1, &sd->status.inventory[item_index], sd->inventory_data[item_index]); + refine->refinery_add_item(sd, item_index); + break; + case REFINE_FAILURE_BEHAVIOR_DESTROY: + default: + clif->refine(sd->fd, 1, item_index, sd->status.inventory[item_index].refine); + pc->delitem(sd, item_index, 1, 0, DELITEM_FAILREFINE, LOG_TYPE_REFINE); + break; + } + } else { + sd->status.inventory[item_index].refine += 1; + sd->status.inventory[item_index].refine = cap_value(sd->status.inventory[item_index].refine, 0, MAX_REFINE); + + clif->misceffect(&sd->bl, 3); + clif->refine(sd->fd, 0, item_index, sd->status.inventory[item_index].refine); + logs->pick_pc(sd, LOG_TYPE_REFINE, 1, &sd->status.inventory[item_index], sd->inventory_data[item_index]); + refine->refinery_add_item(sd, item_index); + } +} + +/// @copydoc refine_interface::refinery_add_item() +static void refine_refinery_add_item(struct map_session_data *sd, int item_index) +{ + nullpo_retv(sd); + + if (item_index < 0 || item_index >= sd->status.inventorySize) + return; + + if (!refine->p->is_refinable(sd, item_index)) + return; + + int weapon_level = itemdb_wlv(sd->status.inventory[item_index].nameid); + int refine_level = sd->status.inventory[item_index].refine; + clif->AddItemRefineryUIAck(sd, item_index, &refine->p->dbs->refine_info[weapon_level].refine_requirements[refine_level]); +} + +/// @copydoc refine_interface_private::is_refinable() +static bool refine_is_refinable(struct map_session_data *sd, int item_index) +{ + nullpo_retr(false, sd); + Assert_retr(false, item_index >= 0 && item_index < sd->status.inventorySize); + + if (sd->status.inventory[item_index].nameid == 0) + return false; + + struct item_data *itd = itemdb->search(sd->status.inventory[item_index].nameid); + + if (itd == &itemdb->dummy) + return false; + + if (itd->type != IT_WEAPON && itd->type != IT_ARMOR) + return false; + + if (itd->flag.no_refine == 1) + return false; + + if (sd->status.inventory[item_index].identify == 0) + return false; + + if (sd->status.inventory[item_index].refine >= MAX_REFINE || sd->status.inventory[item_index].expire_time > 0) + return false; + + if ((sd->status.inventory[item_index].attribute & ATTR_BROKEN) != 0) + return false; + + return true; +} + /// @copydoc refine_interface::get_randombonus_max() static int refine_get_randombonus_max(enum refine_type equipment_type, int refine_level) { @@ -72,6 +222,221 @@ static int refine_get_refine_chance(enum refine_type wlv, int refine_level, enum return refine->p->dbs->refine_info[wlv].chance[type][refine_level]; } +/// @copydoc refine_interface_private::failure_behavior_string2enum() +static bool refine_failure_behavior_string2enum(const char *str, enum refine_ui_failure_behavior *result) +{ + nullpo_retr(false, str); + nullpo_retr(false, result); + + if (strcasecmp(str, "Destroy") == 0) + *result = REFINE_FAILURE_BEHAVIOR_DESTROY; + else if (strcasecmp(str, "Keep") == 0) + *result = REFINE_FAILURE_BEHAVIOR_KEEP; + else if (strcasecmp(str, "Downgrade") == 0) + *result = REFINE_FAILURE_BEHAVIOR_DOWNGRADE; + else + return false; + + return true; +} + +/// @copydoc refine_interface_private::readdb_refinery_ui_settings_items() +static bool refine_readdb_refinery_ui_settings_items(const struct config_setting_t *elem, struct s_refine_requirement *req, const char *name, const char *source) +{ + nullpo_retr(false, elem); + nullpo_retr(false, req); + nullpo_retr(false, name); + nullpo_retr(false, source); + Assert_retr(false, req->req_count < MAX_REFINE_REQUIREMENTS); + + const char *aegis_name = config_setting_name(elem); + struct item_data *itd; + + if ((itd = itemdb->search_name(aegis_name)) == NULL) { + ShowWarning("refine_readdb_requirements_items: Invalid item '%s' passed to requirements of '%s' in \"%s\" skipping...\n", aegis_name, name, source); + return false; + } + + for (int i = 0; i < req->req_count; ++i) { + if (req->req[i].nameid == itd->nameid) { + ShowWarning("refine_readdb_requirements_items: Duplicated item '%s' passed to requirements of '%s' in \"%s\" skipping...\n", aegis_name, name, source); + return false; + } + } + + const char *type_string = NULL; + if (libconfig->setting_lookup_string(elem, "Type", &type_string) == CONFIG_FALSE) { + ShowWarning("refine_readdb_requirements_items: no type passed to item '%s' of requirements of '%s' in \"%s\" skipping...\n", aegis_name, name, source); + return false; + } + + int type; + if (!script->get_constant(type_string, &type)) { + ShowWarning("refine_readdb_requirements_items: invalid type '%s' passed to item '%s' of requirements of '%s' in \"%s\" skipping...\n", type_string, aegis_name, name, source); + return false; + } + + int cost = 0; + if (libconfig->setting_lookup_int(elem, "Cost", &cost) == CONFIG_TRUE) { + if (cost < 1) { + ShowWarning("refine_readdb_requirements_items: invalid cost value %d passed to item '%s' of requirements of '%s' in \"%s\" defaulting to 0...\n", cost, aegis_name, name, source); + cost = 0; + } + } + + enum refine_ui_failure_behavior behavior = REFINE_FAILURE_BEHAVIOR_DESTROY; + const char *behavior_string = NULL; + if (libconfig->setting_lookup_string(elem, "FailureBehavior", &behavior_string) != CONFIG_FALSE) { + if (!refine->p->failure_behavior_string2enum(behavior_string, &behavior)) { + ShowWarning("refine_readdb_requirements_items: invalid failure behavior value %s passed to item '%s' of requirements of '%s' in \"%s\" defaulting to 'Destroy'...\n", behavior_string, aegis_name, name, source); + } + } + + req->req[req->req_count].nameid = itd->nameid; + req->req[req->req_count].type = type; + req->req[req->req_count].cost = cost; + req->req[req->req_count].failure_behavior = behavior; + req->req_count++; + + return true; +} + +/// @copydoc refine_interface_private::readdb_refinery_ui_settings_sub() +static bool refine_readdb_refinery_ui_settings_sub(const struct config_setting_t *elem, int type, const char *name, const char *source) +{ + nullpo_retr(false, elem); + nullpo_retr(false, name); + nullpo_retr(false, source); + Assert_retr(0, type >= REFINE_TYPE_ARMOR && type < REFINE_TYPE_MAX); + + struct config_setting_t *level_t; + bool levels[MAX_REFINE] = {0}; + + if ((level_t = libconfig->setting_get_member(elem, "Level")) == NULL) { + ShowWarning("refine_readdb_requirements_sub: a requirements element missing level field for entry '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + if (config_setting_is_scalar(level_t)) { + if (!config_setting_is_number(level_t)) { + ShowWarning("refine_readdb_requirements_sub: expected 'Level' field to be an integer '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + int refine_level = libconfig->setting_get_int(level_t); + if (refine_level < 1 || refine_level > MAX_REFINE) { + ShowWarning("refine_readdb_requirements_sub: Invalid 'Level' given value %d expected a value between %d and %d '%s' in \"%s\" skipping...\n", refine_level, 1, MAX_REFINE, name, source); + return false; + } + + levels[refine_level - 1] = true; + } else if (config_setting_is_aggregate(level_t)) { + if (libconfig->setting_length(level_t) != 2) { + ShowWarning("refine_readdb_requirements_sub: invalid length for Level array, expected 2 found %d for entry '%s' in \"%s\" skipping...\n", libconfig->setting_length(level_t), name, source); + return false; + } + + int levels_range[2]; + const struct config_setting_t *level_entry = NULL; + int i = 0, + k = 0; + while ((level_entry = libconfig->setting_get_elem(level_t, i++)) != NULL) { + if (!config_setting_is_number(level_entry)) { + ShowWarning("refine_readdb_requirements_sub: expected 'Level' array field to be an integer '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + levels_range[k] = libconfig->setting_get_int(level_entry); + if (levels_range[k] < 1 || levels_range[k] > MAX_REFINE) { + ShowWarning("refine_readdb_requirements_sub: Invalid 'Level' given value %d expected a value between %d and %d in entry'%s' in \"%s\" skipping...\n", levels_range[k], 1, MAX_REFINE, name, source); + return false; + } + + ++k; + } + + if (!(levels_range[0] < levels_range[1])) { + ShowWarning("refine_readdb_requirements_sub: Invalid 'Level' range was given low %d high %d in entry'%s' in \"%s\" skipping...\n", levels_range[0], levels_range[1], name, source); + return false; + } + + for (i = levels_range[0] - 1; i < levels_range[1]; ++i) { + levels[i] = true; + } + } + + struct s_refine_requirement req = {0}; + if (libconfig->setting_lookup_int(elem, "BlacksmithBlessing", &req.blacksmith_blessing) == CONFIG_TRUE) { + if (req.blacksmith_blessing < 1 || req.blacksmith_blessing > INT8_MAX) { + ShowWarning("refine_readdb_requirements_sub: Invalid 'BlacksmithBlessing' amount was given value %d expected a value between %d and %d in entry'%s' in \"%s\" defaulting to 0...\n", req.blacksmith_blessing, 1, INT8_MAX, name, source); + req.blacksmith_blessing = 0; + } + } + + struct config_setting_t *items_t; + if ((items_t = libconfig->setting_get_member(elem, "Items")) == NULL) { + ShowWarning("refine_readdb_requirements_sub: a requirements element missing Items element for entry '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + if (libconfig->setting_length(items_t) < 1) { + ShowWarning("refine_readdb_requirements_sub: an Items element containing no items passed for entry '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + int loaded_items = 0; + for (int i = 0; i < libconfig->setting_length(items_t); ++i) { + if (req.req_count >= MAX_REFINE_REQUIREMENTS) { + ShowWarning("refine_readdb_requirements_sub: Too many items passed to requirements maximum possible items is %d entry '%s' in \"%s\" skipping...\n", MAX_REFINE_REQUIREMENTS, name, source); + continue; + } + + struct config_setting_t *item_t = libconfig->setting_get_elem(items_t, i); + + if (!refine->p->readdb_refinery_ui_settings_items(item_t, &req, name, source)) + continue; + + loaded_items++; + } + + if (loaded_items == 0) { + ShowWarning("refine_readdb_requirements_sub: no valid items for requirements is passed for entry '%s' in \"%s\" skipping...\n", name, source); + return false; + } + + for (int i = 0; i < MAX_REFINE; ++i) { + if (!levels[i]) + continue; + + refine->p->dbs->refine_info[type].refine_requirements[i] = req; + } + + return true; +} + +/// @copydoc refine_interface_private::readdb_refinery_ui_settings() +static int refine_readdb_refinery_ui_settings(const struct config_setting_t *r, int type, const char *name, const char *source) +{ + nullpo_retr(0, r); + nullpo_retr(0, name); + nullpo_retr(0, source); + Assert_retr(0, type >= REFINE_TYPE_ARMOR && type < REFINE_TYPE_MAX); + + int i = 0; + const struct config_setting_t *elem = NULL; + while ((elem = libconfig->setting_get_elem(r, i++)) != NULL) { + refine->p->readdb_refinery_ui_settings_sub(elem, type, name, source); + } + + int retval = 0; + for (i = 0; i < MAX_REFINE; ++i) { + if (refine->p->dbs->refine_info[type].refine_requirements[i].req_count > 0) + retval++; + } + + return retval; +} + /// @copydoc refine_interface_private::readdb_refine_libconfig_sub() static int refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const char *name, const char *source) { @@ -92,6 +457,18 @@ static int refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const ShowError("status_readdb_refine_libconfig_sub: Out of range level for entry '%s' in \"%s\", skipping.\n", name, source); return 0; } + + struct config_setting_t *refinery_ui_settings; + if ((refinery_ui_settings = libconfig->setting_get_member(r, "RefineryUISettings")) == NULL) { + ShowWarning("status_readdb_refine_libconfig_sub: Missing Requirements for entry '%s' in \"%s\", skipping.\n", name, source); + return 0; + } + + if (refine->p->readdb_refinery_ui_settings(refinery_ui_settings, type, name, source) != MAX_REFINE) { + ShowWarning("status_readdb_refine_libconfig_sub: Not all refine levels have requrements entry for entry '%s' in \"%s\", skipping.\n", name, source); + return 0; + } + if (!libconfig->setting_lookup_int(r, "StatsPerLevel", &bonus_per_level)) { ShowWarning("status_readdb_refine_libconfig_sub: Missing StatsPerLevel for entry '%s' in \"%s\", skipping.\n", name, source); return 0; @@ -191,6 +568,8 @@ static int refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const /// @copydoc refine_interface_private::readdb_refine_libconfig() static int refine_readdb_refine_libconfig(const char *filename) { + nullpo_retr(0, filename); + bool duplicate[REFINE_TYPE_MAX]; struct config_t refine_db_conf; struct config_setting_t *r; @@ -244,9 +623,16 @@ void refine_defaults(void) refine->p->readdb_refine_libconfig = refine_readdb_refine_libconfig; refine->p->readdb_refine_libconfig_sub = refine_readdb_refine_libconfig_sub; + refine->p->failure_behavior_string2enum = refine_failure_behavior_string2enum; + refine->p->readdb_refinery_ui_settings_items = refine_readdb_refinery_ui_settings_items; + refine->p->readdb_refinery_ui_settings_sub = refine_readdb_refinery_ui_settings_sub; + refine->p->readdb_refinery_ui_settings = refine_readdb_refinery_ui_settings; + refine->p->is_refinable = refine_is_refinable; refine->init = refine_init; refine->final = refine_final; + refine->refinery_refine_request = refine_refinery_refine_request; + refine->refinery_add_item = refine_refinery_add_item; refine->get_refine_chance = refine_get_refine_chance; refine->get_bonus = refine_get_bonus; refine->get_randombonus_max = refine_get_randombonus_max; diff --git a/src/map/refine.h b/src/map/refine.h index 850f6143a..100d2c6b2 100644 --- a/src/map/refine.h +++ b/src/map/refine.h @@ -25,6 +25,7 @@ * Refine Interface. **/ #include "common/hercules.h" +#include "common/mmo.h" /* Defines */ /** @@ -60,6 +61,24 @@ enum refine_chance_type { REFINE_CHANCE_TYPE_MAX }; +enum refine_ui_failure_behavior { + REFINE_FAILURE_BEHAVIOR_DESTROY, + REFINE_FAILURE_BEHAVIOR_KEEP, + REFINE_FAILURE_BEHAVIOR_DOWNGRADE +}; + +/* Structure */ +struct s_refine_requirement { + int blacksmith_blessing; + int req_count; + struct { + int nameid; + int cost; + enum refine_chance_type type; + enum refine_ui_failure_behavior failure_behavior; + } req[MAX_REFINE_REQUIREMENTS]; +}; + /** * Refine Interface **/ @@ -101,6 +120,22 @@ struct refine_interface { * @return returns the bonus from refine db **/ int(*get_randombonus_max) (enum refine_type equipment_type, int refine_level); + + /** + * Validates and send Item addition packet to the client for refinery UI + * @param sd player session data. + * @param item_index the requested item index in inventory. + **/ + void (*refinery_add_item) (struct map_session_data *sd, int item_index); + + /** + * Processes an refine request through Refinery UI + * @param sd player session data + * @param item_index the index of the requested item + * @param material_id the refine material chosen by player + * @param use_blacksmith_blessing sets either if blacksmith blessing is requested to be used or not + **/ + void (*refinery_refine_request) (struct map_session_data *sd, int item_index, int material_id, bool use_blacksmith_blessing); }; #ifdef HERCULES_CORE diff --git a/src/map/refine.p.h b/src/map/refine.p.h index d47944315..e1a24f6b7 100644 --- a/src/map/refine.p.h +++ b/src/map/refine.p.h @@ -28,11 +28,11 @@ #include "refine.h" #include "common/conf.h" -/* Structures */ struct s_refine_info { - int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE]; // success chance - int bonus[MAX_REFINE]; // cumulative fixed bonus damage - int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage + int chance[REFINE_CHANCE_TYPE_MAX][MAX_REFINE]; //< success chance + int bonus[MAX_REFINE]; //< cumulative fixed bonus damage + int randombonus_max[MAX_REFINE]; //< cumulative maximum random bonus damage + struct s_refine_requirement refine_requirements[MAX_REFINE]; //< The requirements used for refinery UI }; struct refine_interface_dbs { @@ -66,6 +66,64 @@ struct refine_interface_private { * @return The number of found entries. **/ int (*readdb_refine_libconfig) (const char *filename); + + /** + * Converts refine database failure behvaior string to enum refine_ui_failure_behavior + * @param str the string to convert + * @param result pointer to where the converted value will be held + * @return true on success, false otherwise. + **/ + bool (*failure_behavior_string2enum) (const char *str, enum refine_ui_failure_behavior *result); + + /** + * Processes a refine_db.conf RefineryUISettings items entry. + * + * @param elem Libconfig setting entry. It is expected to be valid and it + * won't be freed (it is care of the caller to do so if + * necessary) + * @param req a pointer to requirements struct to fill with the item data + * @param name the current element name + * @param source Source of the entry (file name), to be displayed in case of + * validation errors. + * @return true on success, false otherwise. + **/ + bool (*readdb_refinery_ui_settings_items) (const struct config_setting_t *elem, struct s_refine_requirement *req, const char *name, const char *source); + + /** + * Processes a refine_db.conf RefineryUISettings entry. + * + * @param elem Libconfig setting entry. It is expected to be valid and it + * won't be freed (it is care of the caller to do so if + * necessary) + * @param type the type index in refine database to fill the data + * @param name the current element name + * @param source Source of the entry (file name), to be displayed in case of + * validation errors. + * @return true on success, false otherwise. + **/ + bool (*readdb_refinery_ui_settings_sub) (const struct config_setting_t *elem, int type, const char *name, const char *source); + + /** + * Reads a refine_db.conf RefineryUISettings entry and sends it to be processed. + * + * @param r Libconfig setting entry. It is expected to be valid and it + * won't be freed (it is care of the caller to do so if + * necessary) + * @param type the type index in refine database to fill the data + * @param name the current element name + * @param source Source of the entry (file name), to be displayed in case of + * validation errors. + * @return true on success, false otherwise. + **/ + int (*readdb_refinery_ui_settings) (const struct config_setting_t *r, int type, const char *name, const char *source); + + /** + * Checks if a given item in player's inventory is refineable. + * @param sd player session data. + * @param item_index the item index in player's inventory. + * @return true if item is refineable, false otherwise. + **/ + bool (*is_refinable) (struct map_session_data *sd, int item_index); }; #endif diff --git a/src/map/script.c b/src/map/script.c index 1cc1d3ad2..5843ac292 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -25286,6 +25286,25 @@ static BUILDIN(closeroulette) return true; } +static BUILDIN(openrefineryui) +{ + struct map_session_data *sd = script_rid2sd(st); + + if (sd == NULL) { + script_pushint(st, 0); + return true; + } + + if (battle_config.enable_refinery_ui == 0) { + script_pushint(st, 0); + return true; + } + + clif->OpenRefineryUI(sd); + script_pushint(st, 1); + return true; +} + /** * Adds a built-in script function. * @@ -26039,6 +26058,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(getInventorySize, ""), BUILDIN_DEF(closeroulette, ""), + BUILDIN_DEF(openrefineryui, ""), }; int i, len = ARRAYLENGTH(BUILDIN); RECREATE(script->buildin, char *, script->buildin_count + len); // Pre-alloc to speed up -- cgit v1.2.3-70-g09d2 From f03c5ef6f787c85f3f745de06757b45c5c5d6ede Mon Sep 17 00:00:00 2001 From: Ibrahim Zidan Date: Sat, 13 Apr 2019 21:18:53 +0200 Subject: HPM Hooks update Signed-off-by: Ibrahim Zidan --- src/common/HPMDataCheck.h | 14 +- src/common/HPMSymbols.inc.h | 7 + src/plugins/HPMHooking.c | 2 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 60 +- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 98 ++- .../HPMHooking/HPMHooking_map.HookingPoints.inc | 26 +- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 665 ++++++++++++++++++--- src/plugins/HPMHooking/HPMHooking_map.sources.inc | 2 + 8 files changed, 755 insertions(+), 119 deletions(-) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 966e63d29..db0594ff6 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -892,6 +892,19 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #else #define MAP_QUEST_H #endif // MAP_QUEST_H + #ifdef MAP_REFINE_H + { "refine_interface", sizeof(struct refine_interface), SERVER_TYPE_MAP }, + { "s_refine_requirement", sizeof(struct s_refine_requirement), SERVER_TYPE_MAP }, + #else + #define MAP_REFINE_H + #endif // MAP_REFINE_H + #ifdef MAP_REFINE_P_H + { "refine_interface_dbs", sizeof(struct refine_interface_dbs), SERVER_TYPE_MAP }, + { "refine_interface_private", sizeof(struct refine_interface_private), SERVER_TYPE_MAP }, + { "s_refine_info", sizeof(struct s_refine_info), SERVER_TYPE_MAP }, + #else + #define MAP_REFINE_P_H + #endif // MAP_REFINE_P_H #ifdef MAP_RODEX_H { "rodex_interface", sizeof(struct rodex_interface), SERVER_TYPE_MAP }, #else @@ -954,7 +967,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { #ifdef MAP_STATUS_H { "regen_data", sizeof(struct regen_data), SERVER_TYPE_MAP }, { "regen_data_sub", sizeof(struct regen_data_sub), SERVER_TYPE_MAP }, - { "s_refine_info", sizeof(struct s_refine_info), SERVER_TYPE_MAP }, { "s_status_dbs", sizeof(struct s_status_dbs), SERVER_TYPE_MAP }, { "sc_display_entry", sizeof(struct sc_display_entry), SERVER_TYPE_MAP }, { "status_change", sizeof(struct status_change), SERVER_TYPE_MAP }, diff --git a/src/common/HPMSymbols.inc.h b/src/common/HPMSymbols.inc.h index 9410f0586..f92899114 100644 --- a/src/common/HPMSymbols.inc.h +++ b/src/common/HPMSymbols.inc.h @@ -245,6 +245,9 @@ struct pincode_interface *pincode; #ifdef MAP_QUEST_H /* quest */ struct quest_interface *quest; #endif // MAP_QUEST_H +#ifdef MAP_REFINE_H /* refine */ +struct refine_interface *refine; +#endif // MAP_REFINE_H #ifdef COMMON_RANDOM_H /* rnd */ struct rnd_interface *rnd; #endif // COMMON_RANDOM_H @@ -601,6 +604,10 @@ HPExport const char *HPM_shared_symbols(int server_type) if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("quest", quest)) return "quest"; #endif // MAP_QUEST_H +#ifdef MAP_REFINE_H /* refine */ + if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("refine", refine)) + return "refine"; +#endif // MAP_REFINE_H #ifdef COMMON_RANDOM_H /* rnd */ if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("rnd", rnd)) return "rnd"; diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index f95a3a92d..8e7ed4823 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -106,6 +106,8 @@ PRAGMA_GCC5(GCC diagnostic ignored "-Wdiscarded-qualifiers") #include "map/pet.h" #include "map/quest.h" #include "map/rodex.h" +#include "map/refine.h" +#include "map/refine.p.h" #include "map/script.h" #include "map/skill.h" #include "map/status.h" diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 715e19a48..f6fa6a5e8 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2702,6 +2702,18 @@ typedef void (*HPMHOOK_pre_clif_loadConfirm) (struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_loadConfirm) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_send_selforarea) (int *fd, struct block_list **bl, const void **buf, int *len); typedef void (*HPMHOOK_post_clif_send_selforarea) (int fd, struct block_list *bl, const void *buf, int len); +typedef void (*HPMHOOK_pre_clif_OpenRefineryUI) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_OpenRefineryUI) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pAddItemRefineryUI) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pAddItemRefineryUI) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_AddItemRefineryUIAck) (struct map_session_data **sd, int *item_index, struct s_refine_requirement **req); +typedef void (*HPMHOOK_post_clif_AddItemRefineryUIAck) (struct map_session_data *sd, int item_index, struct s_refine_requirement *req); +typedef void (*HPMHOOK_pre_clif_pRefineryUIClose) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pRefineryUIClose) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pRefineryUIRefine) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pRefineryUIRefine) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_announce_refine_status) (struct map_session_data **sd, int *item_id, int *refine_level, bool *success, enum send_target *target); +typedef void (*HPMHOOK_post_clif_announce_refine_status) (struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target); #endif // MAP_CLIF_H #ifdef COMMON_CORE_H /* cmdline */ typedef void (*HPMHOOK_pre_cmdline_init) (void); @@ -4342,8 +4354,8 @@ typedef char (*HPMHOOK_pre_logs_picktype2char) (e_log_pick_type *type); typedef char (*HPMHOOK_post_logs_picktype2char) (char retVal___, e_log_pick_type type); typedef char (*HPMHOOK_pre_logs_chattype2char) (e_log_chat_type *type); typedef char (*HPMHOOK_post_logs_chattype2char) (char retVal___, e_log_chat_type type); -typedef bool (*HPMHOOK_pre_logs_should_log_item) (int *nameid, int *amount, int *refine, struct item_data **id); -typedef bool (*HPMHOOK_post_logs_should_log_item) (bool retVal___, int nameid, int amount, int refine, struct item_data *id); +typedef bool (*HPMHOOK_pre_logs_should_log_item) (int *nameid, int *amount, int *refine_level, struct item_data **id); +typedef bool (*HPMHOOK_post_logs_should_log_item) (bool retVal___, int nameid, int amount, int refine_level, struct item_data *id); #endif // MAP_LOG_H #ifdef LOGIN_LOGIN_H /* login */ typedef int (*HPMHOOK_pre_login_mmo_auth) (struct login_session_data **sd, bool *isServer); @@ -6617,6 +6629,40 @@ typedef bool (*HPMHOOK_post_quest_questinfo_validate_mercenary_class) (bool retV typedef void (*HPMHOOK_pre_quest_questinfo_vector_clear) (int *m); typedef void (*HPMHOOK_post_quest_questinfo_vector_clear) (int m); #endif // MAP_QUEST_H +#ifdef MAP_REFINE_H /* refine */ +typedef int (*HPMHOOK_pre_refine_init) (bool *minimal); +typedef int (*HPMHOOK_post_refine_init) (int retVal___, bool minimal); +typedef void (*HPMHOOK_pre_refine_final) (void); +typedef void (*HPMHOOK_post_refine_final) (void); +typedef int (*HPMHOOK_pre_refine_get_refine_chance) (enum refine_type *wlv, int *refine_level, enum refine_chance_type *type); +typedef int (*HPMHOOK_post_refine_get_refine_chance) (int retVal___, enum refine_type wlv, int refine_level, enum refine_chance_type type); +typedef int (*HPMHOOK_pre_refine_get_bonus) (enum refine_type *equipment_type, int *refine_level); +typedef int (*HPMHOOK_post_refine_get_bonus) (int retVal___, enum refine_type equipment_type, int refine_level); +typedef int (*HPMHOOK_pre_refine_get_randombonus_max) (enum refine_type *equipment_type, int *refine_level); +typedef int (*HPMHOOK_post_refine_get_randombonus_max) (int retVal___, enum refine_type equipment_type, int refine_level); +typedef void (*HPMHOOK_pre_refine_refinery_add_item) (struct map_session_data **sd, int *item_index); +typedef void (*HPMHOOK_post_refine_refinery_add_item) (struct map_session_data *sd, int item_index); +typedef void (*HPMHOOK_pre_refine_refinery_refine_request) (struct map_session_data **sd, int *item_index, int *material_id, bool *use_blacksmith_blessing); +typedef void (*HPMHOOK_post_refine_refinery_refine_request) (struct map_session_data *sd, int item_index, int material_id, bool use_blacksmith_blessing); +#endif // MAP_REFINE_H +#ifdef MAP_REFINE_P_H /* PRIV__refine */ +typedef int (*HPMHOOK_pre_PRIV__refine_readdb_refine_libconfig_sub) (struct config_setting_t **r, const char **name, const char **source); +typedef int (*HPMHOOK_post_PRIV__refine_readdb_refine_libconfig_sub) (int retVal___, struct config_setting_t *r, const char *name, const char *source); +typedef int (*HPMHOOK_pre_PRIV__refine_readdb_refine_libconfig) (const char **filename); +typedef int (*HPMHOOK_post_PRIV__refine_readdb_refine_libconfig) (int retVal___, const char *filename); +typedef bool (*HPMHOOK_pre_PRIV__refine_announce_behavior_string2enum) (const char **str, unsigned int **result); +typedef bool (*HPMHOOK_post_PRIV__refine_announce_behavior_string2enum) (bool retVal___, const char *str, unsigned int *result); +typedef bool (*HPMHOOK_pre_PRIV__refine_failure_behavior_string2enum) (const char **str, enum refine_ui_failure_behavior **result); +typedef bool (*HPMHOOK_post_PRIV__refine_failure_behavior_string2enum) (bool retVal___, const char *str, enum refine_ui_failure_behavior *result); +typedef bool (*HPMHOOK_pre_PRIV__refine_readdb_refinery_ui_settings_items) (const struct config_setting_t **elem, struct s_refine_requirement **req, const char **name, const char **source); +typedef bool (*HPMHOOK_post_PRIV__refine_readdb_refinery_ui_settings_items) (bool retVal___, const struct config_setting_t *elem, struct s_refine_requirement *req, const char *name, const char *source); +typedef bool (*HPMHOOK_pre_PRIV__refine_readdb_refinery_ui_settings_sub) (const struct config_setting_t **elem, int *type, const char **name, const char **source); +typedef bool (*HPMHOOK_post_PRIV__refine_readdb_refinery_ui_settings_sub) (bool retVal___, const struct config_setting_t *elem, int type, const char *name, const char *source); +typedef int (*HPMHOOK_pre_PRIV__refine_readdb_refinery_ui_settings) (const struct config_setting_t **r, int *type, const char **name, const char **source); +typedef int (*HPMHOOK_post_PRIV__refine_readdb_refinery_ui_settings) (int retVal___, const struct config_setting_t *r, int type, const char *name, const char *source); +typedef bool (*HPMHOOK_pre_PRIV__refine_is_refinable) (struct map_session_data **sd, int *item_index); +typedef bool (*HPMHOOK_post_PRIV__refine_is_refinable) (bool retVal___, struct map_session_data *sd, int item_index); +#endif // MAP_REFINE_P_H #ifdef COMMON_RANDOM_H /* rnd */ typedef void (*HPMHOOK_pre_rnd_init) (void); typedef void (*HPMHOOK_post_rnd_init) (void); @@ -7064,8 +7110,8 @@ typedef bool (*HPMHOOK_pre_searchstore_queryremote) (struct map_session_data **s typedef bool (*HPMHOOK_post_searchstore_queryremote) (bool retVal___, struct map_session_data *sd, int account_id); typedef void (*HPMHOOK_pre_searchstore_clearremote) (struct map_session_data **sd); typedef void (*HPMHOOK_post_searchstore_clearremote) (struct map_session_data *sd); -typedef bool (*HPMHOOK_pre_searchstore_result) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, int *nameid, unsigned short *amount, unsigned int *price, const int **card, unsigned char *refine, const struct item_option **option); -typedef bool (*HPMHOOK_post_searchstore_result) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine, const struct item_option *option); +typedef bool (*HPMHOOK_pre_searchstore_result) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, int *nameid, unsigned short *amount, unsigned int *price, const int **card, unsigned char *refine_level, const struct item_option **option); +typedef bool (*HPMHOOK_post_searchstore_result) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine_level, const struct item_option *option); #endif // MAP_SEARCHSTORE_H #ifdef COMMON_SHOWMSG_H /* showmsg */ typedef void (*HPMHOOK_pre_showmsg_init) (void); @@ -7702,8 +7748,6 @@ typedef int (*HPMHOOK_pre_status_init) (bool *minimal); typedef int (*HPMHOOK_post_status_init) (int retVal___, bool minimal); typedef void (*HPMHOOK_pre_status_final) (void); typedef void (*HPMHOOK_post_status_final) (void); -typedef int (*HPMHOOK_pre_status_get_refine_chance) (enum refine_type *wlv, int *refine, enum refine_chance_type *type); -typedef int (*HPMHOOK_post_status_get_refine_chance) (int retVal___, enum refine_type wlv, int refine, enum refine_chance_type type); typedef sc_type (*HPMHOOK_pre_status_skill2sc) (int *skill_id); typedef sc_type (*HPMHOOK_post_status_skill2sc) (sc_type retVal___, int skill_id); typedef int (*HPMHOOK_pre_status_sc2skill) (sc_type *sc); @@ -7934,10 +7978,6 @@ typedef bool (*HPMHOOK_pre_status_readdb_job2) (char **fields[], int *columns, i typedef bool (*HPMHOOK_post_status_readdb_job2) (bool retVal___, char *fields[], int columns, int current); typedef bool (*HPMHOOK_pre_status_readdb_sizefix) (char **fields[], int *columns, int *current); typedef bool (*HPMHOOK_post_status_readdb_sizefix) (bool retVal___, char *fields[], int columns, int current); -typedef int (*HPMHOOK_pre_status_readdb_refine_libconfig) (const char **filename); -typedef int (*HPMHOOK_post_status_readdb_refine_libconfig) (int retVal___, const char *filename); -typedef int (*HPMHOOK_pre_status_readdb_refine_libconfig_sub) (struct config_setting_t **r, const char **name, const char **source); -typedef int (*HPMHOOK_post_status_readdb_refine_libconfig_sub) (int retVal___, struct config_setting_t *r, const char *name, const char *source); typedef bool (*HPMHOOK_pre_status_readdb_scconfig) (char **fields[], int *columns, int *current); typedef bool (*HPMHOOK_post_status_readdb_scconfig) (bool retVal___, char *fields[], int columns, int current); typedef void (*HPMHOOK_pre_status_read_job_db) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 671d8ad8a..9c0b1905e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2292,6 +2292,18 @@ struct { struct HPMHookPoint *HP_clif_loadConfirm_post; struct HPMHookPoint *HP_clif_send_selforarea_pre; struct HPMHookPoint *HP_clif_send_selforarea_post; + struct HPMHookPoint *HP_clif_OpenRefineryUI_pre; + struct HPMHookPoint *HP_clif_OpenRefineryUI_post; + struct HPMHookPoint *HP_clif_pAddItemRefineryUI_pre; + struct HPMHookPoint *HP_clif_pAddItemRefineryUI_post; + struct HPMHookPoint *HP_clif_AddItemRefineryUIAck_pre; + struct HPMHookPoint *HP_clif_AddItemRefineryUIAck_post; + struct HPMHookPoint *HP_clif_pRefineryUIClose_pre; + struct HPMHookPoint *HP_clif_pRefineryUIClose_post; + struct HPMHookPoint *HP_clif_pRefineryUIRefine_pre; + struct HPMHookPoint *HP_clif_pRefineryUIRefine_post; + struct HPMHookPoint *HP_clif_announce_refine_status_pre; + struct HPMHookPoint *HP_clif_announce_refine_status_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -5126,6 +5138,36 @@ struct { struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_post; struct HPMHookPoint *HP_quest_questinfo_vector_clear_pre; struct HPMHookPoint *HP_quest_questinfo_vector_clear_post; + struct HPMHookPoint *HP_refine_init_pre; + struct HPMHookPoint *HP_refine_init_post; + struct HPMHookPoint *HP_refine_final_pre; + struct HPMHookPoint *HP_refine_final_post; + struct HPMHookPoint *HP_refine_get_refine_chance_pre; + struct HPMHookPoint *HP_refine_get_refine_chance_post; + struct HPMHookPoint *HP_refine_get_bonus_pre; + struct HPMHookPoint *HP_refine_get_bonus_post; + struct HPMHookPoint *HP_refine_get_randombonus_max_pre; + struct HPMHookPoint *HP_refine_get_randombonus_max_post; + struct HPMHookPoint *HP_refine_refinery_add_item_pre; + struct HPMHookPoint *HP_refine_refinery_add_item_post; + struct HPMHookPoint *HP_refine_refinery_refine_request_pre; + struct HPMHookPoint *HP_refine_refinery_refine_request_post; + struct HPMHookPoint *HP_PRIV__refine_readdb_refine_libconfig_sub_pre; + struct HPMHookPoint *HP_PRIV__refine_readdb_refine_libconfig_sub_post; + struct HPMHookPoint *HP_PRIV__refine_readdb_refine_libconfig_pre; + struct HPMHookPoint *HP_PRIV__refine_readdb_refine_libconfig_post; + struct HPMHookPoint *HP_PRIV__refine_announce_behavior_string2enum_pre; + struct HPMHookPoint *HP_PRIV__refine_announce_behavior_string2enum_post; + struct HPMHookPoint *HP_PRIV__refine_failure_behavior_string2enum_pre; + struct HPMHookPoint *HP_PRIV__refine_failure_behavior_string2enum_post; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_items_pre; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_items_post; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_sub_pre; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_sub_post; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_pre; + struct HPMHookPoint *HP_PRIV__refine_readdb_refinery_ui_settings_post; + struct HPMHookPoint *HP_PRIV__refine_is_refinable_pre; + struct HPMHookPoint *HP_PRIV__refine_is_refinable_post; struct HPMHookPoint *HP_rnd_init_pre; struct HPMHookPoint *HP_rnd_init_post; struct HPMHookPoint *HP_rnd_final_pre; @@ -6194,8 +6236,6 @@ struct { struct HPMHookPoint *HP_status_init_post; struct HPMHookPoint *HP_status_final_pre; struct HPMHookPoint *HP_status_final_post; - struct HPMHookPoint *HP_status_get_refine_chance_pre; - struct HPMHookPoint *HP_status_get_refine_chance_post; struct HPMHookPoint *HP_status_skill2sc_pre; struct HPMHookPoint *HP_status_skill2sc_post; struct HPMHookPoint *HP_status_sc2skill_pre; @@ -6426,10 +6466,6 @@ struct { struct HPMHookPoint *HP_status_readdb_job2_post; struct HPMHookPoint *HP_status_readdb_sizefix_pre; struct HPMHookPoint *HP_status_readdb_sizefix_post; - struct HPMHookPoint *HP_status_readdb_refine_libconfig_pre; - struct HPMHookPoint *HP_status_readdb_refine_libconfig_post; - struct HPMHookPoint *HP_status_readdb_refine_libconfig_sub_pre; - struct HPMHookPoint *HP_status_readdb_refine_libconfig_sub_post; struct HPMHookPoint *HP_status_readdb_scconfig_pre; struct HPMHookPoint *HP_status_readdb_scconfig_post; struct HPMHookPoint *HP_status_read_job_db_pre; @@ -9037,6 +9073,18 @@ struct { int HP_clif_loadConfirm_post; int HP_clif_send_selforarea_pre; int HP_clif_send_selforarea_post; + int HP_clif_OpenRefineryUI_pre; + int HP_clif_OpenRefineryUI_post; + int HP_clif_pAddItemRefineryUI_pre; + int HP_clif_pAddItemRefineryUI_post; + int HP_clif_AddItemRefineryUIAck_pre; + int HP_clif_AddItemRefineryUIAck_post; + int HP_clif_pRefineryUIClose_pre; + int HP_clif_pRefineryUIClose_post; + int HP_clif_pRefineryUIRefine_pre; + int HP_clif_pRefineryUIRefine_post; + int HP_clif_announce_refine_status_pre; + int HP_clif_announce_refine_status_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -11871,6 +11919,36 @@ struct { int HP_quest_questinfo_validate_mercenary_class_post; int HP_quest_questinfo_vector_clear_pre; int HP_quest_questinfo_vector_clear_post; + int HP_refine_init_pre; + int HP_refine_init_post; + int HP_refine_final_pre; + int HP_refine_final_post; + int HP_refine_get_refine_chance_pre; + int HP_refine_get_refine_chance_post; + int HP_refine_get_bonus_pre; + int HP_refine_get_bonus_post; + int HP_refine_get_randombonus_max_pre; + int HP_refine_get_randombonus_max_post; + int HP_refine_refinery_add_item_pre; + int HP_refine_refinery_add_item_post; + int HP_refine_refinery_refine_request_pre; + int HP_refine_refinery_refine_request_post; + int HP_PRIV__refine_readdb_refine_libconfig_sub_pre; + int HP_PRIV__refine_readdb_refine_libconfig_sub_post; + int HP_PRIV__refine_readdb_refine_libconfig_pre; + int HP_PRIV__refine_readdb_refine_libconfig_post; + int HP_PRIV__refine_announce_behavior_string2enum_pre; + int HP_PRIV__refine_announce_behavior_string2enum_post; + int HP_PRIV__refine_failure_behavior_string2enum_pre; + int HP_PRIV__refine_failure_behavior_string2enum_post; + int HP_PRIV__refine_readdb_refinery_ui_settings_items_pre; + int HP_PRIV__refine_readdb_refinery_ui_settings_items_post; + int HP_PRIV__refine_readdb_refinery_ui_settings_sub_pre; + int HP_PRIV__refine_readdb_refinery_ui_settings_sub_post; + int HP_PRIV__refine_readdb_refinery_ui_settings_pre; + int HP_PRIV__refine_readdb_refinery_ui_settings_post; + int HP_PRIV__refine_is_refinable_pre; + int HP_PRIV__refine_is_refinable_post; int HP_rnd_init_pre; int HP_rnd_init_post; int HP_rnd_final_pre; @@ -12939,8 +13017,6 @@ struct { int HP_status_init_post; int HP_status_final_pre; int HP_status_final_post; - int HP_status_get_refine_chance_pre; - int HP_status_get_refine_chance_post; int HP_status_skill2sc_pre; int HP_status_skill2sc_post; int HP_status_sc2skill_pre; @@ -13171,10 +13247,6 @@ struct { int HP_status_readdb_job2_post; int HP_status_readdb_sizefix_pre; int HP_status_readdb_sizefix_post; - int HP_status_readdb_refine_libconfig_pre; - int HP_status_readdb_refine_libconfig_post; - int HP_status_readdb_refine_libconfig_sub_pre; - int HP_status_readdb_refine_libconfig_sub_post; int HP_status_readdb_scconfig_pre; int HP_status_readdb_scconfig_post; int HP_status_read_job_db_pre; @@ -13564,6 +13636,8 @@ struct { struct pcre_interface libpcre; struct pet_interface pet; struct quest_interface quest; + struct refine_interface refine; + struct refine_interface_private PRIV__refine; struct rnd_interface rnd; struct rodex_interface rodex; struct script_interface script; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index b33cc6f4e..6c0b6db36 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1170,6 +1170,12 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->pResetCooldown, HP_clif_pResetCooldown) }, { HP_POP(clif->loadConfirm, HP_clif_loadConfirm) }, { HP_POP(clif->send_selforarea, HP_clif_send_selforarea) }, + { HP_POP(clif->OpenRefineryUI, HP_clif_OpenRefineryUI) }, + { HP_POP(clif->pAddItemRefineryUI, HP_clif_pAddItemRefineryUI) }, + { HP_POP(clif->AddItemRefineryUIAck, HP_clif_AddItemRefineryUIAck) }, + { HP_POP(clif->pRefineryUIClose, HP_clif_pRefineryUIClose) }, + { HP_POP(clif->pRefineryUIRefine, HP_clif_pRefineryUIRefine) }, + { HP_POP(clif->announce_refine_status, HP_clif_announce_refine_status) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -2624,6 +2630,23 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->questinfo_validate_quests, HP_quest_questinfo_validate_quests) }, { HP_POP(quest->questinfo_validate_mercenary_class, HP_quest_questinfo_validate_mercenary_class) }, { HP_POP(quest->questinfo_vector_clear, HP_quest_questinfo_vector_clear) }, +/* refine_interface */ + { HP_POP(refine->init, HP_refine_init) }, + { HP_POP(refine->final, HP_refine_final) }, + { HP_POP(refine->get_refine_chance, HP_refine_get_refine_chance) }, + { HP_POP(refine->get_bonus, HP_refine_get_bonus) }, + { HP_POP(refine->get_randombonus_max, HP_refine_get_randombonus_max) }, + { HP_POP(refine->refinery_add_item, HP_refine_refinery_add_item) }, + { HP_POP(refine->refinery_refine_request, HP_refine_refinery_refine_request) }, +/* refine_interface_private */ + { HP_POP(refine->p->readdb_refine_libconfig_sub, HP_PRIV__refine_readdb_refine_libconfig_sub) }, + { HP_POP(refine->p->readdb_refine_libconfig, HP_PRIV__refine_readdb_refine_libconfig) }, + { HP_POP(refine->p->announce_behavior_string2enum, HP_PRIV__refine_announce_behavior_string2enum) }, + { HP_POP(refine->p->failure_behavior_string2enum, HP_PRIV__refine_failure_behavior_string2enum) }, + { HP_POP(refine->p->readdb_refinery_ui_settings_items, HP_PRIV__refine_readdb_refinery_ui_settings_items) }, + { HP_POP(refine->p->readdb_refinery_ui_settings_sub, HP_PRIV__refine_readdb_refinery_ui_settings_sub) }, + { HP_POP(refine->p->readdb_refinery_ui_settings, HP_PRIV__refine_readdb_refinery_ui_settings) }, + { HP_POP(refine->p->is_refinable, HP_PRIV__refine_is_refinable) }, /* rnd_interface */ { HP_POP(rnd->init, HP_rnd_init) }, { HP_POP(rnd->final, HP_rnd_final) }, @@ -3167,7 +3190,6 @@ struct HookingPointData HookingPoints[] = { /* status_interface */ { HP_POP(status->init, HP_status_init) }, { HP_POP(status->final, HP_status_final) }, - { HP_POP(status->get_refine_chance, HP_status_get_refine_chance) }, { HP_POP(status->skill2sc, HP_status_skill2sc) }, { HP_POP(status->sc2skill, HP_status_sc2skill) }, { HP_POP(status->sc2scb_flag, HP_status_sc2scb_flag) }, @@ -3283,8 +3305,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->natural_heal_timer, HP_status_natural_heal_timer) }, { HP_POP(status->readdb_job2, HP_status_readdb_job2) }, { HP_POP(status->readdb_sizefix, HP_status_readdb_sizefix) }, - { HP_POP(status->readdb_refine_libconfig, HP_status_readdb_refine_libconfig) }, - { HP_POP(status->readdb_refine_libconfig_sub, HP_status_readdb_refine_libconfig_sub) }, { HP_POP(status->readdb_scconfig, HP_status_readdb_scconfig) }, { HP_POP(status->read_job_db, HP_status_read_job_db) }, { HP_POP(status->read_job_db_sub, HP_status_read_job_db_sub) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 4bfa46abe..44fb02b62 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -29881,6 +29881,162 @@ void HP_clif_send_selforarea(int fd, struct block_list *bl, const void *buf, int } return; } +void HP_clif_OpenRefineryUI(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_OpenRefineryUI_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_OpenRefineryUI_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_OpenRefineryUI_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.OpenRefineryUI(sd); + } + if (HPMHooks.count.HP_clif_OpenRefineryUI_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_OpenRefineryUI_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_OpenRefineryUI_post[hIndex].func; + postHookFunc(sd); + } + } + return; +} +void HP_clif_pAddItemRefineryUI(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pAddItemRefineryUI_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAddItemRefineryUI_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pAddItemRefineryUI_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pAddItemRefineryUI(fd, sd); + } + if (HPMHooks.count.HP_clif_pAddItemRefineryUI_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pAddItemRefineryUI_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pAddItemRefineryUI_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_AddItemRefineryUIAck(struct map_session_data *sd, int item_index, struct s_refine_requirement *req) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_AddItemRefineryUIAck_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *item_index, struct s_refine_requirement **req); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_AddItemRefineryUIAck_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_AddItemRefineryUIAck_pre[hIndex].func; + preHookFunc(&sd, &item_index, &req); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.AddItemRefineryUIAck(sd, item_index, req); + } + if (HPMHooks.count.HP_clif_AddItemRefineryUIAck_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int item_index, struct s_refine_requirement *req); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_AddItemRefineryUIAck_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_AddItemRefineryUIAck_post[hIndex].func; + postHookFunc(sd, item_index, req); + } + } + return; +} +void HP_clif_pRefineryUIClose(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pRefineryUIClose_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRefineryUIClose_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pRefineryUIClose_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pRefineryUIClose(fd, sd); + } + if (HPMHooks.count.HP_clif_pRefineryUIClose_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRefineryUIClose_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pRefineryUIClose_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_pRefineryUIRefine(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pRefineryUIRefine_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRefineryUIRefine_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pRefineryUIRefine_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pRefineryUIRefine(fd, sd); + } + if (HPMHooks.count.HP_clif_pRefineryUIRefine_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pRefineryUIRefine_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pRefineryUIRefine_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} +void HP_clif_announce_refine_status(struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_announce_refine_status_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *item_id, int *refine_level, bool *success, enum send_target *target); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_announce_refine_status_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_announce_refine_status_pre[hIndex].func; + preHookFunc(&sd, &item_id, &refine_level, &success, &target); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.announce_refine_status(sd, item_id, refine_level, success, target); + } + if (HPMHooks.count.HP_clif_announce_refine_status_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_announce_refine_status_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_announce_refine_status_post[hIndex].func; + postHookFunc(sd, item_id, refine_level, success, target); + } + } + return; +} /* cmdline_interface */ void HP_cmdline_init(void) { int hIndex = 0; @@ -45278,15 +45434,15 @@ char HP_logs_chattype2char(e_log_chat_type type) { } return retVal___; } -bool HP_logs_should_log_item(int nameid, int amount, int refine, struct item_data *id) { +bool HP_logs_should_log_item(int nameid, int amount, int refine_level, struct item_data *id) { int hIndex = 0; bool retVal___ = false; if (HPMHooks.count.HP_logs_should_log_item_pre > 0) { - bool (*preHookFunc) (int *nameid, int *amount, int *refine, struct item_data **id); + bool (*preHookFunc) (int *nameid, int *amount, int *refine_level, struct item_data **id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_logs_should_log_item_pre[hIndex].func; - retVal___ = preHookFunc(&nameid, &amount, &refine, &id); + retVal___ = preHookFunc(&nameid, &amount, &refine_level, &id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -45294,13 +45450,13 @@ bool HP_logs_should_log_item(int nameid, int amount, int refine, struct item_dat } } { - retVal___ = HPMHooks.source.logs.should_log_item(nameid, amount, refine, id); + retVal___ = HPMHooks.source.logs.should_log_item(nameid, amount, refine_level, id); } if (HPMHooks.count.HP_logs_should_log_item_post > 0) { - bool (*postHookFunc) (bool retVal___, int nameid, int amount, int refine, struct item_data *id); + bool (*postHookFunc) (bool retVal___, int nameid, int amount, int refine_level, struct item_data *id); for (hIndex = 0; hIndex < HPMHooks.count.HP_logs_should_log_item_post; hIndex++) { postHookFunc = HPMHooks.list.HP_logs_should_log_item_post[hIndex].func; - retVal___ = postHookFunc(retVal___, nameid, amount, refine, id); + retVal___ = postHookFunc(retVal___, nameid, amount, refine_level, id); } } return retVal___; @@ -68265,6 +68421,410 @@ void HP_quest_questinfo_vector_clear(int m) { } return; } +/* refine_interface */ +int HP_refine_init(bool minimal) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_refine_init_pre > 0) { + int (*preHookFunc) (bool *minimal); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_init_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_init_pre[hIndex].func; + retVal___ = preHookFunc(&minimal); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.refine.init(minimal); + } + if (HPMHooks.count.HP_refine_init_post > 0) { + int (*postHookFunc) (int retVal___, bool minimal); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_init_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_init_post[hIndex].func; + retVal___ = postHookFunc(retVal___, minimal); + } + } + return retVal___; +} +void HP_refine_final(void) { + int hIndex = 0; + if (HPMHooks.count.HP_refine_final_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_final_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_final_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.refine.final(); + } + if (HPMHooks.count.HP_refine_final_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_final_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_final_post[hIndex].func; + postHookFunc(); + } + } + return; +} +int HP_refine_get_refine_chance(enum refine_type wlv, int refine_level, enum refine_chance_type type) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_refine_get_refine_chance_pre > 0) { + int (*preHookFunc) (enum refine_type *wlv, int *refine_level, enum refine_chance_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_refine_chance_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_get_refine_chance_pre[hIndex].func; + retVal___ = preHookFunc(&wlv, &refine_level, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.refine.get_refine_chance(wlv, refine_level, type); + } + if (HPMHooks.count.HP_refine_get_refine_chance_post > 0) { + int (*postHookFunc) (int retVal___, enum refine_type wlv, int refine_level, enum refine_chance_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_refine_chance_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_get_refine_chance_post[hIndex].func; + retVal___ = postHookFunc(retVal___, wlv, refine_level, type); + } + } + return retVal___; +} +int HP_refine_get_bonus(enum refine_type equipment_type, int refine_level) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_refine_get_bonus_pre > 0) { + int (*preHookFunc) (enum refine_type *equipment_type, int *refine_level); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_bonus_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_get_bonus_pre[hIndex].func; + retVal___ = preHookFunc(&equipment_type, &refine_level); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.refine.get_bonus(equipment_type, refine_level); + } + if (HPMHooks.count.HP_refine_get_bonus_post > 0) { + int (*postHookFunc) (int retVal___, enum refine_type equipment_type, int refine_level); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_bonus_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_get_bonus_post[hIndex].func; + retVal___ = postHookFunc(retVal___, equipment_type, refine_level); + } + } + return retVal___; +} +int HP_refine_get_randombonus_max(enum refine_type equipment_type, int refine_level) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_refine_get_randombonus_max_pre > 0) { + int (*preHookFunc) (enum refine_type *equipment_type, int *refine_level); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_randombonus_max_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_get_randombonus_max_pre[hIndex].func; + retVal___ = preHookFunc(&equipment_type, &refine_level); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.refine.get_randombonus_max(equipment_type, refine_level); + } + if (HPMHooks.count.HP_refine_get_randombonus_max_post > 0) { + int (*postHookFunc) (int retVal___, enum refine_type equipment_type, int refine_level); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_get_randombonus_max_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_get_randombonus_max_post[hIndex].func; + retVal___ = postHookFunc(retVal___, equipment_type, refine_level); + } + } + return retVal___; +} +void HP_refine_refinery_add_item(struct map_session_data *sd, int item_index) { + int hIndex = 0; + if (HPMHooks.count.HP_refine_refinery_add_item_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *item_index); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_refinery_add_item_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_refinery_add_item_pre[hIndex].func; + preHookFunc(&sd, &item_index); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.refine.refinery_add_item(sd, item_index); + } + if (HPMHooks.count.HP_refine_refinery_add_item_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int item_index); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_refinery_add_item_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_refinery_add_item_post[hIndex].func; + postHookFunc(sd, item_index); + } + } + return; +} +void HP_refine_refinery_refine_request(struct map_session_data *sd, int item_index, int material_id, bool use_blacksmith_blessing) { + int hIndex = 0; + if (HPMHooks.count.HP_refine_refinery_refine_request_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd, int *item_index, int *material_id, bool *use_blacksmith_blessing); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_refinery_refine_request_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_refine_refinery_refine_request_pre[hIndex].func; + preHookFunc(&sd, &item_index, &material_id, &use_blacksmith_blessing); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.refine.refinery_refine_request(sd, item_index, material_id, use_blacksmith_blessing); + } + if (HPMHooks.count.HP_refine_refinery_refine_request_post > 0) { + void (*postHookFunc) (struct map_session_data *sd, int item_index, int material_id, bool use_blacksmith_blessing); + for (hIndex = 0; hIndex < HPMHooks.count.HP_refine_refinery_refine_request_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_refine_refinery_refine_request_post[hIndex].func; + postHookFunc(sd, item_index, material_id, use_blacksmith_blessing); + } + } + return; +} +/* refine_interface_private */ +int HP_PRIV__refine_readdb_refine_libconfig_sub(struct config_setting_t *r, const char *name, const char *source) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_sub_pre > 0) { + int (*preHookFunc) (struct config_setting_t **r, const char **name, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refine_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&r, &name, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.readdb_refine_libconfig_sub(r, name, source); + } + if (HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_sub_post > 0) { + int (*postHookFunc) (int retVal___, struct config_setting_t *r, const char *name, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refine_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, r, name, source); + } + } + return retVal___; +} +int HP_PRIV__refine_readdb_refine_libconfig(const char *filename) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_pre > 0) { + int (*preHookFunc) (const char **filename); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refine_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(&filename); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.readdb_refine_libconfig(filename); + } + if (HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_post > 0) { + int (*postHookFunc) (int retVal___, const char *filename); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refine_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refine_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename); + } + } + return retVal___; +} +bool HP_PRIV__refine_announce_behavior_string2enum(const char *str, unsigned int *result) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_PRIV__refine_announce_behavior_string2enum_pre > 0) { + bool (*preHookFunc) (const char **str, unsigned int **result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_announce_behavior_string2enum_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_announce_behavior_string2enum_pre[hIndex].func; + retVal___ = preHookFunc(&str, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.announce_behavior_string2enum(str, result); + } + if (HPMHooks.count.HP_PRIV__refine_announce_behavior_string2enum_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *str, unsigned int *result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_announce_behavior_string2enum_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_announce_behavior_string2enum_post[hIndex].func; + retVal___ = postHookFunc(retVal___, str, result); + } + } + return retVal___; +} +bool HP_PRIV__refine_failure_behavior_string2enum(const char *str, enum refine_ui_failure_behavior *result) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_PRIV__refine_failure_behavior_string2enum_pre > 0) { + bool (*preHookFunc) (const char **str, enum refine_ui_failure_behavior **result); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_failure_behavior_string2enum_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_failure_behavior_string2enum_pre[hIndex].func; + retVal___ = preHookFunc(&str, &result); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.failure_behavior_string2enum(str, result); + } + if (HPMHooks.count.HP_PRIV__refine_failure_behavior_string2enum_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *str, enum refine_ui_failure_behavior *result); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_failure_behavior_string2enum_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_failure_behavior_string2enum_post[hIndex].func; + retVal___ = postHookFunc(retVal___, str, result); + } + } + return retVal___; +} +bool HP_PRIV__refine_readdb_refinery_ui_settings_items(const struct config_setting_t *elem, struct s_refine_requirement *req, const char *name, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_items_pre > 0) { + bool (*preHookFunc) (const struct config_setting_t **elem, struct s_refine_requirement **req, const char **name, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_items_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_items_pre[hIndex].func; + retVal___ = preHookFunc(&elem, &req, &name, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.readdb_refinery_ui_settings_items(elem, req, name, source); + } + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_items_post > 0) { + bool (*postHookFunc) (bool retVal___, const struct config_setting_t *elem, struct s_refine_requirement *req, const char *name, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_items_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_items_post[hIndex].func; + retVal___ = postHookFunc(retVal___, elem, req, name, source); + } + } + return retVal___; +} +bool HP_PRIV__refine_readdb_refinery_ui_settings_sub(const struct config_setting_t *elem, int type, const char *name, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_sub_pre > 0) { + bool (*preHookFunc) (const struct config_setting_t **elem, int *type, const char **name, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_sub_pre[hIndex].func; + retVal___ = preHookFunc(&elem, &type, &name, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.readdb_refinery_ui_settings_sub(elem, type, name, source); + } + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, const struct config_setting_t *elem, int type, const char *name, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, elem, type, name, source); + } + } + return retVal___; +} +int HP_PRIV__refine_readdb_refinery_ui_settings(const struct config_setting_t *r, int type, const char *name, const char *source) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_pre > 0) { + int (*preHookFunc) (const struct config_setting_t **r, int *type, const char **name, const char **source); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_pre[hIndex].func; + retVal___ = preHookFunc(&r, &type, &name, &source); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.readdb_refinery_ui_settings(r, type, name, source); + } + if (HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_post > 0) { + int (*postHookFunc) (int retVal___, const struct config_setting_t *r, int type, const char *name, const char *source); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_readdb_refinery_ui_settings_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_readdb_refinery_ui_settings_post[hIndex].func; + retVal___ = postHookFunc(retVal___, r, type, name, source); + } + } + return retVal___; +} +bool HP_PRIV__refine_is_refinable(struct map_session_data *sd, int item_index) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_PRIV__refine_is_refinable_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd, int *item_index); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_is_refinable_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_PRIV__refine_is_refinable_pre[hIndex].func; + retVal___ = preHookFunc(&sd, &item_index); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.PRIV__refine.is_refinable(sd, item_index); + } + if (HPMHooks.count.HP_PRIV__refine_is_refinable_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int item_index); + for (hIndex = 0; hIndex < HPMHooks.count.HP_PRIV__refine_is_refinable_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_PRIV__refine_is_refinable_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, item_index); + } + } + return retVal___; +} /* rnd_interface */ void HP_rnd_init(void) { int hIndex = 0; @@ -74267,15 +74827,15 @@ void HP_searchstore_clearremote(struct map_session_data *sd) { } return; } -bool HP_searchstore_result(struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine, const struct item_option *option) { +bool HP_searchstore_result(struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine_level, const struct item_option *option) { int hIndex = 0; bool retVal___ = false; if (HPMHooks.count.HP_searchstore_result_pre > 0) { - bool (*preHookFunc) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, int *nameid, unsigned short *amount, unsigned int *price, const int **card, unsigned char *refine, const struct item_option **option); + bool (*preHookFunc) (struct map_session_data **sd, unsigned int *store_id, int *account_id, const char **store_name, int *nameid, unsigned short *amount, unsigned int *price, const int **card, unsigned char *refine_level, const struct item_option **option); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_searchstore_result_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &store_id, &account_id, &store_name, &nameid, &amount, &price, &card, &refine, &option); + retVal___ = preHookFunc(&sd, &store_id, &account_id, &store_name, &nameid, &amount, &price, &card, &refine_level, &option); } if (*HPMforce_return) { *HPMforce_return = false; @@ -74283,13 +74843,13 @@ bool HP_searchstore_result(struct map_session_data *sd, unsigned int store_id, i } } { - retVal___ = HPMHooks.source.searchstore.result(sd, store_id, account_id, store_name, nameid, amount, price, card, refine, option); + retVal___ = HPMHooks.source.searchstore.result(sd, store_id, account_id, store_name, nameid, amount, price, card, refine_level, option); } if (HPMHooks.count.HP_searchstore_result_post > 0) { - bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine, const struct item_option *option); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, unsigned int store_id, int account_id, const char *store_name, int nameid, unsigned short amount, unsigned int price, const int *card, unsigned char refine_level, const struct item_option *option); for (hIndex = 0; hIndex < HPMHooks.count.HP_searchstore_result_post; hIndex++) { postHookFunc = HPMHooks.list.HP_searchstore_result_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, store_id, account_id, store_name, nameid, amount, price, card, refine, option); + retVal___ = postHookFunc(retVal___, sd, store_id, account_id, store_name, nameid, amount, price, card, refine_level, option); } } return retVal___; @@ -82853,33 +83413,6 @@ void HP_status_final(void) { } return; } -int HP_status_get_refine_chance(enum refine_type wlv, int refine, enum refine_chance_type type) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_status_get_refine_chance_pre > 0) { - int (*preHookFunc) (enum refine_type *wlv, int *refine, enum refine_chance_type *type); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_status_get_refine_chance_pre[hIndex].func; - retVal___ = preHookFunc(&wlv, &refine, &type); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.status.get_refine_chance(wlv, refine, type); - } - if (HPMHooks.count.HP_status_get_refine_chance_post > 0) { - int (*postHookFunc) (int retVal___, enum refine_type wlv, int refine, enum refine_chance_type type); - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_refine_chance_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_status_get_refine_chance_post[hIndex].func; - retVal___ = postHookFunc(retVal___, wlv, refine, type); - } - } - return retVal___; -} sc_type HP_status_skill2sc(int skill_id) { int hIndex = 0; sc_type retVal___ = SC_NONE; @@ -85981,60 +86514,6 @@ bool HP_status_readdb_sizefix(char *fields[], int columns, int current) { } return retVal___; } -int HP_status_readdb_refine_libconfig(const char *filename) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_status_readdb_refine_libconfig_pre > 0) { - int (*preHookFunc) (const char **filename); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_pre[hIndex].func; - retVal___ = preHookFunc(&filename); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.status.readdb_refine_libconfig(filename); - } - if (HPMHooks.count.HP_status_readdb_refine_libconfig_post > 0) { - int (*postHookFunc) (int retVal___, const char *filename); - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_post[hIndex].func; - retVal___ = postHookFunc(retVal___, filename); - } - } - return retVal___; -} -int HP_status_readdb_refine_libconfig_sub(struct config_setting_t *r, const char *name, const char *source) { - int hIndex = 0; - int retVal___ = 0; - if (HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre > 0) { - int (*preHookFunc) (struct config_setting_t **r, const char **name, const char **source); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_sub_pre[hIndex].func; - retVal___ = preHookFunc(&r, &name, &source); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.status.readdb_refine_libconfig_sub(r, name, source); - } - if (HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post > 0) { - int (*postHookFunc) (int retVal___, struct config_setting_t *r, const char *name, const char *source); - for (hIndex = 0; hIndex < HPMHooks.count.HP_status_readdb_refine_libconfig_sub_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_status_readdb_refine_libconfig_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, r, name, source); - } - } - return retVal___; -} bool HP_status_readdb_scconfig(char *fields[], int columns, int current) { int hIndex = 0; bool retVal___ = false; diff --git a/src/plugins/HPMHooking/HPMHooking_map.sources.inc b/src/plugins/HPMHooking/HPMHooking_map.sources.inc index 59ee43ab7..786b60288 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.sources.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.sources.inc @@ -73,6 +73,8 @@ HPMHooks.source.pc = *pc; HPMHooks.source.libpcre = *libpcre; HPMHooks.source.pet = *pet; HPMHooks.source.quest = *quest; +HPMHooks.source.refine = *refine; +HPMHooks.source.PRIV__refine = *refine->p; HPMHooks.source.rnd = *rnd; HPMHooks.source.rodex = *rodex; HPMHooks.source.script = *script; -- cgit v1.2.3-70-g09d2 From a321a26f2f9867c8c0e4b5503e4ad2275801122e Mon Sep 17 00:00:00 2001 From: Asheraf Date: Mon, 6 May 2019 20:02:41 +0000 Subject: HPM Hooks Update --- src/common/HPMDataCheck.h | 6 +- src/plugins/HPMHooking/HPMHooking.Defs.inc | 8 +-- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 8 +-- .../HPMHooking/HPMHooking_map.HookingPoints.inc | 2 +- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 69 +++++++++++----------- 5 files changed, 47 insertions(+), 46 deletions(-) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index db0594ff6..0a3494cce 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -571,9 +571,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "mapcell", sizeof(struct mapcell), SERVER_TYPE_MAP }, { "mapflag_skill_adjust", sizeof(struct mapflag_skill_adjust), SERVER_TYPE_MAP }, { "mapit_interface", sizeof(struct mapit_interface), SERVER_TYPE_MAP }, - { "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP }, - { "questinfo_itemreq", sizeof(struct questinfo_itemreq), SERVER_TYPE_MAP }, - { "questinfo_qreq", sizeof(struct questinfo_qreq), SERVER_TYPE_MAP }, { "spawn_data", sizeof(struct spawn_data), SERVER_TYPE_MAP }, #else #define MAP_MAP_H @@ -889,6 +886,9 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "quest_dropitem", sizeof(struct quest_dropitem), SERVER_TYPE_MAP }, { "quest_interface", sizeof(struct quest_interface), SERVER_TYPE_MAP }, { "quest_objective", sizeof(struct quest_objective), SERVER_TYPE_MAP }, + { "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP }, + { "questinfo_itemreq", sizeof(struct questinfo_itemreq), SERVER_TYPE_MAP }, + { "questinfo_qreq", sizeof(struct questinfo_qreq), SERVER_TYPE_MAP }, #else #define MAP_QUEST_H #endif // MAP_QUEST_H diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 920f81ca5..d8bf3fae9 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4816,8 +4816,8 @@ typedef void (*HPMHOOK_pre_map_update_cell_bl) (struct block_list **bl, bool *in typedef void (*HPMHOOK_post_map_update_cell_bl) (struct block_list *bl, bool increase); typedef int (*HPMHOOK_pre_map_get_new_bonus_id) (void); typedef int (*HPMHOOK_post_map_get_new_bonus_id) (int retVal___); -typedef void (*HPMHOOK_pre_map_add_questinfo) (int *m, struct questinfo **qi); -typedef void (*HPMHOOK_post_map_add_questinfo) (int m, struct questinfo *qi); +typedef bool (*HPMHOOK_pre_map_add_questinfo) (int *m, struct npc_data **nd); +typedef bool (*HPMHOOK_post_map_add_questinfo) (bool retVal___, int m, struct npc_data *nd); typedef bool (*HPMHOOK_pre_map_remove_questinfo) (int *m, struct npc_data **nd); typedef bool (*HPMHOOK_post_map_remove_questinfo) (bool retVal___, int m, struct npc_data *nd); typedef struct map_zone_data* (*HPMHOOK_pre_map_merge_zone) (struct map_zone_data **main, struct map_zone_data **other); @@ -5794,6 +5794,8 @@ 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); typedef void (*HPMHOOK_post_npc_refresh) (struct npc_data *nd); +typedef void (*HPMHOOK_pre_npc_questinfo_clear) (struct npc_data **nd); +typedef void (*HPMHOOK_post_npc_questinfo_clear) (struct npc_data *nd); typedef int (*HPMHOOK_pre_npc_secure_timeout_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_npc_secure_timeout_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); #endif // MAP_NPC_H @@ -6626,8 +6628,6 @@ typedef bool (*HPMHOOK_pre_quest_questinfo_validate_quests) (struct map_session_ typedef bool (*HPMHOOK_post_quest_questinfo_validate_quests) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); typedef bool (*HPMHOOK_pre_quest_questinfo_validate_mercenary_class) (struct map_session_data **sd, struct questinfo **qi); typedef bool (*HPMHOOK_post_quest_questinfo_validate_mercenary_class) (bool retVal___, struct map_session_data *sd, struct questinfo *qi); -typedef void (*HPMHOOK_pre_quest_questinfo_vector_clear) (int *m); -typedef void (*HPMHOOK_post_quest_questinfo_vector_clear) (int m); #endif // MAP_QUEST_H #ifdef MAP_REFINE_H /* refine */ typedef int (*HPMHOOK_pre_refine_init) (bool *minimal); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 9c0b1905e..1044b7592 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4356,6 +4356,8 @@ struct { struct HPMHookPoint *HP_npc_db_checkid_post; struct HPMHookPoint *HP_npc_refresh_pre; struct HPMHookPoint *HP_npc_refresh_post; + struct HPMHookPoint *HP_npc_questinfo_clear_pre; + struct HPMHookPoint *HP_npc_questinfo_clear_post; struct HPMHookPoint *HP_npc_secure_timeout_timer_pre; struct HPMHookPoint *HP_npc_secure_timeout_timer_post; struct HPMHookPoint *HP_nullpo_assert_report_pre; @@ -5136,8 +5138,6 @@ struct { struct HPMHookPoint *HP_quest_questinfo_validate_quests_post; struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_pre; struct HPMHookPoint *HP_quest_questinfo_validate_mercenary_class_post; - struct HPMHookPoint *HP_quest_questinfo_vector_clear_pre; - struct HPMHookPoint *HP_quest_questinfo_vector_clear_post; struct HPMHookPoint *HP_refine_init_pre; struct HPMHookPoint *HP_refine_init_post; struct HPMHookPoint *HP_refine_final_pre; @@ -11137,6 +11137,8 @@ struct { int HP_npc_db_checkid_post; int HP_npc_refresh_pre; int HP_npc_refresh_post; + int HP_npc_questinfo_clear_pre; + int HP_npc_questinfo_clear_post; int HP_npc_secure_timeout_timer_pre; int HP_npc_secure_timeout_timer_post; int HP_nullpo_assert_report_pre; @@ -11917,8 +11919,6 @@ struct { int HP_quest_questinfo_validate_quests_post; int HP_quest_questinfo_validate_mercenary_class_pre; int HP_quest_questinfo_validate_mercenary_class_post; - int HP_quest_questinfo_vector_clear_pre; - int HP_quest_questinfo_vector_clear_post; int HP_refine_init_pre; int HP_refine_init_post; int HP_refine_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 6c0b6db36..a817b2023 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2230,6 +2230,7 @@ struct HookingPointData HookingPoints[] = { { 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->questinfo_clear, HP_npc_questinfo_clear) }, { HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) }, /* nullpo_interface */ { HP_POP(nullpo->assert_report, HP_nullpo_assert_report) }, @@ -2629,7 +2630,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(quest->questinfo_validate_homunculus_type, HP_quest_questinfo_validate_homunculus_type) }, { HP_POP(quest->questinfo_validate_quests, HP_quest_questinfo_validate_quests) }, { HP_POP(quest->questinfo_validate_mercenary_class, HP_quest_questinfo_validate_mercenary_class) }, - { HP_POP(quest->questinfo_vector_clear, HP_quest_questinfo_vector_clear) }, /* refine_interface */ { HP_POP(refine->init, HP_refine_init) }, { HP_POP(refine->final, HP_refine_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9cc986922..9636d67c7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -49379,31 +49379,32 @@ int HP_map_get_new_bonus_id(void) { } return retVal___; } -void HP_map_add_questinfo(int m, struct questinfo *qi) { +bool HP_map_add_questinfo(int m, struct npc_data *nd) { int hIndex = 0; + bool retVal___ = false; if (HPMHooks.count.HP_map_add_questinfo_pre > 0) { - void (*preHookFunc) (int *m, struct questinfo **qi); + bool (*preHookFunc) (int *m, struct npc_data **nd); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_map_add_questinfo_pre[hIndex].func; - preHookFunc(&m, &qi); + retVal___ = preHookFunc(&m, &nd); } if (*HPMforce_return) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.map.add_questinfo(m, qi); + retVal___ = HPMHooks.source.map.add_questinfo(m, nd); } if (HPMHooks.count.HP_map_add_questinfo_post > 0) { - void (*postHookFunc) (int m, struct questinfo *qi); + bool (*postHookFunc) (bool retVal___, int m, struct npc_data *nd); for (hIndex = 0; hIndex < HPMHooks.count.HP_map_add_questinfo_post; hIndex++) { postHookFunc = HPMHooks.list.HP_map_add_questinfo_post[hIndex].func; - postHookFunc(m, qi); + retVal___ = postHookFunc(retVal___, m, nd); } } - return; + return retVal___; } bool HP_map_remove_questinfo(int m, struct npc_data *nd) { int hIndex = 0; @@ -57872,6 +57873,32 @@ void HP_npc_refresh(struct npc_data *nd) { } return; } +void HP_npc_questinfo_clear(struct npc_data *nd) { + int hIndex = 0; + if (HPMHooks.count.HP_npc_questinfo_clear_pre > 0) { + void (*preHookFunc) (struct npc_data **nd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_questinfo_clear_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_npc_questinfo_clear_pre[hIndex].func; + preHookFunc(&nd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.questinfo_clear(nd); + } + if (HPMHooks.count.HP_npc_questinfo_clear_post > 0) { + void (*postHookFunc) (struct npc_data *nd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_npc_questinfo_clear_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_npc_questinfo_clear_post[hIndex].func; + postHookFunc(nd); + } + } + return; +} int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) { int hIndex = 0; int retVal___ = 0; @@ -68395,32 +68422,6 @@ bool HP_quest_questinfo_validate_mercenary_class(struct map_session_data *sd, st } return retVal___; } -void HP_quest_questinfo_vector_clear(int m) { - int hIndex = 0; - if (HPMHooks.count.HP_quest_questinfo_vector_clear_pre > 0) { - void (*preHookFunc) (int *m); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_vector_clear_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_quest_questinfo_vector_clear_pre[hIndex].func; - preHookFunc(&m); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return; - } - } - { - HPMHooks.source.quest.questinfo_vector_clear(m); - } - if (HPMHooks.count.HP_quest_questinfo_vector_clear_post > 0) { - void (*postHookFunc) (int m); - for (hIndex = 0; hIndex < HPMHooks.count.HP_quest_questinfo_vector_clear_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_quest_questinfo_vector_clear_post[hIndex].func; - postHookFunc(m); - } - } - return; -} /* refine_interface */ int HP_refine_init(bool minimal) { int hIndex = 0; -- cgit v1.2.3-70-g09d2 From 9bc8827ddf049c0f6b4f8613b0f157ec15ae7ff5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 May 2019 07:27:53 +0300 Subject: Update packets table up to 2019-05-30 --- src/common/packets/packets2019_len_main.h | 72 ++++++++++++++++++++++++++++--- src/common/packets/packets2019_len_re.h | 72 ++++++++++++++++++++++++++++--- src/common/packets/packets2019_len_zero.h | 48 ++++++++++++++++++--- 3 files changed, 172 insertions(+), 20 deletions(-) (limited to 'src/common') diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index f55db7cd0..0382a72d3 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -3946,7 +3946,7 @@ packetLen(0x0a85, 82) packetLen(0x0a86, -1) // Packet: 0x0a87 -packetLen(0x0a87, -1) +packetLen(0x0a87, -1) // ZC_BAN_LIST // Packet: 0x0a88 packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET @@ -4404,25 +4404,25 @@ packetLen(0x0b1f, 10) // Packet: 0x0b20 #if PACKETVER >= 20190403 -packetLen(0x0b20, 271) +packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4 #endif // Packet: 0x0b21 #if PACKETVER >= 20190403 -packetLen(0x0b21, 13) +packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE #elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 -packetLen(0x0b21, 10) +packetLen(0x0b21, 10) // CZ_SHORTCUT_KEY_CHANGE #endif // Packet: 0x0b22 #if PACKETVER >= 20190403 -packetLen(0x0b22, 5) +packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE #elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 -packetLen(0x0b22, 6) +packetLen(0x0b22, 6) // CZ_SHORTCUTKEYBAR_ROTATE #endif // Packet: 0x0b23 @@ -4445,9 +4445,67 @@ packetLen(0x0b25, 6) #endif // Packet: 0x0b26 -#if PACKETVER >= 20190417 +#if PACKETVER >= 20190522 +// removed +#elif PACKETVER >= 20190508 +packetLen(0x0b26, 16) +#elif PACKETVER >= 20190417 packetLen(0x0b26, 18) #endif +// Packet: 0x0b27 +#if PACKETVER >= 20190508 +packetLen(0x0b27, -1) +#endif + +// Packet: 0x0b28 +#if PACKETVER >= 20190522 +packetLen(0x0b28, 3) +#elif PACKETVER >= 20190508 +packetLen(0x0b28, 22) +#endif + +// Packet: 0x0b29 +#if PACKETVER >= 20190508 +packetLen(0x0b29, 6) +#endif + +// Packet: 0x0b2a +#if PACKETVER >= 20190522 +packetLen(0x0b2a, 40) +#elif PACKETVER >= 20190508 +packetLen(0x0b2a, 6) +#endif + +// Packet: 0x0b2b +#if PACKETVER >= 20190522 +packetLen(0x0b2b, 11) +#endif + +// Packet: 0x0b2c +#if PACKETVER >= 20190522 +packetLen(0x0b2c, 3) +#endif + +// Packet: 0x0b2d +#if PACKETVER >= 20190522 +packetLen(0x0b2d, 11) +#endif + +// Packet: 0x0b2e +#if PACKETVER >= 20190522 +packetLen(0x0b2e, 4) +#endif + +// Packet: 0x0b2f +#if PACKETVER >= 20190529 +packetLen(0x0b2f, 73) +#endif + +// Packet: 0x0b30 +#if PACKETVER >= 20190529 +packetLen(0x0b30, -1) +#endif + #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index 2f68261cd..c553d9324 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -3952,7 +3952,7 @@ packetLen(0x0a85, 82) packetLen(0x0a86, -1) // Packet: 0x0a87 -packetLen(0x0a87, -1) +packetLen(0x0a87, -1) // ZC_BAN_LIST // Packet: 0x0a88 packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET @@ -4410,25 +4410,25 @@ packetLen(0x0b1f, 10) // Packet: 0x0b20 #if PACKETVER >= 20190403 -packetLen(0x0b20, 271) +packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4 #endif // Packet: 0x0b21 #if PACKETVER >= 20190403 -packetLen(0x0b21, 13) +packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE #elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 -packetLen(0x0b21, 10) +packetLen(0x0b21, 10) // CZ_SHORTCUT_KEY_CHANGE #endif // Packet: 0x0b22 #if PACKETVER >= 20190403 -packetLen(0x0b22, 5) +packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE #elif PACKETVER >= 20190306 // removed #elif PACKETVER >= 20190227 -packetLen(0x0b22, 6) +packetLen(0x0b22, 6) // CZ_SHORTCUTKEYBAR_ROTATE #endif // Packet: 0x0b23 @@ -4451,9 +4451,67 @@ packetLen(0x0b25, 6) #endif // Packet: 0x0b26 -#if PACKETVER >= 20190417 +#if PACKETVER >= 20190522 +// removed +#elif PACKETVER >= 20190508 +packetLen(0x0b26, 16) +#elif PACKETVER >= 20190417 packetLen(0x0b26, 18) #endif +// Packet: 0x0b27 +#if PACKETVER >= 20190508 +packetLen(0x0b27, -1) +#endif + +// Packet: 0x0b28 +#if PACKETVER >= 20190522 +packetLen(0x0b28, 3) +#elif PACKETVER >= 20190508 +packetLen(0x0b28, 22) +#endif + +// Packet: 0x0b29 +#if PACKETVER >= 20190508 +packetLen(0x0b29, 6) +#endif + +// Packet: 0x0b2a +#if PACKETVER >= 20190522 +packetLen(0x0b2a, 40) +#elif PACKETVER >= 20190508 +packetLen(0x0b2a, 6) +#endif + +// Packet: 0x0b2b +#if PACKETVER >= 20190522 +packetLen(0x0b2b, 11) +#endif + +// Packet: 0x0b2c +#if PACKETVER >= 20190522 +packetLen(0x0b2c, 3) +#endif + +// Packet: 0x0b2d +#if PACKETVER >= 20190522 +packetLen(0x0b2d, 11) +#endif + +// Packet: 0x0b2e +#if PACKETVER >= 20190522 +packetLen(0x0b2e, 4) +#endif + +// Packet: 0x0b2f +#if PACKETVER >= 20190529 +packetLen(0x0b2f, 73) +#endif + +// Packet: 0x0b30 +#if PACKETVER >= 20190529 +packetLen(0x0b30, -1) +#endif + #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 24abdb7bd..3295b26d9 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -4404,17 +4404,17 @@ packetLen(0x0b1f, 10) // Packet: 0x0b20 #if PACKETVER >= 20190327 -packetLen(0x0b20, 271) +packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4 #endif // Packet: 0x0b21 #if PACKETVER >= 20190327 -packetLen(0x0b21, 13) +packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE #endif // Packet: 0x0b22 #if PACKETVER >= 20190327 -packetLen(0x0b22, 5) +packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE #endif // Packet: 0x0b23 @@ -4433,7 +4433,9 @@ packetLen(0x0b25, 6) #endif // Packet: 0x0b26 -#if PACKETVER >= 20190424 +#if PACKETVER >= 20190515 +// removed +#elif PACKETVER >= 20190424 packetLen(0x0b26, 16) #endif @@ -4445,7 +4447,9 @@ packetLen(0x0b27, 2) #endif // Packet: 0x0b28 -#if PACKETVER >= 20190502 +#if PACKETVER >= 20190515 +packetLen(0x0b28, 3) +#elif PACKETVER >= 20190502 packetLen(0x0b28, 22) #elif PACKETVER >= 20190424 packetLen(0x0b28, -1) @@ -4459,9 +4463,41 @@ packetLen(0x0b29, 3) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190502 +#if PACKETVER >= 20190529 +packetLen(0x0b2a, 40) +#elif PACKETVER >= 20190502 packetLen(0x0b2a, 6) #endif +// Packet: 0x0b2b +#if PACKETVER >= 20190515 +packetLen(0x0b2b, 11) +#endif + +// Packet: 0x0b2c +#if PACKETVER >= 20190515 +packetLen(0x0b2c, 3) +#endif + +// Packet: 0x0b2d +#if PACKETVER >= 20190515 +packetLen(0x0b2d, 11) +#endif + +// Packet: 0x0b2e +#if PACKETVER >= 20190515 +packetLen(0x0b2e, 4) +#endif + +// Packet: 0x0b2f +#if PACKETVER >= 20190529 +packetLen(0x0b2f, 73) +#endif + +// Packet: 0x0b30 +#if PACKETVER >= 20190529 +packetLen(0x0b30, -1) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ -- cgit v1.2.3-70-g09d2 From 62ee0d94b98493e60d41c8a5a3ec27a7246a21e9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 May 2019 23:48:48 +0300 Subject: Add define MAX_HOTKEYS_DB for max stored hotkeys in db For new RE clients it's double of MAX_HOTKEYS --- src/char/char.c | 2 +- src/common/mmo.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/char/char.c b/src/char/char.c index 44225ecb5..81856a25d 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1415,7 +1415,7 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa while( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) { - if( hotkey_num >= 0 && hotkey_num < MAX_HOTKEYS ) + if( hotkey_num >= 0 && hotkey_num < MAX_HOTKEYS_DB ) memcpy(&p->hotkeys[hotkey_num], &tmp_hotkey, sizeof(tmp_hotkey)); else ShowWarning("chr->mmo_char_fromsql: ignoring invalid hotkey (hotkey=%d,type=%u,id=%u,lv=%u) of character %s (AID=%d,CID=%d)\n", hotkey_num, tmp_hotkey.type, tmp_hotkey.id, tmp_hotkey.lv, p->name, p->account_id, p->char_id); diff --git a/src/common/mmo.h b/src/common/mmo.h index eb74d62b3..c62fd31d0 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -151,6 +151,12 @@ #endif // 20090603 #endif // 20070227 +#if PACKETVER_RE_NUM >= 20190508 +#define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) +#else +#define MAX_HOTKEYS_DB MAX_HOTKEYS +#endif + #if PACKETVER >= 20150805 /* Cart Decoration */ #define CART_DECORATION #define MAX_CARTDECORATION_CARTS 3 // Currently there are 3 Carts available in kRO. [Frost] @@ -732,7 +738,7 @@ struct mmo_charstatus { struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex] #ifdef HOTKEY_SAVING - struct hotkey hotkeys[MAX_HOTKEYS]; + struct hotkey hotkeys[MAX_HOTKEYS_DB]; #endif bool show_equip; bool allow_party; -- cgit v1.2.3-70-g09d2 From 441470decb97f738ea4c854cbf5138e8eeac2bb4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 May 2019 02:34:00 +0300 Subject: Update packet ZC_SHORTCUT_KEY_LIST --- src/common/mmo.h | 29 +++++++++++++++----------- src/map/clif.c | 44 +++++++++++++++++++++++++++++----------- src/map/clif.h | 3 ++- src/map/packets_struct.h | 53 +++++++++++++++++++++++++++++++++++------------- 4 files changed, 90 insertions(+), 39 deletions(-) (limited to 'src/common') diff --git a/src/common/mmo.h b/src/common/mmo.h index c62fd31d0..3af414fdb 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -134,22 +134,27 @@ // Comment the following line to disable sc_data saving. [Skotlex] #define ENABLE_SC_SAVING -#if PACKETVER >= 20070227 +#if PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) // Comment the following like to disable server-side hot-key saving support. [Skotlex] // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER < 20090603 - // (27 = 9 skills x 3 bars) (0x02b9,191) - #define MAX_HOTKEYS 27 -#elif PACKETVER < 20090617 - // (36 = 9 skills x 4 bars) (0x07d9,254) - #define MAX_HOTKEYS 36 -#else // >= 20090617 - // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) - #define MAX_HOTKEYS 38 -#endif // 20090603 -#endif // 20070227 +#if PACKETVER_RE_NUM >= 20190508 +#define MAX_HOTKEYS 38 +#elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) +// (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) +#define MAX_HOTKEYS 38 +#elif PACKETVER_MAIN_NUM >= 20090617 || PACKETVER_RE_NUM >= 20090617 || PACKETVER_SAK_NUM >= 20090617 +// (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) +#define MAX_HOTKEYS 38 +#elif PACKETVER_MAIN_NUM >= 20090603 || PACKETVER_RE_NUM >= 20090603 || PACKETVER_SAK_NUM >= 20090603 +// (36 = 9 skills x 4 bars) (0x07d9,254) +#define MAX_HOTKEYS 36 +#elif PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 +// (27 = 9 skills x 3 bars) (0x02b9,191) +#define MAX_HOTKEYS 27 +#endif +#endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) #if PACKETVER_RE_NUM >= 20190508 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) diff --git a/src/map/clif.c b/src/map/clif.c index b93274d3d..b04637ebc 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10608,7 +10608,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) first_time = true; sd->state.connect_new = 0; clif->skillinfoblock(sd); - clif->hotkeys(sd); + clif->hotkeysAll(sd); clif->updatestatus(sd,SP_BASEEXP); clif->updatestatus(sd,SP_NEXTBASEEXP); clif->updatestatus(sd,SP_JOBEXP); @@ -10821,27 +10821,46 @@ static void clif_parse_TickSend(int fd, struct map_session_data *sd) clif->notify_time(sd, timer->gettick()); } +static void clif_hotkeysAll_send(struct map_session_data *sd) +{ +#ifdef HOTKEY_SAVING + clif->hotkeys(sd, 0); +#if PACKETVER_RE_NUM >= 20190508 + // send second tab only if data exists + for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { + if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { + clif->hotkeys(sd, 1); + return; + } + } +#endif +#endif +} + /// Sends hotkey bar. /// 02b9 { .B .L .W }*27 (ZC_SHORTCUT_KEY_LIST) /// 07d9 { .B .L .W }*36 (ZC_SHORTCUT_KEY_LIST_V2, PACKETVER >= 20090603) /// 07d9 { .B .L .W }*38 (ZC_SHORTCUT_KEY_LIST_V2, PACKETVER >= 20090617) /// 0a00 .B { .B .L .W }*38 (ZC_SHORTCUT_KEY_LIST_V3, PACKETVER >= 20141022) -static void clif_hotkeys_send(struct map_session_data *sd) +static void clif_hotkeys_send(struct map_session_data *sd, int tab) { #ifdef HOTKEY_SAVING - struct packet_hotkey p; - int i; nullpo_retv(sd); - p.PacketType = hotkeyType; -#if PACKETVER >= 20141022 - p.Rotate = sd->status.hotkey_rowshift; + struct PACKET_ZC_SHORTCUT_KEY_LIST p; + p.packetType = HEADER_ZC_SHORTCUT_KEY_LIST; +#if PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) + p.rotate = sd->status.hotkey_rowshift; +#endif +#if PACKETVER_RE_NUM >= 20190508 + p.tab = tab; #endif - for(i = 0; i < ARRAYLENGTH(p.hotkey); i++) { - p.hotkey[i].isSkill = sd->status.hotkeys[i].type; - p.hotkey[i].ID = sd->status.hotkeys[i].id; - p.hotkey[i].count = sd->status.hotkeys[i].lv; + const int offset = tab * MAX_HOTKEYS; + for (int i = 0; i < MAX_HOTKEYS_PACKET; i++) { + p.hotkey[i].isSkill = sd->status.hotkeys[i + offset].type; + p.hotkey[i].id = sd->status.hotkeys[i + offset].id; + p.hotkey[i].count = sd->status.hotkeys[i + offset].lv; } - clif->send(&p, sizeof(p), &sd->bl, SELF); + clif->send(&p, sizeof(struct PACKET_ZC_SHORTCUT_KEY_LIST), &sd->bl, SELF); #endif } @@ -23070,6 +23089,7 @@ void clif_defaults(void) clif->pRanklist = clif_parse_ranklist; clif->update_rankingpoint = clif_update_rankingpoint; clif->hotkeys = clif_hotkeys_send; + clif->hotkeysAll = clif_hotkeysAll_send; clif->insight = clif_insight; clif->outsight = clif_outsight; clif->skillcastcancel = clif_skillcastcancel; diff --git a/src/map/clif.h b/src/map/clif.h index 19c321ed3..1e49e50a2 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -851,7 +851,8 @@ struct clif_interface { void (*ranklist) (struct map_session_data *sd, enum fame_list_type type); void (*update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); void (*pRanklist) (int fd, struct map_session_data *sd); - void (*hotkeys) (struct map_session_data *sd); + void (*hotkeys) (struct map_session_data *sd, int tab); + void (*hotkeysAll) (struct map_session_data *sd); int (*insight) (struct block_list *bl,va_list ap); int (*outsight) (struct block_list *bl,va_list ap); void (*skillcastcancel) (struct block_list* bl); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index d90d6dc97..4e3d7de84 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -39,13 +39,6 @@ enum packet_headers { banking_checkType = 0x9a6, cart_additem_ackType = 0x12c, sc_notickType = 0x196, -#if PACKETVER >= 20141022 - hotkeyType = 0xa00, -#elif PACKETVER >= 20090603 - hotkeyType = 0x7d9, -#else - hotkeyType = 0x2b9, -#endif #if PACKETVER >= 20150226 cartaddType = 0xa0b, #elif PACKETVER >= 5 @@ -1426,17 +1419,49 @@ struct packet_party_leader_changed { #ifdef HOTKEY_SAVING struct hotkey_data { int8 isSkill; // 0: Item, 1:Skill - uint32 ID; // Item/Skill ID + uint32 id; // Item/Skill ID int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -struct packet_hotkey { - int16 PacketType; -#if PACKETVER >= 20141022 - int8 Rotate; -#endif - struct hotkey_data hotkey[MAX_HOTKEYS]; +#if PACKETVER_RE_NUM >= 20190508 +#define MAX_HOTKEYS_PACKET 38 +struct PACKET_ZC_SHORTCUT_KEY_LIST { + int16 packetType; + int8 rotate; + int16 tab; + struct hotkey_data hotkey[MAX_HOTKEYS_PACKET]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SHORTCUT_KEY_LIST, 0x0b20); +#elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) +#define MAX_HOTKEYS_PACKET 38 +struct PACKET_ZC_SHORTCUT_KEY_LIST { + int16 packetType; + int8 rotate; + struct hotkey_data hotkey[MAX_HOTKEYS_PACKET]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SHORTCUT_KEY_LIST, 0x0a00); +#elif PACKETVER_MAIN_NUM >= 20090617 || PACKETVER_RE_NUM >= 20090617 || PACKETVER_SAK_NUM >= 20090617 +#define MAX_HOTKEYS_PACKET 38 +struct PACKET_ZC_SHORTCUT_KEY_LIST { + int16 packetType; + struct hotkey_data hotkey[MAX_HOTKEYS_PACKET]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SHORTCUT_KEY_LIST, 0x07d9); +#elif PACKETVER_MAIN_NUM >= 20090603 || PACKETVER_RE_NUM >= 20090603 || PACKETVER_SAK_NUM >= 20090603 +#define MAX_HOTKEYS_PACKET 36 +struct PACKET_ZC_SHORTCUT_KEY_LIST { + int16 packetType; + struct hotkey_data hotkey[MAX_HOTKEYS_PACKET]; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SHORTCUT_KEY_LIST, 0x07d9); +#elif PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 +#define MAX_HOTKEYS_PACKET 27 +struct PACKET_ZC_SHORTCUT_KEY_LIST { + int16 packetType; + struct hotkey_data hotkey[MAX_HOTKEYS_PACKET]; } __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SHORTCUT_KEY_LIST, 0x02b9); +#endif #endif // HOTKEY_SAVING /** -- cgit v1.2.3-70-g09d2 From 0d5238bba6552616921f22d484f6b707d0abe6fe Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 May 2019 02:38:58 +0300 Subject: Update HPM --- src/common/HPMDataCheck.h | 1 - src/plugins/HPMHooking/HPMHooking.Defs.inc | 6 ++-- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 +++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 36 +++++++++++++++++++--- 5 files changed, 40 insertions(+), 8 deletions(-) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 0a3494cce..1e1d8068f 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -778,7 +778,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "packet_equipitem_ack", sizeof(struct packet_equipitem_ack), SERVER_TYPE_MAP }, { "packet_gm_monster_item", sizeof(struct packet_gm_monster_item), SERVER_TYPE_MAP }, { "packet_graffiti_entry", sizeof(struct packet_graffiti_entry), SERVER_TYPE_MAP }, - { "packet_hotkey", sizeof(struct packet_hotkey), SERVER_TYPE_MAP }, { "packet_idle_unit", sizeof(struct packet_idle_unit), SERVER_TYPE_MAP }, { "packet_idle_unit2", sizeof(struct packet_idle_unit2), SERVER_TYPE_MAP }, { "packet_item_drop_announce", sizeof(struct packet_item_drop_announce), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index d8bf3fae9..e70e64123 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1300,8 +1300,10 @@ typedef void (*HPMHOOK_pre_clif_update_rankingpoint) (struct map_session_data ** typedef void (*HPMHOOK_post_clif_update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); typedef void (*HPMHOOK_pre_clif_pRanklist) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pRanklist) (int fd, struct map_session_data *sd); -typedef void (*HPMHOOK_pre_clif_hotkeys) (struct map_session_data **sd); -typedef void (*HPMHOOK_post_clif_hotkeys) (struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_hotkeys) (struct map_session_data **sd, int *tab); +typedef void (*HPMHOOK_post_clif_hotkeys) (struct map_session_data *sd, int tab); +typedef void (*HPMHOOK_pre_clif_hotkeysAll) (struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_hotkeysAll) (struct map_session_data *sd); typedef int (*HPMHOOK_pre_clif_insight) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_clif_insight) (int retVal___, struct block_list *bl, va_list ap); typedef int (*HPMHOOK_pre_clif_outsight) (struct block_list **bl, va_list ap); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 1044b7592..4fb306d00 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -892,6 +892,8 @@ struct { struct HPMHookPoint *HP_clif_pRanklist_post; struct HPMHookPoint *HP_clif_hotkeys_pre; struct HPMHookPoint *HP_clif_hotkeys_post; + struct HPMHookPoint *HP_clif_hotkeysAll_pre; + struct HPMHookPoint *HP_clif_hotkeysAll_post; struct HPMHookPoint *HP_clif_insight_pre; struct HPMHookPoint *HP_clif_insight_post; struct HPMHookPoint *HP_clif_outsight_pre; @@ -7673,6 +7675,8 @@ struct { int HP_clif_pRanklist_post; int HP_clif_hotkeys_pre; int HP_clif_hotkeys_post; + int HP_clif_hotkeysAll_pre; + int HP_clif_hotkeysAll_post; int HP_clif_insight_pre; int HP_clif_insight_post; int HP_clif_outsight_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index a817b2023..00867e4ac 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -470,6 +470,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->update_rankingpoint, HP_clif_update_rankingpoint) }, { HP_POP(clif->pRanklist, HP_clif_pRanklist) }, { HP_POP(clif->hotkeys, HP_clif_hotkeys) }, + { HP_POP(clif->hotkeysAll, HP_clif_hotkeysAll) }, { HP_POP(clif->insight, HP_clif_insight) }, { HP_POP(clif->outsight, HP_clif_outsight) }, { HP_POP(clif->skillcastcancel, HP_clif_skillcastcancel) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9636d67c7..fb738a81f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11591,14 +11591,14 @@ void HP_clif_pRanklist(int fd, struct map_session_data *sd) { } return; } -void HP_clif_hotkeys(struct map_session_data *sd) { +void HP_clif_hotkeys(struct map_session_data *sd, int tab) { int hIndex = 0; if (HPMHooks.count.HP_clif_hotkeys_pre > 0) { - void (*preHookFunc) (struct map_session_data **sd); + void (*preHookFunc) (struct map_session_data **sd, int *tab); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_clif_hotkeys_pre[hIndex].func; - preHookFunc(&sd); + preHookFunc(&sd, &tab); } if (*HPMforce_return) { *HPMforce_return = false; @@ -11606,12 +11606,38 @@ void HP_clif_hotkeys(struct map_session_data *sd) { } } { - HPMHooks.source.clif.hotkeys(sd); + HPMHooks.source.clif.hotkeys(sd, tab); } if (HPMHooks.count.HP_clif_hotkeys_post > 0) { - void (*postHookFunc) (struct map_session_data *sd); + void (*postHookFunc) (struct map_session_data *sd, int tab); for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeys_post; hIndex++) { postHookFunc = HPMHooks.list.HP_clif_hotkeys_post[hIndex].func; + postHookFunc(sd, tab); + } + } + return; +} +void HP_clif_hotkeysAll(struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_hotkeysAll_pre > 0) { + void (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeysAll_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_hotkeysAll_pre[hIndex].func; + preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.hotkeysAll(sd); + } + if (HPMHooks.count.HP_clif_hotkeysAll_post > 0) { + void (*postHookFunc) (struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_hotkeysAll_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_hotkeysAll_post[hIndex].func; postHookFunc(sd); } } -- cgit v1.2.3-70-g09d2 From 70b5e954990b857946d81750263bcf11b06414ce Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 May 2019 18:12:01 +0300 Subject: Use separate field hotkey_rowshift for each hotkeys group --- sql-files/main.sql | 2 ++ sql-files/upgrades/2019-05-09--18-07.sql | 22 ++++++++++++++++++++++ sql-files/upgrades/index.txt | 1 + src/char/char.c | 21 +++++++++++---------- src/common/mmo.h | 1 + src/map/clif.c | 11 ++++++++--- 6 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 sql-files/upgrades/2019-05-09--18-07.sql (limited to 'src/common') diff --git a/sql-files/main.sql b/sql-files/main.sql index 241efd39b..e364ec778 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -241,6 +241,7 @@ CREATE TABLE IF NOT EXISTS `char` ( `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', `sex` ENUM('M','F','U') NOT NULL DEFAULT 'U', `hotkey_rowshift` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + `hotkey_rowshift2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', `attendance_count` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', `attendance_timer` BIGINT(20) NULL DEFAULT '0', `title_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', @@ -928,6 +929,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1544738447); -- 2018-12-1 INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1546059075); -- 2018-12-29--07-51.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1554760320); -- 2019-04-08--21-52.sql INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1556147483); -- 2019-04-25--02-12.sql +INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1557414445); -- 2019-05-09--18-07.sql -- -- Table structure for table `storage` diff --git a/sql-files/upgrades/2019-05-09--18-07.sql b/sql-files/upgrades/2019-05-09--18-07.sql new file mode 100644 index 000000000..96d80c29c --- /dev/null +++ b/sql-files/upgrades/2019-05-09--18-07.sql @@ -0,0 +1,22 @@ +#1557414445 + +-- This file is part of Hercules. +-- http://herc.ws - http://github.com/HerculesWS/Hercules +-- +-- Copyright (C) 2015 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 +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +ALTER TABLE `char` ADD COLUMN `hotkey_rowshift2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `hotkey_rowshift`; +INSERT INTO `sql_updates` (`timestamp`) VALUES (1557414445); diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt index a820f3b0d..3025a728c 100644 --- a/sql-files/upgrades/index.txt +++ b/sql-files/upgrades/index.txt @@ -54,3 +54,4 @@ 2018-12-29--07-51.sql 2019-04-08--21-52.sql 2019-04-25--02-12.sql +2019-05-09--18-07.sql diff --git a/src/char/char.c b/src/char/char.c index 81856a25d..cad28b373 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -477,7 +477,7 @@ static int char_mmo_char_tosql(int char_id, struct mmo_charstatus *p) (p->look.head_mid != cp->look.head_mid) || (p->look.head_bottom != cp->look.head_bottom) || (p->delete_date != cp->delete_date) || (p->rename != cp->rename) || (p->slotchange != cp->slotchange) || (p->look.robe != cp->look.robe) || (p->show_equip != cp->show_equip) || (p->allow_party != cp->allow_party) || (p->font != cp->font) || - (p->uniqueitem_counter != cp->uniqueitem_counter) || (p->hotkey_rowshift != cp->hotkey_rowshift) || + (p->uniqueitem_counter != cp->uniqueitem_counter) || (p->hotkey_rowshift != cp->hotkey_rowshift) || (p->hotkey_rowshift2 != cp->hotkey_rowshift2) || (p->clan_id != cp->clan_id) || (p->last_login != cp->last_login) || (p->attendance_count != cp->attendance_count) || (p->attendance_timer != cp->attendance_timer) || (p->title_id != cp->title_id) || (p->inventorySize != cp->inventorySize) || (p->allow_call != cp->allow_call) @@ -507,7 +507,7 @@ static int char_mmo_char_tosql(int char_id, struct mmo_charstatus *p) "`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d'," "`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d', `rename`='%d'," "`delete_date`='%lu',`robe`='%d',`slotchange`='%d', `char_opt`='%u', `font`='%u', `uniqueitem_counter` ='%u'," - "`hotkey_rowshift`='%d',`clan_id`='%d',`last_login`='%"PRId64"',`attendance_count`='%d',`attendance_timer`='%"PRId64"'," + "`hotkey_rowshift`='%d',`hotkey_rowshift2`='%d',`clan_id`='%d',`last_login`='%"PRId64"',`attendance_count`='%d',`attendance_timer`='%"PRId64"'," "`title_id`='%d', `inventory_size`='%d'" " WHERE `account_id`='%d' AND `char_id` = '%d'", char_db, p->base_level, p->job_level, @@ -520,7 +520,7 @@ static int char_mmo_char_tosql(int char_id, struct mmo_charstatus *p) mapindex_id2name(p->save_point.map), p->save_point.x, p->save_point.y, p->rename, (unsigned long)p->delete_date, // FIXME: platform-dependent size p->look.robe,p->slotchange,opt,p->font,p->uniqueitem_counter, - p->hotkey_rowshift,p->clan_id,p->last_login, p->attendance_count, p->attendance_timer, + p->hotkey_rowshift,p->hotkey_rowshift2,p->clan_id,p->last_login, p->attendance_count, p->attendance_timer, p->title_id, p->inventorySize, p->account_id, p->char_id) ) { @@ -1215,7 +1215,7 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa "`status_point`,`skill_point`,`option`,`karma`,`manner`,`party_id`,`guild_id`,`pet_id`,`homun_id`,`elemental_id`,`hair`," "`hair_color`,`clothes_color`,`body`,`weapon`,`shield`,`head_top`,`head_mid`,`head_bottom`,`last_map`,`last_x`,`last_y`," "`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`,`slotchange`," - "`char_opt`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`, `attendance_count`, `attendance_timer`," + "`char_opt`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`hotkey_rowshift2`,`clan_id`,`last_login`, `attendance_count`, `attendance_timer`," "`title_id`, `inventory_size`" " FROM `%s` WHERE `char_id`=? LIMIT 1", char_db) || SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &char_id, sizeof char_id) @@ -1279,12 +1279,13 @@ static int char_mmo_char_fromsql(int char_id, struct mmo_charstatus *p, bool loa || SQL_ERROR == SQL->StmtBindColumn(stmt, 56, SQLDT_UINT32, &p->uniqueitem_counter, sizeof p->uniqueitem_counter, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 57, SQLDT_ENUM, &sex, sizeof sex, NULL, NULL) || SQL_ERROR == SQL->StmtBindColumn(stmt, 58, SQLDT_UCHAR, &p->hotkey_rowshift, sizeof p->hotkey_rowshift, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 59, SQLDT_INT, &p->clan_id, sizeof p->clan_id, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 60, SQLDT_INT64, &p->last_login, sizeof p->last_login, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 61, SQLDT_SHORT, &p->attendance_count, sizeof p->attendance_count, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 62, SQLDT_INT64, &p->attendance_timer, sizeof p->attendance_timer, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 63, SQLDT_INT, &p->title_id, sizeof p->title_id, NULL, NULL) - || SQL_ERROR == SQL->StmtBindColumn(stmt, 64, SQLDT_INT, &p->inventorySize, sizeof p->inventorySize, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 59, SQLDT_UCHAR, &p->hotkey_rowshift2, sizeof p->hotkey_rowshift2, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 60, SQLDT_INT, &p->clan_id, sizeof p->clan_id, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 61, SQLDT_INT64, &p->last_login, sizeof p->last_login, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 62, SQLDT_SHORT, &p->attendance_count, sizeof p->attendance_count, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 63, SQLDT_INT64, &p->attendance_timer, sizeof p->attendance_timer, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 64, SQLDT_INT, &p->title_id, sizeof p->title_id, NULL, NULL) + || SQL_ERROR == SQL->StmtBindColumn(stmt, 65, SQLDT_INT, &p->inventorySize, sizeof p->inventorySize, NULL, NULL) ) { SqlStmt_ShowDebug(stmt); SQL->StmtFree(stmt); diff --git a/src/common/mmo.h b/src/common/mmo.h index 3af414fdb..9594a39eb 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -764,6 +764,7 @@ struct mmo_charstatus { short attendance_count; unsigned char hotkey_rowshift; + unsigned char hotkey_rowshift2; int32 title_id; // Achievement Title[Dastgir/Hercules] }; diff --git a/src/map/clif.c b/src/map/clif.c index 9f751a68d..f5fcc7d9d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10849,7 +10849,10 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) struct PACKET_ZC_SHORTCUT_KEY_LIST p; p.packetType = HEADER_ZC_SHORTCUT_KEY_LIST; #if PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) - p.rotate = sd->status.hotkey_rowshift; + if (tab == 0) + p.rotate = sd->status.hotkey_rowshift; + else + p.rotate = sd->status.hotkey_rowshift2; #endif #if PACKETVER_RE_NUM >= 20190508 p.tab = tab; @@ -10878,8 +10881,10 @@ static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { #if PACKETVER_RE_NUM >= 20190508 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); - // need use p->tab - sd->status.hotkey_rowshift = p->rowshift; + if (p->tab == 0) + sd->status.hotkey_rowshift = p->rowshift; + else + sd->status.hotkey_rowshift2 = p->rowshift; #endif } -- cgit v1.2.3-70-g09d2 From 0f4fd231e6660860c991bbcc59c075547245e71d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 15 May 2019 05:35:40 +0300 Subject: Use new shortcuts packets in zero 2019-05-15 and main 2019-05-22 --- src/common/mmo.h | 4 ++-- src/map/clif.c | 8 ++++---- src/map/packets.h | 2 +- src/map/packets_struct.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/common') diff --git a/src/common/mmo.h b/src/common/mmo.h index 9594a39eb..545d180fd 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -139,7 +139,7 @@ // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS 38 #elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) @@ -156,7 +156,7 @@ #endif #endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) #else #define MAX_HOTKEYS_DB MAX_HOTKEYS diff --git a/src/map/clif.c b/src/map/clif.c index f5fcc7d9d..2bab6391c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10825,7 +10825,7 @@ static void clif_hotkeysAll_send(struct map_session_data *sd) { #ifdef HOTKEY_SAVING clif->hotkeys(sd, 0); -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 // send second tab only if data exists for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { @@ -10854,7 +10854,7 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) else p.rotate = sd->status.hotkey_rowshift2; #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 p.tab = tab; #endif const int offset = tab * MAX_HOTKEYS; @@ -10879,7 +10879,7 @@ static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); if (p->tab == 0) sd->status.hotkey_rowshift = p->rowshift; @@ -10911,7 +10911,7 @@ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) __attribute_ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) { #ifdef HOTKEY_SAVING -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 const struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 *p = RFIFOP(fd, 0); const unsigned short idx = p->index + p->tab * MAX_HOTKEYS; Assert_retv(idx < MAX_HOTKEYS_DB); diff --git a/src/map/packets.h b/src/map/packets.h index 6df05900e..8ff6c4993 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1949,7 +1949,7 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b1c,clif->pPing); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 packet(0x0b21,clif->pHotkey2); packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 5cc58affb..9d77540e2 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1423,7 +1423,7 @@ struct hotkey_data { int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 #define MAX_HOTKEYS_PACKET 38 struct PACKET_ZC_SHORTCUT_KEY_LIST { int16 packetType; @@ -1472,7 +1472,7 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE1, 0x02ba); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { int16 packetType; uint16 tab; @@ -1490,7 +1490,7 @@ struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); #endif -#if PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { int16 packetType; uint16 tab; -- cgit v1.2.3-70-g09d2 From 9e8a5d4e52721f09bf7e1653bfba7f03e7403061 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Jun 2019 23:55:57 +0300 Subject: Disable new shortcuts on zero clients Because on zero they still not implimented. --- src/common/mmo.h | 4 ++-- src/map/clif.c | 8 ++++---- src/map/packets.h | 2 +- src/map/packets_struct.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/common') diff --git a/src/common/mmo.h b/src/common/mmo.h index 545d180fd..b58a70ae9 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -139,7 +139,7 @@ // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 #define MAX_HOTKEYS 38 #elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) @@ -156,7 +156,7 @@ #endif #endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) #else #define MAX_HOTKEYS_DB MAX_HOTKEYS diff --git a/src/map/clif.c b/src/map/clif.c index 0a1b4bdd2..4e8653783 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10825,7 +10825,7 @@ static void clif_hotkeysAll_send(struct map_session_data *sd) { #ifdef HOTKEY_SAVING clif->hotkeys(sd, 0); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 // send second tab only if data exists for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { @@ -10854,7 +10854,7 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) else p.rotate = sd->status.hotkey_rowshift2; #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 p.tab = tab; #endif const int offset = tab * MAX_HOTKEYS; @@ -10879,7 +10879,7 @@ static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); if (p->tab == 0) sd->status.hotkey_rowshift = p->rowshift; @@ -10911,7 +10911,7 @@ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) __attribute_ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) { #ifdef HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 const struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 *p = RFIFOP(fd, 0); const unsigned short idx = p->index + p->tab * MAX_HOTKEYS; Assert_retv(idx < MAX_HOTKEYS_DB); diff --git a/src/map/packets.h b/src/map/packets.h index 8ff6c4993..45b47c921 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1949,7 +1949,7 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b1c,clif->pPing); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 packet(0x0b21,clif->pHotkey2); packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index e3070ae71..2da1ece9e 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1423,7 +1423,7 @@ struct hotkey_data { int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 #define MAX_HOTKEYS_PACKET 38 struct PACKET_ZC_SHORTCUT_KEY_LIST { int16 packetType; @@ -1472,7 +1472,7 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE1, 0x02ba); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { int16 packetType; uint16 tab; @@ -1490,7 +1490,7 @@ struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { int16 packetType; uint16 tab; -- cgit v1.2.3-70-g09d2 From e6e9213694da2a45a249bcd2546d7ae69f32317f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Jun 2019 23:25:21 +0300 Subject: Update packets table up to 2019-06-26 --- src/common/packets/packets2019_len_main.h | 37 ++++++++++++++++++++++---- src/common/packets/packets2019_len_re.h | 43 +++++++++++++++++++++++++++---- src/common/packets/packets2019_len_zero.h | 42 ++++++++++++++++++++++++++---- 3 files changed, 107 insertions(+), 15 deletions(-) (limited to 'src/common') diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index 0382a72d3..3ec006750 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -4312,7 +4312,11 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190109 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4393,12 +4397,16 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190227 +#if PACKETVER >= 20190619 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190227 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190619 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190306 packetLen(0x0b1f, 10) #endif @@ -4466,12 +4474,16 @@ packetLen(0x0b28, 22) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190508 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190508 packetLen(0x0b29, 6) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190522 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190522 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190508 packetLen(0x0b2a, 6) @@ -4499,7 +4511,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4507,5 +4519,20 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190619 +packetLen(0x0b31, 17) +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190619 +packetLen(0x0b32, -1) +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190619 +packetLen(0x0b33, 17) +#endif + #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index c553d9324..24741a353 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -4318,7 +4318,11 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190109 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4399,12 +4403,22 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190227 +#if PACKETVER >= 20190619 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190605 +packetLen(0x0b1e, 14) +// ignored packet from 2019-06-05hRagexeRE +#elif PACKETVER >= 20190227 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190306 +#if PACKETVER >= 20190619 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190605 +packetLen(0x0b1f, 14) +// ignored packet from 2019-06-05hRagexeRE +#elif PACKETVER >= 20190306 packetLen(0x0b1f, 10) #endif @@ -4472,12 +4486,16 @@ packetLen(0x0b28, 22) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190508 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190508 packetLen(0x0b29, 6) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190522 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190522 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190508 packetLen(0x0b2a, 6) @@ -4505,7 +4523,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4513,5 +4531,20 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190619 +packetLen(0x0b31, 17) +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190619 +packetLen(0x0b32, -1) +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190619 +packetLen(0x0b33, 17) +#endif + #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 3295b26d9..85824232d 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -4312,7 +4312,11 @@ packetLen(0x0b02, 26) // AC_REFUSE_LOGIN4 packetLen(0x0b03, -1) // ZC_EQUIPWIN_MICROSCOPE_V7 // Packet: 0x0b04 +#if PACKETVER >= 20190605 +packetLen(0x0b04, 72) +#elif PACKETVER >= 20190116 packetLen(0x0b04, 80) +#endif // Packet: 0x0b05 packetLen(0x0b05, 63) // ZC_OFFLINE_STORE_VISIBLE @@ -4393,12 +4397,16 @@ packetLen(0x0b1d, 2) // ZC_PING #endif // Packet: 0x0b1e -#if PACKETVER >= 20190313 +#if PACKETVER >= 20190626 +packetLen(0x0b1e, 14) +#elif PACKETVER >= 20190313 packetLen(0x0b1e, 10) #endif // Packet: 0x0b1f -#if PACKETVER >= 20190313 +#if PACKETVER >= 20190626 +packetLen(0x0b1f, 14) +#elif PACKETVER >= 20190313 packetLen(0x0b1f, 10) #endif @@ -4456,14 +4464,18 @@ packetLen(0x0b28, -1) #endif // Packet: 0x0b29 -#if PACKETVER >= 20190502 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190502 packetLen(0x0b29, 6) #elif PACKETVER >= 20190424 packetLen(0x0b29, 3) #endif // Packet: 0x0b2a -#if PACKETVER >= 20190529 +#if PACKETVER >= 20190605 +// removed +#elif PACKETVER >= 20190529 packetLen(0x0b2a, 40) #elif PACKETVER >= 20190502 packetLen(0x0b2a, 6) @@ -4491,7 +4503,7 @@ packetLen(0x0b2e, 4) // Packet: 0x0b2f #if PACKETVER >= 20190529 -packetLen(0x0b2f, 73) +packetLen(0x0b2f, 73) // ZC_PROPERTY_HOMUN_3 #endif // Packet: 0x0b30 @@ -4499,5 +4511,25 @@ packetLen(0x0b2f, 73) packetLen(0x0b30, -1) #endif +// Packet: 0x0b31 +#if PACKETVER >= 20190626 +packetLen(0x0b31, 17) +#endif + +// Packet: 0x0b32 +#if PACKETVER >= 20190626 +packetLen(0x0b32, -1) +#endif + +// Packet: 0x0b33 +#if PACKETVER >= 20190626 +packetLen(0x0b33, 17) +#endif + +// Packet: 0x0b34 +#if PACKETVER >= 20190626 +packetLen(0x0b34, 26) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ -- cgit v1.2.3-70-g09d2 From 58e5437cc7611579155e6d47439becc418f9b51d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Jun 2019 01:58:48 +0300 Subject: Add support for new shortcuts packets in zero --- configure | 2 +- src/common/mmo.h | 4 ++-- src/map/clif.c | 8 ++++---- src/map/packets.h | 2 +- src/map/packets_struct.h | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/common') diff --git a/configure b/configure index 4ab9057e8..3704a350c 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac 5b2340b4d. +# From configure.ac 11d86a97d. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # diff --git a/src/common/mmo.h b/src/common/mmo.h index b58a70ae9..1fa6fadc8 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -139,7 +139,7 @@ // Note that newer clients no longer save hotkeys in the registry! #define HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS 38 #elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO) // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) @@ -156,7 +156,7 @@ #endif #endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2) #else #define MAX_HOTKEYS_DB MAX_HOTKEYS diff --git a/src/map/clif.c b/src/map/clif.c index 4e8653783..4b80942e8 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10825,7 +10825,7 @@ static void clif_hotkeysAll_send(struct map_session_data *sd) { #ifdef HOTKEY_SAVING clif->hotkeys(sd, 0); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 // send second tab only if data exists for (int i = MAX_HOTKEYS; i < MAX_HOTKEYS * 2; i++) { if (sd->status.hotkeys[i].type != 0 || sd->status.hotkeys[i].id != 0 || sd->status.hotkeys[i].lv != 0) { @@ -10854,7 +10854,7 @@ static void clif_hotkeys_send(struct map_session_data *sd, int tab) else p.rotate = sd->status.hotkey_rowshift2; #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 p.tab = tab; #endif const int offset = tab * MAX_HOTKEYS; @@ -10879,7 +10879,7 @@ static void clif_parse_HotkeyRowShift1(int fd, struct map_session_data *sd) static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_HotkeyRowShift2(int fd, struct map_session_data *sd) { -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 const struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 *p = RFIFOP(fd, 0); if (p->tab == 0) sd->status.hotkey_rowshift = p->rowshift; @@ -10911,7 +10911,7 @@ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) __attribute_ static void clif_parse_Hotkey2(int fd, struct map_session_data *sd) { #ifdef HOTKEY_SAVING -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 const struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 *p = RFIFOP(fd, 0); const unsigned short idx = p->index + p->tab * MAX_HOTKEYS; Assert_retv(idx < MAX_HOTKEYS_DB); diff --git a/src/map/packets.h b/src/map/packets.h index 45b47c921..83a9d0322 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -1949,7 +1949,7 @@ packet(0x96e,clif->ackmergeitems); packet(0x0b1c,clif->pPing); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 packet(0x0b21,clif->pHotkey2); packet(0x0b22,clif->pHotkeyRowShift2); // CZ_SHORTCUTKEYBAR_ROTATE #endif diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 2da1ece9e..df8f009d6 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -1423,7 +1423,7 @@ struct hotkey_data { int16 count; // Item Quantity/Skill Level } __attribute__((packed)); -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 #define MAX_HOTKEYS_PACKET 38 struct PACKET_ZC_SHORTCUT_KEY_LIST { int16 packetType; @@ -1472,7 +1472,7 @@ struct PACKET_CZ_SHORTCUT_KEY_CHANGE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUT_KEY_CHANGE1, 0x02ba); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 struct PACKET_CZ_SHORTCUT_KEY_CHANGE2 { int16 packetType; uint16 tab; @@ -1490,7 +1490,7 @@ struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE1 { DEFINE_PACKET_HEADER(CZ_SHORTCUTKEYBAR_ROTATE1, 0x0a01); #endif -#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 +#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605 struct PACKET_CZ_SHORTCUTKEYBAR_ROTATE2 { int16 packetType; uint16 tab; -- cgit v1.2.3-70-g09d2 From bfce997d9c2a1154136f01f005d66e4960fcf501 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Jul 2019 19:51:17 +0300 Subject: Update packets table up to 2019-07-24 --- src/common/packets/packets2019_len_main.h | 138 +++++++++++++++++++++++++++++- src/common/packets/packets2019_len_re.h | 138 +++++++++++++++++++++++++++++- src/common/packets/packets2019_len_zero.h | 135 ++++++++++++++++++++++++++++- 3 files changed, 401 insertions(+), 10 deletions(-) (limited to 'src/common') diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index 3ec006750..bfcb7c159 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -3757,7 +3757,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3901,7 +3901,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4270,7 +4270,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4534,5 +4534,137 @@ packetLen(0x0b32, -1) packetLen(0x0b33, 17) #endif +// Packet: 0x0b34 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190703 +packetLen(0x0b34, 26) +#endif + +// Packet: 0x0b35 +#if PACKETVER >= 20190703 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190717 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index 24741a353..33aa7a524 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -3763,7 +3763,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3907,7 +3907,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4276,7 +4276,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4546,5 +4546,137 @@ packetLen(0x0b32, -1) packetLen(0x0b33, 17) #endif +// Packet: 0x0b34 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190703 +packetLen(0x0b34, 26) +#endif + +// Packet: 0x0b35 +#if PACKETVER >= 20190703 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190717 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 85824232d..7b9310cf2 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -3757,7 +3757,7 @@ packetLen(0x0a39, 36) // CH_MAKE_CHAR packetLen(0x0a3a, 12) // Packet: 0x0a3b -packetLen(0x0a3b, -1) // ZC_CUSTOM_HAT_EFFECT +packetLen(0x0a3b, -1) // ZC_HAT_EFFECT // Packet: 0x0a3c packetLen(0x0a3c, -1) @@ -3901,7 +3901,7 @@ packetLen(0x0a74, 8) packetLen(0x0a76, 80) // Packet: 0x0a77 -packetLen(0x0a77, 15) +packetLen(0x0a77, 15) // CZ_CAMERA_INFO // Packet: 0x0a78 packetLen(0x0a78, 15) @@ -4270,7 +4270,7 @@ packetLen(0x0af4, 11) // CZ_USE_SKILL_TOGROUND packetLen(0x0af5, 3) // Packet: 0x0af6 -packetLen(0x0af6, 88) +packetLen(0x0af6, 88) // ZC_ACK_RANKING // Packet: 0x0af7 packetLen(0x0af7, 32) // ZC_ACK_REQNAME_BYGID @@ -4527,9 +4527,136 @@ packetLen(0x0b33, 17) #endif // Packet: 0x0b34 -#if PACKETVER >= 20190626 +#if PACKETVER >= 20190724 +packetLen(0x0b34, 50) +#elif PACKETVER >= 20190626 packetLen(0x0b34, 26) #endif +// Packet: 0x0b35 +#if PACKETVER >= 20190709 +packetLen(0x0b35, 3) +#endif + +// Packet: 0x0b36 +#if PACKETVER >= 20190709 +packetLen(0x0b36, -1) +#endif + +// Packet: 0x0b37 +#if PACKETVER >= 20190724 +packetLen(0x0b37, -1) +#endif + +// Packet: 0x0b38 +#if PACKETVER >= 20190724 +packetLen(0x0b38, -1) +#endif + +// Packet: 0x0b39 +#if PACKETVER >= 20190724 +packetLen(0x0b39, -1) +#endif + +// Packet: 0x0b3a +#if PACKETVER >= 20190724 +packetLen(0x0b3a, 4) +#endif + +// Packet: 0x0b3b +#if PACKETVER >= 20190724 +packetLen(0x0b3b, 4) +#endif + +// Packet: 0x0b3c +#if PACKETVER >= 20190724 +packetLen(0x0b3c, 4) +#endif + +// Packet: 0x0b3d +#if PACKETVER >= 20190724 +packetLen(0x0b3d, -1) +#endif + +// Packet: 0x0b3e +#if PACKETVER >= 20190724 +packetLen(0x0b3e, -1) +#endif + +// Packet: 0x0b3f +#if PACKETVER >= 20190724 +packetLen(0x0b3f, 64) +#endif + +// Packet: 0x0b40 +#if PACKETVER >= 20190724 +packetLen(0x0b40, -1) +#endif + +// Packet: 0x0b41 +#if PACKETVER >= 20190724 +packetLen(0x0b41, 41) +#endif + +// Packet: 0x0b42 +#if PACKETVER >= 20190724 +packetLen(0x0b42, 30) +#endif + +// Packet: 0x0b43 +#if PACKETVER >= 20190724 +packetLen(0x0b43, 47) +#endif + +// Packet: 0x0b44 +#if PACKETVER >= 20190724 +packetLen(0x0b44, 32) +#endif + +// Packet: 0x0b45 +#if PACKETVER >= 20190724 +packetLen(0x0b45, 32) +#endif + +// Packet: 0x0b46 +#if PACKETVER >= 20190724 +packetLen(0x0b46, 10) +#endif + +// Packet: 0x0b47 +#if PACKETVER >= 20190724 +packetLen(0x0b47, 14) +#endif + +// Packet: 0x0b48 +#if PACKETVER >= 20190724 +packetLen(0x0b48, 18) +#endif + +// Packet: 0x0b49 +#if PACKETVER >= 20190724 +packetLen(0x0b49, 4) +#endif + +// Packet: 0x0b4a +#if PACKETVER >= 20190724 +packetLen(0x0b4a, 6) +#endif + +// Packet: 0x0b4b +#if PACKETVER >= 20190724 +packetLen(0x0b4b, 4) +#endif + +// Packet: 0x0b4c +#if PACKETVER >= 20190724 +packetLen(0x0b4c, 2) +#endif + +// Packet: 0x0b4d +#if PACKETVER >= 20190724 +packetLen(0x0b4d, 6) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ -- cgit v1.2.3-70-g09d2 From 89db5fc44ec9d9b960a87819aa32fe38cb428237 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Jul 2019 00:13:25 +0300 Subject: Update HPM --- src/common/HPMDataCheck.h | 1 + src/plugins/HPMHooking/HPMHooking.Defs.inc | 4 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 8 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 2 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 52 ++++++++++++++++++++++ 5 files changed, 67 insertions(+) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 1e1d8068f..68384857f 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -666,6 +666,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_ACK_LEAVE_GUILD1", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD1), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_LEAVE_GUILD2", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD2), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_OPEN_WRITE_MAIL", sizeof(struct PACKET_ZC_ACK_OPEN_WRITE_MAIL), SERVER_TYPE_MAP }, + { "PACKET_ZC_ACK_RANKING_sub", sizeof(struct PACKET_ZC_ACK_RANKING_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REMOVE_ITEM_MAIL", sizeof(struct PACKET_ZC_ACK_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQMAKINGITEM", sizeof(struct PACKET_ZC_ACK_REQMAKINGITEM), SERVER_TYPE_MAP }, { "PACKET_ZC_ACK_REQNAME_TITLE", sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE), SERVER_TYPE_MAP }, diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index b59d80b9c..16cbc8b03 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -1296,6 +1296,10 @@ typedef void (*HPMHOOK_pre_clif_fame_taekwon) (struct map_session_data **sd, int typedef void (*HPMHOOK_post_clif_fame_taekwon) (struct map_session_data *sd, int points); typedef void (*HPMHOOK_pre_clif_ranklist) (struct map_session_data **sd, enum fame_list_type *type); typedef void (*HPMHOOK_post_clif_ranklist) (struct map_session_data *sd, enum fame_list_type type); +typedef void (*HPMHOOK_pre_clif_ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub **ranks, enum fame_list_type *type); +typedef void (*HPMHOOK_post_clif_ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); +typedef void (*HPMHOOK_pre_clif_ranklist_sub2) (uint32 **chars, uint32 **points, enum fame_list_type *type); +typedef void (*HPMHOOK_post_clif_ranklist_sub2) (uint32 *chars, uint32 *points, enum fame_list_type type); typedef void (*HPMHOOK_pre_clif_update_rankingpoint) (struct map_session_data **sd, enum fame_list_type *type, int *points); typedef void (*HPMHOOK_post_clif_update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); typedef void (*HPMHOOK_pre_clif_pRanklist) (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 454a5229c..aa78e5447 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -886,6 +886,10 @@ struct { struct HPMHookPoint *HP_clif_fame_taekwon_post; struct HPMHookPoint *HP_clif_ranklist_pre; struct HPMHookPoint *HP_clif_ranklist_post; + struct HPMHookPoint *HP_clif_ranklist_sub_pre; + struct HPMHookPoint *HP_clif_ranklist_sub_post; + struct HPMHookPoint *HP_clif_ranklist_sub2_pre; + struct HPMHookPoint *HP_clif_ranklist_sub2_post; struct HPMHookPoint *HP_clif_update_rankingpoint_pre; struct HPMHookPoint *HP_clif_update_rankingpoint_post; struct HPMHookPoint *HP_clif_pRanklist_pre; @@ -7673,6 +7677,10 @@ struct { int HP_clif_fame_taekwon_post; int HP_clif_ranklist_pre; int HP_clif_ranklist_post; + int HP_clif_ranklist_sub_pre; + int HP_clif_ranklist_sub_post; + int HP_clif_ranklist_sub2_pre; + int HP_clif_ranklist_sub2_post; int HP_clif_update_rankingpoint_pre; int HP_clif_update_rankingpoint_post; int HP_clif_pRanklist_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index da2f81541..a36fc1243 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -467,6 +467,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->fame_alchemist, HP_clif_fame_alchemist) }, { HP_POP(clif->fame_taekwon, HP_clif_fame_taekwon) }, { HP_POP(clif->ranklist, HP_clif_ranklist) }, + { HP_POP(clif->ranklist_sub, HP_clif_ranklist_sub) }, + { HP_POP(clif->ranklist_sub2, HP_clif_ranklist_sub2) }, { HP_POP(clif->update_rankingpoint, HP_clif_update_rankingpoint) }, { HP_POP(clif->pRanklist, HP_clif_pRanklist) }, { HP_POP(clif->hotkeys, HP_clif_hotkeys) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index b31959ff4..5c14af024 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -11539,6 +11539,58 @@ void HP_clif_ranklist(struct map_session_data *sd, enum fame_list_type type) { } return; } +void HP_clif_ranklist_sub(struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ranklist_sub_pre > 0) { + void (*preHookFunc) (struct PACKET_ZC_ACK_RANKING_sub **ranks, enum fame_list_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ranklist_sub_pre[hIndex].func; + preHookFunc(&ranks, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ranklist_sub(ranks, type); + } + if (HPMHooks.count.HP_clif_ranklist_sub_post > 0) { + void (*postHookFunc) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ranklist_sub_post[hIndex].func; + postHookFunc(ranks, type); + } + } + return; +} +void HP_clif_ranklist_sub2(uint32 *chars, uint32 *points, enum fame_list_type type) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_ranklist_sub2_pre > 0) { + void (*preHookFunc) (uint32 **chars, uint32 **points, enum fame_list_type *type); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub2_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_ranklist_sub2_pre[hIndex].func; + preHookFunc(&chars, &points, &type); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.ranklist_sub2(chars, points, type); + } + if (HPMHooks.count.HP_clif_ranklist_sub2_post > 0) { + void (*postHookFunc) (uint32 *chars, uint32 *points, enum fame_list_type type); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_ranklist_sub2_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_ranklist_sub2_post[hIndex].func; + postHookFunc(chars, points, type); + } + } + return; +} void HP_clif_update_rankingpoint(struct map_session_data *sd, enum fame_list_type type, int points) { int hIndex = 0; if (HPMHooks.count.HP_clif_update_rankingpoint_pre > 0) { -- cgit v1.2.3-70-g09d2 From ef8bc3a8375d4fe9a5f75faf951b3deecb891d57 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sat, 27 Jul 2019 22:12:38 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/common/HPMDataCheck.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 68384857f..d63ed7b99 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -736,6 +736,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "PACKET_ZC_SEARCH_STORE_INFO_ACK_sub", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub), SERVER_TYPE_MAP }, { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP }, { "PACKET_ZC_SPRITE_CHANGE", sizeof(struct PACKET_ZC_SPRITE_CHANGE), SERVER_TYPE_MAP }, + { "PACKET_ZC_STATUS_CHANGE_ACK", sizeof(struct PACKET_ZC_STATUS_CHANGE_ACK), SERVER_TYPE_MAP }, { "PACKET_ZC_STYLE_CHANGE_RES", sizeof(struct PACKET_ZC_STYLE_CHANGE_RES), SERVER_TYPE_MAP }, { "PACKET_ZC_UI_ACTION", sizeof(struct PACKET_ZC_UI_ACTION), SERVER_TYPE_MAP }, { "PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE", sizeof(struct PACKET_ZC_UPDATE_ITEM_FROM_BUYING_STORE), SERVER_TYPE_MAP }, -- cgit v1.2.3-70-g09d2