Scripts/Spells: Added spell effect validation helper

This commit is contained in:
Shauren
2023-05-30 19:34:19 +02:00
parent 3ca9e1253a
commit f8a6a9b017
23 changed files with 110 additions and 65 deletions
+7 -5
View File
@@ -774,7 +774,8 @@ class spell_gen_burning_depths_necrolyte_image : public AuraScript
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_2 && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_2).CalcValue()) });
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } })
&& ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_2).CalcValue()) });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -2019,7 +2020,7 @@ class spell_gen_gift_of_naaru : public AuraScript
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_1;
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
@@ -2637,7 +2638,7 @@ class spell_gen_oracle_wolvar_reputation : public SpellScript
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_1;
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
bool Load() override
@@ -3088,7 +3089,7 @@ class spell_gen_remove_on_health_pct : public AuraScript
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_1;
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
void PeriodicTick(AuraEffect const* /*aurEff*/)
@@ -4857,7 +4858,8 @@ class spell_gen_face_rage : public AuraScript
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ SPELL_FACE_RAGE }) && spellInfo->GetEffects().size() > EFFECT_2;
return ValidateSpellInfo({ SPELL_FACE_RAGE })
&& ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } });
}
void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)