Unholy dk

This commit is contained in:
Yunfan Li
2024-09-06 20:29:56 +08:00
parent 593b30bbb0
commit f20d3aea6c
13 changed files with 98 additions and 50 deletions

View File

@@ -910,8 +910,8 @@ AiPlayerbot.PremadeSpecLink.6.1.60 = -32003350332203012300023101351
AiPlayerbot.PremadeSpecLink.6.1.80 = -32002350352203012300033101351-230200305003 AiPlayerbot.PremadeSpecLink.6.1.80 = -32002350352203012300033101351-230200305003
AiPlayerbot.PremadeSpecName.6.2 = unholy pve AiPlayerbot.PremadeSpecName.6.2 = unholy pve
AiPlayerbot.PremadeSpecGlyph.6.2 = 43542,43673,45804,43544,43672,43549 AiPlayerbot.PremadeSpecGlyph.6.2 = 43542,43673,45804,43544,43672,43549
AiPlayerbot.PremadeSpecLink.6.2.60 = --2301303050032151000150013113151 AiPlayerbot.PremadeSpecLink.6.2.60 = --2301303050032151000150013132051
AiPlayerbot.PremadeSpecLink.6.2.80 = -320033500002-2301303050032151000150013133151 AiPlayerbot.PremadeSpecLink.6.2.80 = -320043500002-2301303050032151000150013133051
AiPlayerbot.PremadeSpecName.6.3 = double aura blood pve AiPlayerbot.PremadeSpecName.6.3 = double aura blood pve
AiPlayerbot.PremadeSpecGlyph.6.3 = 45805,43673,43827,43544,43672,43554 AiPlayerbot.PremadeSpecGlyph.6.3 = 45805,43673,43827,43544,43672,43554
AiPlayerbot.PremadeSpecLink.6.3.60 = 005512153330030320102013-305 AiPlayerbot.PremadeSpecLink.6.3.60 = 005512153330030320102013-305

View File

@@ -162,8 +162,14 @@ bool CastMeleeDebuffSpellAction::isUseful()
bool CastAuraSpellAction::isUseful() bool CastAuraSpellAction::isUseful()
{ {
return GetTarget() && (GetTarget() != nullptr) && CastSpellAction::isUseful() && if (!GetTarget() || !CastSpellAction::isUseful())
!botAI->HasAura(spell, GetTarget(), false, isOwner); return false;
Aura* aura = botAI->GetAura(spell, GetTarget(), isOwner, checkDuration);
if (!aura)
return true;
if (beforeDuration && aura->GetDuration() < beforeDuration)
return true;
return false;
} }
CastEnchantItemAction::CastEnchantItemAction(PlayerbotAI* botAI, std::string const spell) CastEnchantItemAction::CastEnchantItemAction(PlayerbotAI* botAI, std::string const spell)
@@ -251,8 +257,8 @@ Value<Unit*>* CastDebuffSpellOnMeleeAttackerAction::GetTargetValue()
return context->GetValue<Unit*>("melee attacker without aura", spell); return context->GetValue<Unit*>("melee attacker without aura", spell);
} }
CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner) CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner, uint32 beforeDuration)
: CastAuraSpellAction(botAI, spell, checkIsOwner) : CastAuraSpellAction(botAI, spell, checkIsOwner, false, beforeDuration)
{ {
range = botAI->GetRange("spell"); range = botAI->GetRange("spell");
} }

View File

@@ -37,16 +37,20 @@ protected:
class CastAuraSpellAction : public CastSpellAction class CastAuraSpellAction : public CastSpellAction
{ {
public: public:
CastAuraSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false) CastAuraSpellAction(PlayerbotAI* botAI, std::string const spell, bool isOwner = false, bool checkDuration = false, uint32 beforeDuration = 0)
: CastSpellAction(botAI, spell) : CastSpellAction(botAI, spell)
{ {
this->isOwner = isOwner; this->isOwner = isOwner;
this->beforeDuration = beforeDuration;
this->checkDuration = checkDuration;
} }
bool isUseful() override; bool isUseful() override;
protected: protected:
bool isOwner; bool isOwner;
bool checkDuration;
uint32 beforeDuration;
}; };
class CastMeleeSpellAction : public CastSpellAction class CastMeleeSpellAction : public CastSpellAction
@@ -107,7 +111,7 @@ public:
class CastBuffSpellAction : public CastAuraSpellAction class CastBuffSpellAction : public CastAuraSpellAction
{ {
public: public:
CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner = false); CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner = false, uint32 beforeDuration = 0);
std::string const GetTargetName() override { return "self target"; } std::string const GetTargetName() override { return "self target"; }
}; };

View File

@@ -104,5 +104,8 @@ void BloodDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
new NextAction("death strike", ACTION_HIGH + 3), nullptr))); new NextAction("death strike", ACTION_HIGH + 3), nullptr)));
triggers.push_back( triggers.push_back(
new TriggerNode("critical health", NextAction::array(0, new NextAction("vampiric blood", ACTION_HIGH + 5), nullptr))); new TriggerNode("critical health", NextAction::array(0, new NextAction("vampiric blood", ACTION_HIGH + 5), nullptr)));
triggers.push_back(
new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode(
"plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr)));
} }

View File

@@ -165,7 +165,7 @@ public:
class CastGhoulFrenzyAction : public CastBuffSpellAction class CastGhoulFrenzyAction : public CastBuffSpellAction
{ {
public: public:
CastGhoulFrenzyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "ghoul frenzy") {} CastGhoulFrenzyAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "ghoul frenzy", false, 5000) {}
std::string const GetTargetName() override { return "pet target"; } std::string const GetTargetName() override { return "pet target"; }
}; };
@@ -242,7 +242,7 @@ class CastDeathAndDecayAction : public CastSpellAction
{ {
public: public:
CastDeathAndDecayAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death and decay") {} CastDeathAndDecayAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death and decay") {}
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } // ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
}; };
class CastHornOfWinterAction : public CastSpellAction class CastHornOfWinterAction : public CastSpellAction

View File

@@ -10,6 +10,7 @@
#include "DKTriggers.h" #include "DKTriggers.h"
#include "FrostDKStrategy.h" #include "FrostDKStrategy.h"
#include "GenericDKNonCombatStrategy.h" #include "GenericDKNonCombatStrategy.h"
#include "GenericTriggers.h"
#include "Playerbots.h" #include "Playerbots.h"
#include "PullStrategy.h" #include "PullStrategy.h"
#include "UnholyDKStrategy.h" #include "UnholyDKStrategy.h"
@@ -73,10 +74,14 @@ public:
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike; creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker; creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker;
creators["icy touch"] = &DeathKnightTriggerFactoryInternal::icy_touch; creators["icy touch"] = &DeathKnightTriggerFactoryInternal::icy_touch;
creators["icy touch 8s"] = &DeathKnightTriggerFactoryInternal::icy_touch_8s;
creators["dd cd and icy touch 8s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_icy_touch_8s;
creators["death coil"] = &DeathKnightTriggerFactoryInternal::death_coil; creators["death coil"] = &DeathKnightTriggerFactoryInternal::death_coil;
creators["icy touch on attacker"] = &DeathKnightTriggerFactoryInternal::icy_touch_on_attacker; creators["icy touch on attacker"] = &DeathKnightTriggerFactoryInternal::icy_touch_on_attacker;
creators["improved icy talons"] = &DeathKnightTriggerFactoryInternal::improved_icy_talons; creators["improved icy talons"] = &DeathKnightTriggerFactoryInternal::improved_icy_talons;
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike; creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
creators["plague strike 8s"] = &DeathKnightTriggerFactoryInternal::plague_strike_8s;
creators["dd cd and plague strike 8s"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_plague_strike_8s;
creators["horn of winter"] = &DeathKnightTriggerFactoryInternal::horn_of_winter; creators["horn of winter"] = &DeathKnightTriggerFactoryInternal::horn_of_winter;
creators["mind freeze"] = &DeathKnightTriggerFactoryInternal::mind_freeze; creators["mind freeze"] = &DeathKnightTriggerFactoryInternal::mind_freeze;
creators["mind freeze on enemy healer"] = &DeathKnightTriggerFactoryInternal::mind_freeze_on_enemy_healer; creators["mind freeze on enemy healer"] = &DeathKnightTriggerFactoryInternal::mind_freeze_on_enemy_healer;
@@ -91,6 +96,7 @@ public:
creators["high unholy rune"] = &DeathKnightTriggerFactoryInternal::high_unholy_rune; creators["high unholy rune"] = &DeathKnightTriggerFactoryInternal::high_unholy_rune;
creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog; creators["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog;
creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation; creators["no desolation"] = &DeathKnightTriggerFactoryInternal::no_desolation;
creators["dd cd and no desolation"] = &DeathKnightTriggerFactoryInternal::dd_cd_and_no_desolation;
creators["death and decay cooldown"] = &DeathKnightTriggerFactoryInternal::death_and_decay_cooldown; creators["death and decay cooldown"] = &DeathKnightTriggerFactoryInternal::death_and_decay_cooldown;
creators["army of the dead"] = &DeathKnightTriggerFactoryInternal::army_of_the_dead; creators["army of the dead"] = &DeathKnightTriggerFactoryInternal::army_of_the_dead;
} }
@@ -100,11 +106,15 @@ private:
static Trigger* pestilence_glyph(PlayerbotAI* botAI) { return new PestilenceGlyphTrigger(botAI); } static Trigger* pestilence_glyph(PlayerbotAI* botAI) { return new PestilenceGlyphTrigger(botAI); }
static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); } static Trigger* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(botAI); }
static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); } static Trigger* plague_strike(PlayerbotAI* botAI) { return new PlagueStrikeDebuffTrigger(botAI); }
static Trigger* plague_strike_8s(PlayerbotAI* botAI) { return new PlagueStrike8sDebuffTrigger(botAI); }
static Trigger* dd_cd_and_plague_strike_8s(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "plague strike 8s"); }
static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI) static Trigger* plague_strike_on_attacker(PlayerbotAI* botAI)
{ {
return new PlagueStrikeDebuffOnAttackerTrigger(botAI); return new PlagueStrikeDebuffOnAttackerTrigger(botAI);
} }
static Trigger* icy_touch(PlayerbotAI* botAI) { return new IcyTouchDebuffTrigger(botAI); } static Trigger* icy_touch(PlayerbotAI* botAI) { return new IcyTouchDebuffTrigger(botAI); }
static Trigger* icy_touch_8s(PlayerbotAI* botAI) { return new IcyTouch8sDebuffTrigger(botAI); }
static Trigger* dd_cd_and_icy_touch_8s(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "icy touch 8s"); }
static Trigger* death_coil(PlayerbotAI* botAI) { return new DeathCoilTrigger(botAI); } static Trigger* death_coil(PlayerbotAI* botAI) { return new DeathCoilTrigger(botAI); }
static Trigger* icy_touch_on_attacker(PlayerbotAI* botAI) { return new IcyTouchDebuffOnAttackerTrigger(botAI); } static Trigger* icy_touch_on_attacker(PlayerbotAI* botAI) { return new IcyTouchDebuffOnAttackerTrigger(botAI); }
static Trigger* improved_icy_talons(PlayerbotAI* botAI) { return new ImprovedIcyTalonsTrigger(botAI); } static Trigger* improved_icy_talons(PlayerbotAI* botAI) { return new ImprovedIcyTalonsTrigger(botAI); }
@@ -128,6 +138,7 @@ private:
static Trigger* high_unholy_rune(PlayerbotAI* botAI) { return new HighUnholyRuneTrigger(botAI); } static Trigger* high_unholy_rune(PlayerbotAI* botAI) { return new HighUnholyRuneTrigger(botAI); }
static Trigger* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(botAI); } static Trigger* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(botAI); }
static Trigger* no_desolation(PlayerbotAI* botAI) { return new DesolationTrigger(botAI); } static Trigger* no_desolation(PlayerbotAI* botAI) { return new DesolationTrigger(botAI); }
static Trigger* dd_cd_and_no_desolation(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "death and decay cooldown", "no desolation"); }
static Trigger* death_and_decay_cooldown(PlayerbotAI* botAI) { return new DeathAndDecayCooldownTrigger(botAI); } static Trigger* death_and_decay_cooldown(PlayerbotAI* botAI) { return new DeathAndDecayCooldownTrigger(botAI); }
static Trigger* army_of_the_dead(PlayerbotAI* botAI) { return new ArmyOfTheDeadTrigger(botAI); } static Trigger* army_of_the_dead(PlayerbotAI* botAI) { return new ArmyOfTheDeadTrigger(botAI); }
}; };

View File

@@ -53,7 +53,7 @@ bool HighUnholyRuneTrigger::IsActive()
} }
bool DesolationTrigger::IsActive() bool DesolationTrigger::IsActive()
{ {
return bot->HasAura(66817) && !botAI->HasAura("desolation", GetTarget(), false, true, -1, true); return bot->HasAura(66817) && BuffTrigger::IsActive();
} }
bool DeathAndDecayCooldownTrigger::IsActive() bool DeathAndDecayCooldownTrigger::IsActive()
@@ -62,5 +62,5 @@ bool DeathAndDecayCooldownTrigger::IsActive()
if (!spellId) if (!spellId)
return true; return true;
return bot->GetSpellCooldownDelay(spellId) >= 2000; return bot->GetSpellCooldownDelay(spellId) >= 3000;
} }

View File

@@ -17,14 +17,26 @@ BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons");
class PlagueStrikeDebuffTrigger : public DebuffTrigger class PlagueStrikeDebuffTrigger : public DebuffTrigger
{ {
public: public:
PlagueStrikeDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", true, .0f) {} PlagueStrikeDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f) {}
};
class PlagueStrike8sDebuffTrigger : public DebuffTrigger
{
public:
PlagueStrike8sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "blood plague", 1, true, .0f, 3000) {}
}; };
// DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever"); // DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever");
class IcyTouchDebuffTrigger : public DebuffTrigger class IcyTouchDebuffTrigger : public DebuffTrigger
{ {
public: public:
IcyTouchDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", true, .0f) {} IcyTouchDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f) {}
};
class IcyTouch8sDebuffTrigger : public DebuffTrigger
{
public:
IcyTouch8sDebuffTrigger(PlayerbotAI* botAI) : DebuffTrigger(botAI, "frost fever", 1, true, .0f, 3000) {}
}; };
BUFF_TRIGGER(UnbreakableArmorTrigger, "unbreakable armor"); BUFF_TRIGGER(UnbreakableArmorTrigger, "unbreakable armor");
@@ -162,7 +174,7 @@ public:
class DesolationTrigger : public BuffTrigger class DesolationTrigger : public BuffTrigger
{ {
public: public:
DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation") {} DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation", 1, false, true, 10000) {}
bool IsActive() override; bool IsActive() override;
}; };

View File

@@ -109,7 +109,10 @@ void FrostDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr)));
triggers.push_back(
new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode(
"plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr)));
// triggers.push_back(new TriggerNode("empower rune weapon", NextAction::array(0, new NextAction("empower rune // triggers.push_back(new TriggerNode("empower rune weapon", NextAction::array(0, new NextAction("empower rune
// weapon", ACTION_NORMAL + 4), nullptr))); // weapon", ACTION_NORMAL + 4), nullptr)));
} }

View File

@@ -184,24 +184,6 @@ void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back( triggers.push_back(
new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5), new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5),
new NextAction("rune tap", ACTION_HIGH + 4), nullptr))); new NextAction("rune tap", ACTION_HIGH + 4), nullptr)));
// triggers.push_back(new TriggerNode("medium health",
// NextAction::array(0, new NextAction("rune tap", ACTION_NORMAL + 4),
// new NextAction("death strike", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(
new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr)));
triggers.push_back(
new TriggerNode("icy touch on attacker",
NextAction::array(0, new NextAction("icy touch on attacker", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode(
"plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr)));
triggers.push_back(
new TriggerNode("plague strike on attacker",
NextAction::array(0, new NextAction("plague strike on attacker", ACTION_HIGH + 1), nullptr)));
// triggers.push_back(new TriggerNode("high aoe",
// NextAction::array(0,
// new NextAction("death and decay", ACTION_NORMAL + 5),
// new NextAction("pestilence", ACTION_NORMAL + 4),
// new NextAction("blood boil", ACTION_NORMAL + 3), nullptr)));
triggers.push_back( triggers.push_back(
new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_HIGH + 9), new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_HIGH + 9),
new NextAction("pestilence", ACTION_NORMAL + 4), new NextAction("pestilence", ACTION_NORMAL + 4),

View File

@@ -42,7 +42,7 @@ private:
static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI) static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI)
{ {
return new ActionNode("ghoul frenzy", return new ActionNode("ghoul frenzy",
/*P*/ nullptr, /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
/*A*/ nullptr, /*A*/ nullptr,
/*C*/ nullptr); /*C*/ nullptr);
} }
@@ -78,11 +78,11 @@ UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI
NextAction** UnholyDKStrategy::getDefaultActions() NextAction** UnholyDKStrategy::getDefaultActions()
{ {
return NextAction::array( return NextAction::array(
0, new NextAction("death and decay", ACTION_DEFAULT + 1.0f), 0, new NextAction("death and decay", ACTION_HIGH + 5),
new NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f), new NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f),
new NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f), new NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f),
new NextAction("death coil", ACTION_DEFAULT + 0.2f), new NextAction("horn of winter", ACTION_DEFAULT + 0.2f),
new NextAction("horn of winter", ACTION_DEFAULT + 0.1f), new NextAction("death coil", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT), nullptr); new NextAction("melee", ACTION_DEFAULT), nullptr);
} }
@@ -95,24 +95,38 @@ void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
new NextAction("scourge strike", ACTION_DEFAULT + 0.8f), new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("blood boil", ACTION_DEFAULT + 0.7f), new NextAction("blood boil", ACTION_DEFAULT + 0.7f),
new NextAction("icy touch", ACTION_DEFAULT + 0.6f), new NextAction("icy touch", ACTION_DEFAULT + 0.6f),
new NextAction("plague strike", ACTION_DEFAULT + 0.5f),
nullptr))); nullptr)));
triggers.push_back(new TriggerNode("dd cd and no desolation",
NextAction::array(0, new NextAction("blood strike", ACTION_DEFAULT + 0.75f), nullptr)));
triggers.push_back(
new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"high frost rune", NextAction::array(0, new NextAction("icy touch", ACTION_DEFAULT + 0.6f), nullptr))); "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"high unholy rune", NextAction::array(0, "high frost rune", NextAction::array(0,
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f), new NextAction("icy touch", ACTION_NORMAL + 3), nullptr)));
new NextAction("plague strike", ACTION_DEFAULT + 0.5f), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"high blood rune", NextAction::array(0, new NextAction("blood boil", ACTION_DEFAULT + 0.7f), nullptr))); "high unholy rune", NextAction::array(0,
new NextAction("plague strike", ACTION_NORMAL + 2), nullptr)));
triggers.push_back(new TriggerNode(
"high blood rune", NextAction::array(0, new NextAction("blood strike", ACTION_NORMAL + 1), nullptr)));
// triggers.push_back(
// new TriggerNode("dd cd and plague strike 8s", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr)));
// triggers.push_back(
// new TriggerNode("dd cd and icy touch 8s", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 1), nullptr)));
// triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction(, ACTION_NORMAL + 2), nullptr))); // triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction(, ACTION_NORMAL + 2), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr)));
triggers.push_back(new TriggerNode("no desolation",
NextAction::array(0, new NextAction("blood strike", ACTION_HIGH + 4), nullptr)));
triggers.push_back( triggers.push_back(
new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_HIGH + 1), nullptr))); new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_HIGH + 1), nullptr)));
} }

View File

@@ -152,7 +152,16 @@ bool OutNumberedTrigger::IsActive()
bool BuffTrigger::IsActive() bool BuffTrigger::IsActive()
{ {
Unit* target = GetTarget(); Unit* target = GetTarget();
return SpellTrigger::IsActive() && !botAI->HasAura(spell, target, false, checkIsOwner); if (!target)
return false;
if (!SpellTrigger::IsActive())
return false;
Aura* aura = botAI->GetAura(spell, target, checkIsOwner, checkDuration);
if (!aura)
return true;
if (beforeDuration && aura->GetDuration() < beforeDuration)
return true;
return false;
} }
Value<Unit*>* BuffOnPartyTrigger::GetTargetValue() Value<Unit*>* BuffOnPartyTrigger::GetTargetValue()

View File

@@ -308,10 +308,12 @@ public:
class BuffTrigger : public SpellTrigger class BuffTrigger : public SpellTrigger
{ {
public: public:
BuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false) BuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, bool checkDuration = false, uint32 beforeDuration = 0)
: SpellTrigger(botAI, spell, checkInterval) : SpellTrigger(botAI, spell, checkInterval)
{ {
this->checkIsOwner = checkIsOwner; this->checkIsOwner = checkIsOwner;
this->checkDuration = checkDuration;
this->beforeDuration = beforeDuration;
} }
public: public:
@@ -320,6 +322,8 @@ public:
protected: protected:
bool checkIsOwner; bool checkIsOwner;
bool checkDuration;
uint32 beforeDuration;
}; };
class BuffOnPartyTrigger : public BuffTrigger class BuffOnPartyTrigger : public BuffTrigger
@@ -379,8 +383,8 @@ class DebuffTrigger : public BuffTrigger
{ {
public: public:
DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false, DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false,
float needLifeTime = 8.0f) float needLifeTime = 8.0f, uint32 beforeDuration = 0)
: BuffTrigger(botAI, spell, checkInterval, checkIsOwner), needLifeTime(needLifeTime) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner, false, beforeDuration), needLifeTime(needLifeTime)
{ {
} }