aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-02-15 17:48:25 -0300
committerShauren <shauren.trinity@gmail.com>2021-06-21 12:47:03 +0200
commitd91e099b10a33d9205c023c81bcc966d713c39ab (patch)
treece5b4bac27bfdf4502dd4a454fc0b0c7427a021d
parentad1e8addf51cffcc1a1e9f06e7e6d00f591470df (diff)
Core/Spells: prevent creatures to focus channeled spells without SPELL_ATTR1_CHANNEL_TRACK_TARGET
- Creatures stuck here wouldn't try attacking because of this - Remove one workaround in halion script, now it's unneeded Ref #11311 (cherry picked from commit 29f7258dc824659cb2de81c5ff3b3b3853de2a8b)
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp4
-rw-r--r--src/server/game/Spells/Spell.cpp7
-rw-r--r--src/server/game/Spells/Spell.h1
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp7
4 files changed, 11 insertions, 8 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 1e8f3bd598a..3467bb93098 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -3171,6 +3171,10 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
if (m_focusSpell)
return;
+ // some spells shouldn't track targets
+ if (focusSpell->IsFocusDisabled())
+ return;
+
SpellInfo const* spellInfo = focusSpell->GetSpellInfo();
// don't use spell focus for vehicle spells
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a14c2e04e06..44bff9f6932 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3055,7 +3055,7 @@ void Spell::prepare(SpellCastTargets const& targets, AuraEffect const* triggered
// focus if not controlled creature
if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
{
- if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat() || (_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING)))
+ if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat()))
{
if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
@@ -7218,6 +7218,11 @@ bool Spell::IsIgnoringCooldowns() const
return (_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) != 0;
}
+bool Spell::IsFocusDisabled() const
+{
+ return ((_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING) || (m_spellInfo->IsChanneled() && !m_spellInfo->HasAttribute(SPELL_ATTR1_CHANNEL_TRACK_TARGET)));
+}
+
bool Spell::IsProcDisabled() const
{
return (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS) != 0;
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 82456b035b1..bf5e2ef84a7 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -660,6 +660,7 @@ class TC_GAME_API Spell
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
bool IsTriggered() const;
bool IsIgnoringCooldowns() const;
+ bool IsFocusDisabled() const;
bool IsProcDisabled() const;
bool IsChannelActive() const;
bool IsAutoActionResetSpell() const;
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index dc23c621fea..e6635bf0cd4 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -925,13 +925,6 @@ class npc_orb_carrier : public CreatureScript
me->CastSpell(nullptr, SPELL_TRACK_ROTATION, false);
scheduler.Update(diff);
-
- /// Workaround: This is here because even though the above spell has SPELL_ATTR1_CHANNEL_TRACK_TARGET,
- /// we are having two creatures involded here. This attribute is handled clientside, meaning the client
- /// sends orientation update itself. Here, no packet is sent, and the creature does not rotate. By
- /// forcing the carrier to always be facing the rotation focus, we ensure everything works as it should.
- if (Creature* rotationFocus = _instance->GetCreature(DATA_ORB_ROTATION_FOCUS))
- me->SetFacingToObject(rotationFocus); // setInFront
}
void DoAction(int32 action) override