diff options
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 288307cf8c0..00209b04caf 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -739,8 +739,10 @@ void AuraEffect::GetApplicationList(Container& applicationContainer) const int32 AuraEffect::CalculateAmount(Unit* caster) { + Unit* unitOwner = GetBase()->GetOwner()->ToUnit(); + // default amount calculation - int32 amount = 0; + int32 amount = GetSpellEffectInfo().CalcValue(caster, &m_baseAmount, unitOwner, nullptr, GetBase()->GetCastItemId(), GetBase()->GetCastItemLevel()); if (!m_spellInfo->HasAttribute(SPELL_ATTR8_MASTERY_AFFECTS_POINTS) || G3D::fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f)) amount = GetSpellEffectInfo().CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); @@ -760,7 +762,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) m_canBeRecalculated = false; if (!m_spellInfo->ProcFlags) break; - amount = int32(GetBase()->GetUnitOwner()->CountPctFromMaxHealth(10)); + amount = int32(unitOwner->CountPctFromMaxHealth(10)); break; case SPELL_AURA_SCHOOL_ABSORB: case SPELL_AURA_MANA_SHIELD: @@ -772,7 +774,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId())) mountType = mountEntry->MountTypeID; - if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(mountType)) + if (MountCapabilityEntry const* mountCapability = unitOwner->GetMountCapability(mountType)) amount = mountCapability->ID; break; } @@ -787,7 +789,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->HasAttribute(SPELL_ATTR10_ROLLING_PERIODIC)) { - Unit::AuraEffectList const& periodicAuras = GetBase()->GetUnitOwner()->GetAuraEffectsByType(GetAuraType()); + Unit::AuraEffectList const& periodicAuras = unitOwner->GetAuraEffectsByType(GetAuraType()); if (uint32 totalTicks = GetTotalTicks()) { amount = std::accumulate(std::begin(periodicAuras), std::end(periodicAuras), amount, [&](int32 val, AuraEffect const* aurEff) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 30fd8e27546..ec495532d4e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -553,6 +553,10 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 value += comboDamage * comboPoints; } + if (_spellInfo->HasAttribute(SPELL_ATTR8_MASTERY_AFFECTS_POINTS)) + if (Player const* playerCaster = Object::ToPlayer(caster)) + value += *playerCaster->m_activePlayerData->Mastery * BonusCoefficient; + if (caster) value = caster->ApplyEffectModifiers(_spellInfo, EffectIndex, value); |