mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat(Core): CreatureUnitRelocationWorker reworked (#8672)
This is further support of void MoveInLineOfSight(Unit* who) override of creature AIs. Currently before this PR, src scripted creatures of void MoveInLineOfSight(Unit* who) override would only follow void MoveInLineOfSight(Unit* who) override if they were hostile and nothing else. With this PR we create it with any aggression stance\faction stance, which will open up while improving upon only the future scripting of the core. - Ellminates restricting HasReactState(REACT_AGGRESSIVE) only to requirements of creatures to use void MoveInLineOfSight(Unit* who) override to having no React State requirements.
This commit is contained in:
@@ -150,18 +150,19 @@ void VisibleChangesNotifier::Visit(DynamicObjectMapType& m)
|
||||
inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
|
||||
{
|
||||
if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS))
|
||||
if (!c->HasUnitState(UNIT_STATE_SIGHTLESS))
|
||||
{
|
||||
if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
|
||||
{
|
||||
c->AI()->MoveInLineOfSight_Safe(u);
|
||||
}
|
||||
else
|
||||
else if (u->GetTypeId() == TYPEID_PLAYER && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
|
||||
{
|
||||
if (u->GetTypeId() == TYPEID_PLAYER && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
|
||||
c->AI()->TriggerAlert(u);
|
||||
c->AI()->TriggerAlert(u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user