mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 02:53:48 +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();
|
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
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
events.ScheduleEvent(EVENT_FLAME_BUFFET, 4s);
|
events.ScheduleEvent(EVENT_FLAME_BUFFET, 4s);
|
||||||
@@ -2610,12 +2621,9 @@ public:
|
|||||||
|
|
||||||
void IsSummonedBy(WorldObject* summoner) override
|
void IsSummonedBy(WorldObject* summoner) override
|
||||||
{
|
{
|
||||||
if (summoner->GetTypeId() != TYPEID_UNIT)
|
if (summoner->GetTypeId() == TYPEID_UNIT || summoner->IsPlayer())
|
||||||
{
|
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
|
|||||||
Reference in New Issue
Block a user