mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
fix(Core/Creature): Creatures should skip confused targets (#21410)
This commit is contained in:
@@ -110,25 +110,7 @@ public:
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
{
|
||||
if (target->IsCreature() && !secondPhase)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (me->GetThreatMgr().GetThreatListSize() > 1)
|
||||
{
|
||||
ThreatContainer::StorageType::const_iterator lastRef = me->GetThreatMgr().GetOnlineContainer().GetThreatList().end();
|
||||
--lastRef;
|
||||
if (Unit* lastTarget = (*lastRef)->getTarget())
|
||||
{
|
||||
if (lastTarget != target)
|
||||
{
|
||||
return !target->HasAura(SPELL_CONFLAGRATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return !(target->IsCreature() && !secondPhase);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
|
||||
@@ -153,24 +153,6 @@ struct boss_jindo : public BossAI
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
{
|
||||
if (me->GetThreatMgr().GetThreatListSize() > 1)
|
||||
{
|
||||
ThreatContainer::StorageType::const_iterator lastRef = me->GetThreatMgr().GetOnlineContainer().GetThreatList().end();
|
||||
--lastRef;
|
||||
if (Unit* lastTarget = (*lastRef)->getTarget())
|
||||
{
|
||||
if (lastTarget != target)
|
||||
{
|
||||
return !target->HasAura(SPELL_HEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
TaskScheduler _scheduler;
|
||||
};
|
||||
|
||||
@@ -51,24 +51,6 @@ struct boss_nethermancer_sepethrea : public BossAI
|
||||
{
|
||||
boss_nethermancer_sepethrea(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
{
|
||||
if (me->GetThreatMgr().GetThreatListSize() > 1)
|
||||
{
|
||||
ThreatContainer::StorageType::const_iterator lastRef = me->GetThreatMgr().GetOnlineContainer().GetThreatList().end();
|
||||
--lastRef;
|
||||
if (Unit* lastTarget = (*lastRef)->getTarget())
|
||||
{
|
||||
if (lastTarget != target)
|
||||
{
|
||||
return !target->HasAura(SPELL_DRAGONS_BREATH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
|
||||
Reference in New Issue
Block a user