aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-03-21 00:07:16 +0100
committerOvahlord <dreadkiller@gmx.de>2025-04-06 19:35:29 +0200
commit528f8e3332e13a451df8bcc198eeec7b2bec8d86 (patch)
tree38c9bce62a1091225d1b47b2b0f08d0e3e2371e6 /src
parentcc8eafbfd0df39dc7efeab246e07b94a6cfe2544 (diff)
Core/Spells: Fixed spells that scale value with master not being affected by SpellModOp::Points and SpellModOp::PointsIndex spellmods
(cherry picked from commit bb67a4279145c37c2106d2bd7a54b14186502602) # Conflicts: # src/server/game/Entities/Unit/StatSystem.cpp # src/server/game/Spells/Auras/SpellAuraEffects.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/game/Spells/SpellInfo.cpp4
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);