feat(Core/Spell): Implement ValidateSpellInfo (#4323)

* feat(Core/Spell): Implement ValidateSpellInfo

* cherry-pick from 2b5d7eef3a & a0a158b5b8

* sLog->outError

* cleanup

* convert to ValidateSpellInfo

* fix error log

* improve sLog->outError

* remove non related spells stuff from Validate

* remove the last

* build

* build x2
This commit is contained in:
Kitzunu
2021-02-01 18:57:25 +01:00
committed by GitHub
parent b68f469c73
commit 0d52b4ca4a
45 changed files with 544 additions and 841 deletions

View File

@@ -737,9 +737,7 @@ public:
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM))
return false;
return true;
return ValidateSpellInfo({ SPELL_SERVICE_UNIFORM });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)

View File

@@ -217,9 +217,7 @@ public:
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_CRAB_DISGUISE))
return false;
return true;
return ValidateSpellInfo({ SPELL_CRAB_DISGUISE });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)

View File

@@ -29,11 +29,12 @@ public:
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_MISTLETOE) ||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_HOLLY) ||
!sSpellMgr->GetSpellInfo(SPELL_CREATE_SNOWFLAKES))
return false;
return true;
return ValidateSpellInfo(
{
SPELL_CREATE_MISTLETOE,
SPELL_CREATE_HOLLY,
SPELL_CREATE_SNOWFLAKES
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
@@ -293,4 +294,4 @@ void AddSC_event_winter_veil_scripts()
new spell_winter_veil_racer_rocket_slam();
new spell_winter_veil_racer_slam_hit();
new spell_winter_veil_shoot_air_rifle();
}
}