diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index be60bf1b..e03447cb 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -881,7 +881,7 @@ void PlayerbotFactory::InitTalentsTree(bool increment /*false*/, bool use_templa /// @todo: match current talent with template specTab = AiFactory::GetPlayerSpecTab(bot); /// @todo: fix cat druid hardcode - if (bot->getClass() == CLASS_DRUID && specTab == DRUID_TAB_FERAL && bot->GetLevel() >= 20 && PlayerbotAI::IsDps(bot)) + if (bot->getClass() == CLASS_DRUID && specTab == DRUID_TAB_FERAL && bot->GetLevel() >= 20 && !bot->HasAura(16931)) specTab = 3; } else @@ -3081,7 +3081,7 @@ void PlayerbotFactory::InitGlyphs(bool increment) uint8 cls = bot->getClass(); uint8 tab = AiFactory::GetPlayerSpecTab(bot); /// @todo: fix cat druid hardcode - if (bot->getClass() == CLASS_DRUID && tab == DRUID_TAB_FERAL && PlayerbotAI::IsDps(bot)) + if (bot->getClass() == CLASS_DRUID && tab == DRUID_TAB_FERAL && bot->GetLevel() >= 20 && !bot->HasAura(16931)) tab = 3; std::list glyphs; ItemTemplateContainer const* itemTemplates = sObjectMgr->GetItemTemplateStore(); diff --git a/src/strategy/druid/CatDpsDruidStrategy.cpp b/src/strategy/druid/CatDpsDruidStrategy.cpp index bb860b02..0ae00e28 100644 --- a/src/strategy/druid/CatDpsDruidStrategy.cpp +++ b/src/strategy/druid/CatDpsDruidStrategy.cpp @@ -122,8 +122,8 @@ CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrateg NextAction** CatDpsDruidStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), - new NextAction("shred", ACTION_DEFAULT + 0.2f), nullptr); + return NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), + new NextAction("tiger's fury", ACTION_DEFAULT + 0.1f), nullptr); } void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) @@ -132,7 +132,9 @@ void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) // Default priority triggers.push_back(new TriggerNode("high energy available", - NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.1f), nullptr))); + NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr))); + triggers.push_back(new TriggerNode("high energy available", + NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.2f), nullptr))); triggers.push_back( new TriggerNode("faerie fire (feral)", NextAction::array(0, new NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.0f), nullptr))); @@ -140,17 +142,17 @@ void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) // Main spell triggers.push_back( new TriggerNode("cat form", NextAction::array(0, new NextAction("cat form", ACTION_HIGH + 8), nullptr))); - - triggers.push_back(new TriggerNode("tiger's fury", - NextAction::array(0, new NextAction("tiger's fury", ACTION_HIGH + 7), nullptr))); triggers.push_back( - new TriggerNode("savage roar", NextAction::array(0, new NextAction("savage roar", ACTION_HIGH + 5), nullptr))); + new TriggerNode("savage roar", NextAction::array(0, new NextAction("savage roar", ACTION_HIGH + 7), nullptr))); triggers.push_back(new TriggerNode("combo points available", - NextAction::array(0, new NextAction("rip", ACTION_HIGH + 4), nullptr))); + NextAction::array(0, new NextAction("rip", ACTION_HIGH + 6), nullptr))); triggers.push_back(new TriggerNode( - "combo points available", NextAction::array(0, new NextAction("ferocious bite", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode("target with combo points almost dead", - NextAction::array(0, new NextAction("ferocious bite", ACTION_HIGH + 2), nullptr))); + "ferocious bite time", NextAction::array(0, new NextAction("ferocious bite", ACTION_HIGH + 5), nullptr))); + triggers.push_back( + new TriggerNode("target with combo points almost dead", + NextAction::array(0, new NextAction("ferocious bite", ACTION_HIGH + 4), nullptr))); + triggers.push_back(new TriggerNode("mangle (cat)", + NextAction::array(0, new NextAction("mangle (cat)", ACTION_HIGH + 3), nullptr))); triggers.push_back(new TriggerNode("rake", NextAction::array(0, new NextAction("rake", ACTION_HIGH + 2), nullptr))); triggers.push_back( new TriggerNode("medium threat", NextAction::array(0, new NextAction("cower", ACTION_HIGH + 1), nullptr))); diff --git a/src/strategy/druid/DruidAiObjectContext.cpp b/src/strategy/druid/DruidAiObjectContext.cpp index 61e66e95..04652487 100644 --- a/src/strategy/druid/DruidAiObjectContext.cpp +++ b/src/strategy/druid/DruidAiObjectContext.cpp @@ -103,6 +103,8 @@ public: creators["party member remove curse"] = &DruidTriggerFactoryInternal::party_member_remove_curse; creators["eclipse (solar) cooldown"] = &DruidTriggerFactoryInternal::eclipse_solar_cooldown; creators["eclipse (lunar) cooldown"] = &DruidTriggerFactoryInternal::eclipse_lunar_cooldown; + creators["mangle (cat)"] = &DruidTriggerFactoryInternal::mangle_cat; + creators["ferocious bite time"] = &DruidTriggerFactoryInternal::ferocious_bite_time; } private: @@ -137,6 +139,8 @@ private: static Trigger* party_member_remove_curse(PlayerbotAI* ai) { return new DruidPartyMemberRemoveCurseTrigger(ai); } static Trigger* eclipse_solar_cooldown(PlayerbotAI* ai) { return new EclipseSolarCooldownTrigger(ai); } static Trigger* eclipse_lunar_cooldown(PlayerbotAI* ai) { return new EclipseLunarCooldownTrigger(ai); } + static Trigger* mangle_cat(PlayerbotAI* ai) { return new MangleCatTrigger(ai); } + static Trigger* ferocious_bite_time(PlayerbotAI* ai) { return new FerociousBiteTimeTrigger(ai); } }; class DruidAiObjectContextInternal : public NamedObjectContext diff --git a/src/strategy/druid/DruidCatActions.cpp b/src/strategy/druid/DruidCatActions.cpp index fb3a0e88..03571a8e 100644 --- a/src/strategy/druid/DruidCatActions.cpp +++ b/src/strategy/druid/DruidCatActions.cpp @@ -1,6 +1 @@ #include "DruidCatActions.h" - -bool CastMangleCatAction::isUseful() -{ - return CastMeleeDebuffSpellAction::isUseful() && !botAI->HasAura("mangle (bear)", GetTarget(), false, isOwner); -} \ No newline at end of file diff --git a/src/strategy/druid/DruidCatActions.h b/src/strategy/druid/DruidCatActions.h index 8adddf98..cf4c6c35 100644 --- a/src/strategy/druid/DruidCatActions.h +++ b/src/strategy/druid/DruidCatActions.h @@ -60,11 +60,10 @@ public: CastClawAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "claw") {} }; -class CastMangleCatAction : public CastMeleeDebuffSpellAction +class CastMangleCatAction : public CastMeleeSpellAction { public: - CastMangleCatAction(PlayerbotAI* botAI) : CastMeleeDebuffSpellAction(botAI, "mangle (cat)", false, 0.0f) {} - bool isUseful() override; + CastMangleCatAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "mangle (cat)") {} }; class CastSwipeCatAction : public CastMeleeSpellAction diff --git a/src/strategy/druid/DruidTriggers.h b/src/strategy/druid/DruidTriggers.h index 14b210fe..b0f13205 100644 --- a/src/strategy/druid/DruidTriggers.h +++ b/src/strategy/druid/DruidTriggers.h @@ -9,6 +9,8 @@ #include "CureTriggers.h" #include "GenericTriggers.h" #include "Player.h" +#include "PlayerbotAI.h" +#include "Playerbots.h" #include "SharedDefines.h" class PlayerbotAI; @@ -224,4 +226,43 @@ public: bool IsActive() override { return bot->HasSpellCooldown(48518); } }; +class MangleCatTrigger : public DebuffTrigger +{ +public: + MangleCatTrigger(PlayerbotAI* ai) : DebuffTrigger(ai, "mangle (cat)", 1, false, 0.0f) {} + bool IsActive() override + { + return DebuffTrigger::IsActive() && !botAI->HasAura("mangle (bear)", GetTarget(), false, false, -1, true) + && !botAI->HasAura("trauma", GetTarget(), false, false, -1, true); + } +}; + +class FerociousBiteTimeTrigger : public Trigger +{ +public: + FerociousBiteTimeTrigger(PlayerbotAI* ai) : Trigger(ai, "ferocious bite time") {} + bool IsActive() override + { + Unit* target = AI_VALUE(Unit*, "current target"); + if (!target) + return false; + + uint8 cp = AI_VALUE2(uint8, "combo", "current target"); + if (cp < 5) + return false; + + Aura* roar = botAI->GetAura("savage roar", bot); + bool roarCheck = roar && roar->GetDuration() > 8000; + if (!roarCheck) + return false; + + Aura* rip = botAI->GetAura("rip", target, true); + bool ripCheck = rip && rip->GetDuration() > 8000; + if (!ripCheck) + return false; + + return true; + } +}; + #endif