fix(Scripts/TempleOfAhnQiraj): Fix Twin Emperor's critters aggroing p… (#13365)
…layers randomly
This commit is contained in:
@@ -445,6 +445,19 @@ struct npc_ahnqiraji_critter : public ScriptedAI
|
|||||||
me->RestoreFaction();
|
me->RestoreFaction();
|
||||||
|
|
||||||
_scheduler.CancelAll();
|
_scheduler.CancelAll();
|
||||||
|
|
||||||
|
// Don't attack nearby players randomly if they are the Twin's pet bugs.
|
||||||
|
if (CreatureData const* crData = me->GetCreatureData())
|
||||||
|
{
|
||||||
|
ObjectGuid dbtableHighGuid = ObjectGuid::Create<HighGuid::Unit>(crData->id1, me->GetSpawnId());
|
||||||
|
ObjectGuid targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
|
||||||
|
|
||||||
|
if (targetGuid.GetEntry() == NPC_VEKLOR)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_scheduler.Schedule(100ms, [this](TaskContext context)
|
_scheduler.Schedule(100ms, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
if (Player* player = me->SelectNearestPlayer(10.f))
|
if (Player* player = me->SelectNearestPlayer(10.f))
|
||||||
|
|||||||
Reference in New Issue
Block a user