From 7f328b6e325486d7cbb095816aec77bd2d9c713e Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sat, 15 Jul 2023 18:17:12 +0800 Subject: [PATCH] paladin buff --- src/strategy/paladin/PaladinActions.cpp | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/strategy/paladin/PaladinActions.cpp b/src/strategy/paladin/PaladinActions.cpp index 2d15c35e..7bc25a24 100644 --- a/src/strategy/paladin/PaladinActions.cpp +++ b/src/strategy/paladin/PaladinActions.cpp @@ -3,18 +3,41 @@ */ #include "PaladinActions.h" +#include "AiFactory.h" #include "Event.h" +#include "PlayerbotAI.h" +#include "PlayerbotFactory.h" #include "Playerbots.h" #include "SharedDefines.h" inline std::string const GetActualBlessingOfMight(Unit* target) { + if (!target->ToPlayer()) { + return {""}; + } + int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer()); switch (target->getClass()) { case CLASS_MAGE: case CLASS_PRIEST: case CLASS_WARLOCK: return "blessing of wisdom"; + break; + case CLASS_SHAMAN: + if (tab == SHAMAN_TAB_ELEMENTAL || tab == SHAMAN_TAB_RESTORATION) { + return "bless of wisdom"; + } + break; + case CLASS_DRUID: + if (tab == DRUID_TAB_RESTORATION || tab == DRUID_TAB_BALANCE) { + return "bless of wisdom"; + } + break; + case CLASS_PALADIN: + if (tab == PALADIN_TAB_HOLY) { + return "bless of wisdom"; + } + break; } return "blessing of might"; @@ -22,12 +45,33 @@ inline std::string const GetActualBlessingOfMight(Unit* target) inline std::string const GetActualBlessingOfWisdom(Unit* target) { + if (!target->ToPlayer()) { + return {""}; + } + int tab = AiFactory::GetPlayerSpecTab(target->ToPlayer()); switch (target->getClass()) { case CLASS_WARRIOR: case CLASS_ROGUE: case CLASS_DEATH_KNIGHT: + case CLASS_HUNTER: return "blessing of might"; + break; + case CLASS_SHAMAN: + if (tab == SHAMAN_TAB_ENHANCEMENT) { + return "blessing of might"; + } + break; + case CLASS_DRUID: + if (tab == DRUID_TAB_FERAL) { + return "blessing of might"; + } + break; + case CLASS_PALADIN: + if (tab == PALADIN_TAB_PROTECTION || tab == PALADIN_TAB_RETRIBUTION) { + return "blessing of might"; + } + break; } return "blessing of wisdom";