mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-27 23:46:23 +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:
@@ -8,9 +8,13 @@
|
||||
|
||||
#include "GenericTriggers.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "Playerbots.h"
|
||||
#include "CureTriggers.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
// Buff and Out of Combat Triggers
|
||||
|
||||
class DemonArmorTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
@@ -19,90 +23,50 @@ public:
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SoulLinkTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
SoulLinkTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "soul link") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class FirestoneTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
FirestoneTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "firestone") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SpellstoneTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
SpellstoneTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "spellstone") {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
// DEBUFF_CHECKISOWNER_TRIGGER(CurseOfAgonyTrigger, "curse of agony");
|
||||
class CurseOfAgonyTrigger : public DebuffTrigger
|
||||
class HasSoulstoneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
CurseOfAgonyTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "curse of agony", 1, true, 20.0f) {}
|
||||
HasSoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "no soulstone") {}
|
||||
bool IsActive() override { return AI_VALUE2(uint32, "item count", "soulstone") == 0; }
|
||||
};
|
||||
|
||||
class CorruptionTrigger : public DebuffTrigger
|
||||
class SoulstoneTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
CorruptionTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "corruption", 1, true) {}
|
||||
SoulstoneTrigger(PlayerbotAI* botAI) : Trigger(botAI, "soulstone") {}
|
||||
|
||||
bool IsActive() override
|
||||
{
|
||||
return DebuffTrigger::IsActive() && !botAI->HasAura("seed of corruption", GetTarget(), false, true);
|
||||
// Just check if we have a soulstone item available
|
||||
return AI_VALUE2(uint32, "item count", "soulstone") > 0;
|
||||
}
|
||||
};
|
||||
|
||||
DEBUFF_CHECKISOWNER_TRIGGER(SiphonLifeTrigger, "siphon life");
|
||||
|
||||
class CorruptionOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CorruptionOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "corruption", true) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
return DebuffOnAttackerTrigger::IsActive() && !botAI->HasAura("seed of corruption", GetTarget(), false, true);
|
||||
}
|
||||
};
|
||||
|
||||
class CastCurseOfAgonyOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CastCurseOfAgonyOnAttackerTrigger(PlayerbotAI* botAI)
|
||||
: DebuffOnAttackerTrigger(botAI, "curse of agony", true, 20.0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class SiphonLifeOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
SiphonLifeOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "siphon life") {}
|
||||
};
|
||||
|
||||
DEBUFF_CHECKISOWNER_TRIGGER(ImmolateTrigger, "immolate");
|
||||
|
||||
class ImmolateOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
ImmolateOnAttackerTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "immolate") {}
|
||||
virtual bool IsActive();
|
||||
};
|
||||
|
||||
class ShadowTranceTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
ShadowTranceTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "shadow trance") {}
|
||||
};
|
||||
|
||||
class BacklashTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
BacklashTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "backlash") {}
|
||||
};
|
||||
|
||||
class BanishTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
BanishTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "banish") {}
|
||||
};
|
||||
|
||||
class WarlockConjuredItemTrigger : public ItemCountTrigger
|
||||
{
|
||||
public:
|
||||
WarlockConjuredItemTrigger(PlayerbotAI* botAI, std::string const item) : ItemCountTrigger(botAI, item, 1) {}
|
||||
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
@@ -124,30 +88,114 @@ public:
|
||||
HasHealthstoneTrigger(PlayerbotAI* botAI) : WarlockConjuredItemTrigger(botAI, "healthstone") {}
|
||||
};
|
||||
|
||||
// CC and Pet Triggers
|
||||
|
||||
class BanishTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
BanishTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "banish") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class FearTrigger : public HasCcTargetTrigger
|
||||
{
|
||||
public:
|
||||
FearTrigger(PlayerbotAI* botAI) : HasCcTargetTrigger(botAI, "fear") {}
|
||||
};
|
||||
|
||||
class AmplifyCurseTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
AmplifyCurseTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "amplify curse") {}
|
||||
};
|
||||
|
||||
class UnstableAfflictionTrigger : public DebuffTrigger // SpellTrigger
|
||||
{
|
||||
public:
|
||||
UnstableAfflictionTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "unstable affliction", 1, true) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class SpellLockInterruptSpellTrigger : public InterruptSpellTrigger
|
||||
{
|
||||
public:
|
||||
SpellLockInterruptSpellTrigger(PlayerbotAI* botAI) : InterruptSpellTrigger(botAI, "spell lock") {}
|
||||
};
|
||||
|
||||
class DevourMagicPurgeTrigger : public TargetAuraDispelTrigger
|
||||
{
|
||||
public:
|
||||
DevourMagicPurgeTrigger(PlayerbotAI* botAI) : TargetAuraDispelTrigger(botAI, "devour magic", DISPEL_MAGIC) {}
|
||||
};
|
||||
|
||||
class DevourMagicCleanseTrigger : public PartyMemberNeedCureTrigger
|
||||
{
|
||||
public:
|
||||
DevourMagicCleanseTrigger(PlayerbotAI* botAI) : PartyMemberNeedCureTrigger(botAI, "devour magic", DISPEL_MAGIC) {}
|
||||
};
|
||||
|
||||
// DoT/Debuff Triggers
|
||||
|
||||
class CurseOfAgonyTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
CurseOfAgonyTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "curse of agony", 1, true, 0.5f) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
if (botAI->HasStrategy(
|
||||
"curse of elements", BOT_STATE_COMBAT)) // If Curse of the Elements strategy is active, do not cast Curse of Agony
|
||||
return false;
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
};
|
||||
|
||||
class CurseOfAgonyOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CurseOfAgonyOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "curse of agony", true) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
if (botAI->HasStrategy(
|
||||
"curse of elements", BOT_STATE_COMBAT)) // If Curse of the Elements strategy is active, do not cast Curse of Agony
|
||||
return false;
|
||||
return BuffTrigger::IsActive();
|
||||
}
|
||||
};
|
||||
|
||||
class CorruptionTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
CorruptionTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "corruption", 1, true, 0.5f) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
return BuffTrigger::IsActive() && !botAI->HasAura("seed of corruption", GetTarget(), false, true);
|
||||
}
|
||||
};
|
||||
|
||||
class CorruptionOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
CorruptionOnAttackerTrigger(PlayerbotAI* botAI) : DebuffOnAttackerTrigger(botAI, "corruption", true) {}
|
||||
bool IsActive() override
|
||||
{
|
||||
return BuffTrigger::IsActive() && !botAI->HasAura("seed of corruption", GetTarget(), false, true);
|
||||
}
|
||||
};
|
||||
|
||||
class ImmolateTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
ImmolateTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "immolate", 1, true, 0.5f) {}
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class ImmolateOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
ImmolateOnAttackerTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "immolate", true) {}
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class UnstableAfflictionTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
UnstableAfflictionTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "unstable affliction", 1, true, 0.5f) {}
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class UnstableAfflictionOnAttackerTrigger : public DebuffOnAttackerTrigger
|
||||
{
|
||||
public:
|
||||
UnstableAfflictionOnAttackerTrigger(PlayerbotAI* ai) : DebuffOnAttackerTrigger(ai, "unstable affliction", true) {}
|
||||
bool IsActive() override;
|
||||
bool IsActive() override { return BuffTrigger::IsActive(); }
|
||||
};
|
||||
|
||||
class HauntTrigger : public DebuffTrigger
|
||||
@@ -156,10 +204,20 @@ public:
|
||||
HauntTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "haunt", 1, true, 0) {}
|
||||
};
|
||||
|
||||
class DecimationTrigger : public HasAuraTrigger
|
||||
class CurseOfTheElementsTrigger : public DebuffTrigger
|
||||
{
|
||||
public:
|
||||
DecimationTrigger(PlayerbotAI* ai) : HasAuraTrigger(ai, "decimation") {}
|
||||
CurseOfTheElementsTrigger(PlayerbotAI* botAI)
|
||||
: DebuffTrigger(botAI, "curse of the elements", 1, true, 0.5f) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
// Proc/Cooldown Triggers
|
||||
|
||||
class LifeTapTrigger : public Trigger
|
||||
{
|
||||
public:
|
||||
LifeTapTrigger(PlayerbotAI* ai) : Trigger(ai, "life tap") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
@@ -170,15 +228,47 @@ public:
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class MoltenCoreTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
MoltenCoreTrigger(PlayerbotAI* ai) : HasAuraTrigger(ai, "molten core") {}
|
||||
};
|
||||
|
||||
class MetamorphosisTrigger : public BoostTrigger
|
||||
{
|
||||
public:
|
||||
MetamorphosisTrigger(PlayerbotAI* ai) : BoostTrigger(ai, "metamorphosis") {}
|
||||
};
|
||||
|
||||
class DemonicEmpowermentTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DemonicEmpowermentTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "demonic empowerment") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class ImmolationAuraActiveTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
ImmolationAuraActiveTrigger(PlayerbotAI* ai) : HasAuraTrigger(ai, "immolation aura") {}
|
||||
};
|
||||
|
||||
class ShadowTranceTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
ShadowTranceTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "shadow trance") {}
|
||||
};
|
||||
|
||||
class BacklashTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
BacklashTrigger(PlayerbotAI* botAI) : HasAuraTrigger(botAI, "backlash") {}
|
||||
};
|
||||
|
||||
class DecimationTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
DecimationTrigger(PlayerbotAI* ai) : HasAuraTrigger(ai, "decimation") {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
class MoltenCoreTrigger : public HasAuraTrigger
|
||||
{
|
||||
public:
|
||||
MoltenCoreTrigger(PlayerbotAI* ai) : HasAuraTrigger(ai, "molten core") {}
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user