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:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user