fix(Core/Spells): Dungeon and world bosses are always subject to spell school lockouts. (#9638)

Fixes #9633
This commit is contained in:
UltraNix
2022-01-01 06:28:21 +01:00
committed by GitHub
parent 913e65f97f
commit 4a36897873

View File

@@ -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;
}