Skip to content

Commit 57c09af

Browse files
committed
Fix creatures being immune to spells that bypass immunities.
1 parent 07c43c5 commit 57c09af

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

src/game/Objects/Creature.cpp

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ void Creature::ForcedDespawn(uint32 msTimeToDespawn /*= 0*/, uint32 secsTimeToRe
23652365

23662366
bool Creature::IsImmuneToSpell(SpellEntry const* spellInfo, bool castOnSelf) const
23672367
{
2368-
if (!spellInfo)
2368+
if (!spellInfo || spellInfo->HasAttribute(SPELL_ATTR_NO_IMMUNITIES) || spellInfo->IsIgnoringCasterAndTargetRestrictions())
23692369
return false;
23702370

23712371
if (!castOnSelf)
@@ -2377,28 +2377,14 @@ bool Creature::IsImmuneToSpell(SpellEntry const* spellInfo, bool castOnSelf) con
23772377
return true;
23782378
}
23792379

2380-
// HACK!
2381-
if (IsWorldBoss())
2382-
{
2383-
if (spellInfo->IsFitToFamily<SPELLFAMILY_HUNTER, CF_HUNTER_SCORPID_STING>())
2384-
return true;
2385-
2386-
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4
2387-
switch (spellInfo->Id)
2388-
{
2389-
case 67: // Vindication
2390-
case 26017:
2391-
case 26018:
2392-
return true;
2393-
}
2394-
#endif
2395-
}
2396-
23972380
return Unit::IsImmuneToSpell(spellInfo, castOnSelf);
23982381
}
23992382

24002383
bool Creature::IsImmuneToDamage(SpellSchoolMask meleeSchoolMask, SpellEntry const* spellInfo) const
24012384
{
2385+
if (spellInfo && (spellInfo->HasAttribute(SPELL_ATTR_NO_IMMUNITIES) || spellInfo->IsIgnoringCasterAndTargetRestrictions()))
2386+
return false;
2387+
24022388
if (GetCreatureInfo()->school_immune_mask & meleeSchoolMask)
24032389
return true;
24042390

@@ -2407,6 +2393,9 @@ bool Creature::IsImmuneToDamage(SpellSchoolMask meleeSchoolMask, SpellEntry cons
24072393

24082394
bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index, bool castOnSelf) const
24092395
{
2396+
if (spellInfo->IsIgnoringCasterAndTargetRestrictions())
2397+
return false;
2398+
24102399
if (!castOnSelf && spellInfo->EffectMechanic[index] && GetCreatureInfo()->mechanic_immune_mask & (1 << (spellInfo->EffectMechanic[index] - 1)))
24112400
return true;
24122401

0 commit comments

Comments
 (0)