fix(Scripts/TempleOfAhnQiraj): Fix Twin Emperor's critters aggroing p… (#13365)

…layers randomly
This commit is contained in:
Skjalf
2022-10-12 14:03:39 -03:00
committed by GitHub
parent 4cf0906a91
commit 0cb13b1242

View File

@@ -445,6 +445,19 @@ struct npc_ahnqiraji_critter : public ScriptedAI
me->RestoreFaction();
_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)
{
if (Player* player = me->SelectNearestPlayer(10.f))