aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-07-07 12:13:14 +0200
committerShauren <shauren.trinity@gmail.com>2015-07-07 12:13:14 +0200
commitdea6c0b122c8f4b97cb7b3833b41d9bef5c0d911 (patch)
tree8ced5dfe3c85d1742b91b00325bbb0ffd2d9df7a /src/server/game/Spells/SpellInfo.cpp
parentd8338669d51fe114ce0698ddde44de113d95e76e (diff)
Core/DataStores: Updated dbc/db2 structures to 6.2.0
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 26b3ee17f12..f9f777f22f3 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -947,7 +947,8 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] =
{EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 244 SPELL_EFFECT_244
};
-SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap const& effectsMap) : _hasPowerDifficultyData(false)
+SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap const& effectsMap, SpellVisualMap&& visuals)
+ : _hasPowerDifficultyData(false)
{
Id = spellEntry->ID;
@@ -1006,13 +1007,11 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap const& ef
Speed = _misc ? _misc->Speed : 0;
SchoolMask = _misc ? _misc->SchoolMask : 0;
AttributesCu = 0;
-
- for (uint8 i = 0; i < 2; ++i)
- SpellVisual[i] = _misc ? _misc->SpellVisualID[i] : 0;
-
SpellIconID = _misc ? _misc->SpellIconID : 0;
ActiveIconID = _misc ? _misc->ActiveIconID : 0;
+ _visuals = std::move(visuals);
+
// SpellScalingEntry
SpellScalingEntry const* _scaling = GetSpellScaling();
Scaling.CastTimeMin = _scaling ? _scaling->CastTimeMin : 0;
@@ -2801,6 +2800,42 @@ bool SpellInfo::IsHighRankOf(SpellInfo const* spellInfo) const
return false;
}
+uint32 SpellInfo::GetSpellXSpellVisualId(Difficulty difficulty) const
+{
+ DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
+ while (difficultyEntry)
+ {
+ auto itr = _visuals.find(difficulty);
+ if (itr != _visuals.end())
+ for (SpellXSpellVisualEntry const* visual : itr->second)
+ if (!visual->PlayerConditionID)
+ return visual->ID;
+
+ difficultyEntry = sDifficultyStore.LookupEntry(difficultyEntry->FallbackDifficultyID);
+ }
+
+ auto itr = _visuals.find(DIFFICULTY_NONE);
+ if (itr != _visuals.end())
+ for (SpellXSpellVisualEntry const* visual : itr->second)
+ if (!visual->PlayerConditionID)
+ return visual->ID;
+
+ return 0;
+}
+
+uint32 SpellInfo::GetSpellVisual(Difficulty difficulty, Player* /*forPlayer*/ /*= nullptr*/) const
+{
+ if (SpellXSpellVisualEntry const* visual = sSpellXSpellVisualStore.LookupEntry(GetSpellXSpellVisualId(difficulty)))
+ {
+ //if (visual->SpellVisualID[1] && forPlayer->GetViolenceLevel() operator 2)
+ // return visual->SpellVisualID[1];
+
+ return visual->SpellVisualID[0];
+ }
+
+ return 0;
+}
+
void SpellInfo::_InitializeExplicitTargetMask()
{
bool srcSet = false;