Improvement on warlock life tap glyph

This commit is contained in:
Yunfan Li
2025-01-18 23:47:19 +08:00
parent 106b36b498
commit 3523a65ff8
5 changed files with 26 additions and 4 deletions

View File

@@ -71,6 +71,8 @@ void DpsWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode("decimation", NextAction::array(0, new NextAction("soul fire", 16.0f), NULL)));
triggers.push_back(new TriggerNode("life tap glyph buff", NextAction::array(0, new NextAction("life tap", 28.0f), NULL)));
triggers.push_back(
new TriggerNode("metamorphosis", NextAction::array(0, new NextAction("metamorphosis", 20.0f), NULL)));
}
@@ -78,9 +80,9 @@ void DpsWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
void DpsAoeWarlockStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(
new TriggerNode("medium aoe", NextAction::array(0, new NextAction("seed of corruption", 39.0f),
new NextAction("seed of corruption on attacker", 38.0f),
new NextAction("rain of fire", 37.0f), nullptr)));
new TriggerNode("medium aoe", NextAction::array(0, new NextAction("seed of corruption", 33.0f),
new NextAction("seed of corruption on attacker", 32.0f),
new NextAction("rain of fire", 31.0f), nullptr)));
triggers.push_back(new TriggerNode("corruption on attacker",
NextAction::array(0, new NextAction("corruption on attacker", 27.0f), nullptr)));
triggers.push_back(

View File

@@ -18,7 +18,7 @@ Value<Unit*>* CastFearOnCcAction::GetTargetValue() { return context->GetValue<Un
bool CastFearOnCcAction::Execute(Event event) { return botAI->CastSpell("fear", GetTarget()); }
bool CastFearOnCcAction::isPossible() { return botAI->CanCastSpell("fear", GetTarget()); }
bool CastFearOnCcAction::isPossible() { return true; }
bool CastFearOnCcAction::isUseful() { return true; }

View File

@@ -6,6 +6,7 @@
#include "WarlockAiObjectContext.h"
#include "DpsWarlockStrategy.h"
#include "GenericTriggers.h"
#include "GenericWarlockNonCombatStrategy.h"
#include "NamedObjectContext.h"
#include "Playerbots.h"
@@ -98,6 +99,7 @@ public:
creators["unstable affliction on attacker"] = &WarlockTriggerFactoryInternal::unstable_affliction_on_attacker;
creators["haunt"] = &WarlockTriggerFactoryInternal::haunt;
creators["decimation"] = &WarlockTriggerFactoryInternal::decimation;
creators["life tap glyph buff"] = &WarlockTriggerFactoryInternal::life_tap_glyph_buff;
creators["molten core"] = &WarlockTriggerFactoryInternal::molten_core;
creators["metamorphosis"] = &WarlockTriggerFactoryInternal::metamorphosis;
}
@@ -131,6 +133,7 @@ private:
}
static Trigger* haunt(PlayerbotAI* ai) { return new HauntTrigger(ai); }
static Trigger* decimation(PlayerbotAI* ai) { return new DecimationTrigger(ai); }
static Trigger* life_tap_glyph_buff(PlayerbotAI* ai) { return new LifeTapGlyphBuffTrigger(ai); }
static Trigger* molten_core(PlayerbotAI* ai) { return new MoltenCoreTrigger(ai); }
static Trigger* metamorphosis(PlayerbotAI* ai) { return new MetamorphosisTrigger(ai); }
};

View File

@@ -5,6 +5,7 @@
#include "WarlockTriggers.h"
#include "GenericTriggers.h"
#include "Playerbots.h"
bool DemonArmorTrigger::IsActive()
@@ -44,4 +45,13 @@ bool DecimationTrigger::IsActive()
{
Aura* aura = botAI->GetAura(getName(), GetTarget(), false, true);
return aura && aura->GetDuration() > 3000;
}
bool LifeTapGlyphBuffTrigger::IsActive()
{
// Check life tap glyph first
if (!botAI->HasAura(63320, bot))
return false;
return BuffTrigger::IsActive();
}

View File

@@ -163,6 +163,13 @@ public:
bool IsActive() override;
};
class LifeTapGlyphBuffTrigger : public BuffTrigger
{
public:
LifeTapGlyphBuffTrigger(PlayerbotAI* ai) : BuffTrigger(ai, "life tap") {}
bool IsActive() override;
};
class MoltenCoreTrigger : public HasAuraTrigger
{
public: