Core/Unit: Abide UNIT_FLAG2_DISABLE_TURN on creatures.
Port From (https://github.com/TrinityCore/TrinityCore/commit/ac8ff492744e65437fc906372058a0b29147af3f)
This commit is contained in:
@@ -519,14 +519,19 @@ namespace Game.Entities
|
||||
if (m_shouldReacquireTarget && !IsFocusing(null, true))
|
||||
{
|
||||
SetTarget(m_suppressedTarget);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
|
||||
if (!HasUnitFlag2(UnitFlags2.DisableTurn))
|
||||
{
|
||||
WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, m_suppressedTarget);
|
||||
if (objTarget)
|
||||
SetFacingToObject(objTarget);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
{
|
||||
WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, m_suppressedTarget);
|
||||
if (objTarget)
|
||||
SetFacingToObject(objTarget);
|
||||
}
|
||||
else
|
||||
SetFacingTo(m_suppressedOrientation);
|
||||
}
|
||||
else
|
||||
SetFacingTo(m_suppressedOrientation);
|
||||
|
||||
m_shouldReacquireTarget = false;
|
||||
}
|
||||
|
||||
@@ -2979,18 +2984,22 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
bool canTurnDuringCast = !focusSpell.GetSpellInfo().HasAttribute(SpellAttr5.DontTurnDuringCast);
|
||||
// Face the target - we need to do this before the unit state is modified for no-turn spells
|
||||
if (target)
|
||||
SetFacingToObject(target, false);
|
||||
else if (!canTurnDuringCast)
|
||||
bool noTurnDuringCast = spellInfo.HasAttribute(SpellAttr5.DontTurnDuringCast);
|
||||
|
||||
if (!HasUnitFlag2(UnitFlags2.DisableTurn))
|
||||
{
|
||||
Unit victim = GetVictim();
|
||||
if (victim)
|
||||
SetFacingToObject(victim, false); // ensure server-side orientation is correct at beginning of cast
|
||||
// Face the target - we need to do this before the unit state is modified for no-turn spells
|
||||
if (target)
|
||||
SetFacingToObject(target, false);
|
||||
else if (!noTurnDuringCast)
|
||||
{
|
||||
Unit victim = GetVictim();
|
||||
if (victim)
|
||||
SetFacingToObject(victim, false); // ensure server-side orientation is correct at beginning of cast
|
||||
}
|
||||
}
|
||||
|
||||
if (!canTurnDuringCast)
|
||||
if (!noTurnDuringCast)
|
||||
AddUnitState(UnitState.CannotTurn);
|
||||
}
|
||||
|
||||
@@ -3028,7 +3037,7 @@ namespace Game.Entities
|
||||
if (focusSpell && focusSpell != _focusSpell)
|
||||
return;
|
||||
|
||||
if (IsPet())// player pets do not use delay system
|
||||
if (IsPet() && !HasUnitFlag2(UnitFlags2.DisableTurn))// player pets do not use delay system
|
||||
{
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), m_suppressedTarget);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
|
||||
@@ -517,7 +517,7 @@ namespace Game.Entities
|
||||
if (attType != WeaponAttackType.BaseAttack && attType != WeaponAttackType.OffAttack)
|
||||
return;
|
||||
|
||||
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled))
|
||||
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled) && !HasUnitFlag2(UnitFlags2.DisableTurn))
|
||||
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
|
||||
|
||||
// melee attack spell casted at main hand attack only - no normal melee dmg dealt
|
||||
@@ -600,7 +600,7 @@ namespace Game.Entities
|
||||
if (attType != WeaponAttackType.BaseAttack && attType != WeaponAttackType.OffAttack)
|
||||
return; // ignore ranged case
|
||||
|
||||
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled))
|
||||
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled) && !HasUnitFlag2(UnitFlags2.DisableTurn))
|
||||
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
|
||||
|
||||
CalcDamageInfo damageInfo = new();
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `unit_flags2` = `unit_flags2`|0x8000 WHERE `entry` IN (32930,33909);
|
||||
Reference in New Issue
Block a user