- Added generic boss shadow aura trigger and action (#1480)

- Added automatic aura for General Vezax and Yogg-Saron
- Added support for all rank for boss aura triggers
This commit is contained in:
kadeshar
2025-08-01 15:31:44 +02:00
committed by GitHub
parent 989b48f491
commit 65a3bf481c
5 changed files with 154 additions and 12 deletions

View File

@@ -23,7 +23,9 @@ bool BossFireResistanceTrigger::IsActive()
return false;
// Check if bot have fire resistance aura
if (bot->HasAura(SPELL_FIRE_RESISTANCE_AURA))
if (bot->HasAura(SPELL_FIRE_RESISTANCE_AURA_RANK_5) || bot->HasAura(SPELL_FIRE_RESISTANCE_AURA_RANK_4) ||
bot->HasAura(SPELL_FIRE_RESISTANCE_AURA_RANK_3) || bot->HasAura(SPELL_FIRE_RESISTANCE_AURA_RANK_2) ||
bot->HasAura(SPELL_FIRE_RESISTANCE_AURA_RANK_1))
return false;
// Check if bot dont have already have fire resistance strategy
@@ -32,7 +34,11 @@ bool BossFireResistanceTrigger::IsActive()
return false;
// Check that the bot actually knows the spell
if (!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA))
if (!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA_RANK_5) &&
!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA_RANK_4) &&
!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA_RANK_3) &&
!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA_RANK_2) &&
!bot->HasActiveSpell(SPELL_FIRE_RESISTANCE_AURA_RANK_1))
return false;
// Get the group and ensure it's a raid group
@@ -47,7 +53,7 @@ bool BossFireResistanceTrigger::IsActive()
if (!member || !member->IsAlive())
continue;
// Check if the member is a hunter
// Check if the member is a paladin
if (member->getClass() == CLASS_PALADIN)
{
// Return true only if the current bot is the first alive paladin
@@ -70,7 +76,9 @@ bool BossFrostResistanceTrigger::IsActive()
return false;
// Check if bot have frost resistance aura
if (bot->HasAura(SPELL_FROST_RESISTANCE_AURA))
if (bot->HasAura(SPELL_FROST_RESISTANCE_AURA_RANK_5) || bot->HasAura(SPELL_FROST_RESISTANCE_AURA_RANK_4) ||
bot->HasAura(SPELL_FROST_RESISTANCE_AURA_RANK_3) || bot->HasAura(SPELL_FROST_RESISTANCE_AURA_RANK_2) ||
bot->HasAura(SPELL_FROST_RESISTANCE_AURA_RANK_1))
return false;
// Check if bot dont have already have frost resistance strategy
@@ -79,7 +87,11 @@ bool BossFrostResistanceTrigger::IsActive()
return false;
// Check that the bot actually knows the spell
if (!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA))
if (!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA_RANK_5) &&
!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA_RANK_4) &&
!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA_RANK_3) &&
!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA_RANK_2) &&
!bot->HasActiveSpell(SPELL_FROST_RESISTANCE_AURA_RANK_1))
return false;
// Get the group and ensure it's a raid group
@@ -94,7 +106,7 @@ bool BossFrostResistanceTrigger::IsActive()
if (!member || !member->IsAlive())
continue;
// Check if the member is a hunter
// Check if the member is a paladin
if (member->getClass() == CLASS_PALADIN)
{
// Return true only if the current bot is the first alive paladin
@@ -121,7 +133,8 @@ bool BossNatureResistanceTrigger::IsActive()
return false;
// Check if bot have nature resistance aura
if (bot->HasAura(SPELL_ASPECT_OF_THE_WILD))
if (bot->HasAura(SPELL_ASPECT_OF_THE_WILD_RANK_4) || bot->HasAura(SPELL_ASPECT_OF_THE_WILD_RANK_3) ||
bot->HasAura(SPELL_ASPECT_OF_THE_WILD_RANK_2) || bot->HasAura(SPELL_ASPECT_OF_THE_WILD_RANK_1))
return false;
// Check if bot dont have already setted nature resistance aura
@@ -130,7 +143,10 @@ bool BossNatureResistanceTrigger::IsActive()
return false;
// Check that the bot actually knows Aspect of the Wild
if (!bot->HasActiveSpell(SPELL_ASPECT_OF_THE_WILD))
if (!bot->HasActiveSpell(SPELL_ASPECT_OF_THE_WILD_RANK_4) &&
!bot->HasActiveSpell(SPELL_ASPECT_OF_THE_WILD_RANK_3) &&
!bot->HasActiveSpell(SPELL_ASPECT_OF_THE_WILD_RANK_2) &&
!bot->HasActiveSpell(SPELL_ASPECT_OF_THE_WILD_RANK_1))
return false;
// Get the group and ensure it's a raid group
@@ -155,3 +171,58 @@ bool BossNatureResistanceTrigger::IsActive()
return false;
}
bool BossShadowResistanceTrigger::IsActive()
{
// Check boss and it is alive
Unit* boss = AI_VALUE2(Unit*, "find target", bossName);
if (!boss || !boss->IsAlive())
return false;
// Check if bot is paladin
if (bot->getClass() != CLASS_PALADIN)
return false;
// Check if bot have shadow resistance aura
if (bot->HasAura(SPELL_SHADOW_RESISTANCE_AURA_RANK_5) ||
bot->HasAura(SPELL_SHADOW_RESISTANCE_AURA_RANK_4) ||
bot->HasAura(SPELL_SHADOW_RESISTANCE_AURA_RANK_3) ||
bot->HasAura(SPELL_SHADOW_RESISTANCE_AURA_RANK_2) ||
bot->HasAura(SPELL_SHADOW_RESISTANCE_AURA_RANK_1))
return false;
// Check if bot dont have already have shadow resistance strategy
PaladinShadowResistanceStrategy paladinShadowResistanceStrategy(botAI);
if (botAI->HasStrategy(paladinShadowResistanceStrategy.getName(), BotState::BOT_STATE_COMBAT))
return false;
// Check that the bot actually knows the spell
if (!bot->HasActiveSpell(SPELL_SHADOW_RESISTANCE_AURA_RANK_5) &&
!bot->HasActiveSpell(SPELL_SHADOW_RESISTANCE_AURA_RANK_4) &&
!bot->HasActiveSpell(SPELL_SHADOW_RESISTANCE_AURA_RANK_3) &&
!bot->HasActiveSpell(SPELL_SHADOW_RESISTANCE_AURA_RANK_2) &&
!bot->HasActiveSpell(SPELL_SHADOW_RESISTANCE_AURA_RANK_1))
return false;
// Get the group and ensure it's a raid group
Group* group = bot->GetGroup();
if (!group || !group->isRaidGroup())
return false;
// Iterate through group members to find the first alive paladin
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
{
Player* member = gref->GetSource();
if (!member || !member->IsAlive())
continue;
// Check if the member is a paladin
if (member->getClass() == CLASS_PALADIN)
{
// Return true only if the current bot is the first alive paladin
return member == bot;
}
}
return false;
}