From 566ac2078d9779379f8e2786fbc124e8bd9c3de1 Mon Sep 17 00:00:00 2001 From: Playtester <3785983+Playtester@users.noreply.github.com> Date: Wed, 19 Jun 2024 07:53:30 +0200 Subject: [PATCH] Guillotine Fist SP Recovery Prevention Cleanup (#8443) - Unified code for SC_EXTREMITYFIST * It stops natural SP recovery for 300s in pre-re * It stops natural SP recovery and recovery from items for 3s and shows icon in renewal - Removed SC_EXTREMITYFIST2 as it's no longer needed - Fixed an issue that caused a natural SP regen tick to happen right after using Guillotine Fist - Fixes #8377 --- db/pre-re/skill_db.yml | 2 +- db/re/skill_db.yml | 1 - db/re/status.yml | 9 +-------- src/map/pc.cpp | 2 +- src/map/script.cpp | 2 +- src/map/script_constants.hpp | 1 - src/map/skill.cpp | 29 +++++++---------------------- src/map/status.cpp | 2 ++ src/map/status.hpp | 8 ++++---- 9 files changed, 17 insertions(+), 39 deletions(-) diff --git a/db/pre-re/skill_db.yml b/db/pre-re/skill_db.yml index 33cb72990d..731174b147 100644 --- a/db/pre-re/skill_db.yml +++ b/db/pre-re/skill_db.yml @@ -7359,7 +7359,7 @@ Body: Time: 1500 - Level: 5 Time: 1000 - Duration2: 300000 + Duration1: 300000 Requires: SpCost: 1 Weapon: diff --git a/db/re/skill_db.yml b/db/re/skill_db.yml index a7447d1bcf..fcdc35aec2 100644 --- a/db/re/skill_db.yml +++ b/db/re/skill_db.yml @@ -7699,7 +7699,6 @@ Body: - Level: 5 Time: 1000 Duration1: 3000 - Duration2: 300000 FixedCastTime: - Level: 1 Time: 2000 diff --git a/db/re/status.yml b/db/re/status.yml index 5ced62cccd..e7b737e68e 100644 --- a/db/re/status.yml +++ b/db/re/status.yml @@ -1009,6 +1009,7 @@ Body: Flags: SendOption: true - Status: Extremityfist + Icon: EFST_EXTREMITYFIST DurationLookup: MO_EXTREMITYFIST CalcFlags: Regen: true @@ -6117,14 +6118,6 @@ Body: NoBanishingBuster: true NoDispell: true RemoveOnHermode: true - - Status: Extremityfist2 - Icon: EFST_EXTREMITYFIST - DurationLookup: MO_EXTREMITYFIST - Flags: - NoRemoveOnDead: true - NoDispell: true - NoBanishingBuster: true - NoClearance: true - Status: Mtf_Aspd2 Icon: EFST_MTF_ASPD2 CalcFlags: diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 14a1d7641d..3c8eb5a07c 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -10623,7 +10623,7 @@ int pc_itemheal(map_session_data *sd, t_itemid itemid, int hp, int sp) } #ifdef RENEWAL - if (sd->sc.getSCE(SC_EXTREMITYFIST2)) + if (sd->sc.getSCE(SC_EXTREMITYFIST)) sp = 0; #endif if (sd->sc.getSCE(SC_BITESCAR)) diff --git a/src/map/script.cpp b/src/map/script.cpp index 27b55e68ba..434d154828 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -6073,7 +6073,7 @@ BUILDIN_FUNC(percentheal) return SCRIPT_CMD_SUCCESS; #ifdef RENEWAL - if( sd->sc.getSCE(SC_EXTREMITYFIST2) ) + if( sd->sc.getSCE(SC_EXTREMITYFIST) ) sp = 0; #endif diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index cdd18995a9..58a2c46233 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -1912,7 +1912,6 @@ export_constant(SC_HIDDEN_CARD); export_constant(SC_PERIOD_RECEIVEITEM_2ND); export_constant(SC_PERIOD_PLUSEXP_2ND); - export_constant(SC_EXTREMITYFIST2); export_constant(SC_POWERUP); export_constant(SC_AGIUP); export_constant(SC_PROTECTION); diff --git a/src/map/skill.cpp b/src/map/skill.cpp index ba9bf0dbaa..1e23f64d31 100755 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -2529,11 +2529,7 @@ int skill_onskillusage(map_session_data *sd, struct block_list *bl, uint16 skill /* Splitted off from skill_additional_effect, which is never called when the * attack skill kills the enemy. Place in this function counter status effects - * when using skills (eg: Asura's sp regen penalty, or counter-status effects - * from cards) that will take effect on the source, not the target. [Skotlex] - * Note: Currently this function only applies to Extremity Fist and BF_WEAPON - * type of skills, so not every instance of skill_additional_effect needs a call - * to this one. + * when using skills that will take effect on the source, not the target. [Skotlex] */ int skill_counter_additional_effect (struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int attack_type, t_tick tick) { @@ -2581,9 +2577,6 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * } switch(skill_id) { - case MO_EXTREMITYFIST: - sc_start(src,src,SC_EXTREMITYFIST,100,skill_lv,skill_get_time2(skill_id,skill_lv)); - break; case GS_FULLBUSTER: sc_start(src,src,SC_BLIND,2*skill_lv,skill_lv,skill_get_time2(skill_id,skill_lv)); break; @@ -5522,11 +5515,9 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); if (skill_id == MO_EXTREMITYFIST) { status_set_sp(src, 0, 0); + sc_start(src, src, SC_EXTREMITYFIST, 100, skill_lv, skill_get_time(skill_id, skill_lv)); status_change_end(src, SC_EXPLOSIONSPIRITS); status_change_end(src, SC_BLADESTOP); -#ifdef RENEWAL - sc_start(src,src,SC_EXTREMITYFIST2,100,skill_lv,skill_get_time(skill_id,skill_lv)); -#endif } else { status_set_hp(src, 1, 0); status_change_end(src, SC_NEN); @@ -9553,7 +9544,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui clif_skill_nodamage(nullptr,bl,MG_SRECOVERY,sp,1); if (tsc) { #ifdef RENEWAL - if (tsc->getSCE(SC_EXTREMITYFIST2)) + if (tsc->getSCE(SC_EXTREMITYFIST)) sp = 0; #endif if (tsc->getSCE(SC_NORECOVER_STATE)) { @@ -10306,7 +10297,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui #ifdef RENEWAL sp1 = sp1 / 2; sp2 = sp2 / 2; - if (tsc && tsc->getSCE(SC_EXTREMITYFIST2)) + if (tsc && tsc->getSCE(SC_EXTREMITYFIST)) sp1 = tstatus->sp; #endif if (tsc && tsc->getSCE(SC_NORECOVER_STATE)) @@ -13488,15 +13479,9 @@ TIMER_FUNC(skill_castend_id){ //Consume SP/spheres skill_consume_requirement(sd,ud->skill_id, ud->skill_lv,1); status_set_sp(src, 0, 0); - sc = &sd->sc; - if (sc->count) - { //End states - status_change_end(src, SC_EXPLOSIONSPIRITS); - status_change_end(src, SC_BLADESTOP); -#ifdef RENEWAL - sc_start(src,src, SC_EXTREMITYFIST2, 100, ud->skill_lv, skill_get_time(ud->skill_id, ud->skill_lv)); -#endif - } + sc_start(src, src, SC_EXTREMITYFIST, 100, ud->skill_lv, skill_get_time(ud->skill_id, ud->skill_lv)); + status_change_end(src, SC_EXPLOSIONSPIRITS); + status_change_end(src, SC_BLADESTOP); if( target && target->m == src->m ) { //Move character to target anyway. short x, y; short dir = map_calc_dir(src,target->x,target->y); diff --git a/src/map/status.cpp b/src/map/status.cpp index da86386695..bb082cc716 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -12992,6 +12992,8 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty case SC_BERSERK: case SC_MERC_HPUP: case SC_MERC_SPUP: + // Status needs to be updated immediately and not at the end of the damage + case SC_EXTREMITYFIST: status_calc_bl_(bl, calc_flag, SCO_FORCE); break; default: diff --git a/src/map/status.hpp b/src/map/status.hpp index 794d469111..1db334c11e 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -756,7 +756,7 @@ enum sc_type : int16 { /* Guild Aura */ SC_LEADERSHIP, SC_GLORYWOUNDS, - SC_SOULCOLD, //508 + SC_SOULCOLD, SC_HAWKEYES, /* ... */ SC_ODINS_POWER, @@ -779,7 +779,7 @@ enum sc_type : int16 { /* Max HP & SP */ SC_INCMHP, SC_INCMSP, - SC_PARTYFLEE, // 531 + SC_PARTYFLEE, /** * Kagerou & Oboro [malufett] **/ @@ -1307,8 +1307,8 @@ enum sc_type : int16 { SC_PERIOD_RECEIVEITEM_2ND, SC_PERIOD_PLUSEXP_2ND, - SC_EXTREMITYFIST2, - SC_POWERUP, + //SC_EXTREMITYFIST2, + SC_POWERUP = 951, SC_AGIUP, SC_PROTECTION,