Skip to content

Commit

Permalink
fix(Scripts/BlackTemple): Parasitic Shadowfiends should not target pl… (
Browse files Browse the repository at this point in the history
azerothcore#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
  • Loading branch information
Nyeriah authored Sep 15, 2024
1 parent 4fc60bb commit 99b39e5
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
};

Expand Down

0 comments on commit 99b39e5

Please sign in to comment.