mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Unit: Abide UNIT_FLAG2_DISABLE_TURN on creatures. Add that flag to Kologarn (from sniff). Hi sirikfoll.
(cherry picked from commit d9c772303c)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `unit_flags2` = `unit_flags2`|0x8000 WHERE `entry` IN (32930,33909);
|
||||
@@ -778,13 +778,17 @@ void Creature::Update(uint32 diff)
|
||||
if (m_shouldReacquireTarget && !IsFocusing(nullptr, true))
|
||||
{
|
||||
SetTarget(m_suppressedTarget);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
|
||||
if (!HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
|
||||
{
|
||||
if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
|
||||
SetFacingToObject(objTarget, false);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
{
|
||||
if (WorldObject const* objTarget = ObjectAccessor::GetWorldObject(*this, m_suppressedTarget))
|
||||
SetFacingToObject(objTarget, false);
|
||||
}
|
||||
else
|
||||
SetFacingTo(m_suppressedOrientation, false);
|
||||
}
|
||||
else
|
||||
SetFacingTo(m_suppressedOrientation, false);
|
||||
m_shouldReacquireTarget = false;
|
||||
}
|
||||
|
||||
@@ -3277,15 +3281,19 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
|
||||
}
|
||||
}
|
||||
|
||||
bool const canTurnDuringCast = !spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_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 (!canTurnDuringCast)
|
||||
if (Unit* victim = GetVictim())
|
||||
SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast
|
||||
bool const noTurnDuringCast = spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST);
|
||||
|
||||
if (!canTurnDuringCast)
|
||||
if (!HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
|
||||
{
|
||||
// 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)
|
||||
if (Unit* victim = GetVictim())
|
||||
SetFacingToObject(victim, false); // ensure orientation is correct at beginning of cast
|
||||
}
|
||||
|
||||
if (noTurnDuringCast)
|
||||
AddUnitState(UNIT_STATE_CANNOT_TURN);
|
||||
}
|
||||
|
||||
@@ -3323,7 +3331,7 @@ void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
|
||||
if (focusSpell && focusSpell != m_focusSpell)
|
||||
return;
|
||||
|
||||
if (IsPet()) // player pets do not use delay system
|
||||
if (IsPet() && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN)) // player pets do not use delay system
|
||||
{
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Target), m_suppressedTarget);
|
||||
if (!m_suppressedTarget.IsEmpty())
|
||||
|
||||
@@ -2021,7 +2021,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
||||
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
return; // ignore ranged case
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
|
||||
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
|
||||
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
|
||||
|
||||
// melee attack spell cast at main hand attack only - no normal melee dmg dealt
|
||||
@@ -2105,7 +2105,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA
|
||||
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
return; // ignore ranged case
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
|
||||
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED) && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
|
||||
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
|
||||
|
||||
CalcDamageInfo damageInfo;
|
||||
|
||||
Reference in New Issue
Block a user