diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-12 01:29:18 +0200 |
commit | c7306439e7004288fb85890d6a5f730cf1761d71 (patch) | |
tree | a1b6fd4af385923f321ff24ef4d66d09374397b9 /src/server/game/Spells/SpellScript.cpp | |
parent | 1cdd1d0249ad49c860e117e1e39d451e1a3fbe43 (diff) |
Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index e2a54597b2e..10722473019 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -39,7 +39,7 @@ bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end) bool allValid = true; while (begin != end) { - if (!sSpellMgr->GetSpellInfo(*begin)) + if (!sSpellMgr->GetSpellInfo(*begin, DIFFICULTY_NONE)) { TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", *begin); allValid = false; @@ -685,6 +685,11 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result) m_spell->m_customError = result; } +Difficulty SpellScript::GetCastDifficulty() const +{ + return m_spell->GetCastDifficulty(); +} + SpellValue const* SpellScript::GetSpellValue() const { return m_spell->m_spellValue; @@ -692,7 +697,7 @@ SpellValue const* SpellScript::GetSpellValue() const SpellEffectInfo const* SpellScript::GetEffectInfo(SpellEffIndex effIndex) const { - return m_spell->GetEffect(effIndex); + return GetSpellInfo()->GetEffect(effIndex); } bool AuraScript::_Validate(SpellInfo const* entry) @@ -1230,3 +1235,8 @@ AuraApplication const* AuraScript::GetTargetApplication() const { return m_auraApplication; } + +Difficulty AuraScript::GetCastDifficulty() const +{ + return GetAura()->GetCastDifficulty(); +} |