fix(Scripts/Pet): Fix Risen Ghoul behavior that does not automaticall… (#22546)

This commit is contained in:
EricksOliveira
2025-08-10 17:18:53 -03:00
committed by GitHub
parent 2450237b7d
commit 1d70c6acc3

View File

@@ -245,6 +245,20 @@ struct npc_pet_dk_ghoul : public CombatAI
{
npc_pet_dk_ghoul(Creature* c) : CombatAI(c) { }
void IsSummonedBy(WorldObject* summoner) override
{
if (!summoner || !summoner->IsPlayer())
return;
Player* player = summoner->ToPlayer();
if (Unit* victim = player->GetVictim())
{
me->Attack(victim, true);
me->GetMotionMaster()->MoveChase(victim);
}
}
void JustDied(Unit* /*who*/) override
{
if (me->IsGuardian() || me->IsSummon())