Skip to content

Commit e53b90d

Browse files
committed
Core/Spells: do not allow SPELL_EFFECT_HEAL_PCT to critically heal
1 parent b313336 commit e53b90d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/server/game/Spells/Spell.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,9 +2730,13 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
27302730
std::unique_ptr<HealInfo> healInfo;
27312731
if (spell->m_healing > 0)
27322732
{
2733+
// SPELL_EFFECT_HEAL_PCT must never crit, even if other spell effects do crit. As of 4.3.4.15595,
2734+
// this spell effect does not share other healing effects in any spell so we can use this rule here
2735+
bool critPrevented = IsCrit && spell->m_spellInfo->HasEffect(SPELL_EFFECT_HEAL_PCT);
2736+
27332737
hasHealing = true;
27342738
uint32 addhealth = spell->m_healing;
2735-
if (IsCrit)
2739+
if (IsCrit && !critPrevented)
27362740
{
27372741
ProcHitMask |= PROC_HIT_CRITICAL;
27382742
addhealth = Unit::SpellCriticalHealingBonus(caster, addhealth);
@@ -2741,7 +2745,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
27412745
ProcHitMask |= PROC_HIT_NORMAL;
27422746

27432747
healInfo = std::make_unique<HealInfo>(caster, spell->unitTarget, addhealth, spell->m_spellInfo, spell->m_spellInfo->GetSchoolMask());
2744-
caster->HealBySpell(*healInfo, IsCrit);
2748+
caster->HealBySpell(*healInfo, IsCrit && !critPrevented);
27452749
spell->unitTarget->GetThreatManager().ForwardThreatForAssistingMe(caster, float(healInfo->GetEffectiveHeal()) * 0.5f, spell->m_spellInfo);
27462750
spell->m_healing = healInfo->GetEffectiveHeal();
27472751

0 commit comments

Comments
 (0)