mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Update to work with latest AzerothCore master
This commit is contained in:
@@ -307,7 +307,7 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
|
||||
me->SetLootRecipient(nullptr);
|
||||
me->ResetPlayerDamageReq();
|
||||
me->SetLastDamagedTime(0);
|
||||
me->SetCannotReachTarget();
|
||||
me->SetCannotReachTarget(true);
|
||||
|
||||
if (ZoneScript* zoneScript = me->GetZoneScript() ? me->GetZoneScript() : (ZoneScript*)me->GetInstanceScript())
|
||||
zoneScript->OnCreatureEvade(me);
|
||||
|
||||
@@ -3494,6 +3494,11 @@ bool Creature::IsMovementPreventedByCasting() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Creature::SetCannotReachTarget()
|
||||
{
|
||||
return SetCannotReachTarget(true);
|
||||
}
|
||||
|
||||
bool Creature::SetCannotReachTarget(bool cannotReach, bool isChase /*= true*/)
|
||||
{
|
||||
if (!isChase || !Unit::SetCannotReachTarget(cannotReach))
|
||||
@@ -3511,21 +3516,6 @@ bool Creature::SetCannotReachTarget(bool cannotReach, bool isChase /*= true*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Creature::CanNotReachTarget() const
|
||||
{
|
||||
return m_cannotReachTarget;
|
||||
}
|
||||
|
||||
bool Creature::IsNotReachableAndNeedRegen() const
|
||||
{
|
||||
if (CanNotReachTarget())
|
||||
{
|
||||
return m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID) * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
time_t Creature::GetLastDamagedTime() const
|
||||
{
|
||||
if (!_lastDamagedTime)
|
||||
|
||||
@@ -310,6 +310,7 @@ public:
|
||||
return m_charmInfo->GetCharmSpell(pos)->GetAction();
|
||||
}
|
||||
|
||||
bool SetCannotReachTarget();
|
||||
bool SetCannotReachTarget(bool cannotReach, bool isChase = true) override;
|
||||
[[nodiscard]] bool IsNotReachable() const { return (m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_EVADE_IF_NOT_REACHABLE) * IN_MILLISECONDS)) && m_cannotReachTarget; }
|
||||
[[nodiscard]] bool IsNotReachableAndNeedRegen() const { return (m_cannotReachTimer >= (sWorld->getIntConfig(CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID) * IN_MILLISECONDS)) && m_cannotReachTarget; }
|
||||
|
||||
Reference in New Issue
Block a user