mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-22 11:34:36 +00:00
Violet Hold implementation
Violet Hold implementation Consortium guy is missing, will revisit once I reach heroics so I can code it properly
This commit is contained in:
99
src/strategy/dungeons/wotlk/violethold/VioletHoldActions.cpp
Normal file
99
src/strategy/dungeons/wotlk/violethold/VioletHoldActions.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
#include "Playerbots.h"
|
||||
#include "VioletHoldActions.h"
|
||||
#include "VioletHoldStrategy.h"
|
||||
|
||||
|
||||
bool AttackErekemAction::Execute(Event event)
|
||||
{
|
||||
// Focus boss first, adds after
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "erekem");
|
||||
if (AI_VALUE(Unit*, "current target") != boss)
|
||||
{
|
||||
return Attack(boss);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AttackIchorGlobuleAction::Execute(Event event)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "ichoron");
|
||||
if (!boss) { return false; }
|
||||
|
||||
// Tank prioritise boss if it's up
|
||||
if (botAI->IsTank(bot) && !boss->HasAura(SPELL_DRAINED))
|
||||
{
|
||||
if (AI_VALUE(Unit*, "current target") != boss)
|
||||
{
|
||||
return Attack(boss);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets");
|
||||
|
||||
for (auto i = targets.begin(); i != targets.end(); ++i)
|
||||
{
|
||||
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
|
||||
if (currentTarget && currentTarget->GetEntry() == NPC_ICHOR_GLOBULE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Attack(unit);
|
||||
}
|
||||
}
|
||||
// No ichor globules left alive, fall back to targeting boss
|
||||
if (AI_VALUE(Unit*, "current target") != boss)
|
||||
{
|
||||
return Attack(boss);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AttackVoidSentryAction::Execute(Event event)
|
||||
{
|
||||
Unit* boss = AI_VALUE2(Unit*, "find target", "zuramat the obliterator");
|
||||
if (!boss) { return false; }
|
||||
|
||||
// Target is not findable from threat table using AI_VALUE2(),
|
||||
// therefore need to search manually for the unit name
|
||||
// GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
|
||||
|
||||
for (auto i = targets.begin(); i != targets.end(); ++i)
|
||||
{
|
||||
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
|
||||
if (currentTarget && currentTarget->GetEntry() == NPC_VOID_SENTRY)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Attack(unit);
|
||||
}
|
||||
}
|
||||
// No void sentries left alive, fall back to targeting boss
|
||||
if (AI_VALUE(Unit*, "current target") != boss)
|
||||
{
|
||||
return Attack(boss);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StopAttackAction::Execute(Event event)
|
||||
{
|
||||
return bot->AttackStop();
|
||||
}
|
||||
Reference in New Issue
Block a user