mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Cat druid energy control
This commit is contained in:
@@ -122,8 +122,7 @@ CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrateg
|
|||||||
|
|
||||||
NextAction** CatDpsDruidStrategy::getDefaultActions()
|
NextAction** CatDpsDruidStrategy::getDefaultActions()
|
||||||
{
|
{
|
||||||
return NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f),
|
return NextAction::array(0, new NextAction("tiger's fury", ACTION_DEFAULT + 0.1f), nullptr);
|
||||||
new NextAction("tiger's fury", ACTION_DEFAULT + 0.1f), nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CatDpsDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
void CatDpsDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||||
@@ -131,9 +130,17 @@ void CatDpsDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
FeralDruidStrategy::InitTriggers(triggers);
|
FeralDruidStrategy::InitTriggers(triggers);
|
||||||
|
|
||||||
// Default priority
|
// Default priority
|
||||||
triggers.push_back(new TriggerNode("high energy available",
|
triggers.push_back(new TriggerNode("almost full energy available",
|
||||||
|
NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("combo points not full",
|
||||||
|
NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("almost full energy available",
|
||||||
NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr)));
|
NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("high energy available",
|
triggers.push_back(new TriggerNode("combo points not full and high energy",
|
||||||
|
NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("almost full energy available",
|
||||||
|
NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.2f), nullptr)));
|
||||||
|
triggers.push_back(new TriggerNode("combo points not full and high energy",
|
||||||
NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.2f), nullptr)));
|
NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.2f), nullptr)));
|
||||||
triggers.push_back(
|
triggers.push_back(
|
||||||
new TriggerNode("faerie fire (feral)",
|
new TriggerNode("faerie fire (feral)",
|
||||||
|
|||||||
@@ -250,12 +250,12 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
Aura* roar = botAI->GetAura("savage roar", bot);
|
Aura* roar = botAI->GetAura("savage roar", bot);
|
||||||
bool roarCheck = !roar || roar->GetDuration() > 8000;
|
bool roarCheck = !roar || roar->GetDuration() > 10000;
|
||||||
if (!roarCheck)
|
if (!roarCheck)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Aura* rip = botAI->GetAura("rip", target, true);
|
Aura* rip = botAI->GetAura("rip", target, true);
|
||||||
bool ripCheck = !rip || rip->GetDuration() > 8000;
|
bool ripCheck = !rip || rip->GetDuration() > 10000;
|
||||||
if (!ripCheck)
|
if (!ripCheck)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ bool EnergyAvailable::IsActive() { return AI_VALUE2(uint8, "energy", "self targe
|
|||||||
|
|
||||||
bool ComboPointsAvailableTrigger::IsActive() { return AI_VALUE2(uint8, "combo", "current target") >= amount; }
|
bool ComboPointsAvailableTrigger::IsActive() { return AI_VALUE2(uint8, "combo", "current target") >= amount; }
|
||||||
|
|
||||||
|
bool ComboPointsNotFullTrigger::IsActive() { return AI_VALUE2(uint8, "combo", "current target") < amount; }
|
||||||
|
|
||||||
bool TargetWithComboPointsLowerHealTrigger::IsActive()
|
bool TargetWithComboPointsLowerHealTrigger::IsActive()
|
||||||
{
|
{
|
||||||
Unit* target = AI_VALUE(Unit*, "current target");
|
Unit* target = AI_VALUE(Unit*, "current target");
|
||||||
|
|||||||
@@ -126,6 +126,17 @@ private:
|
|||||||
float lifeTime;
|
float lifeTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ComboPointsNotFullTrigger : public StatAvailable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ComboPointsNotFullTrigger(PlayerbotAI* botAI, int32 amount = 5, std::string const name = "combo points not full")
|
||||||
|
: StatAvailable(botAI, amount, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsActive() override;
|
||||||
|
};
|
||||||
|
|
||||||
class LoseAggroTrigger : public Trigger
|
class LoseAggroTrigger : public Trigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public:
|
|||||||
creators["light energy available"] = &TriggerContext::LightEnergyAvailable;
|
creators["light energy available"] = &TriggerContext::LightEnergyAvailable;
|
||||||
creators["medium energy available"] = &TriggerContext::MediumEnergyAvailable;
|
creators["medium energy available"] = &TriggerContext::MediumEnergyAvailable;
|
||||||
creators["high energy available"] = &TriggerContext::HighEnergyAvailable;
|
creators["high energy available"] = &TriggerContext::HighEnergyAvailable;
|
||||||
|
creators["almost full energy available"] = &TriggerContext::AlmostFullEnergyAvailable;
|
||||||
|
|
||||||
creators["loot available"] = &TriggerContext::LootAvailable;
|
creators["loot available"] = &TriggerContext::LootAvailable;
|
||||||
creators["no attackers"] = &TriggerContext::NoAttackers;
|
creators["no attackers"] = &TriggerContext::NoAttackers;
|
||||||
@@ -97,6 +98,8 @@ public:
|
|||||||
creators["combo points available"] = &TriggerContext::ComboPointsAvailable;
|
creators["combo points available"] = &TriggerContext::ComboPointsAvailable;
|
||||||
creators["combo points 3 available"] = &TriggerContext::ComboPoints3Available;
|
creators["combo points 3 available"] = &TriggerContext::ComboPoints3Available;
|
||||||
creators["target with combo points almost dead"] = &TriggerContext::target_with_combo_points_almost_dead;
|
creators["target with combo points almost dead"] = &TriggerContext::target_with_combo_points_almost_dead;
|
||||||
|
creators["combo points not full"] = &TriggerContext::ComboPointsNotFull;
|
||||||
|
creators["combo points not full and high energy"] = &TriggerContext::ComboPointsNotFullAndHighEnergy;
|
||||||
|
|
||||||
creators["medium threat"] = &TriggerContext::MediumThreat;
|
creators["medium threat"] = &TriggerContext::MediumThreat;
|
||||||
|
|
||||||
@@ -280,6 +283,7 @@ private:
|
|||||||
static Trigger* LightEnergyAvailable(PlayerbotAI* botAI) { return new LightEnergyAvailableTrigger(botAI); }
|
static Trigger* LightEnergyAvailable(PlayerbotAI* botAI) { return new LightEnergyAvailableTrigger(botAI); }
|
||||||
static Trigger* MediumEnergyAvailable(PlayerbotAI* botAI) { return new MediumEnergyAvailableTrigger(botAI); }
|
static Trigger* MediumEnergyAvailable(PlayerbotAI* botAI) { return new MediumEnergyAvailableTrigger(botAI); }
|
||||||
static Trigger* HighEnergyAvailable(PlayerbotAI* botAI) { return new HighEnergyAvailableTrigger(botAI); }
|
static Trigger* HighEnergyAvailable(PlayerbotAI* botAI) { return new HighEnergyAvailableTrigger(botAI); }
|
||||||
|
static Trigger* AlmostFullEnergyAvailable(PlayerbotAI* botAI) { return new EnergyAvailable(botAI, 90); }
|
||||||
static Trigger* LootAvailable(PlayerbotAI* botAI) { return new LootAvailableTrigger(botAI); }
|
static Trigger* LootAvailable(PlayerbotAI* botAI) { return new LootAvailableTrigger(botAI); }
|
||||||
static Trigger* NoAttackers(PlayerbotAI* botAI) { return new NoAttackersTrigger(botAI); }
|
static Trigger* NoAttackers(PlayerbotAI* botAI) { return new NoAttackersTrigger(botAI); }
|
||||||
static Trigger* TankAssist(PlayerbotAI* botAI) { return new TankAssistTrigger(botAI); }
|
static Trigger* TankAssist(PlayerbotAI* botAI) { return new TankAssistTrigger(botAI); }
|
||||||
@@ -314,6 +318,8 @@ private:
|
|||||||
{
|
{
|
||||||
return new TargetWithComboPointsLowerHealTrigger(ai, 3, 3.0f);
|
return new TargetWithComboPointsLowerHealTrigger(ai, 3, 3.0f);
|
||||||
}
|
}
|
||||||
|
static Trigger* ComboPointsNotFull(PlayerbotAI* botAI) { return new ComboPointsNotFullTrigger(botAI); }
|
||||||
|
static Trigger* ComboPointsNotFullAndHighEnergy(PlayerbotAI* botAI) { return new TwoTriggers(botAI, "combo points not full", "high energy available"); }
|
||||||
static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); }
|
static Trigger* MediumThreat(PlayerbotAI* botAI) { return new MediumThreatTrigger(botAI); }
|
||||||
static Trigger* Dead(PlayerbotAI* botAI) { return new DeadTrigger(botAI); }
|
static Trigger* Dead(PlayerbotAI* botAI) { return new DeadTrigger(botAI); }
|
||||||
static Trigger* corpse_near(PlayerbotAI* botAI) { return new CorpseNearTrigger(botAI); }
|
static Trigger* corpse_near(PlayerbotAI* botAI) { return new CorpseNearTrigger(botAI); }
|
||||||
|
|||||||
Reference in New Issue
Block a user