UP and CoS dungeons

- Utgarde Pinnacle implementation
- Culling of Stratholme implementation
- Added additional value ("nearest hostile npcs") needed to expose some hidden trigger-type npc units (eg. frost breath on Skadi fight in UP)
This commit is contained in:
Bobblybook
2024-10-21 22:29:03 +11:00
parent edcf90f4e8
commit c788e96828
31 changed files with 665 additions and 18 deletions

View File

@@ -0,0 +1,48 @@
#include "Playerbots.h"
#include "UtgardePinnacleTriggers.h"
#include "AiObject.h"
#include "AiObjectContext.h"
bool SkadiFreezingCloudTrigger::IsActive()
{
Unit* bossMount = AI_VALUE2(Unit*, "find target", "grauf");
if (!bossMount) { return false; }
// Need to check two conditions here - the persistent ground effect doesn't
// seem to be detectable until 3-5 secs in, despite it dealing damage.
// The initial breath triggers straight away but once it's over, the bots will run back on
// to the frezzing cloud and take damage.
// Therefore check both conditions and trigger on either.
// Check this one first, if true then we don't need to iterate over any objects
if (bossMount->HasAura(SPELL_FREEZING_CLOUD_BREATH))
{
return true;
}
// Otherwise, check for persistent ground objects emitting the freezing cloud
GuidVector objects = AI_VALUE(GuidVector, "nearest hostile npcs");
for (auto i = objects.begin(); i != objects.end(); ++i)
{
Unit* unit = botAI->GetUnit(*i);
if (unit && unit->GetEntry() == NPC_BREATH_TRIGGER)
{
Unit::AuraApplicationMap const& Auras = unit->GetAppliedAuras();
for (Unit::AuraApplicationMap::const_iterator itr = Auras.begin(); itr != Auras.end(); ++itr)
{
Aura* aura = itr->second->GetBase();
if (aura && aura->GetId() == SPELL_FREEZING_CLOUD)
{
return true;
}
}
}
}
return false;
}
bool SkadiWhirlwindTrigger::IsActive()
{
Unit* boss = AI_VALUE2(Unit*, "find target", "skadi the ruthless");
return boss && boss->HasAura(SPELL_SKADI_WHIRLWIND);
}