mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Spells: Fixed spells that scale value with master not being affected by SpellModOp::Points and SpellModOp::PointsIndex spellmods
(cherry picked from commit bb67a42791)
# Conflicts:
# src/server/game/Entities/Unit/StatSystem.cpp
# src/server/game/Spells/Auras/SpellAuraEffects.cpp
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user