From 585949a9cf5339fa2a4abd644d98dfd91a506b00 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 26 Aug 2024 18:05:34 -0400 Subject: [PATCH] Core/Spells: Implemented SPELL_ATTR9_IGNORE_SCHOOL_LOCKOUT Port From (https://github.com/TrinityCore/TrinityCore/commit/0b8eed2d547acc0ba115198cb306c4f9127af807) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Spells/SpellHistory.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 6151edc20..a41642a83 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1984,7 +1984,7 @@ namespace Framework.Constants DoNotDisplayPowerCost = 0x8000, // Do Not Display Power Cost (client only) NextModalSpellRequiresSameUnitTarget = 0x10000, // Prevents automatically casting the spell from SpellClassOptions::ModalNextSpell after current spell if target was changed (client only) AutocastOffByDefault = 0x20000, // AutoCast Off By Default - Unk18 = 0x40000, // 18 + IgnoreSchoolLockout = 0x40000, // Ignore School Lockout Unk19 = 0x80000, // 19 Unk20 = 0x100000, // 20 Unk21 = 0x200000, // 21 diff --git a/Source/Game/Spells/SpellHistory.cs b/Source/Game/Spells/SpellHistory.cs index 354802683..918a6145e 100644 --- a/Source/Game/Spells/SpellHistory.cs +++ b/Source/Game/Spells/SpellHistory.cs @@ -211,7 +211,7 @@ namespace Game.Spells public bool IsReady(SpellInfo spellInfo, uint itemId = 0) { - if (spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence)) + if (!spellInfo.HasAttribute(SpellAttr9.IgnoreSchoolLockout) && spellInfo.PreventionType.HasFlag(SpellPreventionType.Silence)) if (IsSchoolLocked(spellInfo.GetSchoolMask())) return false; @@ -741,6 +741,9 @@ namespace Game.Spells if (!spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence)) continue; + if (spellInfo.HasAttribute(SpellAttr9.IgnoreSchoolLockout)) + continue; + if ((schoolMask & spellInfo.GetSchoolMask()) == 0) continue;