From f5ead031f4b0648a7dec0cce6c06466da7ae6a0f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 12 May 2020 20:22:53 -0400 Subject: [PATCH] Core/Spell: fix SpellAttr3.IgnoreHitResult bypassing reflects Port From (https://github.com/TrinityCore/TrinityCore/commit/fc0a037eef2a6a1dd1cc43f0233aaa1d400393be) --- Source/Game/Entities/Unit/Unit.Spells.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 6718e73cb..a1db1546e 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -749,18 +749,6 @@ namespace Game.Entities // Resist public SpellMissInfo SpellHitResult(Unit victim, SpellInfo spellInfo, bool canReflect = false) { - 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; - // 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() @@ -784,6 +772,18 @@ namespace Game.Entities return SpellMissInfo.Reflect; } + 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: