From 215dde06cd292fad9eee4bd123e2e718ab3f2fab Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:25:27 -0700 Subject: [PATCH] [core] Only proc skillchains if target hp > 0 --- src/map/entities/battleentity.cpp | 2 +- src/map/entities/charentity.cpp | 6 ++++-- src/map/entities/petentity.cpp | 2 +- src/map/entities/trustentity.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 62cf583cca6..b335410b2dd 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -2164,7 +2164,7 @@ void CBattleEntity::OnMobSkillFinished(CMobSkillState& state, action_t& action) target.knockback = 0; } - if (first && (PSkill->getPrimarySkillchain() != 0)) + if (first && PTargetFound->health.hp > 0 && PSkill->getPrimarySkillchain() != 0) { SUBEFFECT effect = battleutils::GetSkillChainEffect(PTargetFound, PSkill->getPrimarySkillchain(), PSkill->getSecondarySkillchain(), PSkill->getTertiarySkillchain()); diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index 89a731edf1f..10204d87274 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -1255,7 +1255,8 @@ void CCharEntity::OnCastFinished(CMagicState& state, action_t& action) } // Immanence will create or extend a skillchain for elemental spells - if (actionTarget.param >= 0 && + if (PTarget->health.hp > 0 && + actionTarget.param >= 0 && PSpell->dealsDamage() && PSpell->getSpellGroup() == SPELLGROUP_BLACK && (StatusEffectContainer->HasStatusEffect(EFFECT_IMMANENCE))) @@ -1507,7 +1508,8 @@ void CCharEntity::OnWeaponSkillFinished(CWeaponSkillState& state, action_t& acti if ((actionTarget.reaction & REACTION::MISS) == REACTION::NONE) { int wspoints = settings::get("map.WS_POINTS_BASE"); - if (PWeaponSkill->getPrimarySkillchain() != 0) + + if (PBattleTarget->health.hp > 0 && PWeaponSkill->getPrimarySkillchain() != 0) { // NOTE: GetSkillChainEffect is INSIDE this if statement because it // ALTERS the state of the resonance, which misses and non-elemental skills should NOT do. diff --git a/src/map/entities/petentity.cpp b/src/map/entities/petentity.cpp index 7072515507e..4ef655fc392 100644 --- a/src/map/entities/petentity.cpp +++ b/src/map/entities/petentity.cpp @@ -570,7 +570,7 @@ void CPetEntity::OnPetSkillFinished(CPetSkillState& state, action_t& action) { target.speceffect = SPECEFFECT::RECOIL; target.knockback = PSkill->getKnockback(); - if (first && (PSkill->getPrimarySkillchain() != 0)) + if (first && PTargetFound->health.hp > 0 && PSkill->getPrimarySkillchain() != 0) { SUBEFFECT effect = battleutils::GetSkillChainEffect(PTargetFound, PSkill->getPrimarySkillchain(), PSkill->getSecondarySkillchain(), PSkill->getTertiarySkillchain()); diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 15bb5553f4f..bb8a4d1cf74 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -573,7 +573,7 @@ void CTrustEntity::OnWeaponSkillFinished(CWeaponSkillState& state, action_t& act if (primary) { - if (PWeaponSkill->getPrimarySkillchain() != 0) + if (PBattleTarget->health.hp > 0 && PWeaponSkill->getPrimarySkillchain() != 0) { // NOTE: GetSkillChainEffect is INSIDE this if statement because it // ALTERS the state of the resonance, which misses and non-elemental skills should NOT do.