diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index af3fc70d7..c7678383c 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1981,6 +1981,15 @@ namespace Game.Entities // Resist public SpellMissInfo SpellHitResult(Unit victim, SpellInfo spellInfo, bool canReflect = false) { + // Check for immune + if (victim.IsImmunedToSpell(spellInfo, this)) + return SpellMissInfo.Immune; + + // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply + // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit + if (spellInfo.HasOnlyDamageEffects() && victim.IsImmunedToDamage(spellInfo)) + return SpellMissInfo.Immune; + // All positive spells can`t miss /// @todo client not show miss log for this spells - so need find info for this in dbc and use it! if (spellInfo.IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell @@ -2006,15 +2015,6 @@ namespace Game.Entities if (spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult)) return SpellMissInfo.None; - // Check for immune - if (victim.IsImmunedToSpell(spellInfo, this)) - return SpellMissInfo.Immune; - - // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply - // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit - if (spellInfo.HasOnlyDamageEffects() && victim.IsImmunedToDamage(spellInfo)) - return SpellMissInfo.Immune; - switch (spellInfo.DmgClass) { case SpellDmgClass.Ranged: