mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-15 09:50:27 +00:00
Warlock overhaul (#1397)
This is a complete overhaul of the warlock class, making 3 new strategies (affliction, demonology, and destruction), as well as finishing the warlock tank strategy (shadow ward and searing pain). It also includes a soulstone fix, where the bots can change who they soulstone based on the non-combat strategies you set for them. It also includes a self-resurrect action and trigger that allows the bots to resurrect using a soulstone or reincarnation. Many other skills were added to finish out the warlock skillset.
This commit is contained in:
@@ -4,10 +4,34 @@
|
||||
*/
|
||||
|
||||
#include "WarlockTriggers.h"
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool SpellstoneTrigger::IsActive() { return BuffTrigger::IsActive() && AI_VALUE2(uint32, "item count", getName()) > 0; }
|
||||
|
||||
bool FirestoneTrigger::IsActive() { return BuffTrigger::IsActive() && AI_VALUE2(uint32, "item count", getName()) > 0; }
|
||||
|
||||
bool WarlockConjuredItemTrigger::IsActive()
|
||||
{
|
||||
return ItemCountTrigger::IsActive() && AI_VALUE2(uint32, "item count", "soul shard") > 0;
|
||||
}
|
||||
|
||||
// Checks if the target marked with the moon icon can be banished
|
||||
bool BanishTrigger::IsActive()
|
||||
{
|
||||
Unit* ccTarget = context->GetValue<Unit*>("cc target", "banish")->Get();
|
||||
Unit* moonTarget = context->GetValue<Unit*>("rti cc target")->Get();
|
||||
return ccTarget && moonTarget && ccTarget == moonTarget && HasCcTargetTrigger::IsActive();
|
||||
}
|
||||
|
||||
// Checks if the target marked with the moon icon can be feared
|
||||
bool FearTrigger::IsActive()
|
||||
{
|
||||
Unit* ccTarget = context->GetValue<Unit*>("cc target", "fear")->Get();
|
||||
Unit* moonTarget = context->GetValue<Unit*>("rti cc target")->Get();
|
||||
return ccTarget && moonTarget && ccTarget == moonTarget && HasCcTargetTrigger::IsActive();
|
||||
}
|
||||
|
||||
bool DemonArmorTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
@@ -15,30 +39,18 @@ bool DemonArmorTrigger::IsActive()
|
||||
!botAI->HasAura("fel armor", target);
|
||||
}
|
||||
|
||||
bool SpellstoneTrigger::IsActive() { return BuffTrigger::IsActive() && AI_VALUE2(uint32, "item count", getName()) > 0; }
|
||||
|
||||
bool WarlockConjuredItemTrigger::IsActive()
|
||||
bool SoulLinkTrigger::IsActive()
|
||||
{
|
||||
return ItemCountTrigger::IsActive() && AI_VALUE2(uint32, "item count", "soul shard") > 0;
|
||||
Unit* target = GetTarget();
|
||||
return !botAI->HasAura("soul link", target);
|
||||
}
|
||||
|
||||
bool ImmolateOnAttackerTrigger::IsActive()
|
||||
bool DemonicEmpowermentTrigger::IsActive()
|
||||
{
|
||||
return DebuffOnAttackerTrigger::IsActive() &&
|
||||
// !botAI->HasAura("immolate", GetTarget(), false, true) &&
|
||||
!botAI->HasAura("unstable affliction", GetTarget(), false, true);
|
||||
}
|
||||
|
||||
bool UnstableAfflictionTrigger::IsActive()
|
||||
{
|
||||
return DebuffTrigger::IsActive() && !botAI->HasAura("immolate", GetTarget(), false, true);
|
||||
// !botAI->HasAura("unstable affliction", GetTarget(), false, true);
|
||||
}
|
||||
|
||||
bool UnstableAfflictionOnAttackerTrigger::IsActive()
|
||||
{
|
||||
return DebuffOnAttackerTrigger::IsActive() && !botAI->HasAura("immolate", GetTarget(), false, true);
|
||||
// !botAI->HasAura("unstable affliction", GetTarget(), false, true);
|
||||
Pet* pet = bot->GetPet();
|
||||
if (!pet)
|
||||
return false;
|
||||
return !botAI->HasAura("demonic empowerment", pet);
|
||||
}
|
||||
|
||||
bool DecimationTrigger::IsActive()
|
||||
@@ -47,11 +59,51 @@ bool DecimationTrigger::IsActive()
|
||||
return aura && aura->GetDuration() > 3000;
|
||||
}
|
||||
|
||||
// Checks if the bot's mana is below 85% and health is above a low health threshold
|
||||
bool LifeTapTrigger::IsActive()
|
||||
{
|
||||
if (AI_VALUE2(uint8, "health", "self target") <= sPlayerbotAIConfig->lowHealth)
|
||||
return false;
|
||||
|
||||
if (!AI_VALUE2(bool, "has mana", "self target"))
|
||||
return false;
|
||||
if (AI_VALUE2(uint8, "mana", "self target") >= 85)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Checks if the Life Tap Glyph buff is active
|
||||
bool LifeTapGlyphBuffTrigger::IsActive()
|
||||
{
|
||||
// Check life tap glyph first
|
||||
if (!botAI->HasAura(63320, bot))
|
||||
return false;
|
||||
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if the target has a conflicting debuff that is equal to Curse of the Elements
|
||||
bool CurseOfTheElementsTrigger::IsActive()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target || !target->IsAlive() || !target->IsInWorld())
|
||||
return false;
|
||||
|
||||
// List of all spell IDs for Ebon Plague, Earth and Moon, and Curse of the Elements
|
||||
static const uint32 CurseOfTheElementsExclusiveDebuffs[] = {// Ebon Plague
|
||||
51735, 51734, 51726,
|
||||
// Earth and Moon
|
||||
48511, 48513, 48514,
|
||||
// Curse of the Elements
|
||||
1490, 11721, 11722, 27228, 47865};
|
||||
|
||||
// Check if target has any of the exclusive debuffs
|
||||
for (uint32 spellId : CurseOfTheElementsExclusiveDebuffs)
|
||||
{
|
||||
if (target->HasAura(spellId))
|
||||
return false;
|
||||
}
|
||||
|
||||
// Use default BuffTrigger logic for the rest (only trigger if debuff is missing or expiring)
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user