mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
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:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user