Scripts/Spells: Added spell effect validation helper

Port From (https://github.com/TrinityCore/TrinityCore/commit/f8a6a9b01713a5dbe5ed38bd3d1b1c72191cf288)
This commit is contained in:
hondacrx
2023-06-13 03:59:41 -04:00
parent 71a878c2cf
commit b7146a011e
14 changed files with 73 additions and 51 deletions
+3 -6
View File
@@ -191,7 +191,7 @@ namespace Scripts.Spells.Warrior
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.ColossusSmashAura, SpellIds.InForTheKill, SpellIds.InForTheKillHaste)
&& Global.SpellMgr.GetSpellInfo(SpellIds.InForTheKill, Difficulty.None).GetEffects().Count > 2;
&& ValidateSpellEffect(SpellIds.InForTheKill, 2);
}
void HandleHit()
@@ -412,7 +412,7 @@ namespace Scripts.Spells.Warrior
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.Stoicism) && spellInfo.GetEffects().Count > 1;
return ValidateSpellInfo(SpellIds.Stoicism) && ValidateSpellEffect(spellInfo.Id, 1);
}
void HandleProc(ProcEventInfo eventInfo)
@@ -523,10 +523,7 @@ namespace Scripts.Spells.Warrior
{
public override bool Validate(SpellInfo spellInfo)
{
if (!ValidateSpellInfo(SpellIds.Shockwave, SpellIds.ShockwaveStun))
return false;
return spellInfo.GetEffects().Count > 3;
return !ValidateSpellInfo(SpellIds.Shockwave, SpellIds.ShockwaveStun) && ValidateSpellEffect(spellInfo.Id, 3);
}
public override bool Load()