From 3372bee04f91d545c1d0d0ce14fec6e150331bc3 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 7 Jan 2024 15:32:51 +0800 Subject: [PATCH] Tank warrior aoe --- src/strategy/warrior/GenericWarriorStrategy.cpp | 9 +++++---- src/strategy/warrior/TankWarriorStrategy.cpp | 11 ++++++----- src/strategy/warrior/WarriorActions.h | 14 ++++++++++++-- src/strategy/warrior/WarriorAiObjectContext.cpp | 2 ++ 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/strategy/warrior/GenericWarriorStrategy.cpp b/src/strategy/warrior/GenericWarriorStrategy.cpp index a398d730..01260118 100644 --- a/src/strategy/warrior/GenericWarriorStrategy.cpp +++ b/src/strategy/warrior/GenericWarriorStrategy.cpp @@ -39,15 +39,16 @@ WarrirorAoeStrategy::WarrirorAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(bo void WarrirorAoeStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("thunder clap on snare target", NextAction::array(0, new NextAction("thunder clap on snare target", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode("thunder clap", NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 10), nullptr))); + // triggers.push_back(new TriggerNode("thunder clap on snare target", NextAction::array(0, new NextAction("thunder clap on snare target", ACTION_HIGH + 3), nullptr))); + // triggers.push_back(new TriggerNode("thunder clap", NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 10), nullptr))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, - new NextAction("demoralizing shout", ACTION_HIGH + 1), + new NextAction("thunder clap", ACTION_HIGH + 5), new NextAction("shockwave", ACTION_HIGH + 4), new NextAction("sweeping strikes", ACTION_HIGH + 3), new NextAction("bladestorm", ACTION_HIGH + 3), new NextAction("whirlwind", ACTION_HIGH + 2), - new NextAction("cleave", ACTION_HIGH + 2), + new NextAction("demoralizing shout without life time check", ACTION_HIGH + 1), + new NextAction("cleave", ACTION_HIGH), nullptr))); triggers.push_back(new TriggerNode("shockwave on snare target", NextAction::array(0, new NextAction("shockwave on snare target", ACTION_HIGH + 5), nullptr))); triggers.push_back(new TriggerNode("high rage available", NextAction::array(0, new NextAction("whirlwind", ACTION_HIGH + 10), nullptr))); diff --git a/src/strategy/warrior/TankWarriorStrategy.cpp b/src/strategy/warrior/TankWarriorStrategy.cpp index f3e77630..6f19d85b 100644 --- a/src/strategy/warrior/TankWarriorStrategy.cpp +++ b/src/strategy/warrior/TankWarriorStrategy.cpp @@ -49,8 +49,9 @@ TankWarriorStrategy::TankWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStr NextAction** TankWarriorStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("devastate", ACTION_DEFAULT + 0.2f), - new NextAction("revenge", ACTION_DEFAULT + 0.1f), + new NextAction("devastate", ACTION_DEFAULT + 0.3f), + new NextAction("revenge", ACTION_DEFAULT + 0.2f), + new NextAction("demoralizing shout", ACTION_DEFAULT + 0.1f), new NextAction("melee", ACTION_DEFAULT), NULL); } @@ -60,9 +61,9 @@ void TankWarriorStrategy::InitTriggers(std::vector& triggers) GenericWarriorStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("heroic throw", ACTION_MOVE + 11), new NextAction("charge", ACTION_MOVE + 10), nullptr))); - triggers.push_back(new TriggerNode("intercept and rage", NextAction::array(0, new NextAction("berserker stance", ACTION_MOVE + 14), nullptr))); - triggers.push_back(new TriggerNode("intercept and rage", NextAction::array(0, new NextAction("intercept", ACTION_MOVE + 13), nullptr))); - triggers.push_back(new TriggerNode("thunder clap and rage", NextAction::array(0, new NextAction("battle stance", ACTION_MOVE + 12), nullptr))); + // triggers.push_back(new TriggerNode("intercept and rage", NextAction::array(0, new NextAction("berserker stance", ACTION_MOVE + 14), nullptr))); + // triggers.push_back(new TriggerNode("intercept and rage", NextAction::array(0, new NextAction("intercept", ACTION_MOVE + 13), nullptr))); + // triggers.push_back(new TriggerNode("thunder clap and rage", NextAction::array(0, new NextAction("battle stance", ACTION_MOVE + 12), nullptr))); triggers.push_back(new TriggerNode("thunder clap and rage", NextAction::array(0, new NextAction("thunder clap", ACTION_MOVE + 11), nullptr))); triggers.push_back(new TriggerNode("defensive stance", NextAction::array(0, new NextAction("defensive stance", ACTION_HIGH + 9), nullptr))); triggers.push_back(new TriggerNode("commanding shout", NextAction::array(0, new NextAction("commanding shout", ACTION_HIGH + 8), nullptr))); diff --git a/src/strategy/warrior/WarriorActions.h b/src/strategy/warrior/WarriorActions.h index bb89f439..f963100d 100644 --- a/src/strategy/warrior/WarriorActions.h +++ b/src/strategy/warrior/WarriorActions.h @@ -5,6 +5,7 @@ #ifndef _PLAYERBOT_WARRIORACTIONS_H #define _PLAYERBOT_WARRIORACTIONS_H +#include "AiObject.h" #include "GenericSpellActions.h" #include "Player.h" #include "PlayerbotAI.h" @@ -18,7 +19,16 @@ BUFF_ACTION(CastBerserkerStanceAction, "berserker stance"); // shouts BUFF_ACTION(CastBattleShoutAction, "battle shout"); MELEE_ACTION_U(CastBattleShoutTauntAction, "battle shout", CastSpellAction::isUseful()); // useful to rebuff -DEBUFF_ACTION_R(CastDemoralizingShoutAction, "demoralizing shout", 8.0f); // low range debuff +DEBUFF_ACTION_R(CastDemoralizingShoutAction, "demoralizing shout", 8.0f); // low range debuff +class CastDemoralizingShoutWithoutLifeTimeCheckAction : public CastDebuffSpellAction +{ + public: + CastDemoralizingShoutWithoutLifeTimeCheckAction(PlayerbotAI* botAI) : CastDebuffSpellAction(botAI, "demoralizing shout", false, 0.0f) \ + { + range = 8.0f; + } +}; + MELEE_ACTION(CastChallengingShoutAction, "challenging shout"); DEBUFF_ACTION_R(CastIntimidatingShoutAction, "intimidating shout", 8.0f); // shouts 2.4.3 @@ -36,7 +46,7 @@ class CastRendOnAttackerAction : public CastDebuffSpellOnMeleeAttackerAction CastRendOnAttackerAction(PlayerbotAI* botAI) : CastDebuffSpellOnMeleeAttackerAction(botAI, "rend") {} }; -DEBUFF_ACTION_R(CastThunderClapAction, "thunder clap", 8.0f); +MELEE_ACTION(CastThunderClapAction, "thunder clap"); SNARE_ACTION(CastThunderClapSnareAction, "thunder clap"); SNARE_ACTION(CastHamstringAction, "hamstring"); MELEE_ACTION(CastOverpowerAction, "overpower"); diff --git a/src/strategy/warrior/WarriorAiObjectContext.cpp b/src/strategy/warrior/WarriorAiObjectContext.cpp index fe22a725..6803d270 100644 --- a/src/strategy/warrior/WarriorAiObjectContext.cpp +++ b/src/strategy/warrior/WarriorAiObjectContext.cpp @@ -172,6 +172,7 @@ class WarriorAiObjectContextInternal : public NamedObjectContext creators["heroic strike"] = &WarriorAiObjectContextInternal::heroic_strike; creators["intimidating shout"] = &WarriorAiObjectContextInternal::intimidating_shout; creators["demoralizing shout"] = &WarriorAiObjectContextInternal::demoralizing_shout; + creators["demoralizing shout without life time check"] = &WarriorAiObjectContextInternal::demoralizing_shout_without_life_time_check; creators["challenging shout"] = &WarriorAiObjectContextInternal::challenging_shout; creators["shield wall"] = &WarriorAiObjectContextInternal::shield_wall; creators["battle shout"] = &WarriorAiObjectContextInternal::battle_shout; @@ -245,6 +246,7 @@ class WarriorAiObjectContextInternal : public NamedObjectContext static Action* heroic_strike(PlayerbotAI* botAI) { return new CastHeroicStrikeAction(botAI); } static Action* intimidating_shout(PlayerbotAI* botAI) { return new CastIntimidatingShoutAction(botAI); } static Action* demoralizing_shout(PlayerbotAI* botAI) { return new CastDemoralizingShoutAction(botAI); } + static Action* demoralizing_shout_without_life_time_check(PlayerbotAI* botAI) { return new CastDemoralizingShoutWithoutLifeTimeCheckAction(botAI); } static Action* challenging_shout(PlayerbotAI* botAI) { return new CastChallengingShoutAction(botAI); } static Action* shield_wall(PlayerbotAI* botAI) { return new CastShieldWallAction(botAI); } static Action* battle_shout(PlayerbotAI* botAI) { return new CastBattleShoutAction(botAI); }