mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -704,7 +704,7 @@ void Creature::Update(uint32 diff)
|
||||
}
|
||||
|
||||
// periodic check to see if the creature has passed an evade boundary
|
||||
if (IsAIEnabled && !IsInEvadeMode() && IsInCombat())
|
||||
if (IsAIEnabled && !IsInEvadeMode() && IsEngaged())
|
||||
{
|
||||
if (diff >= m_boundaryCheckTime)
|
||||
{
|
||||
@@ -1810,6 +1810,21 @@ bool Creature::CanAlwaysSee(WorldObject const* obj) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Creature::IsAlwaysDetectableFor(WorldObject const* seer) const
|
||||
{
|
||||
if (Unit::IsAlwaysDetectableFor(seer))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsAIEnabled && AI()->CanAlwaysBeDetectable(seer))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Creature::CanStartAttack(Unit const* who) const
|
||||
{
|
||||
if (IsCivilian())
|
||||
@@ -1839,7 +1854,7 @@ bool Creature::CanStartAttack(Unit const* who) const
|
||||
// pussywizard: at this point we are either hostile to who or friendly to who->getAttackerForHelper()
|
||||
// pussywizard: if who is in combat and has an attacker, help him if the distance is right (help because who is hostile or help because attacker is friendly)
|
||||
bool assist = false;
|
||||
if (who->IsInCombat() && IsWithinDist(who, ATTACK_DISTANCE))
|
||||
if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE))
|
||||
if (Unit* victim = who->getAttackerForHelper())
|
||||
if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
|
||||
assist = true;
|
||||
@@ -2358,7 +2373,7 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /
|
||||
return false;
|
||||
|
||||
// skip fighting creature
|
||||
if (IsInCombat())
|
||||
if (IsEngaged())
|
||||
return false;
|
||||
|
||||
// only free creature
|
||||
@@ -2409,11 +2424,10 @@ bool Creature::_IsTargetAcceptable(Unit const* target) const
|
||||
return false;
|
||||
}
|
||||
|
||||
Unit const* myVictim = getAttackerForHelper();
|
||||
Unit const* targetVictim = target->getAttackerForHelper();
|
||||
|
||||
// if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
|
||||
if (myVictim == target || targetVictim == this || IsHostileTo(target))
|
||||
if (IsEngagedBy(target) || IsHostileTo(target))
|
||||
return true;
|
||||
|
||||
// if the target's victim is friendly, and the target is neutral, the target is acceptable
|
||||
|
||||
@@ -443,6 +443,7 @@ protected:
|
||||
|
||||
[[nodiscard]] bool IsInvisibleDueToDespawn() const override;
|
||||
bool CanAlwaysSee(WorldObject const* obj) const override;
|
||||
bool IsAlwaysDetectableFor(WorldObject const* seer) const override;
|
||||
|
||||
private:
|
||||
void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds forcedRespawnTimer = 0s);
|
||||
|
||||
@@ -190,7 +190,7 @@ void CreatureGroup::RemoveMember(Creature* member)
|
||||
member->SetFormation(nullptr);
|
||||
}
|
||||
|
||||
void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
|
||||
void CreatureGroup::MemberEngagingTarget(Creature* member, Unit* target)
|
||||
{
|
||||
uint8 const groupAI = sFormationMgr->CreatureGroupMap[member->GetSpawnId()].groupAI;
|
||||
if (member == m_leader)
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
void FormationReset(bool dismiss, bool initMotionMaster);
|
||||
|
||||
void LeaderMoveTo(float x, float y, float z, bool run);
|
||||
void MemberAttackStart(Creature* member, Unit* target);
|
||||
void MemberEngagingTarget(Creature* member, Unit* target);
|
||||
void MemberEvaded(Creature* member);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user