aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/DataStores/DBCStores.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp2
-rw-r--r--src/server/game/Spells/Spell.cpp12
-rw-r--r--src/server/game/Spells/Spell.h2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp29
6 files changed, 36 insertions, 13 deletions
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 633376d85aa..6047c3d37ef 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -207,6 +207,7 @@ extern DBCStorage <SkillLineEntry> sSkillLineStore;
extern DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore;
extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore;
+extern SpellEffectScallingByEffectId sSpellEffectScallingByEffectId;
extern DBCStorage <SpecializationSpellsEntry> sSpecializationSpellsStore;
extern SpecializationSpellsBySpecStore sSpecializationSpellsBySpecStore;
extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
@@ -222,6 +223,7 @@ extern DBCStorage <SpellRangeEntry> sSpellRangeStore;
extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
extern DBCStorage <SpellEntry> sSpellStore;
+extern DBCStorage <SpellEffectScalingEntry> sSpellEffectScalingStore;
extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore;
extern DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b6286eac5bb..e9d977f53b9 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25627,7 +25627,7 @@ void Player::LearnTalentSpecialization(uint32 talentSpec)
RemoveSpell(talent->SpellID, false);
itr = talents->erase(itr);
- TC_LOG_DEBUG("spells", "Player %s unlearning talent id: %u tier: %u because of specialization change", GetName().c_str(), talent->ID, talent->TierID);
+ TC_LOG_DEBUG("spells", "Player %s unlearning talent id: %u tier: %u due to specialization change", GetName().c_str(), talent->ID, talent->TierID);
}
}
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 015ce3224a3..0636c74f589 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -386,7 +386,7 @@ void Aura::_InitEffects(uint32 effMask, Unit* caster, int32 *baseAmount)
ASSERT(!_spelEffectInfos.empty());
- _effects.resize(MAX_SPELL_EFFECTS);
+ _effects.resize(GetSpellEffectInfos().size());
for (SpellEffectInfo const* effect : GetSpellEffectInfos())
{
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());
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 33e4923d2f1..7e59126c028 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -201,7 +201,7 @@ class SpellCastTargets
struct SpellValue
{
- explicit SpellValue(SpellInfo const* proto);
+ explicit SpellValue(Difficulty diff, SpellInfo const* proto);
int32 EffectBasePoints[MAX_SPELL_EFFECTS];
uint32 MaxAffectedTargets;
float RadiusMod;
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index b97c169ec7b..e711e0b910f 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -368,10 +368,13 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con
TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0;
SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128();
ImplicitTargetConditions = NULL;
- // TODO: 6.x these values are no longer in dbc
- ScalingMultiplier = /*scaling ? scaling->Multiplier[EffectIndex] :*/ 0.0f;
- DeltaScalingMultiplier = /*scaling ? scaling->RandomMultiplier[EffectIndex] :*/ 0.0f;
- ComboScalingMultiplier = /*scaling ? scaling->OtherMultiplier[EffectIndex] :*/ 0.0f;
+
+ uint32 _effectScalingId = _effect ? sSpellEffectScallingByEffectId.find(_effect->ID) != sSpellEffectScallingByEffectId.end() ? sSpellEffectScallingByEffectId[_effect->ID] : 0 : 0;
+ SpellEffectScalingEntry const* _effectScalingEntry = sSpellEffectScalingStore.LookupEntry(_effectScalingId);
+
+ ScalingMultiplier = _effectScalingEntry ? _effectScalingEntry->Coefficient : 0.0f;
+ DeltaScalingMultiplier = _effectScalingEntry ? _effectScalingEntry->Variance : 0.0f;
+ ComboScalingMultiplier = _effectScalingEntry ? _effectScalingEntry->ResourceCoefficient : 0.0f;
}
bool SpellEffectInfo::IsEffect() const
@@ -856,14 +859,26 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap effects)
// SpellDifficultyEntry
for (SpellEffectEntryMap::const_iterator itr = effects.begin(); itr != effects.end(); ++itr)
{
- _effects[itr->first].resize(MAX_SPELL_EFFECTS);
+ SpellEffectEntryVector effects = itr->second;
+ _effects[itr->first].resize(effects.size());
+
+ for (uint32 i = effects.size(); i > 0; --i)
+ {
+ SpellEffectEntry const* effect = effects[i - 1];
+ if (!effect)
+ continue;
+
+ _effects[itr->first][effect->EffectIndex] = new SpellEffectInfo(spellEntry, this, effect->EffectIndex, effect);
+ }
+
+ /*_effects[itr->first].resize(MAX_SPELL_EFFECTS);
for (SpellEffectEntryVector::const_iterator i = itr->second.begin(); i != itr->second.end(); ++i)
{
if (!(*i))
continue;
_effects[itr->first][(*i)->EffectIndex] = new SpellEffectInfo(spellEntry, this, (*i)->EffectIndex, (*i));
- }
+ }*/
}
SpellName = spellEntry->Name_lang;
@@ -3064,6 +3079,8 @@ void SpellInfo::_UnloadImplicitTargetConditionLists()
SpellEffectInfoVector SpellInfo::GetEffectsForDifficulty(uint32 difficulty) const
{
+ // 6.x todo: add first highest difficulty effect, resize list to max element, add lower diff effects without overwriting any higher diffed ones
+
SpellEffectInfoVector effList;
// DIFFICULTY_NONE effects are the default effects, always active if current difficulty's effects don't overwrite