Files
mod-playerbots/src/strategy/warrior/FuryWarriorStrategy.cpp
avirar 739a0df44c Warrior strategy update (#838)
* Enraged regen at critial health

* Enraged regen action context

* Enraged regen on critical health trigger

* Enraged regen on critical health trigger

* Added logic for Arms to use Retaliation

* Added logic for Arms to use Retaliation

* Used correct class enums for !players

* Retaliation on medium health

* Removed temp line

* Added check for attacker->GetVictim() != bot

* Adjusted triggers for emergency actions

* Added Shattering Throw logic

* Added Shattering Throw logic

* Added Shattering Throw logic

* Added Shattering Throw logic

* Added Shattering Throw logic

* Added Shattering Throw logic

* Fixed ActionNode for Shattering Throw

* Added debug logging

* More debug logs

* Better debug logs

* Adjusted range on action

* Adjusted priorities

* More logging

* Update WarriorActions.cpp

* Update WarriorActions.h

* Changed trigger name for differentiation

* Updated to new shattering throw trigger name

* Update WarriorTriggers.h with new ST name

* Update ArmsWarriorStrategy.cpp

* Changed priority

* Shattering Throw and Retaliation stance reqs

Battlestance needed for Shattering Throw and Retaliation

* Created isUseful for Shattering Throw

* Created isUseful for Shattering Throw

* GetTarget instead of GetTargetValue

* Changed to GetTarget instead of GetTargetValue

* Commented out Execute function

* Commented out Execute function

* isPossible was failing, created basic isPossible

IsImmuneToSpell was returning true for Shattering Throw

2 DAYS! :(

* isPossible was failing, created basic isPossible

* Added some more isPossible checks

* Update WarriorActions.cpp

* Missing )

* Missing !

* Removed logging

* Removed logging

* Clean up

* Cleanup

* Corrected logic for Rogue's Expose Armor trigger

Logic was checking the Rogue, not the Rogue's target, for Sunder Armor before casting Expose Armor.
2025-01-03 16:06:47 +01:00

100 lines
5.1 KiB
C++

/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "FuryWarriorStrategy.h"
#include "Playerbots.h"
class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory<ActionNode>
{
public:
FuryWarriorStrategyActionNodeFactory()
{
creators["charge"] = &charge;
creators["intercept"] = &intercept;
// creators["death wish"] = &death_wish;
creators["piercing howl"] = &piercing_howl;
// creators["bloodthirst"] = &bloodthirst;
creators["pummel"] = &pummel;
creators["enraged regeneration"] = &enraged_regeneration;
}
private:
ACTION_NODE_A(charge, "charge", "intercept");
ACTION_NODE_A(intercept, "intercept", "reach melee");
ACTION_NODE_A(piercing_howl, "piercing howl", "hamstring");
// ACTION_NODE_A(death_wish, "death wish", "berserker rage");
// ACTION_NODE_A(bloodthirst, "bloodthirst", "melee");
ACTION_NODE_A(pummel, "pummel", "intercept");
static ActionNode* enraged_regeneration(PlayerbotAI* botAI)
{
return new ActionNode("enraged regeneration",
/*P*/ nullptr,
/*A*/ nullptr,
/*C*/ nullptr);
}
};
FuryWarriorStrategy::FuryWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI)
{
actionNodeFactories.Add(new FuryWarriorStrategyActionNodeFactory());
}
NextAction** FuryWarriorStrategy::getDefaultActions()
{
return NextAction::array(
0, new NextAction("bloodthirst", ACTION_DEFAULT + 0.5f), new NextAction("whirlwind", ACTION_DEFAULT + 0.4f),
new NextAction("sunder armor", ACTION_DEFAULT + 0.3f), new NextAction("execute", ACTION_DEFAULT + 0.2f),
// new NextAction("overpower", ACTION_DEFAULT + 0.1f),
new NextAction("melee", ACTION_DEFAULT), NULL);
}
void FuryWarriorStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
GenericWarriorStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("enemy out of melee",
NextAction::array(0, new NextAction("charge", ACTION_MOVE + 9), nullptr)));
triggers.push_back(new TriggerNode(
"berserker stance", NextAction::array(0, new NextAction("berserker stance", ACTION_HIGH + 9), nullptr)));
triggers.push_back(new TriggerNode("battle shout",
NextAction::array(0, new NextAction("battle shout", ACTION_HIGH + 8), nullptr)));
// triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("execute",
// ACTION_HIGH + 4), nullptr))); triggers.push_back(new TriggerNode("sudden death", NextAction::array(0, new
// NextAction("execute", ACTION_HIGH + 4), nullptr))); triggers.push_back(new TriggerNode("hamstring",
// NextAction::array(0, new NextAction("piercing howl", ACTION_HIGH + 1), nullptr)));
triggers.push_back(
new TriggerNode("pummel on enemy healer",
NextAction::array(0, new NextAction("pummel on enemy healer", ACTION_INTERRUPT), nullptr)));
triggers.push_back(
new TriggerNode("pummel", NextAction::array(0, new NextAction("pummel", ACTION_INTERRUPT), nullptr)));
triggers.push_back(new TriggerNode(
"victory rush", NextAction::array(0, new NextAction("victory rush", ACTION_INTERRUPT), nullptr)));
// triggers.push_back(new TriggerNode("intercept on snare target", NextAction::array(0, new NextAction("intercept on
// snare target", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("bloodthirst", NextAction::array(0, new NextAction("bloodthirst", ACTION_HIGH + 7), nullptr)));
triggers.push_back(
new TriggerNode("whirlwind", NextAction::array(0, new NextAction("whirlwind", ACTION_HIGH + 6), nullptr)));
triggers.push_back(
new TriggerNode("instant slam", NextAction::array(0, new NextAction("slam", ACTION_HIGH + 5), nullptr)));
triggers.push_back(
new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr)));
triggers.push_back(new TriggerNode("medium rage available",
NextAction::array(0, new NextAction("heroic strike", ACTION_DEFAULT + 0.1f), NULL)));
// triggers.push_back(new TriggerNode("berserker rage", NextAction::array(0, new NextAction("berserker rage",
// ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0,
// new NextAction("whirlwind", ACTION_HIGH + 2),
// nullptr)));
triggers.push_back(
new TriggerNode("death wish", NextAction::array(0, new NextAction("death wish", ACTION_HIGH), nullptr)));
triggers.push_back(
new TriggerNode("recklessness", NextAction::array(0, new NextAction("recklessness", ACTION_HIGH), nullptr)));
triggers.push_back(new TriggerNode("critical health",
NextAction::array(0, new NextAction("enraged regeneration", ACTION_EMERGENCY), nullptr)));
}