fix(Core/Spells): make HoTs healing-done pct dynamic (#25357)
This commit is contained in:
parent
6c7cca1871
commit
ea2f6236d2
3 changed files with 11 additions and 6 deletions
|
|
@ -9459,12 +9459,12 @@ uint32 Unit::SpellCriticalHealingBonus(Unit const* caster, SpellInfo const* spel
|
|||
return damage;
|
||||
}
|
||||
|
||||
float Unit::SpellPctHealingModsDone(Unit* victim, SpellInfo const* spellProto, DamageEffectType damagetype)
|
||||
float Unit::SpellPctHealingModsDone(Unit* victim, SpellInfo const* spellProto, DamageEffectType damagetype, bool includeHealingDonePct)
|
||||
{
|
||||
// For totems get healing bonus from owner (statue isn't totem in fact)
|
||||
if (IsCreature() && IsTotem())
|
||||
if (Unit* owner = GetOwner())
|
||||
return owner->SpellPctHealingModsDone(victim, spellProto, damagetype);
|
||||
return owner->SpellPctHealingModsDone(victim, spellProto, damagetype, includeHealingDonePct);
|
||||
|
||||
// Some spells don't benefit from done mods
|
||||
if (spellProto->HasAttribute(SPELL_ATTR3_IGNORE_CASTER_MODIFIERS))
|
||||
|
|
@ -9481,7 +9481,8 @@ float Unit::SpellPctHealingModsDone(Unit* victim, SpellInfo const* spellProto, D
|
|||
float DoneTotalMod = 1.0f;
|
||||
|
||||
// Healing done percent
|
||||
DoneTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
|
||||
if (includeHealingDonePct)
|
||||
DoneTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
|
||||
|
||||
// done scripted mod (take it from owner)
|
||||
Unit* owner = GetOwner() ? GetOwner() : this;
|
||||
|
|
|
|||
|
|
@ -1622,7 +1622,7 @@ public:
|
|||
int32 HealBySpell(HealInfo& healInfo, bool critical = false);
|
||||
|
||||
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask);
|
||||
float SpellPctHealingModsDone(Unit* victim, SpellInfo const* spellProto, DamageEffectType damagetype);
|
||||
float SpellPctHealingModsDone(Unit* victim, SpellInfo const* spellProto, DamageEffectType damagetype, bool includeHealingDonePct = true);
|
||||
uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod = 0.0f, uint32 stack = 1);
|
||||
uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
|
||||
static uint32 SpellCriticalHealingBonus(Unit const* caster, SpellInfo const* spellProto, uint32 damage, Unit const* victim);
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS] =
|
|||
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32* baseAmount, Unit* caster):
|
||||
m_base(base), m_spellInfo(base->GetSpellInfo()),
|
||||
m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_dieSides(m_spellInfo->Effects[effIndex].DieSides),
|
||||
m_critChance(0), m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
|
||||
m_critChance(0), m_pctMods(1.0f), m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_amplitude(0), m_tickNumber(0), m_effIndex(effIndex),
|
||||
m_canBeRecalculated(true), m_isPeriodic(false)
|
||||
{
|
||||
CalculatePeriodic(caster, true, false);
|
||||
|
|
@ -587,7 +587,7 @@ void AuraEffect::CalculatePeriodicData()
|
|||
if (GetBase()->GetType() == UNIT_AURA_TYPE && GetCaster())
|
||||
{
|
||||
if (m_spellInfo->HasAura(SPELL_AURA_PERIODIC_HEAL))
|
||||
m_pctMods = GetCaster()->SpellPctHealingModsDone(GetBase()->GetUnitOwner(), GetSpellInfo(), DOT);
|
||||
m_pctMods = GetCaster()->SpellPctHealingModsDone(GetBase()->GetUnitOwner(), GetSpellInfo(), DOT, false);
|
||||
else if (m_spellInfo->HasAura(SPELL_AURA_PERIODIC_DAMAGE) || m_spellInfo->HasAura(SPELL_AURA_PERIODIC_LEECH))
|
||||
m_pctMods = GetCaster()->SpellPctDamageModsDone(GetBase()->GetUnitOwner(), GetSpellInfo(), DOT);
|
||||
}
|
||||
|
|
@ -6632,6 +6632,10 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
|||
{
|
||||
if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
|
||||
damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
|
||||
|
||||
if (caster && GetBase()->GetType() == UNIT_AURA_TYPE)
|
||||
damage = int32(float(damage) * caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT));
|
||||
|
||||
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue