aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-27 22:08:39 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-13 00:42:18 +0100
commit575f42089e2014c3df64f0468ed25c45a544f6d8 (patch)
tree089bc769b640db03a0ddaedb698c8182a6176392 /src
parent9d40a105e61376dd5f377f5d1e8131f6669ffdca (diff)
Core/Spell: fix some issues with taunt spells (#23425)
(cherry picked from commit 5dc2dfd60c4ecd243729e86496d926976e383156)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Spell.cpp4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp13
2 files changed, 16 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 8486580a215..3bc60f66b3c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2372,6 +2372,10 @@ void Spell::TargetInfo::PreprocessTarget(Spell* spell)
else if (MissCondition == SPELL_MISS_REFLECT && ReflectResult == SPELL_MISS_NONE)
_spellHitTarget = spell->m_caster->ToUnit();
+ // Ensure that a player target is put in combat by a taunt, even if they result immune clientside
+ if ((MissCondition == SPELL_MISS_IMMUNE || MissCondition == SPELL_MISS_IMMUNE2) && spell->m_caster->GetTypeId() == TYPEID_PLAYER && unit->GetTypeId() == TYPEID_PLAYER && spell->m_caster->IsValidAttackTarget(unit, spell->GetSpellInfo()))
+ unit->SetInCombatWith(spell->m_caster->ToPlayer());
+
_enablePVP = false; // need to check PvP state before spell effects, but act on it afterwards
if (_spellHitTarget)
{
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index dd04159818f..91b9bbc6183 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2803,7 +2803,18 @@ void Spell::EffectTaunt()
// 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 || !unitTarget->CanHaveThreatList())
+ if (!unitTarget || unitTarget->IsTotem())
+ {
+ SendCastResult(SPELL_FAILED_DONT_REPORT);
+ 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->GetTypeId() != TYPEID_PLAYER && unitTarget->GetTarget() != unitCaster->GetGUID())
+ unitCaster->CastSpell(unitTarget, 67485, true);
+
+ if (!unitTarget->CanHaveThreatList())
{
SendCastResult(SPELL_FAILED_DONT_REPORT);
return;