Skip to content

Commit 0d34ce6

Browse files
authored
Merge pull request #9818 from sruon/resonance_subtarget
[core] Mobskills only trigger resonance on main target
2 parents f8da10c + a8fc29e commit 0d34ce6

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/map/entities/battleentity.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,18 +2847,22 @@ void CBattleEntity::OnMobSkillFinished(CMobSkillState& state, action_t& action)
28472847
result.resolution = ActionResolution::Hit;
28482848
}
28492849

2850-
if (result.resolution != ActionResolution::Miss && result.resolution != ActionResolution::Parry)
2850+
if (first)
28512851
{
2852-
if (first && PTargetFound->health.hp > 0 && PSkill->getPrimarySkillchain() != 0)
2852+
bool isNegated = result.resolution == ActionResolution::Miss || result.resolution == ActionResolution::Parry;
2853+
if (!isNegated)
28532854
{
2854-
const auto effect = battleutils::GetSkillChainEffect(PTargetFound, PSkill->getPrimarySkillchain(), PSkill->getSecondarySkillchain(), PSkill->getTertiarySkillchain());
2855-
if (effect != ActionProcSkillChain::None)
2855+
if (PTargetFound->health.hp > 0 && PSkill->getPrimarySkillchain() != 0)
28562856
{
2857-
result.recordSkillchain(effect, battleutils::TakeSkillchainDamage(this, PTargetFound, result.param, nullptr));
2857+
const auto effect = battleutils::GetSkillChainEffect(PTargetFound, PSkill->getPrimarySkillchain(), PSkill->getSecondarySkillchain(), PSkill->getTertiarySkillchain());
2858+
if (effect != ActionProcSkillChain::None)
2859+
{
2860+
result.recordSkillchain(effect, battleutils::TakeSkillchainDamage(this, PTargetFound, result.param, nullptr));
2861+
}
28582862
}
2859-
2860-
first = false;
28612863
}
2864+
2865+
first = false;
28622866
}
28632867

28642868
if (PSkill->getValidTargets() & TARGET_ENEMY)

src/map/entities/charentity.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,8 @@ void CCharEntity::OnWeaponSkillFinished(CWeaponSkillState& state, action_t& acti
16231623
// On retail, weaponskills will contain 0x08, 0x10 (HIT, ABILITY) on hit and may include the following:
16241624
// 0x01, 0x02, 0x04 (MISS, GUARDED, BLOCK)
16251625
// TODO: refactor this so lua returns the number of hits so we don't have to check the reaction bits.
1626-
if (actionResult.resolution != ActionResolution::Miss)
1626+
bool isNegated = actionResult.resolution == ActionResolution::Miss || actionResult.resolution == ActionResolution::Parry;
1627+
if (!isNegated)
16271628
{
16281629
int wspoints = settings::get<uint8>("map.WS_POINTS_BASE");
16291630

0 commit comments

Comments
 (0)