Dungeon botAI bugfixes

- Utgarde Keep (Keleseth): Bots continue combat correctly after killing a frost tomb
- Utgarde Keep (Dalronn & Skarvald): Bots continue combat correctly after killing Dalronn
- Utgarde Keep (Ingvar): Tank correctly avoids Dark Smash in second phase
- Oculus (Drake combat): Bots more consistently attack the drakes in the air when flying around
- Halls of Lightning (Bjarngrim): Bots no longer acquire priority targets until in combat
This commit is contained in:
Bobblybook
2024-11-05 19:11:24 +11:00
parent fb2391d4ce
commit dd73fe8a90
9 changed files with 51 additions and 55 deletions

View File

@@ -161,18 +161,17 @@ bool DrakeAttackAction::Execute(Event event)
if (!target)
{
GuidVector attackers = AI_VALUE(GuidVector, "attackers");
for (auto& attacker : attackers)
GuidVector npcs = AI_VALUE(GuidVector, "possible targets");
for (auto& npc : npcs)
{
Unit* unit = botAI->GetUnit(attacker);
if (!unit) { continue; }
Unit* unit = botAI->GetUnit(npc);
if (!unit || !unit->IsInCombat()) { continue; }
SET_AI_VALUE(Unit*, "current target", unit);
target = unit;
break;
}
}
// Check this again to see if a target was assigned
if (!target) { return false; }
switch (vehicleBase->GetEntry())

View File

@@ -49,18 +49,8 @@ bool GroupFlyingTrigger::IsActive()
bool DrakeCombatTrigger::IsActive()
{
Unit* vehicleBase = bot->GetVehicleBase();
if (!vehicleBase) { return false; }
GuidVector attackers = AI_VALUE(GuidVector, "attackers");
for (auto& attacker : attackers)
{
Unit* target = botAI->GetUnit(attacker);
if (!target) { continue; }
return true;
}
return false;
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
return !targets.empty();
}
bool VarosCloudstriderTrigger::IsActive()
@@ -76,7 +66,7 @@ bool UromArcaneExplosionTrigger::IsActive()
Unit* boss = AI_VALUE2(Unit*, "find target", "mage-lord urom");
if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION);
return bool(boss->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION));
}
bool UromTimeBombTrigger::IsActive()