From 5842dd26915b6e7b91007c97b9aac47f8b25de86 Mon Sep 17 00:00:00 2001 From: skyleo Date: Mon, 12 Jul 2021 03:51:05 +0200 Subject: [PATCH 1/7] Initialze atk%, def% etc to 100 for all bl types --- src/map/status.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/status.c b/src/map/status.c index 1a9e79e97b1..00f9ae0d9e2 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3884,6 +3884,11 @@ static void status_calc_misc(struct block_list *bl, struct status_data *st, int st->mdef2 += st->int_ + (st->vit >> 1); #endif // RENEWAL + st->atk_percent = 100; + st->matk_percent = 100; + st->def_percent = 100; + st->mdef_percent = 100; + if ( bl->type&battle_config.enable_critical ) st->cri += 10 + (st->luk * 10 / 3); // (every 1 luk = +0.33 critical -> 3 luk = +1 critical) else From 53e0ee455a54d4a009ece6d186244c402f398678 Mon Sep 17 00:00:00 2001 From: skyleo Date: Thu, 17 Mar 2022 01:52:53 +0100 Subject: [PATCH 2/7] Implement official ATK % calculation for BS_OVERTHRUST in pre-renewal Party members only receive 5% ATK bonus. --- src/map/status.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index 00f9ae0d9e2..1cf1419b328 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8308,8 +8308,15 @@ static int status_change_start_sub(struct block_list *src, struct block_list *bl val2 = 20*val1; //Power increase break; case SC_OVERTHRUST: - //val2 holds if it was casted on self, or is bonus received from others - val3 = 5*val1; //Power increase +#ifndef RENEWAL + if (val2 == 1) // cast on self + val3 = 5 * val1; //Power increase + else // received cast + val3 = 5; +#else + // for renewal this is actually wrong for party members since 2020 and will need to be changed. + val3 = 5 * val1; // Power increase +#endif if(sd && pc->checkskill(sd,BS_HILTBINDING)>0) total_tick += total_tick / 10; break; From 3d37a05cb8e92e6c4392f4a33995b7c768ce1387 Mon Sep 17 00:00:00 2001 From: skyleo Date: Fri, 4 Feb 2022 21:01:28 +0100 Subject: [PATCH 3/7] Fix sending clif->updatestatus to non-sd objects for percent-based stuff --- src/map/status.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/map/status.c b/src/map/status.c index 1cf1419b328..7d956fbcb75 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3079,22 +3079,14 @@ static void status_calc_bl_main(struct block_list *bl, e_scb_flag flag) ; } - if ((flag & SCB_ATK_PERC) != 0) { - int prev_atk_percent = st->atk_percent; + if ((flag & SCB_ATK_PERC) != 0) st->atk_percent = status->calc_atk_percent(bl, sc); - if (prev_atk_percent != st->atk_percent) - clif->updatestatus(sd, SP_ATK1); - } if ((flag & SCB_MATK_PERC) != 0) st->matk_percent = status->calc_matk_percent(bl, sc); - if ((flag & SCB_DEF_PERC) != 0) { - int prev_def_percent = st->def_percent; + if ((flag & SCB_DEF_PERC) != 0) st->def_percent = status->calc_def_percent(bl, sc); - if (prev_def_percent != st->def_percent) - clif->updatestatus(sd, SP_DEF2); - } if ((flag & SCB_MDEF_PERC) != 0) { st->mdef_percent = status->calc_mdef_percent(bl, sc); @@ -3497,6 +3489,8 @@ static void status_calc_bl_(struct block_list *bl, e_scb_flag flag, enum e_statu #endif ) clif->updatestatus(sd,SP_ATK1); + else if (bst.atk_percent != st->atk_percent) + clif->updatestatus(sd, SP_ATK1); if(bst.def != st->def) { clif->updatestatus(sd,SP_DEF1); @@ -3517,7 +3511,10 @@ static void status_calc_bl_(struct block_list *bl, e_scb_flag flag, enum e_statu #ifdef RENEWAL clif->updatestatus(sd,SP_DEF1); #endif + } else if (bst.def_percent != st->def_percent) { + clif->updatestatus(sd,SP_DEF2); } + if(bst.flee2 != st->flee2) clif->updatestatus(sd,SP_FLEE2); if(bst.cri != st->cri) From 9c0dfd161b2d2192118e49895ff768fac0551a92 Mon Sep 17 00:00:00 2001 From: jasonch <31005928+jasonch35@users.noreply.github.com> Date: Wed, 15 May 2024 18:12:36 +0800 Subject: [PATCH 4/7] Fix warning when SECURE_NPCTIMEOUT enabled --- src/map/npc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/npc.c b/src/map/npc.c index 59501209e0e..0ea39b855f8 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -313,7 +313,8 @@ static int npc_rr_secure_timeout_timer(int tid, int64 tick, int id, intptr_t dat case NPCT_MENU: timeout = NPC_SECURE_TIMEOUT_MENU; break; - //case NPCT_WAIT: var starts with this value + case NPCT_WAIT: //var starts with this value + break; } if( DIFF_TICK(tick,sd->npc_idle_tick) > (timeout*1000) ) { From 2ba21bac253ec95e8a936a580fd6193f2b77373d Mon Sep 17 00:00:00 2001 From: jasonch <31005928+jasonch35@users.noreply.github.com> Date: Wed, 15 May 2024 15:27:15 +0800 Subject: [PATCH 5/7] Reload status_type on @reloadskilldb Moved comment to function Removed unwanted lines --- src/map/atcommand.c | 1 + src/map/status.c | 39 +++++++++++++++++++++++---------------- src/map/status.h | 1 + 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 10528e797e1..e3fc633d86f 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3903,6 +3903,7 @@ ACMD(reloadmobdb) ACMD(reloadskilldb) { skill->reload(); + status->load_sc_type(); homun->reload_skill(); elemental->reload_skilldb(); mercenary->read_skilldb(); diff --git a/src/map/status.c b/src/map/status.c index 1a9e79e97b1..7da479e1be7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -134,22 +134,8 @@ static void initChangeTables(void) memset(status->dbs->ChangeFlagTable, 0, sizeof(status->dbs->ChangeFlagTable)); memset(status->dbs->DisplayType, 0, sizeof(status->dbs->DisplayType)); - // Storing the target job rather than simply SC_SOULLINK simplifies code later on. - skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST; - skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK; - skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR; - skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE; - skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER; - skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE; - skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT; - skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD; - skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST; - skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER; - skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE; - skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN; - skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH; - skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER; - skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER; + status->load_sc_type(); + #undef set_sc_with_vfx } @@ -13985,6 +13971,26 @@ static void status_check_job_bonus(int idx, const char *name, int class) } } +static void status_load_sc_type(void) +{ + // Storing the target job rather than simply SC_SOULLINK simplifies code later on. + skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST; + skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK; + skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR; + skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE; + skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER; + skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE; + skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT; + skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD; + skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST; + skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER; + skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE; + skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN; + skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH; + skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER; + skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER; +} + static bool status_readdb_job2(char *fields[], int columns, int current) { int idx, class, i; @@ -14750,6 +14756,7 @@ void status_defaults(void) status->change_start_unknown_sc = status_change_start_unknown_sc; status->display_remove = status_display_remove; status->natural_heal = status_natural_heal; + status->load_sc_type = status_load_sc_type; status->natural_heal_timer = status_natural_heal_timer; status->readdb_job2 = status_readdb_job2; status->readdb_sizefix = status_readdb_sizefix; diff --git a/src/map/status.h b/src/map/status.h index fb78c543a90..a426a71d765 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1512,6 +1512,7 @@ struct status_interface { void (*display_remove) (struct map_session_data *sd, enum sc_type type); int (*natural_heal) (struct block_list *bl, va_list args); int (*natural_heal_timer) (int tid, int64 tick, int id, intptr_t data); + void (*load_sc_type) (void); bool (*readdb_job2) (char *fields[], int columns, int current); bool (*readdb_sizefix) (char *fields[], int columns, int current); bool (*read_scdb_libconfig) (void); From 9c716848301cedc68cfc0ffc595246cd067daaa8 Mon Sep 17 00:00:00 2001 From: hwsapibot Date: Fri, 24 May 2024 12:18:02 +0000 Subject: [PATCH 6/7] Update HPM hooks Signed-off-by: hwsapibot --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 2 ++ .../HPMHooking_map.HPMHooksCore.inc | 4 +++ .../HPMHooking_map.HookingPoints.inc | 1 + .../HPMHooking/HPMHooking_map.Hooks.inc | 26 +++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index fabba238090..9f05793b440 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -9296,6 +9296,8 @@ typedef int (*HPMHOOK_pre_status_natural_heal) (struct block_list **bl, va_list typedef int (*HPMHOOK_post_status_natural_heal) (int retVal___, struct block_list *bl, va_list args); typedef int (*HPMHOOK_pre_status_natural_heal_timer) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_status_natural_heal_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data); +typedef void (*HPMHOOK_pre_status_load_sc_type) (void); +typedef void (*HPMHOOK_post_status_load_sc_type) (void); typedef bool (*HPMHOOK_pre_status_readdb_job2) (char **fields[], int *columns, int *current); 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); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 9acc5bc795e..eaba4419a28 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -7212,6 +7212,8 @@ struct { struct HPMHookPoint *HP_status_natural_heal_post; struct HPMHookPoint *HP_status_natural_heal_timer_pre; struct HPMHookPoint *HP_status_natural_heal_timer_post; + struct HPMHookPoint *HP_status_load_sc_type_pre; + struct HPMHookPoint *HP_status_load_sc_type_post; struct HPMHookPoint *HP_status_readdb_job2_pre; struct HPMHookPoint *HP_status_readdb_job2_post; struct HPMHookPoint *HP_status_readdb_sizefix_pre; @@ -14787,6 +14789,8 @@ struct { int HP_status_natural_heal_post; int HP_status_natural_heal_timer_pre; int HP_status_natural_heal_timer_post; + int HP_status_load_sc_type_pre; + int HP_status_load_sc_type_post; int HP_status_readdb_job2_pre; int HP_status_readdb_job2_post; int HP_status_readdb_sizefix_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index a33b781115d..b6b47879c22 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -3685,6 +3685,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->display_remove, HP_status_display_remove) }, { HP_POP(status->natural_heal, HP_status_natural_heal) }, { HP_POP(status->natural_heal_timer, HP_status_natural_heal_timer) }, + { HP_POP(status->load_sc_type, HP_status_load_sc_type) }, { HP_POP(status->readdb_job2, HP_status_readdb_job2) }, { HP_POP(status->readdb_sizefix, HP_status_readdb_sizefix) }, { HP_POP(status->read_scdb_libconfig, HP_status_read_scdb_libconfig) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 6357501e44a..9861cbe91e5 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -96405,6 +96405,32 @@ int HP_status_natural_heal_timer(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } +void HP_status_load_sc_type(void) { + int hIndex = 0; + if (HPMHooks.count.HP_status_load_sc_type_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_load_sc_type_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_status_load_sc_type_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.status.load_sc_type(); + } + if (HPMHooks.count.HP_status_load_sc_type_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_status_load_sc_type_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_status_load_sc_type_post[hIndex].func; + postHookFunc(); + } + } + return; +} bool HP_status_readdb_job2(char *fields[], int columns, int current) { int hIndex = 0; bool retVal___ = false; From 7312ec2a768a8457b48593890b63fa59bb0c4b70 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 25 May 2024 17:01:26 +0200 Subject: [PATCH 7/7] Release v2024.05 Signed-off-by: Haru --- AUTHORS | 1 + CHANGELOG.md | 13 +++++++++++++ doc/constants_pre-re.md | 2 +- doc/constants_re.md | 2 +- src/config/core.h | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 863ae8379de..6091cd9f5d4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -71,6 +71,7 @@ jaBote jaBote jaBote Jackson +jasonch <31005928+jasonch35@users.noreply.github.com> Jedzkie Jenkijo Jesusaves diff --git a/CHANGELOG.md b/CHANGELOG.md index b9cf603f1d6..c64bd75b6a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,19 @@ If you are reading this in a text editor, simply ignore this section ### Removed --> +## [v2024.05] `May 2024` + +### Changed + +- Implemented official ATK % calculation for `BS_OVERTHRUST` in pre-renewal. Party members only receive 5% ATK bonus. (#3293) + +### Fixed + +- Fixed a missing initialization of the (m)atk/(m)def modifiers, resulting into 0 or 1 damage. (#3293, related to #3290) +- Fixed an incorrect call of `clif->updatestatus()` to non-player objects in relation to atk/def percent bonuses. (#3294, related to #3290) +- Fixed a failure on SCs from skills that don't have a `StatusChange` entry in their skill db entries after a `@reloadskilldb`, such as the spirit skills. (#3296, issue #3295) +- Fixed a compiler warning due to a missing case label when `SECURE_NPCTIMEOUT` is enabled. (#3297, issue #3197) + ## [v2024.04] `April 2024` ### Added diff --git a/doc/constants_pre-re.md b/doc/constants_pre-re.md index 175f3d3330e..0c6e9e092a9 100644 --- a/doc/constants_pre-re.md +++ b/doc/constants_pre-re.md @@ -4878,7 +4878,7 @@ ### Server defines - `PACKETVER`: 20190530 -- `HERCULES_VERSION`: 202404000 +- `HERCULES_VERSION`: 202405000 - `MAX_LEVEL`: 175 - `MAX_STORAGE`: 600 - `MAX_GUILD_STORAGE`: 500 diff --git a/doc/constants_re.md b/doc/constants_re.md index 1df151f05c6..90b7329501b 100644 --- a/doc/constants_re.md +++ b/doc/constants_re.md @@ -4878,7 +4878,7 @@ ### Server defines - `PACKETVER`: 20190530 -- `HERCULES_VERSION`: 202404000 +- `HERCULES_VERSION`: 202405000 - `MAX_LEVEL`: 175 - `MAX_STORAGE`: 600 - `MAX_GUILD_STORAGE`: 500 diff --git a/src/config/core.h b/src/config/core.h index 30e62a20f5f..844549af1e9 100644 --- a/src/config/core.h +++ b/src/config/core.h @@ -22,7 +22,7 @@ #define CONFIG_CORE_H /// Hercules version. From tag vYYYY.MM(+PPP) -> YYYYMMPPP -#define HERCULES_VERSION 202404000 +#define HERCULES_VERSION 202405000 /// Max number of items on @autolootid list #define AUTOLOOTITEM_SIZE 10