fix(Scripts/Northrend): Dalaran guards now ignore non-combat pets (#23939)

This commit is contained in:
sogladev
2025-11-28 10:58:59 +01:00
committed by GitHub
parent a8b50ec9bf
commit afbf47c761

View File

@@ -428,7 +428,7 @@ public:
struct npc_mageguard_dalaranAI : public ScriptedAI
{
npc_mageguard_dalaranAI(Creature* creature) : ScriptedAI(creature)
explicit npc_mageguard_dalaranAI(Creature* creature) : ScriptedAI(creature)
{
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_NORMAL, true);
@@ -449,6 +449,9 @@ public:
if (!me->IsWithinDist(who, 5.0f, false))
return;
if (who->IsCreature() && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
return;
Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!player || player->IsGameMaster() || player->IsBeingTeleported() || (player->GetPositionZ() > 670 && player->GetVehicle()) ||
@@ -484,7 +487,6 @@ public:
break;
}
me->SetOrientation(me->GetHomePosition().GetOrientation());
return;
}
void UpdateAI(uint32 /*diff*/) override {}