diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 430831b7e..ece9b9a3b 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1411,6 +1411,7 @@ namespace Framework.Constants DemonHunter = 107 } + [Flags] public enum TriggerCastFlags : uint { None = 0x0, //! Not Triggered diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 73665301f..eacb66666 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2882,6 +2882,10 @@ namespace Game.Entities if (_focusSpell != null) return; + // some spells shouldn't track targets + if (focusSpell.IsFocusDisabled()) + return; + SpellInfo spellInfo = focusSpell.GetSpellInfo(); // don't use spell focus for vehicle spells diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 1aabb041c..a8b2e15b3 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2543,7 +2543,7 @@ namespace Game.Spells // focus if not controlled creature if (m_caster.GetTypeId() == TypeId.Unit && !m_caster.HasUnitFlag(UnitFlags.PlayerControlled)) { - if (!(m_spellInfo.IsNextMeleeSwingSpell() || IsAutoRepeat() || _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.IgnoreSetFacing))) + if (!(m_spellInfo.IsNextMeleeSwingSpell() || IsAutoRepeat())) { if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget()) m_caster.ToCreature().FocusTarget(this, m_targets.GetObjectTarget()); @@ -7398,6 +7398,7 @@ namespace Game.Spells public bool IsTriggered() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.FullMask); } public bool IsTriggeredByAura(SpellInfo auraSpellInfo) { return (auraSpellInfo == m_triggeredByAuraSpell); } public bool IsIgnoringCooldowns() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.IgnoreSpellAndCategoryCD); } + public bool IsFocusDisabled() { return _triggeredCastFlags.HasFlag(TriggerCastFlags.IgnoreSetFacing) || (m_spellInfo.IsChanneled() && !m_spellInfo.HasAttribute(SpellAttr1.ChannelTrackTarget)); } public bool IsProcDisabled() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DisallowProcEvents); } public bool IsChannelActive() { return m_caster.GetChannelSpellId() != 0; }