Core/Movement: allow focused spells to not break movement if it's movement allowed spell

Port From (https://github.com/TrinityCore/TrinityCore/commit/9ef39fa5d2f76459e3e529a0877655b0f69b98d6)
This commit is contained in:
hondacrx
2020-05-18 22:57:14 -04:00
parent 33097d3e2d
commit d5e2f1e646
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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
{
+7 -1
View File
@@ -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;
}