Core/Units: Allow autoattack if channelling with SPELL_ATTR5_ALLOW_ACTIONS_DURING_CHANNEL
Port From (https://github.com/TrinityCore/TrinityCore/commit/bbe7cba7f411977d756f6f697056aafb920a5b0a)
This commit is contained in:
@@ -500,7 +500,7 @@ namespace Framework.Constants
|
|||||||
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove | FollowFormationMove,
|
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove | FollowFormationMove,
|
||||||
Controlled = Confused | Stunned | Fleeing,
|
Controlled = Confused | Stunned | Fleeing,
|
||||||
LostControl = Controlled | Possessed | Jumping | Charging,
|
LostControl = Controlled | Possessed | Jumping | Charging,
|
||||||
CannotAutoattack = Controlled | Charging | Casting,
|
CannotAutoattack = Controlled | Charging,
|
||||||
Sightless = LostControl | Evade,
|
Sightless = LostControl | Evade,
|
||||||
CannotTurn = LostControl | Rotating | Focusing,
|
CannotTurn = LostControl | Rotating | Focusing,
|
||||||
NotMove = Root | Stunned | Died | Distracted,
|
NotMove = Root | Stunned | Died | Distracted,
|
||||||
|
|||||||
@@ -54,9 +54,16 @@ namespace Game.AI
|
|||||||
|
|
||||||
public void DoMeleeAttackIfReady()
|
public void DoMeleeAttackIfReady()
|
||||||
{
|
{
|
||||||
if (me.HasUnitState(UnitState.Casting) || (me.IsCreature() && !me.ToCreature().CanMelee()))
|
if (me.IsCreature() && !me.ToCreature().CanMelee())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (me.HasUnitState(UnitState.Casting))
|
||||||
|
{
|
||||||
|
Spell channeledSpell = me.GetCurrentSpell(CurrentSpellTypes.Channeled);
|
||||||
|
if (channeledSpell == null || !channeledSpell.GetSpellInfo().HasAttribute(SpellAttr5.AllowActionsDuringChannel))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Unit victim = me.GetVictim();
|
Unit victim = me.GetVictim();
|
||||||
|
|
||||||
if (!me.IsWithinMeleeRange(victim))
|
if (!me.IsWithinMeleeRange(victim))
|
||||||
|
|||||||
@@ -506,6 +506,13 @@ namespace Game.Entities
|
|||||||
if (HasUnitState(UnitState.CannotAutoattack) && !extra)
|
if (HasUnitState(UnitState.CannotAutoattack) && !extra)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (HasUnitState(UnitState.Casting))
|
||||||
|
{
|
||||||
|
Spell channeledSpell = GetCurrentSpell(CurrentSpellTypes.Channeled);
|
||||||
|
if (channeledSpell == null || !channeledSpell.GetSpellInfo().HasAttribute(SpellAttr5.AllowActionsDuringChannel))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (HasAuraType(AuraType.DisableAttackingExceptAbilities))
|
if (HasAuraType(AuraType.DisableAttackingExceptAbilities))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user