aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index b9d17622476..5662a1de538 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -457,11 +457,11 @@ bool SpellEffectInfo::IsUnitOwnedAuraEffect() const
return IsAreaAuraEffect() || Effect == SPELL_EFFECT_APPLY_AURA;
}
-int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const* bp /*= nullptr*/, Unit const* target /*= nullptr*/, float* variance /*= nullptr*/, int32 itemLevel /*= -1*/) const
+int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const* bp /*= nullptr*/, Unit const* target /*= nullptr*/, float* variance /*= nullptr*/, uint32 castItemId /*= 0*/, int32 itemLevel /*= -1*/) const
{
float basePointsPerLevel = RealPointsPerLevel;
// TODO: this needs to be a float, not rounded
- int32 basePoints = CalcBaseValue(caster, target, itemLevel);
+ int32 basePoints = CalcBaseValue(caster, target, castItemId, itemLevel);
float value = bp ? *bp : basePoints;
float comboDamage = PointsPerResource;
@@ -509,7 +509,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster /*= nullptr*/, int32 const*
return int32(round(value));
}
-int32 SpellEffectInfo::CalcBaseValue(Unit const* caster, Unit const* target, int32 itemLevel) const
+int32 SpellEffectInfo::CalcBaseValue(Unit const* caster, Unit const* target, uint32 itemId, int32 itemLevel) const
{
if (Scaling.Coefficient != 0.0f)
{
@@ -555,10 +555,21 @@ int32 SpellEffectInfo::CalcBaseValue(Unit const* caster, Unit const* target, int
value = GetSpellScalingColumnForClass(sSpellScalingGameTable.GetRow(level), _spellInfo->Scaling.Class);
if (_spellInfo->Scaling.Class == -7)
+ if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel))
+ if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId))
+ value *= GetIlvlStatMultiplier(ratingMult, InventoryType(itemSparse->InventoryType));
+
+ if (IsAura(SPELL_AURA_MOD_RATING))
{
- // todo: get inventorytype here
if (GtCombatRatingsMultByILvl const* ratingMult = sCombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel))
- value *= ratingMult->ArmorMultiplier;
+ if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId))
+ value *= GetIlvlStatMultiplier(ratingMult, InventoryType(itemSparse->InventoryType));
+ }
+ else if (IsAura(SPELL_AURA_MOD_STAT) && MiscValue == STAT_STAMINA)
+ {
+ if (GtStaminaMultByILvl const* staminaMult = sStaminaMultByILvlGameTable.GetRow(effectiveItemLevel))
+ if (ItemSparseEntry const* itemSparse = sItemSparseStore.LookupEntry(itemId))
+ value *= GetIlvlStatMultiplier(staminaMult, InventoryType(itemSparse->InventoryType));
}
}
@@ -712,6 +723,7 @@ ExpectedStatType SpellEffectInfo::GetScalingExpectedStat() const
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
case SPELL_EFFECT_APPLY_AURA_ON_PET:
case SPELL_EFFECT_202:
+ case SPELL_EFFECT_APPLY_AREA_AURA_PARTY_NONRANDOM:
switch (ApplyAuraName)
{
case SPELL_AURA_PERIODIC_DAMAGE: