mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Unholy dk
This commit is contained in:
@@ -162,8 +162,14 @@ bool CastMeleeDebuffSpellAction::isUseful()
|
||||
|
||||
bool CastAuraSpellAction::isUseful()
|
||||
{
|
||||
return GetTarget() && (GetTarget() != nullptr) && CastSpellAction::isUseful() &&
|
||||
!botAI->HasAura(spell, GetTarget(), false, isOwner);
|
||||
if (!GetTarget() || !CastSpellAction::isUseful())
|
||||
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)
|
||||
@@ -251,8 +257,8 @@ Value<Unit*>* CastDebuffSpellOnMeleeAttackerAction::GetTargetValue()
|
||||
return context->GetValue<Unit*>("melee attacker without aura", spell);
|
||||
}
|
||||
|
||||
CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner)
|
||||
: CastAuraSpellAction(botAI, spell, checkIsOwner)
|
||||
CastBuffSpellAction::CastBuffSpellAction(PlayerbotAI* botAI, std::string const spell, bool checkIsOwner, uint32 beforeDuration)
|
||||
: CastAuraSpellAction(botAI, spell, checkIsOwner, false, beforeDuration)
|
||||
{
|
||||
range = botAI->GetRange("spell");
|
||||
}
|
||||
|
||||
@@ -37,16 +37,20 @@ protected:
|
||||
class CastAuraSpellAction : public CastSpellAction
|
||||
{
|
||||
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)
|
||||
{
|
||||
this->isOwner = isOwner;
|
||||
this->beforeDuration = beforeDuration;
|
||||
this->checkDuration = checkDuration;
|
||||
}
|
||||
|
||||
bool isUseful() override;
|
||||
|
||||
protected:
|
||||
bool isOwner;
|
||||
bool checkDuration;
|
||||
uint32 beforeDuration;
|
||||
};
|
||||
|
||||
class CastMeleeSpellAction : public CastSpellAction
|
||||
@@ -107,7 +111,7 @@ public:
|
||||
class CastBuffSpellAction : public CastAuraSpellAction
|
||||
{
|
||||
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"; }
|
||||
};
|
||||
|
||||
@@ -104,5 +104,8 @@ void BloodDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
new NextAction("death strike", ACTION_HIGH + 3), nullptr)));
|
||||
triggers.push_back(
|
||||
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)));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
class CastGhoulFrenzyAction : public CastBuffSpellAction
|
||||
{
|
||||
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"; }
|
||||
};
|
||||
|
||||
@@ -242,7 +242,7 @@ class CastDeathAndDecayAction : public CastSpellAction
|
||||
{
|
||||
public:
|
||||
CastDeathAndDecayAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "death and decay") {}
|
||||
ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
|
||||
// ActionThreatType getThreatType() override { return ActionThreatType::Aoe; }
|
||||
};
|
||||
|
||||
class CastHornOfWinterAction : public CastSpellAction
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "DKTriggers.h"
|
||||
#include "FrostDKStrategy.h"
|
||||
#include "GenericDKNonCombatStrategy.h"
|
||||
#include "GenericTriggers.h"
|
||||
#include "Playerbots.h"
|
||||
#include "PullStrategy.h"
|
||||
#include "UnholyDKStrategy.h"
|
||||
@@ -73,10 +74,14 @@ public:
|
||||
creators["plague strike"] = &DeathKnightTriggerFactoryInternal::plague_strike;
|
||||
creators["plague strike on attacker"] = &DeathKnightTriggerFactoryInternal::plague_strike_on_attacker;
|
||||
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["icy touch on attacker"] = &DeathKnightTriggerFactoryInternal::icy_touch_on_attacker;
|
||||
creators["improved icy talons"] = &DeathKnightTriggerFactoryInternal::improved_icy_talons;
|
||||
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["mind freeze"] = &DeathKnightTriggerFactoryInternal::mind_freeze;
|
||||
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["freezing fog"] = &DeathKnightTriggerFactoryInternal::freezing_fog;
|
||||
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["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* blood_strike(PlayerbotAI* botAI) { return new BloodStrikeTrigger(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)
|
||||
{
|
||||
return new PlagueStrikeDebuffOnAttackerTrigger(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* icy_touch_on_attacker(PlayerbotAI* botAI) { return new IcyTouchDebuffOnAttackerTrigger(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* freezing_fog(PlayerbotAI* botAI) { return new FreezingFogTrigger(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* army_of_the_dead(PlayerbotAI* botAI) { return new ArmyOfTheDeadTrigger(botAI); }
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ bool HighUnholyRuneTrigger::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()
|
||||
@@ -62,5 +62,5 @@ bool DeathAndDecayCooldownTrigger::IsActive()
|
||||
if (!spellId)
|
||||
return true;
|
||||
|
||||
return bot->GetSpellCooldownDelay(spellId) >= 2000;
|
||||
return bot->GetSpellCooldownDelay(spellId) >= 3000;
|
||||
}
|
||||
@@ -17,14 +17,26 @@ BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons");
|
||||
class PlagueStrikeDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
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");
|
||||
class IcyTouchDebuffTrigger : public DebuffTrigger
|
||||
{
|
||||
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");
|
||||
@@ -162,7 +174,7 @@ public:
|
||||
class DesolationTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation") {}
|
||||
DesolationTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "desolation", 1, false, true, 10000) {}
|
||||
bool IsActive() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -109,7 +109,10 @@ void FrostDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(new TriggerNode(
|
||||
"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
|
||||
// weapon", ACTION_NORMAL + 4), nullptr)));
|
||||
}
|
||||
|
||||
@@ -184,24 +184,6 @@ void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||
triggers.push_back(
|
||||
new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5),
|
||||
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(
|
||||
new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_HIGH + 9),
|
||||
new NextAction("pestilence", ACTION_NORMAL + 4),
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI)
|
||||
{
|
||||
return new ActionNode("ghoul frenzy",
|
||||
/*P*/ nullptr,
|
||||
/*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr),
|
||||
/*A*/ nullptr,
|
||||
/*C*/ nullptr);
|
||||
}
|
||||
@@ -78,11 +78,11 @@ UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI
|
||||
NextAction** UnholyDKStrategy::getDefaultActions()
|
||||
{
|
||||
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("empower rune weapon", ACTION_DEFAULT + 0.3f),
|
||||
new NextAction("death coil", ACTION_DEFAULT + 0.2f),
|
||||
new NextAction("horn of winter", ACTION_DEFAULT + 0.1f),
|
||||
new NextAction("horn of winter", ACTION_DEFAULT + 0.2f),
|
||||
new NextAction("death coil", ACTION_DEFAULT + 0.1f),
|
||||
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("blood boil", ACTION_DEFAULT + 0.7f),
|
||||
new NextAction("icy touch", ACTION_DEFAULT + 0.6f),
|
||||
new NextAction("plague strike", ACTION_DEFAULT + 0.5f),
|
||||
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(
|
||||
"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(
|
||||
"high unholy rune", NextAction::array(0,
|
||||
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f),
|
||||
new NextAction("plague strike", ACTION_DEFAULT + 0.5f), nullptr)));
|
||||
"high frost rune", NextAction::array(0,
|
||||
new NextAction("icy touch", ACTION_NORMAL + 3), nullptr)));
|
||||
|
||||
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(
|
||||
"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(
|
||||
new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_HIGH + 1), nullptr)));
|
||||
}
|
||||
|
||||
@@ -152,7 +152,16 @@ bool OutNumberedTrigger::IsActive()
|
||||
bool BuffTrigger::IsActive()
|
||||
{
|
||||
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()
|
||||
|
||||
@@ -308,10 +308,12 @@ public:
|
||||
class BuffTrigger : public SpellTrigger
|
||||
{
|
||||
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)
|
||||
{
|
||||
this->checkIsOwner = checkIsOwner;
|
||||
this->checkDuration = checkDuration;
|
||||
this->beforeDuration = beforeDuration;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -320,6 +322,8 @@ public:
|
||||
|
||||
protected:
|
||||
bool checkIsOwner;
|
||||
bool checkDuration;
|
||||
uint32 beforeDuration;
|
||||
};
|
||||
|
||||
class BuffOnPartyTrigger : public BuffTrigger
|
||||
@@ -379,8 +383,8 @@ class DebuffTrigger : public BuffTrigger
|
||||
{
|
||||
public:
|
||||
DebuffTrigger(PlayerbotAI* botAI, std::string const spell, int32 checkInterval = 1, bool checkIsOwner = false,
|
||||
float needLifeTime = 8.0f)
|
||||
: BuffTrigger(botAI, spell, checkInterval, checkIsOwner), needLifeTime(needLifeTime)
|
||||
float needLifeTime = 8.0f, uint32 beforeDuration = 0)
|
||||
: BuffTrigger(botAI, spell, checkInterval, checkIsOwner, false, beforeDuration), needLifeTime(needLifeTime)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user