fix(Scripts/BlackTemple): Parasitic Shadowfiends should not target pl… (#19944)

* fix(Scripts/BlackTemple): Parasitic Shadowfiends should not target players affected with debuff

* Update boss_illidan.cpp

* Update src/server/scripts/Outland/BlackTemple/boss_illidan.cpp

* make it simple
This commit is contained in:
Andrew
2024-09-15 07:46:55 -03:00
committed by GitHub
parent 4fc60bbbdf
commit 99b39e5045

View File

@@ -1186,14 +1186,37 @@ struct npc_parasitic_shadowfiend : public ScriptedAI
{
npc_parasitic_shadowfiend(Creature* creature) : ScriptedAI(creature) { }
bool CanAIAttack(Unit const* who) const override
{
return !who->HasAura(SPELL_PARASITIC_SHADOWFIEND) && !who->HasAura(SPELL_PARASITIC_SHADOWFIEND_TRIGGER);
}
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->DespawnOrUnsummon();
}
void IsSummonedBy(WorldObject* /*summoner*/) override
{
// Simulate blizz-like AI delay to avoid extreme overpopulation of adds
me->SetReactState(REACT_DEFENSIVE);
me->m_Events.AddEventAtOffset([&] {
scheduler.Schedule(2400ms, [this](TaskContext context)
{
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
}, 2400ms);
context.Repeat();
});
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};