fix(Scripts/Spell): Priest shadowfiend attack and Shadowfiend Death proc (#20987)

Co-authored-by: killerwife <killerwife@gmail.com>
Co-authored-by: Grimdhex <176165533+Grimdhex@users.noreply.github.com>
This commit is contained in:
Jelle Meeus
2025-02-19 11:50:44 +01:00
committed by GitHub
parent b80da06152
commit 79ba56ed3d
3 changed files with 42 additions and 28 deletions

View File

@@ -27,10 +27,7 @@
enum PriestSpells
{
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
SPELL_PRIEST_SHADOWFIEND_DODGE = 8273,
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
SPELL_PRIEST_LIGHTWELL_CHARGES = 59907,
};
struct npc_pet_pri_lightwell : public TotemAI
@@ -55,31 +52,7 @@ struct npc_pet_pri_lightwell : public TotemAI
}
};
struct npc_pet_pri_shadowfiend : public PetAI
{
npc_pet_pri_shadowfiend(Creature* creature) : PetAI(creature) { }
void Reset() override
{
PetAI::Reset();
if (!me->HasAura(SPELL_PRIEST_SHADOWFIEND_DODGE))
me->AddAura(SPELL_PRIEST_SHADOWFIEND_DODGE, me);
if (Unit* target = me->SelectNearestTarget(15.0f))
AttackStart(target);
}
void JustDied(Unit* /*killer*/) override
{
if (me->IsSummon())
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
}
};
void AddSC_priest_pet_scripts()
{
RegisterCreatureAI(npc_pet_pri_lightwell);
RegisterCreatureAI(npc_pet_pri_shadowfiend);
}