fix(Scripts/BlackwingLair): Nefarian class calls should not repeat (#12148)
This commit is contained in:
+12
-4
@@ -548,6 +548,8 @@ struct boss_nefarian : public BossAI
|
|||||||
}
|
}
|
||||||
me->DespawnOrUnsummon();
|
me->DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
classesPresent.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* /*who*/) override {}
|
void EnterCombat(Unit* /*who*/) override {}
|
||||||
@@ -675,16 +677,21 @@ struct boss_nefarian : public BossAI
|
|||||||
events.ScheduleEvent(EVENT_TAILLASH, 10000);
|
events.ScheduleEvent(EVENT_TAILLASH, 10000);
|
||||||
break;
|
break;
|
||||||
case EVENT_CLASSCALL:
|
case EVENT_CLASSCALL:
|
||||||
std::set<uint8> classesPresent;
|
if (classesPresent.empty())
|
||||||
for (auto& ref : me->GetThreatMgr().getThreatList())
|
|
||||||
{
|
{
|
||||||
if (ref->getTarget() && ref->getTarget()->GetTypeId() == TYPEID_PLAYER)
|
for (auto& ref : me->GetThreatMgr().getThreatList())
|
||||||
{
|
{
|
||||||
classesPresent.insert(ref->getTarget()->getClass());
|
if (ref->getTarget() && ref->getTarget()->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
{
|
||||||
|
classesPresent.insert(ref->getTarget()->getClass());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 targetClass = Acore::Containers::SelectRandomContainerElement(classesPresent);
|
uint8 targetClass = Acore::Containers::SelectRandomContainerElement(classesPresent);
|
||||||
|
|
||||||
|
classesPresent.erase(targetClass);
|
||||||
|
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ClassCallSelector(me, targetClass)))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ClassCallSelector(me, targetClass)))
|
||||||
{
|
{
|
||||||
switch (target->getClass())
|
switch (target->getClass())
|
||||||
@@ -755,6 +762,7 @@ struct boss_nefarian : public BossAI
|
|||||||
private:
|
private:
|
||||||
bool Phase3;
|
bool Phase3;
|
||||||
bool _introDone;
|
bool _introDone;
|
||||||
|
std::set<uint8> classesPresent;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TotemSpells
|
enum TotemSpells
|
||||||
|
|||||||
Reference in New Issue
Block a user