Core/Entities: don't skip immunity checks for positive spells
Port From (https://github.com/TrinityCore/TrinityCore/commit/cfe69470a888082f21a639560f54e9c9ed2f3512)
This commit is contained in:
@@ -1981,6 +1981,15 @@ namespace Game.Entities
|
|||||||
// Resist
|
// Resist
|
||||||
public SpellMissInfo SpellHitResult(Unit victim, SpellInfo spellInfo, bool canReflect = false)
|
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
|
// 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!
|
/// @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
|
if (spellInfo.IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell
|
||||||
@@ -2006,15 +2015,6 @@ namespace Game.Entities
|
|||||||
if (spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
if (spellInfo.HasAttribute(SpellAttr3.IgnoreHitResult))
|
||||||
return SpellMissInfo.None;
|
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)
|
switch (spellInfo.DmgClass)
|
||||||
{
|
{
|
||||||
case SpellDmgClass.Ranged:
|
case SpellDmgClass.Ranged:
|
||||||
|
|||||||
Reference in New Issue
Block a user