diff options
| author | Rat <gmstreetrat@gmail.com> | 2014-12-07 10:11:47 +0100 |
|---|---|---|
| committer | Rat <gmstreetrat@gmail.com> | 2014-12-07 10:11:47 +0100 |
| commit | 30e2e04c01b7376d23070f1c9b76d443ece42413 (patch) | |
| tree | 9d8f2a929c4e79164c681c79b9f6ca4fc5440c15 /src/server/game/Spells/Spell.cpp | |
| parent | 4b8493d4b2e492cd4a0cda9719cdad187ec0673b (diff) | |
Core/Spells: some work on effects scaling
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 304852b3176..7ceaa38d4bc 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -562,11 +562,15 @@ void SpellCastTargets::OutDebug() const TC_LOG_INFO("spells", "elevation: %f", m_elevation); } -SpellValue::SpellValue(SpellInfo const* proto) +SpellValue::SpellValue(Difficulty diff, SpellInfo const* proto) { // todo 6.x - //for (uint32 i = 0; i < proto->Effects.size(); ++i) - // EffectBasePoints[i] = proto->Effects[i].BasePoints; + SpellEffectInfoVector effects = proto->GetEffectsForDifficulty(diff); + ASSERT(effects.size() <= MAX_SPELL_EFFECTS); + for (SpellEffectInfo const* effect : effects) + if (effect) + EffectBasePoints[effect->EffectIndex] = effect->BasePoints; + MaxAffectedTargets = proto->MaxAffectedTargets; RadiusMod = 1.0f; AuraStackAmount = 1; @@ -574,7 +578,7 @@ SpellValue::SpellValue(SpellInfo const* proto) Spell::Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID, bool skipCheck) : m_spellInfo(info), m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharmerOrOwner()) ? caster->GetCharmerOrOwner() : caster), -m_spellValue(new SpellValue(m_spellInfo)), m_preGeneratedPath(PathGenerator(m_caster)) +m_spellValue(new SpellValue(caster->GetMap()->GetDifficulty(), m_spellInfo)), m_preGeneratedPath(PathGenerator(m_caster)) { _effects = info->GetEffectsForDifficulty(caster->GetMap()->GetDifficulty()); |
