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:
parent
c69e309681
commit
d72b741fbf
1 changed files with 5 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue