fix(Scripts/BlackwingLair): Razorgore the Untamed should not reset enco… (#13782)

* fix(Raids/BlackwingLair): Razorgore the Untamed should not reset encounter upon casting Conflagrate when soloing.

Fixes #13761

* Update.
This commit is contained in:
UltraNix
2022-12-06 13:47:08 +01:00
committed by GitHub
parent 67adf3c9b3
commit 08ff2f277b
5 changed files with 56 additions and 11 deletions

View File

@@ -108,7 +108,25 @@ public:
bool CanAIAttack(Unit const* target) const override
{
return !(target->GetTypeId() == TYPEID_UNIT && !secondPhase) && !target->HasAura(SPELL_CONFLAGRATION);
if (target->GetTypeId() == TYPEID_UNIT && !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;
}
void EnterCombat(Unit* /*victim*/) override
@@ -244,9 +262,6 @@ public:
break;
case EVENT_CONFLAGRATION:
DoCastVictim(SPELL_CONFLAGRATION);
if (me->GetVictim() && me->GetVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
me->TauntApply(target);
events.ScheduleEvent(EVENT_CONFLAGRATION, 30000);
break;
}