From 4a36897873aee165f4225599c1804b8f8b07c781 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 1 Jan 2022 06:28:21 +0100 Subject: [PATCH] fix(Core/Spells): Dungeon and world bosses are always subject to spell school lockouts. (#9638) Fixes #9633 --- src/server/game/Entities/Creature/Creature.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 918e889b5..841f42d5a 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2580,20 +2580,26 @@ void Creature::SetInCombatWithZone() void Creature::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) { for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) + { if (idSchoolMask & (1 << i)) + { m_ProhibitSchoolTime[i] = World::GetGameTimeMS() + unTimeMs; + } + } } bool Creature::IsSpellProhibited(SpellSchoolMask idSchoolMask) const { - const CreatureTemplate* cinfo = GetCreatureTemplate(); - if (!(cinfo && cinfo->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) && (isWorldBoss() || IsDungeonBoss())) - return false; - for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) + { if (idSchoolMask & (1 << i)) + { if (m_ProhibitSchoolTime[i] >= World::GetGameTimeMS()) + { return true; + } + } + } return false; }