Revert "Dungeon code cleanup"

This reverts commit d0a9e98801.
This commit is contained in:
Bobblybook
2024-10-20 15:58:14 +11:00
parent d0a9e98801
commit 3f7f306124
16 changed files with 151 additions and 106 deletions

View File

@@ -7,8 +7,6 @@ bool AttackErekemAction::Execute(Event event)
{
// Focus boss first, adds after
Unit* boss = AI_VALUE2(Unit*, "find target", "erekem");
if (!boss) { return false; }
if (AI_VALUE(Unit*, "current target") != boss)
{
return Attack(boss);
@@ -21,8 +19,6 @@ bool AttackIchorGlobuleAction::Execute(Event event)
Unit* boss = AI_VALUE2(Unit*, "find target", "ichoron");
if (!boss) { return false; }
Unit* currentTarget = AI_VALUE(Unit*, "current target");
// Tank prioritise boss if it's up
if (botAI->IsTank(bot) && !boss->HasAura(SPELL_DRAINED))
{
@@ -42,6 +38,7 @@ bool AttackIchorGlobuleAction::Execute(Event event)
Unit* unit = botAI->GetUnit(*i);
if (unit && unit->GetEntry() == NPC_ICHOR_GLOBULE)
{
Unit* currentTarget = AI_VALUE(Unit*, "current target");
// Check IDs here, NOT Unit* pointers:
// Don't keep swapping between sentries.
// If we're already attacking one, don't retarget another
@@ -53,7 +50,7 @@ bool AttackIchorGlobuleAction::Execute(Event event)
}
}
// No ichor globules left alive, fall back to targeting boss
if (currentTarget != boss)
if (AI_VALUE(Unit*, "current target") != boss)
{
return Attack(boss);
}
@@ -65,8 +62,6 @@ bool AttackVoidSentryAction::Execute(Event event)
{
Unit* boss = AI_VALUE2(Unit*, "find target", "zuramat the obliterator");
if (!boss) { return false; }
Unit* currentTarget = AI_VALUE(Unit*, "current target");
// Target is not findable from threat table using AI_VALUE2(),
// therefore need to search manually for the unit name
@@ -78,6 +73,7 @@ bool AttackVoidSentryAction::Execute(Event event)
Unit* unit = botAI->GetUnit(*i);
if (unit && unit->GetEntry() == NPC_VOID_SENTRY)
{
Unit* currentTarget = AI_VALUE(Unit*, "current target");
// Check IDs here, NOT Unit* pointers:
// Don't keep swapping between sentries.
// If we're already attacking one, don't retarget another
@@ -89,7 +85,7 @@ bool AttackVoidSentryAction::Execute(Event event)
}
}
// No void sentries left alive, fall back to targeting boss
if (currentTarget != boss)
if (AI_VALUE(Unit*, "current target") != boss)
{
return Attack(boss);
}