diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 3 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/StatSystem.cpp | 7 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 16 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 10 |
6 files changed, 21 insertions, 19 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 1728ff7123e..d3362536ecb 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -27,6 +27,7 @@ #include "ObjectAccessor.h" #include "UnitEvents.h" #include "SpellAuras.h" +#include "SpellMgr.h" //============================================================== //================= ThreatCalcHelper =========================== @@ -387,7 +388,7 @@ void ThreatManager::addThreat(Unit* pVictim, float fThreat, SpellSchoolMask scho Unit *unit = pVictim->GetMisdirectionTarget(); if (unit) if (Aura* pAura = unit->GetAura(63326)) // Glyph of Vigilance - reducedThreadPercent += pAura->GetSpellProto()->EffectBasePoints[0]; + reducedThreadPercent += SpellMgr::CalculateSpellEffectAmount(pAura->GetSpellProto(), 0); float reducedThreat = threat * reducedThreadPercent / 100; threat -= reducedThreat; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f5b581446e5..02e7ab3829b 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -25,6 +25,7 @@ #include "SharedDefines.h" #include "SpellAuras.h" #include "SpellAuraEffects.h" +#include "SpellMgr.h" inline bool _ModifyUInt32(bool apply, uint32& baseValue, int32& amount) { @@ -961,7 +962,7 @@ bool Guardian::UpdateStats(Stats stat) if (aurEff) { SpellEntry const* sProto = aurEff->GetSpellProto(); // Then get the SpellProto and add the dummy effect value - mod += mod * (sProto->EffectBasePoints[1] / 100.0f); // Ravenous Dead edits the original scale + mod += mod * (SpellMgr::CalculateSpellEffectAmount(sProto, 1) / 100.0f); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); @@ -987,7 +988,7 @@ bool Guardian::UpdateStats(Stats stat) { SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value - mod += mod * (sProto->EffectBasePoints[0] / 100.0f); + mod += mod * (SpellMgr::CalculateSpellEffectAmount(sProto, 0) / 100.0f); } } value += float(owner->GetStat(stat)) * mod; @@ -1153,7 +1154,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) { SpellEntry const* sProto = sSpellStore.LookupEntry(itr->first); // Then get the SpellProto and add the dummy effect value - mod += (sProto->EffectBasePoints[1] / 100.0f); + mod += (SpellMgr::CalculateSpellEffectAmount(sProto, 1) / 100.0f); } } bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a745bb00487..3f41f3f67c7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1825,8 +1825,9 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff spellProto->Id == 60218) // Essence of Gossamer { // Max absorb stored in 1 dummy effect - if (spellProto->EffectBasePoints[1] < currentAbsorb) - currentAbsorb = spellProto->EffectBasePoints[1]; + int32 maxAbsorb = SpellMgr::CalculateSpellEffectAmount(spellProto, 1); + if (maxAbsorb < currentAbsorb) + currentAbsorb = maxAbsorb; break; } break; @@ -6496,7 +6497,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (procSpell->SpellIconID != 62) return false; - int32 mana_perc = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()]+1; + int32 mana_perc = SpellMgr::CalculateSpellEffectAmount(triggeredByAura->GetSpellProto(), triggeredByAura->GetEffIndex()); basepoints0 = uint32((GetCreatePowers(POWER_MANA) * mana_perc / 100) / 10); triggered_spell_id = 54833; target = this; @@ -6781,7 +6782,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Improved Mend Pet if (dummySpell->SpellIconID == 267) { - int32 chance = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()]; + int32 chance = SpellMgr::CalculateSpellEffectAmount(triggeredByAura->GetSpellProto(), triggeredByAura->GetEffIndex()); if (!roll_chance_i(chance)) return false; @@ -7100,7 +7101,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger for (uint8 i=0; i<MAX_SPELL_EFFECTS; i++) if (procSpell->Effect[i] == SPELL_EFFECT_ENERGIZE) { - int32 mana = procSpell->EffectBasePoints[i]; + int32 mana = SpellMgr::CalculateSpellEffectAmount(procSpell, i); CastCustomSpell(this, 54986, 0, &mana, 0, true, castItem, triggeredByAura); break; } @@ -7435,8 +7436,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (GetTypeId() != TYPEID_PLAYER || !pVictim || !pVictim->isAlive() || !castItem || !castItem->IsEquipped()) return false; - // firehit = dummySpell->EffectBasePoints[0] / ((4*19.25) * 1.3); - float fire_onhit = dummySpell->EffectBasePoints[0] / 100.0f; + float fire_onhit = (float)(SpellMgr::CalculateSpellEffectAmount(dummySpell, 0) / 100.0); float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) + SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_FIRE, pVictim)); @@ -8177,7 +8177,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig break; case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) // Pct value stored in dummy - basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100; + basepoints0 = pVictim->GetCreateHealth() * SpellMgr::CalculateSpellEffectAmount(auraSpellInfo, 1) / 100; target = pVictim; break; case 57345: // Darkmoon Card: Greatness diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 41993275e57..7dd8ad17957 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1896,7 +1896,7 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const case 51689: if (target->getVictim() && (target->GetHealth() * 100 / target->GetMaxHealth() > target->getVictim()->GetHealth() * 100 / target->getVictim()->GetMaxHealth())) { if (!target->HasAura(58670)) { - int32 basepoints = GetSpellProto()->EffectBasePoints[0]; + int32 basepoints = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 0); target->CastCustomSpell(target, 58670, &basepoints, 0, 0, true); } } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 8738c749d4e..31e206a5839 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1477,7 +1477,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (unholyPresenceAura) { // Not listed as any effect, only base points set - int32 basePoints0 = unholyPresenceAura->GetSpellProto()->EffectBasePoints[1]; + int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(unholyPresenceAura->GetSpellProto(), 1) target->CastCustomSpell(target,63622,&basePoints0 ,&basePoints0,&basePoints0,true,0,unholyPresenceAura); target->CastCustomSpell(target,65095,&basePoints0 ,NULL,NULL,true,0,unholyPresenceAura); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9346681f7a5..ebd6b78c590 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -402,7 +402,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0])); if (!radius) return; float distance = m_caster->GetDistance2d(unitTarget); - damage = (distance > radius) ? 0 : int32(m_spellInfo->EffectBasePoints[0]*((radius - distance)/radius)); + damage = (distance > radius) ? 0 : int32(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0) * ((radius - distance)/radius)); break; } // TODO: add spell specific target requirement hook for spells @@ -444,7 +444,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) if (!radius) return; float distance = m_caster->GetDistance2d(unitTarget); - damage = (distance > radius) ? 0 : int32(m_spellInfo->EffectBasePoints[0]*distance); + damage = (distance > radius) ? 0 : int32(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0) * distance); break; } } @@ -698,7 +698,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) // TODO: should this be put on taken but not done? if (found) - damage += m_spellInfo->EffectBasePoints[1]; + damage += SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1); if (m_caster->GetTypeId() == TYPEID_PLAYER) { @@ -1556,7 +1556,7 @@ void Spell::EffectDummy(uint32 i) case 27222: case 57946: spFactor = 0.5f; break; } - int32 damage = int32(m_spellInfo->EffectBasePoints[0] + (6.3875 * m_spellInfo->baseLevel)); + int32 damage = int32(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0) + (6.3875 * m_spellInfo->baseLevel)); int32 mana = int32(damage + (m_caster->ToPlayer()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor)); if (unitTarget && (int32(unitTarget->GetHealth()) > damage)) @@ -6439,7 +6439,7 @@ void Spell::EffectPullTowards(uint32 i) if (!unitTarget) return; - float speedZ = (float)(m_spellInfo->EffectBasePoints[i]/10); + float speedZ = (float)(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, i) / 10); float speedXY = (float)(m_spellInfo->EffectMiscValue[i]/10); Position pos; if (m_spellInfo->Effect[i] == SPELL_EFFECT_PULL_TOWARDS_DEST) |