From d5e2f1e6467d4dd86d2966af9493b8bd27b61c70 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 18 May 2020 22:57:14 -0400 Subject: [PATCH] Core/Movement: allow focused spells to not break movement if it's movement allowed spell Port From (https://github.com/TrinityCore/TrinityCore/commit/9ef39fa5d2f76459e3e529a0877655b0f69b98d6) --- Source/Game/Entities/Creature/Creature.cs | 2 +- Source/Game/Entities/Unit/Unit.Spells.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index df2ac9753..fd86e9d57 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2780,7 +2780,7 @@ namespace Game.Entities AddUnitState(UnitState.CannotTurn); } - public bool IsFocusing(Spell focusSpell = null, bool withDelay = false) + public override bool IsFocusing(Spell focusSpell = null, bool withDelay = false) { if (!IsAlive()) // dead creatures cannot focus { diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 7fb1cee44..b7302964f 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -30,7 +30,10 @@ namespace Game.Entities { public virtual bool HasSpell(uint spellId) { return false; } - + public virtual bool IsFocusing(Spell focusSpell = null, bool withDelay = false) + { + return false; + } // function uses real base points (typically value - 1) public int CalculateSpellDamage(Unit target, SpellInfo spellProto, uint effect_index, int? basePoints = null, uint castItemId = 0, int itemLevel = -1) @@ -1395,6 +1398,9 @@ namespace Game.Entities if (spell.GetSpellInfo().IsMoveAllowedChannel()) return false; + if (IsFocusing(null, true)) + return false; + // prohibit movement for all other spell casts return true; }