mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
fix(Scripts/NPC): Fix arcanite dragonling attacking non flagged players (#19039)
This commit is contained in:
@@ -2602,6 +2602,17 @@ public:
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
{
|
||||
if (Unit* summoner = me->GetCharmerOrOwner())
|
||||
{
|
||||
if (target->IsPlayer() && (!summoner->IsPvP() || !target->IsPvP()))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FLAME_BUFFET, 4s);
|
||||
@@ -2610,12 +2621,9 @@ public:
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
if (summoner->GetTypeId() != TYPEID_UNIT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (summoner->GetTypeId() == TYPEID_UNIT || summoner->IsPlayer())
|
||||
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
|
||||
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
Reference in New Issue
Block a user