Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower

This commit is contained in:
Shauren
2020-06-12 01:29:18 +02:00
parent 1cdd1d0249
commit c7306439e7
101 changed files with 1631 additions and 1796 deletions

View File

@@ -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();
}