From 89661001d5b08afee0f39431a3989307bcc5464b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 24 Dec 2021 21:18:27 -0500 Subject: [PATCH] Core/Spell: fix some issues with taunt spells Port From (https://github.com/TrinityCore/TrinityCore/commit/575f42089e2014c3df64f0468ed25c45a544f6d8) --- Source/Game/Spells/Spell.cs | 4 ++++ Source/Game/Spells/SpellEffects.cs | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 7a817f923..feb9d3baa 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -7790,6 +7790,10 @@ namespace Game.Spells else if (MissCondition == SpellMissInfo.Reflect && ReflectResult == SpellMissInfo.None) _spellHitTarget = spell.GetCaster().ToUnit(); + // Ensure that a player target is put in combat by a taunt, even if they result immune clientside + if ((MissCondition == SpellMissInfo.Immune || MissCondition == SpellMissInfo.Immune2) && spell.GetCaster().IsPlayer() && unit.IsPlayer() && spell.GetCaster().IsValidAttackTarget(unit, spell.GetSpellInfo())) + unit.SetInCombatWith(spell.GetCaster().ToPlayer()); + _enablePVP = false; // need to check PvP state before spell effects, but act on it afterwards if (_spellHitTarget) { diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 122b07bb0..227dfab86 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -2473,7 +2473,18 @@ namespace Game.Spells // this effect use before aura Taunt apply for prevent taunt already attacking target // for spell as marked "non effective at already attacking target" - if (unitTarget == null || !unitTarget.CanHaveThreatList()) + if (!unitTarget || unitTarget.IsTotem()) + { + SendCastResult(SpellCastResult.DontReport); + return; + } + + // Hand of Reckoning can hit some entities that can't have a threat list (including players' pets) + if (m_spellInfo.Id == 62124) + if (!unitTarget.IsPlayer() && unitTarget.GetTarget() != unitCaster.GetGUID()) + unitCaster.CastSpell(unitTarget, 67485, true); + + if (!unitTarget.CanHaveThreatList()) { SendCastResult(SpellCastResult.DontReport); return; @@ -2967,7 +2978,6 @@ namespace Game.Spells } return; } - break; } break; }