From d8b897dd46a460c586af261876c5f0ebb271b11f Mon Sep 17 00:00:00 2001 From: ile <59745756+ileboii@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:49:43 +0200 Subject: [PATCH] Warrior: Proper stance logic for Sweeping Strikes (#128) * Warrior: Prebuilt arms weapon specialization talents * Warrior: Proper stance logic for Sweeping Strikes Stance Dance: Arms Warrior pools rage in Battle Stance until Sweeping Strikes is castable until returning back to Berserk Stance * PvE/PvP/Raid logic + Code cleanup * Ignore mortal strike and heroic strike while pooling rage * Update ArmsWarriorStrategy.cpp * Disable Battle Stance spam if SS is on cooldown --- .../strategy/warrior/ArmsWarriorStrategy.cpp | 114 +++++++++++++++++- .../strategy/warrior/ArmsWarriorStrategy.h | 1 + 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/playerbot/strategy/warrior/ArmsWarriorStrategy.cpp b/playerbot/strategy/warrior/ArmsWarriorStrategy.cpp index 9ead1e4bc..d4ebe86e4 100644 --- a/playerbot/strategy/warrior/ArmsWarriorStrategy.cpp +++ b/playerbot/strategy/warrior/ArmsWarriorStrategy.cpp @@ -1033,4 +1033,116 @@ void ArmsWarriorCcRaidStrategy::InitNonCombatTriggers(std::list& t WarriorCcRaidStrategy::InitNonCombatTriggers(triggers); } -#endif \ No newline at end of file +#endif + +class WarriorSweepingStrikesPveMultiplier : public Multiplier +{ +public: + WarriorSweepingStrikesPveMultiplier(PlayerbotAI* ai) : Multiplier(ai, "aoe arms pve") {} + + float GetValue(Action* action) override + { + // Disable Berserker Stance + const std::string& actionName = action->getName(); + if ((actionName == "berserker stance" || + actionName == "whirlwind" || + actionName == "mortal strike" || + actionName == "heroic strike" || + actionName == "cleave") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + bot->IsSpellReady(12292) && + !bot->HasAura(12292)) + { + return 0.0f; + } + + // Disable Battle Stance spam if SS is on CD + if ((actionName == "battle stance") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + !bot->IsSpellReady(12292)) + { + return 0.0f; + } + + return 1.0f; + } +}; + +class WarriorSweepingStrikesRaidMultiplier : public Multiplier +{ +public: + WarriorSweepingStrikesRaidMultiplier(PlayerbotAI* ai) : Multiplier(ai, "aoe arms raid") {} + + float GetValue(Action* action) override + { + // Disable Berserker Stance + const std::string& actionName = action->getName(); + if ((actionName == "berserker stance" || + actionName == "whirlwind" || + actionName == "mortal strike" || + actionName == "heroic strike" || + actionName == "cleave") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + bot->IsSpellReady(12292) && + !bot->HasAura(12292)) + { + return 0.0f; + } + + // Disable Battle Stance spam if SS is on CD + if ((actionName == "battle stance") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + !bot->IsSpellReady(12292)) + { + return 0.0f; + } + + return 1.0f; + } +}; + +class WarriorSweepingStrikesPvpMultiplier : public Multiplier +{ +public: + WarriorSweepingStrikesPvpMultiplier(PlayerbotAI* ai) : Multiplier(ai, "aoe arms pvp") {} + + float GetValue(Action* action) override + { + // Disable Berserker Stance + const std::string& actionName = action->getName(); + if ((actionName == "berserker stance" || + actionName == "whirlwind" || + actionName == "mortal strike" || + actionName == "heroic strike" || + actionName == "cleave") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + bot->IsSpellReady(12292) && + !bot->HasAura(12292)) + { + return 0.0f; + } + + // Disable Battle Stance spam if SS is on CD + if ((actionName == "battle stance") && + AI_VALUE2(bool, "trigger active", "melee light aoe") && + bot->HasSpell(12292) && + !bot->IsSpellReady(12292)) + { + return 0.0f; + } + + return 1.0f; + } +}; + +void ArmsWarriorAoeStrategy::InitCombatMultipliers(std::list& multipliers) +{ + multipliers.push_back(new WarriorSweepingStrikesPveMultiplier(ai)); + multipliers.push_back(new WarriorSweepingStrikesRaidMultiplier(ai)); + multipliers.push_back(new WarriorSweepingStrikesPvpMultiplier(ai)); +} diff --git a/playerbot/strategy/warrior/ArmsWarriorStrategy.h b/playerbot/strategy/warrior/ArmsWarriorStrategy.h index bf63190a0..9cf27eabe 100644 --- a/playerbot/strategy/warrior/ArmsWarriorStrategy.h +++ b/playerbot/strategy/warrior/ArmsWarriorStrategy.h @@ -71,6 +71,7 @@ namespace ai protected: virtual void InitCombatTriggers(std::list& triggers) override; + void InitCombatMultipliers(std::list& multipliers); virtual void InitNonCombatTriggers(std::list& triggers) override; };