fix(Core/Creatures): Added new AI function OnTeleportUnreacheablePlayer to teleport all unreachable players. (#12193)
* fix(Core/Creatures): Implemented CREATURE_FLAG_EXTRA_TELEPORT_UNREACHABLE_PLAYERS. Fixed #11750 * Update. * Update. * Update.
This commit is contained in:
@@ -306,7 +306,7 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
|
||||
me->SetLootRecipient(nullptr);
|
||||
me->ResetPlayerDamageReq();
|
||||
me->SetLastDamagedTime(0);
|
||||
me->SetCannotReachTarget(false);
|
||||
me->SetCannotReachTarget();
|
||||
|
||||
if (me->IsInEvadeMode())
|
||||
{
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
EVADE_REASON_NO_HOSTILES, // the creature's threat list is empty
|
||||
EVADE_REASON_BOUNDARY, // the creature has moved outside its evade boundary
|
||||
EVADE_REASON_SEQUENCE_BREAK, // this is a boss and the pre-requisite encounters for engaging it are not defeated yet
|
||||
EVADE_REASON_NO_PATH, // the creature was unable to reach its target for over 5 seconds
|
||||
EVADE_REASON_OTHER
|
||||
};
|
||||
|
||||
@@ -210,6 +211,8 @@ public:
|
||||
|
||||
virtual void CalculateThreat(Unit* /*hatedUnit*/, float& /*threat*/, SpellInfo const* /*threatSpell*/) { }
|
||||
|
||||
virtual bool OnTeleportUnreacheablePlayer(Player* /*player*/) { return false; }
|
||||
|
||||
protected:
|
||||
virtual void MoveInLineOfSight(Unit* /*who*/);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user