fix(Scripts/Pet): Fixes behavior of Army of the Dead Ghouls to attack… (#22665)
This commit is contained in:
@@ -292,6 +292,28 @@ struct npc_pet_dk_army_of_the_dead : public CombatAI
|
|||||||
CombatAI::InitializeAI();
|
CombatAI::InitializeAI();
|
||||||
((Minion*)me)->SetFollowAngle(rand_norm() * 2 * M_PI);
|
((Minion*)me)->SetFollowAngle(rand_norm() * 2 * M_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IsSummonedBy(WorldObject* summoner) override
|
||||||
|
{
|
||||||
|
if (Unit* owner = summoner->ToUnit())
|
||||||
|
{
|
||||||
|
Unit* victim = owner->GetVictim();
|
||||||
|
|
||||||
|
if (victim && me->IsValidAttackTarget(victim))
|
||||||
|
{
|
||||||
|
AttackStart(victim);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If there is no valid target, attack the nearest enemy within 30m
|
||||||
|
if (Unit* nearest = me->SelectNearbyTarget(nullptr, 30.0f))
|
||||||
|
{
|
||||||
|
if (me->IsValidAttackTarget(nearest))
|
||||||
|
AttackStart(nearest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct npc_pet_dk_dancing_rune_weapon : public NullCreatureAI
|
struct npc_pet_dk_dancing_rune_weapon : public NullCreatureAI
|
||||||
|
|||||||
Reference in New Issue
Block a user