diff --git a/src/AiFactory.cpp b/src/AiFactory.cpp index 9cafcdab..7d272228 100644 --- a/src/AiFactory.cpp +++ b/src/AiFactory.cpp @@ -263,7 +263,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa if (!player->InBattleground()) { - engine->addStrategies("racials", "chat", "default", "cast time", "duel", nullptr); + engine->addStrategies("racials", "chat", "default", "cast time", "duel", "boost", nullptr); } switch (player->getClass()) @@ -302,7 +302,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa else if (tab == 2) engine->addStrategies("heal", "bmana", nullptr); else - engine->addStrategies("melee", "melee aoe", "bdps", "threat", nullptr); + engine->addStrategies("melee", "melee aoe", "bmana", "threat", nullptr); engine->addStrategies("dps assist", "cure", "totems", nullptr); break; diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index b6a405a3..6e5c77ed 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -1642,7 +1642,6 @@ void PlayerbotFactory::InitSkills() uint32 skillLevel = bot->getLevel() < 40 ? 0 : 1; uint32 dualWieldLevel = bot->getLevel() < 20 ? 0 : 1; - uint32 dualWieldLevelForRogue = bot->getLevel() < 10 ? 0 : 1; SetRandomSkill(SKILL_DEFENSE); switch (bot->getClass()) { @@ -1736,7 +1735,7 @@ void PlayerbotFactory::InitSkills() SetRandomSkill(SKILL_CROSSBOWS); SetRandomSkill(SKILL_FIST_WEAPONS); SetRandomSkill(SKILL_THROWN); - bot->SetSkill(SKILL_DUAL_WIELD, 0, dualWieldLevelForRogue, dualWieldLevelForRogue); + bot->SetSkill(SKILL_DUAL_WIELD, 0, 1, 1); break; case CLASS_DEATH_KNIGHT: SetRandomSkill(SKILL_SWORDS); diff --git a/src/strategy/actions/GenericSpellActions.h b/src/strategy/actions/GenericSpellActions.h index 95a8fb00..21743d2c 100644 --- a/src/strategy/actions/GenericSpellActions.h +++ b/src/strategy/actions/GenericSpellActions.h @@ -60,7 +60,7 @@ class CastDebuffSpellOnAttackerAction : public CastAuraSpellAction Value* GetTargetValue() override; std::string const getName() override { return spell + " on attacker"; } - ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } + // ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } }; class CastDebuffSpellOnMeleeAttackerAction : public CastAuraSpellAction @@ -70,7 +70,7 @@ class CastDebuffSpellOnMeleeAttackerAction : public CastAuraSpellAction Value* GetTargetValue() override; std::string const getName() override { return spell + " on attacker"; } - ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } + // ActionThreatType getThreatType() override { return ActionThreatType::Aoe; } }; class CastBuffSpellAction : public CastAuraSpellAction diff --git a/src/strategy/actions/LootAction.cpp b/src/strategy/actions/LootAction.cpp index 9bcd5530..04d9f1c8 100644 --- a/src/strategy/actions/LootAction.cpp +++ b/src/strategy/actions/LootAction.cpp @@ -461,11 +461,11 @@ bool StoreLootAction::IsLootAllowed(uint32 itemid, PlayerbotAI* botAI) { if (quest->RequiredItemId[i] == itemid) { - if (AI_VALUE2(uint32, "item count", proto->Name1) < quest->RequiredItemCount[i]) - { - if (botAI->GetMaster() && sPlayerbotAIConfig->syncQuestWithPlayer) - return false; //Quest is autocomplete for the bot so no item needed. - } + // if (AI_VALUE2(uint32, "item count", proto->Name1) < quest->RequiredItemCount[i]) + // { + // if (botAI->GetMaster() && sPlayerbotAIConfig->syncQuestWithPlayer) + // return false; //Quest is autocomplete for the bot so no item needed. + // } return true; } diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 0057ac36..6ce90a3a 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -758,6 +758,10 @@ bool MovementAction::IsMovingAllowed() if (bot->GetMotionMaster()->GetMotionSlot(MOTION_SLOT_CONTROLLED)) { return false; } + + // if (bot->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) { + // return false; + // } return bot->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE; } @@ -779,7 +783,6 @@ void MovementAction::UpdateMovementState() if (bot->IsFlying()) bot->UpdateSpeed(MOVE_FLIGHT, true); - // Temporary speed increase in group //if (botAI->HasRealPlayerMaster()) //bot->SetSpeedRate(MOVE_RUN, 1.1f); diff --git a/src/strategy/deathknight/BloodDKStrategy.cpp b/src/strategy/deathknight/BloodDKStrategy.cpp index f3bc07a2..bc610dbf 100644 --- a/src/strategy/deathknight/BloodDKStrategy.cpp +++ b/src/strategy/deathknight/BloodDKStrategy.cpp @@ -99,4 +99,5 @@ void BloodDKStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("lose aggro", NextAction::array(0, new NextAction("dark command", ACTION_HIGH + 3), nullptr))); triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("blood tap", ACTION_HIGH + 5), new NextAction("vampiric blood", ACTION_HIGH + 3), new NextAction("death strike", ACTION_HIGH + 4), nullptr))); + } diff --git a/src/strategy/deathknight/DKAiObjectContext.cpp b/src/strategy/deathknight/DKAiObjectContext.cpp index ef6e940e..a6ffebd6 100644 --- a/src/strategy/deathknight/DKAiObjectContext.cpp +++ b/src/strategy/deathknight/DKAiObjectContext.cpp @@ -84,6 +84,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext creators["blood tap"] = &DeathKnightTriggerFactoryInternal::blood_tap; creators["raise dead"] = &DeathKnightTriggerFactoryInternal::raise_dead; creators["chains of ice"] = &DeathKnightTriggerFactoryInternal::chains_of_ice; + creators["unbreakable armor"] = &DeathKnightTriggerFactoryInternal::unbreakable_armor; } private: @@ -104,6 +105,7 @@ class DeathKnightTriggerFactoryInternal : public NamedObjectContext static Trigger* blood_tap(PlayerbotAI* botAI) { return new BloodTapTrigger(botAI); } static Trigger* raise_dead(PlayerbotAI* botAI) { return new RaiseDeadTrigger(botAI); } static Trigger* chains_of_ice(PlayerbotAI* botAI) { return new ChainsOfIceSnareTrigger(botAI); } + static Trigger* unbreakable_armor(PlayerbotAI* botAI) { return new UnbreakableArmorTrigger(botAI); } }; class DeathKnightAiObjectContextInternal : public NamedObjectContext diff --git a/src/strategy/deathknight/DKTriggers.cpp b/src/strategy/deathknight/DKTriggers.cpp index 30e591c9..c9c6a17c 100644 --- a/src/strategy/deathknight/DKTriggers.cpp +++ b/src/strategy/deathknight/DKTriggers.cpp @@ -17,11 +17,14 @@ bool PestilenceTrigger::IsActive() { if (!SpellTrigger::IsActive()) { return false; } + if (!bot->HasAura(63334)) { + return false; + } Aura *blood_plague = botAI->GetAura("blood plague", GetTarget(), true, true); Aura *frost_fever = botAI->GetAura("frost fever", GetTarget(), true, true); - if ((blood_plague && blood_plague->GetDuration() <= 5000) || - (frost_fever && frost_fever->GetDuration() <= 5000)) { + if ((blood_plague && blood_plague->GetDuration() <= 3000) || + (frost_fever && frost_fever->GetDuration() <= 3000)) { return true; - } + } return false; } \ No newline at end of file diff --git a/src/strategy/deathknight/DKTriggers.h b/src/strategy/deathknight/DKTriggers.h index 039dfbdf..04600e9d 100644 --- a/src/strategy/deathknight/DKTriggers.h +++ b/src/strategy/deathknight/DKTriggers.h @@ -14,7 +14,7 @@ BUFF_TRIGGER(BoneShieldTrigger, "bone shield"); BUFF_TRIGGER(ImprovedIcyTalonsTrigger, "improved icy talons"); DEBUFF_CHECKISOWNER_TRIGGER(PlagueStrikeDebuffTrigger, "blood plague"); DEBUFF_CHECKISOWNER_TRIGGER(IcyTouchDebuffTrigger, "frost fever"); - +BUFF_TRIGGER(UnbreakableArmorTrigger, "unbreakable armor"); class PlagueStrikeDebuffOnAttackerTrigger : public DebuffOnMeleeAttackerTrigger { public: diff --git a/src/strategy/deathknight/FrostDKStrategy.cpp b/src/strategy/deathknight/FrostDKStrategy.cpp index 13f6737e..5958c5c6 100644 --- a/src/strategy/deathknight/FrostDKStrategy.cpp +++ b/src/strategy/deathknight/FrostDKStrategy.cpp @@ -23,7 +23,6 @@ class FrostDKStrategyActionNodeFactory : public NamedObjectFactory //creators["deathchill"] = &deathchill; //creators["icebound fortitude"] = &icebound_fortitude; //creators["mind freeze"] = &mind_freeze; - //creators["empower weapon"] = &empower_weapon; //creators["hungering cold"] = &hungering_cold; //creators["unbreakable armor"] = &unbreakable_armor; //creators["improved icy talons"] = &improved_icy_talons; @@ -74,6 +73,7 @@ NextAction** FrostDKStrategy::getDefaultActions() new NextAction("obliterate", ACTION_NORMAL + 5), new NextAction("frost strike", ACTION_NORMAL + 4), // new NextAction("death strike", ACTION_NORMAL + 3), + new NextAction("empower rune weapon", ACTION_NORMAL + 2), new NextAction("melee", ACTION_NORMAL), NULL ); @@ -82,9 +82,8 @@ NextAction** FrostDKStrategy::getDefaultActions() void FrostDKStrategy::InitTriggers(std::vector& triggers) { GenericDKStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("empower weapon", NextAction::array(0, new NextAction("empower weapon", ACTION_NORMAL + 4), nullptr))); - triggers.push_back(new TriggerNode("pestilence", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL))); + triggers.push_back(new TriggerNode("unbreakable armor", NextAction::array(0, new NextAction("unbreakable armor", ACTION_NORMAL + 4), nullptr))); + // triggers.push_back(new TriggerNode("empower rune weapon", NextAction::array(0, new NextAction("empower rune weapon", ACTION_NORMAL + 4), nullptr))); } void FrostDKAoeStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/deathknight/GenericDKStrategy.cpp b/src/strategy/deathknight/GenericDKStrategy.cpp index c098ff76..e5286faa 100644 --- a/src/strategy/deathknight/GenericDKStrategy.cpp +++ b/src/strategy/deathknight/GenericDKStrategy.cpp @@ -178,4 +178,5 @@ void GenericDKStrategy::InitTriggers(std::vector& triggers) new NextAction("pestilence", ACTION_NORMAL + 4), new NextAction("blood boil", ACTION_NORMAL + 3), nullptr))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("howling blast", ACTION_NORMAL + 5), new NextAction("pestilence", ACTION_NORMAL + 4), new NextAction("hearth strike", ACTION_NORMAL + 3), new NextAction("blood boil", ACTION_NORMAL + 3), nullptr))); + triggers.push_back(new TriggerNode("pestilence", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL))); } diff --git a/src/strategy/druid/CasterDruidStrategy.cpp b/src/strategy/druid/CasterDruidStrategy.cpp index 0b2a55e2..53c33042 100644 --- a/src/strategy/druid/CasterDruidStrategy.cpp +++ b/src/strategy/druid/CasterDruidStrategy.cpp @@ -105,9 +105,9 @@ CasterDruidStrategy::CasterDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrat NextAction** CasterDruidStrategy::getDefaultActions() { return NextAction::array(0, - new NextAction("starfall", ACTION_NORMAL + 3), + new NextAction("starfall", ACTION_NORMAL + 2), new NextAction("wrath", ACTION_NORMAL + 1), - new NextAction("starfire", ACTION_NORMAL), + // new NextAction("starfire", ACTION_NORMAL), nullptr); } @@ -119,9 +119,11 @@ void CasterDruidStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("insect swarm", NextAction::array(0, new NextAction("insect swarm", ACTION_NORMAL + 5), nullptr))); triggers.push_back(new TriggerNode("moonfire", NextAction::array(0, new NextAction("moonfire", ACTION_NORMAL + 4), nullptr))); triggers.push_back(new TriggerNode("eclipse (solar)", NextAction::array(0, new NextAction("wrath", ACTION_NORMAL + 6), nullptr))); + triggers.push_back(new TriggerNode("eclipse (lunar) cooldown", NextAction::array(0, new NextAction("starfire", ACTION_NORMAL + 2), nullptr))); triggers.push_back(new TriggerNode("eclipse (lunar)", NextAction::array(0, new NextAction("starfire", ACTION_NORMAL + 6), nullptr))); + triggers.push_back(new TriggerNode("eclipse (solar) cooldown", NextAction::array(0, new NextAction("wrath", ACTION_NORMAL + 2), nullptr))); triggers.push_back(new TriggerNode("moonfire", NextAction::array(0, new NextAction("moonfire", ACTION_NORMAL + 4), nullptr))); - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), NULL))); + triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 9), NULL))); triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_HIGH), nullptr))); triggers.push_back(new TriggerNode( "party member remove curse", @@ -134,9 +136,9 @@ void CasterDruidAoeStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "light aoe", NextAction::array(0, - new NextAction("starfall", ACTION_NORMAL + 4), + new NextAction("starfall", ACTION_NORMAL + 5), new NextAction("insect swarm on attacker", ACTION_NORMAL + 3), - new NextAction("moonfire on attacker", ACTION_NORMAL + 2), + new NextAction("moonfire on attacker", ACTION_NORMAL + 3), NULL))); } diff --git a/src/strategy/druid/DruidActions.h b/src/strategy/druid/DruidActions.h index d4069e43..afacddb1 100644 --- a/src/strategy/druid/DruidActions.h +++ b/src/strategy/druid/DruidActions.h @@ -108,6 +108,12 @@ class CastThornsOnPartyAction : public BuffOnPartyAction CastThornsOnPartyAction(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, "thorns") { } }; +class CastThornsOnMainTankAction : public BuffOnMainTankAction +{ + public: + CastThornsOnMainTankAction(PlayerbotAI* botAI) : BuffOnMainTankAction(botAI, "thorns", false) { } +}; + class CastOmenOfClarityAction : public CastBuffSpellAction { public: diff --git a/src/strategy/druid/DruidAiObjectContext.cpp b/src/strategy/druid/DruidAiObjectContext.cpp index a498be25..a3e9d1d4 100644 --- a/src/strategy/druid/DruidAiObjectContext.cpp +++ b/src/strategy/druid/DruidAiObjectContext.cpp @@ -73,6 +73,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext creators["omen of clarity"] = &DruidTriggerFactoryInternal::omen_of_clarity; creators["thorns"] = &DruidTriggerFactoryInternal::thorns; creators["thorns on party"] = &DruidTriggerFactoryInternal::thorns_on_party; + creators["thorns on main tank"] = &DruidTriggerFactoryInternal::thorns_on_main_tank; creators["bash"] = &DruidTriggerFactoryInternal::bash; creators["faerie fire (feral)"] = &DruidTriggerFactoryInternal::faerie_fire_feral; creators["faerie fire"] = &DruidTriggerFactoryInternal::faerie_fire; @@ -96,6 +97,8 @@ class DruidTriggerFactoryInternal : public NamedObjectContext creators["bash on enemy healer"] = &DruidTriggerFactoryInternal::bash_on_enemy_healer; creators["nature's swiftness"] = &DruidTriggerFactoryInternal::natures_swiftness; 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; } private: @@ -104,6 +107,7 @@ class DruidTriggerFactoryInternal : public NamedObjectContext static Trigger* eclipse_lunar(PlayerbotAI* botAI) { return new EclipseLunarTrigger(botAI); } static Trigger* thorns(PlayerbotAI* botAI) { return new ThornsTrigger(botAI); } static Trigger* thorns_on_party(PlayerbotAI* botAI) { return new ThornsOnPartyTrigger(botAI); } + static Trigger* thorns_on_main_tank(PlayerbotAI* botAI) { return new ThornsOnMainTankTrigger(botAI); } static Trigger* bash(PlayerbotAI* botAI) { return new BashInterruptSpellTrigger(botAI); } static Trigger* faerie_fire_feral(PlayerbotAI* botAI) { return new FaerieFireFeralTrigger(botAI); } static Trigger* insect_swarm(PlayerbotAI* botAI) { return new InsectSwarmTrigger(botAI); } @@ -125,6 +129,8 @@ class DruidTriggerFactoryInternal : public NamedObjectContext static Trigger* bash_on_enemy_healer(PlayerbotAI* botAI) { return new BashInterruptEnemyHealerSpellTrigger(botAI); } static Trigger* omen_of_clarity(PlayerbotAI* botAI) { return new OmenOfClarityTrigger(botAI); } 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); } }; class DruidAiObjectContextInternal : public NamedObjectContext @@ -172,6 +178,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext creators["survival instincts"] = &DruidAiObjectContextInternal::survival_instincts; creators["thorns"] = &DruidAiObjectContextInternal::thorns; creators["thorns on party"] = &DruidAiObjectContextInternal::thorns_on_party; + creators["thorns on main tank"] = &DruidAiObjectContextInternal::thorns_on_main_tank; creators["cure poison"] = &DruidAiObjectContextInternal::cure_poison; creators["cure poison on party"] = &DruidAiObjectContextInternal::cure_poison_on_party; creators["abolish poison"] = &DruidAiObjectContextInternal::abolish_poison; @@ -252,6 +259,7 @@ class DruidAiObjectContextInternal : public NamedObjectContext static Action* survival_instincts(PlayerbotAI* botAI) { return new CastSurvivalInstinctsAction(botAI); } static Action* thorns(PlayerbotAI* botAI) { return new CastThornsAction(botAI); } static Action* thorns_on_party(PlayerbotAI* botAI) { return new CastThornsOnPartyAction(botAI); } + static Action* thorns_on_main_tank(PlayerbotAI* botAI) { return new CastThornsOnMainTankAction(botAI); } static Action* cure_poison(PlayerbotAI* botAI) { return new CastCurePoisonAction(botAI); } static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyAction(botAI); } static Action* abolish_poison(PlayerbotAI* botAI) { return new CastAbolishPoisonAction(botAI); } diff --git a/src/strategy/druid/DruidTriggers.h b/src/strategy/druid/DruidTriggers.h index 280be700..a08d60f8 100644 --- a/src/strategy/druid/DruidTriggers.h +++ b/src/strategy/druid/DruidTriggers.h @@ -6,7 +6,9 @@ #define _PLAYERBOT_DRUIDTRIGGERS_H #include "CureTriggers.h" +#include "GenericTriggers.h" #include "SharedDefines.h" +#include "Player.h" class PlayerbotAI; @@ -34,6 +36,13 @@ class ThornsOnPartyTrigger : public BuffOnPartyTrigger bool IsActive() override; }; +class ThornsOnMainTankTrigger : public BuffOnMainTankTrigger +{ + public: + ThornsOnMainTankTrigger(PlayerbotAI* botAI) : BuffOnMainTankTrigger(botAI, "thorns", false, 2 * 2000) { } + +}; + class ThornsTrigger : public BuffTrigger { public: @@ -183,4 +192,23 @@ class DruidPartyMemberRemoveCurseTrigger : public PartyMemberNeedCureTrigger public: DruidPartyMemberRemoveCurseTrigger(PlayerbotAI* ai) : PartyMemberNeedCureTrigger(ai, "druid remove curse", DISPEL_CURSE) {} }; + +class EclipseSolarCooldownTrigger : public SpellCooldownTrigger +{ + public: + EclipseSolarCooldownTrigger(PlayerbotAI* ai): SpellCooldownTrigger(ai, "eclipse (solar)") {} + bool IsActive() override { + return bot->HasSpellCooldown(48517); + } +}; + +class EclipseLunarCooldownTrigger : public SpellCooldownTrigger +{ + public: + EclipseLunarCooldownTrigger(PlayerbotAI* ai): SpellCooldownTrigger(ai, "eclipse (lunar)") {} + bool IsActive() override { + return bot->HasSpellCooldown(48518); + } +}; + #endif diff --git a/src/strategy/druid/GenericDruidNonCombatStrategy.cpp b/src/strategy/druid/GenericDruidNonCombatStrategy.cpp index aaa64616..92039976 100644 --- a/src/strategy/druid/GenericDruidNonCombatStrategy.cpp +++ b/src/strategy/druid/GenericDruidNonCombatStrategy.cpp @@ -118,5 +118,5 @@ void GenericDruidBuffStrategy::InitTriggers(std::vector& triggers) NonCombatStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode("mark of the wild on party", NextAction::array(0, new NextAction("mark of the wild on party", 13.0f), nullptr))); - // triggers.push_back(new TriggerNode("thorns on party", NextAction::array(0, new NextAction("thorns on party", 11.0f), nullptr))); + triggers.push_back(new TriggerNode("thorns on main tank", NextAction::array(0, new NextAction("thorns on main tank", 11.0f), nullptr))); } diff --git a/src/strategy/mage/GenericMageStrategy.cpp b/src/strategy/mage/GenericMageStrategy.cpp index 083b1ccb..151451df 100644 --- a/src/strategy/mage/GenericMageStrategy.cpp +++ b/src/strategy/mage/GenericMageStrategy.cpp @@ -142,8 +142,10 @@ void MageCureStrategy::InitTriggers(std::vector& triggers) void MageBoostStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("arcane power", NextAction::array(0, new NextAction("arcane power", 41.0f), nullptr))); + triggers.push_back(new TriggerNode("icy veins", NextAction::array(0, new NextAction("icy veins", 50.0f), nullptr))); triggers.push_back(new TriggerNode("presence of mind", NextAction::array(0, new NextAction("presence of mind", 42.0f), nullptr))); + triggers.push_back(new TriggerNode("arcane power", NextAction::array(0, new NextAction("arcane power", 41.0f), nullptr))); + triggers.push_back(new TriggerNode("mirror image", NextAction::array(0, new NextAction("mirror image", 41.0f), nullptr))); } void MageCcStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/mage/MageActions.h b/src/strategy/mage/MageActions.h index 46d495ac..05153000 100644 --- a/src/strategy/mage/MageActions.h +++ b/src/strategy/mage/MageActions.h @@ -242,4 +242,10 @@ class CastPresenceOfMindAction : public CastBuffSpellAction CastPresenceOfMindAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "presence of mind") { } }; +class CastMirrorImageAction : public CastBuffSpellAction +{ + public: + CastMirrorImageAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "mirror image") {} +}; + #endif diff --git a/src/strategy/mage/MageAiObjectContext.cpp b/src/strategy/mage/MageAiObjectContext.cpp index 0fcf7555..671ea97e 100644 --- a/src/strategy/mage/MageAiObjectContext.cpp +++ b/src/strategy/mage/MageAiObjectContext.cpp @@ -98,6 +98,7 @@ class MageTriggerFactoryInternal : public NamedObjectContext creators["fire ward"] = &MageTriggerFactoryInternal::fire_ward; creators["frost ward"] = &MageTriggerFactoryInternal::frost_ward; creators["arcane blast stack"] = &MageTriggerFactoryInternal::arcane_blast_stack; + creators["mirror image"] = &MageTriggerFactoryInternal::mirror_image; } private: @@ -123,6 +124,7 @@ class MageTriggerFactoryInternal : public NamedObjectContext static Trigger* arcane_blast(PlayerbotAI* botAI) { return new ArcaneBlastTrigger(botAI); } static Trigger* counterspell_enemy_healer(PlayerbotAI* botAI) { return new CounterspellEnemyHealerTrigger(botAI); } static Trigger* arcane_blast_stack(PlayerbotAI* botAI) { return new ArcaneBlastStackTrigger(botAI); } + static Trigger* mirror_image(PlayerbotAI* botAI) { return new MirrorImageTrigger(botAI); } }; class MageAiObjectContextInternal : public NamedObjectContext @@ -169,6 +171,7 @@ class MageAiObjectContextInternal : public NamedObjectContext creators["counterspell on enemy healer"] = &MageAiObjectContextInternal::counterspell_on_enemy_healer; creators["fire ward"] = &MageAiObjectContextInternal::fire_ward; creators["frost ward"] = &MageAiObjectContextInternal::frost_ward; + creators["mirror image"] = &MageAiObjectContextInternal::mirror_image; } private: @@ -211,6 +214,7 @@ class MageAiObjectContextInternal : public NamedObjectContext static Action* invisibility(PlayerbotAI* botAI) { return new CastInvisibilityAction(botAI); } static Action* evocation(PlayerbotAI* botAI) { return new CastEvocationAction(botAI); } static Action* counterspell_on_enemy_healer(PlayerbotAI* botAI) { return new CastCounterspellOnEnemyHealerAction(botAI); } + static Action* mirror_image(PlayerbotAI* botAI) { return new CastMirrorImageAction(botAI); } }; MageAiObjectContext::MageAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) diff --git a/src/strategy/mage/MageTriggers.h b/src/strategy/mage/MageTriggers.h index 04ea5fb6..7bd776d9 100644 --- a/src/strategy/mage/MageTriggers.h +++ b/src/strategy/mage/MageTriggers.h @@ -6,6 +6,7 @@ #define _PLAYERBOT_MAGETRIGGERS_H #include "CureTriggers.h" +#include "GenericTriggers.h" #include "SharedDefines.h" class PlayerbotAI; @@ -137,4 +138,11 @@ class ArcaneBlastStackTrigger : public HasAuraStackTrigger { public: ArcaneBlastStackTrigger(PlayerbotAI* ai) : HasAuraStackTrigger(ai, "arcane blast", 3, 1) {} }; + +class MirrorImageTrigger : public BoostTrigger +{ + public: + MirrorImageTrigger(PlayerbotAI* ai) : BoostTrigger(ai, "mirror image") {} +}; + #endif diff --git a/src/strategy/paladin/DpsPaladinStrategy.cpp b/src/strategy/paladin/DpsPaladinStrategy.cpp index c7c35fce..118fc95e 100644 --- a/src/strategy/paladin/DpsPaladinStrategy.cpp +++ b/src/strategy/paladin/DpsPaladinStrategy.cpp @@ -79,8 +79,9 @@ DpsPaladinStrategy::DpsPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrat NextAction** DpsPaladinStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("crusader strike", ACTION_NORMAL + 6), - new NextAction("judgement of wisdom", ACTION_NORMAL + 5), + return NextAction::array(0, + new NextAction("judgement of wisdom", ACTION_NORMAL + 6), + new NextAction("crusader strike", ACTION_NORMAL + 5), new NextAction("divine storm", ACTION_NORMAL + 4), new NextAction("consecration", ACTION_NORMAL + 3), new NextAction("melee", ACTION_NORMAL), @@ -95,7 +96,7 @@ void DpsPaladinStrategy::InitTriggers(std::vector& triggers) "seal", NextAction::array(0, new NextAction("seal of corruption", ACTION_HIGH), NULL))); // triggers.push_back(new TriggerNode("seal", NextAction::array(0, new NextAction("seal of command", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("seal of wisdom", 91.0f), nullptr))); + triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("seal of wisdom", ACTION_HIGH + 5), nullptr))); // triggers.push_back(new TriggerNode("sanctity aura", NextAction::array(0, new NextAction("sanctity aura", 90.0f), nullptr))); // triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("repentance or shield", ACTION_CRITICAL_HEAL + 3), new NextAction("holy light", ACTION_CRITICAL_HEAL + 2), nullptr))); // triggers.push_back(new TriggerNode("judgement of wisdom", NextAction::array(0, new NextAction("judgement of wisdom", ACTION_NORMAL + 10), nullptr))); @@ -106,10 +107,10 @@ void DpsPaladinStrategy::InitTriggers(std::vector& triggers) // triggers.push_back(new TriggerNode("repentance", NextAction::array(0, new NextAction("repentance", ACTION_INTERRUPT + 2), nullptr))); // triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("divine storm", ACTION_HIGH + 1), new NextAction("consecration", ACTION_HIGH + 1), nullptr))); triggers.push_back(new TriggerNode("art of war", NextAction::array(0, new NextAction("exorcism", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("hammer of wrath", ACTION_CRITICAL_HEAL), nullptr))); - triggers.push_back(new TriggerNode( - "not facing target", - NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), NULL))); + triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("hammer of wrath", ACTION_HIGH), nullptr))); + // triggers.push_back(new TriggerNode( + // "not facing target", + // NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), NULL))); triggers.push_back(new TriggerNode( "enemy out of melee", diff --git a/src/strategy/paladin/GenericPaladinStrategy.cpp b/src/strategy/paladin/GenericPaladinStrategy.cpp index 07437545..37125e94 100644 --- a/src/strategy/paladin/GenericPaladinStrategy.cpp +++ b/src/strategy/paladin/GenericPaladinStrategy.cpp @@ -39,6 +39,7 @@ void PaladinCureStrategy::InitTriggers(std::vector& triggers) void PaladinBoostStrategy::InitTriggers(std::vector& triggers) { + triggers.push_back(new TriggerNode("avenging wrath", NextAction::array(0, new NextAction("avenging wrath", ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode("divine favor", NextAction::array(0, new NextAction("divine favor", ACTION_HIGH + 1), nullptr))); } diff --git a/src/strategy/paladin/PaladinActions.h b/src/strategy/paladin/PaladinActions.h index 219fce3e..c890e47c 100644 --- a/src/strategy/paladin/PaladinActions.h +++ b/src/strategy/paladin/PaladinActions.h @@ -375,4 +375,10 @@ class CastSacredShieldOnMainTankAction : public BuffOnMainTankAction public: CastSacredShieldOnMainTankAction(PlayerbotAI* ai) : BuffOnMainTankAction(ai, "sacred shield", false) {} }; + +class CastAvengingWrathAction : public CastBuffSpellAction +{ + public: + CastAvengingWrathAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "avenging wrath") {} +}; #endif diff --git a/src/strategy/paladin/PaladinAiObjectContext.cpp b/src/strategy/paladin/PaladinAiObjectContext.cpp index f70b35c4..a4250eaa 100644 --- a/src/strategy/paladin/PaladinAiObjectContext.cpp +++ b/src/strategy/paladin/PaladinAiObjectContext.cpp @@ -134,6 +134,8 @@ class PaladinTriggerFactoryInternal : public NamedObjectContext creators["blessing of kings on party"] = &PaladinTriggerFactoryInternal::blessing_of_kings_on_party; creators["blessing of wisdom on party"] = &PaladinTriggerFactoryInternal::blessing_of_wisdom_on_party; creators["blessing of might on party"] = &PaladinTriggerFactoryInternal::blessing_of_might_on_party; + + creators["avenging wrath"] = &PaladinTriggerFactoryInternal::avenging_wrath; } private: @@ -177,6 +179,8 @@ class PaladinTriggerFactoryInternal : public NamedObjectContext static Trigger* blessing_of_kings_on_party(PlayerbotAI* botAI) { return new BlessingOfKingsOnPartyTrigger(botAI); } static Trigger* blessing_of_wisdom_on_party(PlayerbotAI* botAI) { return new BlessingOfWisdomOnPartyTrigger(botAI); } static Trigger* blessing_of_might_on_party(PlayerbotAI* botAI) { return new BlessingOfMightOnPartyTrigger(botAI); } + + static Trigger* avenging_wrath(PlayerbotAI* botAI) { return new AvengingWrathTrigger(botAI); } }; class PaladinAiObjectContextInternal : public NamedObjectContext @@ -257,6 +261,7 @@ class PaladinAiObjectContextInternal : public NamedObjectContext creators["shield of righteousness"] = &PaladinAiObjectContextInternal::shield_of_righteousness; creators["beacon of light on main tank"] = &PaladinAiObjectContextInternal::beacon_of_light_on_main_tank; creators["sacred shield on main tank"] = &PaladinAiObjectContextInternal::sacred_shield_on_main_tank; + creators["avenging wrath"] = &PaladinAiObjectContextInternal::avenging_wrath; } private: @@ -333,6 +338,7 @@ class PaladinAiObjectContextInternal : public NamedObjectContext static Action* shield_of_righteousness(PlayerbotAI* ai) { return new ShieldOfRighteousnessAction(ai); } static Action* beacon_of_light_on_main_tank(PlayerbotAI* ai) { return new CastBeaconOfLightOnMainTankAction(ai); } static Action* sacred_shield_on_main_tank(PlayerbotAI* ai) { return new CastSacredShieldOnMainTankAction(ai); } + static Action* avenging_wrath(PlayerbotAI* ai) { return new CastAvengingWrathAction(ai); } }; PaladinAiObjectContext::PaladinAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) diff --git a/src/strategy/paladin/PaladinTriggers.h b/src/strategy/paladin/PaladinTriggers.h index a669ae78..6a9239bb 100644 --- a/src/strategy/paladin/PaladinTriggers.h +++ b/src/strategy/paladin/PaladinTriggers.h @@ -6,6 +6,7 @@ #define _PLAYERBOT_PALADINTRIGGERS_H #include "CureTriggers.h" +#include "GenericTriggers.h" #include "SharedDefines.h" #include "Unit.h" @@ -216,4 +217,10 @@ class BlessingOfMightOnPartyTrigger : public BuffOnPartyTrigger public: BlessingOfMightOnPartyTrigger(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, "blessing of might,blessing of wisdom", 2 * 2000) { } }; + +class AvengingWrathTrigger : public BoostTrigger +{ + public: + AvengingWrathTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "avenging wrath") {} +}; #endif diff --git a/src/strategy/paladin/TankPaladinStrategy.cpp b/src/strategy/paladin/TankPaladinStrategy.cpp index 8644d83b..583c0c72 100644 --- a/src/strategy/paladin/TankPaladinStrategy.cpp +++ b/src/strategy/paladin/TankPaladinStrategy.cpp @@ -25,6 +25,13 @@ class TankPaladinStrategyActionNodeFactory : public NamedObjectFactory& triggers) { GenericPaladinStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("seal", NextAction::array(0, new NextAction("seal of corruption", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("seal of wisdom", 91.0f), nullptr))); + triggers.push_back(new TriggerNode("seal", NextAction::array(0, new NextAction("seal of command", ACTION_HIGH), nullptr))); + triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("seal of wisdom", ACTION_HIGH + 9), nullptr))); // triggers.push_back(new TriggerNode("devotion aura", NextAction::array(0, new NextAction("devotion aura", 90.0f), NULL))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("avenger's shield", ACTION_HIGH + 5), nullptr))); diff --git a/src/strategy/priest/PriestActions.h b/src/strategy/priest/PriestActions.h index 0b0872e1..cb1a84eb 100644 --- a/src/strategy/priest/PriestActions.h +++ b/src/strategy/priest/PriestActions.h @@ -90,7 +90,7 @@ SPELL_ACTION(CastSilenceAction, "silence"); ENEMY_HEALER_ACTION(CastSilenceOnEnemyHealerAction, "silence"); // shadow talents 2.4.3 DEBUFF_CHECKISOWNER_ACTION(CastVampiricTouchAction, "vampiric touch"); - +DEBUFF_ENEMY_ACTION(CastVampiricTouchOnAttackerAction, "vampiric touch"); // racials DEBUFF_CHECKISOWNER_ACTION(CastDevouringPlagueAction, "devouring plague"); BUFF_ACTION(CastTouchOfWeaknessAction, "touch of weakness"); diff --git a/src/strategy/priest/PriestAiObjectContext.cpp b/src/strategy/priest/PriestAiObjectContext.cpp index 05169ff8..d6810897 100644 --- a/src/strategy/priest/PriestAiObjectContext.cpp +++ b/src/strategy/priest/PriestAiObjectContext.cpp @@ -77,6 +77,7 @@ class PriestTriggerFactoryInternal : public NamedObjectContext creators["divine spirit on party"] = &PriestTriggerFactoryInternal::divine_spirit_on_party; creators["inner fire"] = &PriestTriggerFactoryInternal::inner_fire; creators["vampiric touch"] = &PriestTriggerFactoryInternal::vampiric_touch; + creators["vampiric touch on attacker"] = &PriestTriggerFactoryInternal::vampiric_touch_on_attacker; creators["shadowform"] = &PriestTriggerFactoryInternal::shadowform; creators["vampiric embrace"] = &PriestTriggerFactoryInternal::vampiric_embrace; creators["power infusion"] = &PriestTriggerFactoryInternal::power_infusion; @@ -103,6 +104,7 @@ class PriestTriggerFactoryInternal : public NamedObjectContext static Trigger* vampiric_embrace(PlayerbotAI* botAI) { return new VampiricEmbraceTrigger(botAI); } static Trigger* shadowform(PlayerbotAI* botAI) { return new ShadowformTrigger(botAI); } static Trigger* vampiric_touch(PlayerbotAI* botAI) { return new VampiricTouchTrigger(botAI); } + static Trigger* vampiric_touch_on_attacker(PlayerbotAI* botAI) { return new VampiricTouchOnAttackerTrigger(botAI); } static Trigger* devouring_plague(PlayerbotAI* botAI) { return new DevouringPlagueTrigger(botAI); } static Trigger* shadow_word_pain(PlayerbotAI* botAI) { return new PowerWordPainTrigger(botAI); } static Trigger* shadow_word_pain_on_attacker(PlayerbotAI* botAI) { return new PowerWordPainOnAttackerTrigger(botAI); } @@ -182,6 +184,7 @@ class PriestAiObjectContextInternal : public NamedObjectContext creators["circle of healing"] = &PriestAiObjectContextInternal::circle_of_healing; creators["psychic scream"] = &PriestAiObjectContextInternal::psychic_scream; creators["vampiric touch"] = &PriestAiObjectContextInternal::vampiric_touch; + creators["vampiric touch on attacker"] = &PriestAiObjectContextInternal::vampiric_touch_on_attacker; creators["vampiric embrace"] = &PriestAiObjectContextInternal::vampiric_embrace; creators["dispersion"] = &PriestAiObjectContextInternal::dispersion; creators["shadow protection"] = &PriestAiObjectContextInternal::shadow_protection; @@ -230,6 +233,7 @@ class PriestAiObjectContextInternal : public NamedObjectContext static Action* dispersion(PlayerbotAI* botAI) { return new CastDispersionAction(botAI); } static Action* vampiric_embrace(PlayerbotAI* botAI) { return new CastVampiricEmbraceAction(botAI); } static Action* vampiric_touch(PlayerbotAI* botAI) { return new CastVampiricTouchAction(botAI); } + static Action* vampiric_touch_on_attacker(PlayerbotAI* botAI) { return new CastVampiricTouchOnAttackerAction(botAI); } static Action* psychic_scream(PlayerbotAI* botAI) { return new CastPsychicScreamAction(botAI); } static Action* circle_of_healing(PlayerbotAI* botAI) { return new CastCircleOfHealingAction(botAI); } static Action* resurrection(PlayerbotAI* botAI) { return new CastResurrectionAction(botAI); } diff --git a/src/strategy/priest/PriestTriggers.h b/src/strategy/priest/PriestTriggers.h index 7d529843..126c8663 100644 --- a/src/strategy/priest/PriestTriggers.h +++ b/src/strategy/priest/PriestTriggers.h @@ -14,6 +14,7 @@ DEBUFF_CHECKISOWNER_TRIGGER(HolyFireTrigger, "holy fire"); DEBUFF_CHECKISOWNER_TRIGGER(PowerWordPainTrigger, "shadow word: pain"); DEBUFF_ENEMY_TRIGGER(PowerWordPainOnAttackerTrigger, "shadow word: pain"); DEBUFF_CHECKISOWNER_TRIGGER(VampiricTouchTrigger, "vampiric touch"); +DEBUFF_ENEMY_TRIGGER(VampiricTouchOnAttackerTrigger, "vampiric touch on attacker"); BUFF_TRIGGER(VampiricEmbraceTrigger, "vampiric embrace"); CURE_TRIGGER(DispelMagicTrigger, "dispel magic", DISPEL_MAGIC); CURE_PARTY_TRIGGER(DispelMagicPartyMemberTrigger, "dispel magic", DISPEL_MAGIC); diff --git a/src/strategy/priest/ShadowPriestStrategy.cpp b/src/strategy/priest/ShadowPriestStrategy.cpp index 8210bbec..b187581b 100644 --- a/src/strategy/priest/ShadowPriestStrategy.cpp +++ b/src/strategy/priest/ShadowPriestStrategy.cpp @@ -38,8 +38,9 @@ void ShadowPriestStrategy::InitTriggers(std::vector& triggers) void ShadowPriestAoeStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("shadow word: pain on attacker", NextAction::array(0, new NextAction("shadow word: pain on attacker", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("mind sear", ACTION_HIGH + 4), nullptr))); + triggers.push_back(new TriggerNode("shadow word: pain on attacker", NextAction::array(0, new NextAction("shadow word: pain on attacker", ACTION_NORMAL + 5), nullptr))); + triggers.push_back(new TriggerNode("vampiric touch on attacker", NextAction::array(0, new NextAction("vampiric touch on attacker", ACTION_NORMAL + 4), nullptr))); + // triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("mind sear", ACTION_HIGH + 4), nullptr))); } void ShadowPriestDebuffStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/rogue/DpsRogueStrategy.cpp b/src/strategy/rogue/DpsRogueStrategy.cpp index 5e2c5bba..8ff13bbe 100644 --- a/src/strategy/rogue/DpsRogueStrategy.cpp +++ b/src/strategy/rogue/DpsRogueStrategy.cpp @@ -70,7 +70,9 @@ DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(bot NextAction** DpsRogueStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("melee", ACTION_NORMAL), NULL); + return NextAction::array(0, + new NextAction("killing spree", ACTION_NORMAL + 1), + new NextAction("melee", ACTION_NORMAL), NULL); } void DpsRogueStrategy::InitTriggers(std::vector& triggers) @@ -105,9 +107,9 @@ void DpsRogueStrategy::InitTriggers(std::vector& triggers) "kick on enemy healer", NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), NULL))); - triggers.push_back(new TriggerNode( - "behind target", - NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), NULL))); + // triggers.push_back(new TriggerNode( + // "behind target", + // NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), NULL))); triggers.push_back(new TriggerNode( "light aoe", diff --git a/src/strategy/rogue/RogueActions.h b/src/strategy/rogue/RogueActions.h index 53b4e9bd..c9a84d16 100644 --- a/src/strategy/rogue/RogueActions.h +++ b/src/strategy/rogue/RogueActions.h @@ -102,10 +102,10 @@ class CastAdrenalineRushAction : public CastBuffSpellAction CastAdrenalineRushAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "adrenaline rush") { } }; -class CastKillingSpreeAction : public CastBuffSpellAction +class CastKillingSpreeAction : public CastMeleeSpellAction { public: - CastKillingSpreeAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "killing spree") { } + CastKillingSpreeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "killing spree") { } }; class CastKickOnEnemyHealerAction : public CastSpellOnEnemyHealerAction diff --git a/src/strategy/rogue/RogueAiObjectContext.cpp b/src/strategy/rogue/RogueAiObjectContext.cpp index d0980645..5b5b2063 100644 --- a/src/strategy/rogue/RogueAiObjectContext.cpp +++ b/src/strategy/rogue/RogueAiObjectContext.cpp @@ -72,6 +72,7 @@ class RogueTriggerFactoryInternal : public NamedObjectContext creators["main hand weapon no enchant"] = &RogueTriggerFactoryInternal::main_hand_weapon_no_enchant; creators["off hand weapon no enchant"] = &RogueTriggerFactoryInternal::off_hand_weapon_no_enchant; creators["tricks of the trade on main tank"] = &RogueTriggerFactoryInternal::tricks_of_the_trade_on_main_tank; + creators["adrenaline rush"] = &RogueTriggerFactoryInternal::adrenaline_rush; } private: @@ -128,6 +129,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext creators["use instant poison on main hand"] = &RogueAiObjectContextInternal::use_instant_poison; creators["use deadly poison on off hand"] = &RogueAiObjectContextInternal::use_deadly_poison; creators["fan of knives"] = &RogueAiObjectContextInternal::fan_of_knives; + creators["killing spree"] = &RogueAiObjectContextInternal::killing_spree; } private: @@ -162,6 +164,7 @@ class RogueAiObjectContextInternal : public NamedObjectContext static Action* use_instant_poison(PlayerbotAI* ai) { return new UseInstantPoisonAction(ai); } static Action* use_deadly_poison(PlayerbotAI* ai) { return new UseDeadlyPoisonAction(ai); } static Action* fan_of_knives(PlayerbotAI* ai) { return new FanOfKnivesAction(ai); } + static Action* killing_spree(PlayerbotAI* ai) { return new CastKillingSpreeAction(ai); } }; RogueAiObjectContext::RogueAiObjectContext(PlayerbotAI* botAI) : AiObjectContext(botAI) diff --git a/src/strategy/rogue/RogueTriggers.cpp b/src/strategy/rogue/RogueTriggers.cpp index c31b903d..b4a4f1b7 100644 --- a/src/strategy/rogue/RogueTriggers.cpp +++ b/src/strategy/rogue/RogueTriggers.cpp @@ -6,10 +6,10 @@ #include "Playerbots.h" #include "ServerFacade.h" -bool AdrenalineRushTrigger::isPossible() -{ - return !botAI->HasAura("stealth", bot); -} +// bool AdrenalineRushTrigger::isPossible() +// { +// return !botAI->HasAura("stealth", bot); +// } bool UnstealthTrigger::IsActive() { diff --git a/src/strategy/rogue/RogueTriggers.h b/src/strategy/rogue/RogueTriggers.h index 8e94c23f..4d494868 100644 --- a/src/strategy/rogue/RogueTriggers.h +++ b/src/strategy/rogue/RogueTriggers.h @@ -21,12 +21,12 @@ class SliceAndDiceTrigger : public BuffTrigger SliceAndDiceTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "slice and dice") { } }; -class AdrenalineRushTrigger : public BuffTrigger +class AdrenalineRushTrigger : public BoostTrigger { public: - AdrenalineRushTrigger(PlayerbotAI* botAI) : BuffTrigger(botAI, "adrenaline rush") { } + AdrenalineRushTrigger(PlayerbotAI* botAI) : BoostTrigger(botAI, "adrenaline rush") { } - bool isPossible(); + // bool isPossible(); }; class RuptureTrigger : public DebuffTrigger diff --git a/src/strategy/shaman/MeleeShamanStrategy.cpp b/src/strategy/shaman/MeleeShamanStrategy.cpp index 545bf92a..c514dc33 100644 --- a/src/strategy/shaman/MeleeShamanStrategy.cpp +++ b/src/strategy/shaman/MeleeShamanStrategy.cpp @@ -67,14 +67,17 @@ void MeleeShamanStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode("flame shock", NextAction::array(0, new NextAction("flame shock", 20.0f), nullptr))); triggers.push_back(new TriggerNode( "maelstrom weapon", - NextAction::array(0, new NextAction("lightning bolt", 25.0f), NULL))); + NextAction::array(0, new NextAction("lightning bolt", 25.0f), nullptr))); triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_NORMAL + 7), nullptr))); // triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr))); triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("strength of earth totem", ACTION_LIGHT_HEAL), nullptr))); triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr))); triggers.push_back(new TriggerNode( "no fire totem", - NextAction::array(0, new NextAction("reach melee", 23.0f), new NextAction("magma totem", 22.0f), NULL))); + NextAction::array(0, new NextAction("reach melee", 23.0f), new NextAction("magma totem", 22.0f), nullptr))); + triggers.push_back(new TriggerNode( + "medium mana", + NextAction::array(0, new NextAction("shamanistic rage", 23.0f), nullptr))); } void MeleeAoeShamanStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/shaman/ShamanActions.h b/src/strategy/shaman/ShamanActions.h index 67f53052..2002a5be 100644 --- a/src/strategy/shaman/ShamanActions.h +++ b/src/strategy/shaman/ShamanActions.h @@ -402,4 +402,10 @@ class CastWrathOfAirTotemAction : public CastTotemAction public: CastWrathOfAirTotemAction(PlayerbotAI* ai) : CastTotemAction(ai, "wrath of air totem") {} }; + +class CastShamanisticRageAction : public CastBuffSpellAction +{ + public: + CastShamanisticRageAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "shamanistic rage") {} +}; #endif diff --git a/src/strategy/shaman/ShamanAiObjectContext.cpp b/src/strategy/shaman/ShamanAiObjectContext.cpp index 406df864..234f5bb3 100644 --- a/src/strategy/shaman/ShamanAiObjectContext.cpp +++ b/src/strategy/shaman/ShamanAiObjectContext.cpp @@ -212,6 +212,7 @@ class ShamanAiObjectContextInternal : public NamedObjectContext creators["totem of wrath"] = &ShamanAiObjectContextInternal::totem_of_wrath; creators["fire elemental totem"] = &ShamanAiObjectContextInternal::fire_elemental_totem; creators["wrath of air totem"] = &ShamanAiObjectContextInternal::wrath_of_air_totem; + creators["shamanistic rage"] = &ShamanAiObjectContextInternal::shamanistic_rage; } private: @@ -273,6 +274,8 @@ class ShamanAiObjectContextInternal : public NamedObjectContext static Action* totem_of_wrath(PlayerbotAI* ai) { return new CastTotemOfWrathAction(ai); } static Action* fire_elemental_totem(PlayerbotAI* ai) { return new CastFireElementalTotemAction(ai); } static Action* wrath_of_air_totem(PlayerbotAI* ai) { return new CastWrathOfAirTotemAction(ai); } + static Action* shamanistic_rage(PlayerbotAI* ai) { return new CastShamanisticRageAction(ai); } + }; diff --git a/src/strategy/triggers/GenericTriggers.cpp b/src/strategy/triggers/GenericTriggers.cpp index 8948be16..7ed83a6a 100644 --- a/src/strategy/triggers/GenericTriggers.cpp +++ b/src/strategy/triggers/GenericTriggers.cpp @@ -239,6 +239,15 @@ bool SpellNoCooldownTrigger::IsActive() return !bot->HasSpellCooldown(spellId); } +bool SpellCooldownTrigger::IsActive() +{ + uint32 spellId = AI_VALUE2(uint32, "spell id", name); + if (!spellId) + return false; + + return bot->HasSpellCooldown(spellId); +} + RandomTrigger::RandomTrigger(PlayerbotAI* botAI, std::string const name, int32 probability) : Trigger(botAI, name), probability(probability), lastCheck(getMSTime()) { } diff --git a/src/strategy/triggers/GenericTriggers.h b/src/strategy/triggers/GenericTriggers.h index f0366025..9d4ad5e0 100644 --- a/src/strategy/triggers/GenericTriggers.h +++ b/src/strategy/triggers/GenericTriggers.h @@ -143,6 +143,15 @@ class SpellNoCooldownTrigger : public SpellTrigger bool IsActive() override; }; +class SpellCooldownTrigger : public SpellTrigger +{ + public: + SpellCooldownTrigger(PlayerbotAI* botAI, std::string const spell) : SpellTrigger(botAI, spell) { } + + std::string const GetTargetName() override { return "self target"; } + bool IsActive() override; +}; + // TODO: check other targets class InterruptSpellTrigger : public SpellTrigger { @@ -470,7 +479,6 @@ class HasAuraTrigger : public Trigger std::string const GetTargetName() override { return "self target"; } bool IsActive() override; - }; class HasAuraStackTrigger : public Trigger { @@ -750,7 +758,7 @@ class HasAreaDebuffTrigger : public Trigger { class BuffOnMainTankTrigger : public BuffTrigger { public: - BuffOnMainTankTrigger(PlayerbotAI* botAI, std::string spell, bool checkIsOwner = false) : BuffTrigger(botAI, spell, 1, checkIsOwner) {} + BuffOnMainTankTrigger(PlayerbotAI* botAI, std::string spell, bool checkIsOwner = false, int checkInterval = 1) : BuffTrigger(botAI, spell, checkInterval, checkIsOwner) {} public: virtual Value* GetTargetValue(); }; diff --git a/src/strategy/warlock/DpsWarlockStrategy.cpp b/src/strategy/warlock/DpsWarlockStrategy.cpp index bc7c5790..b5978198 100644 --- a/src/strategy/warlock/DpsWarlockStrategy.cpp +++ b/src/strategy/warlock/DpsWarlockStrategy.cpp @@ -78,19 +78,23 @@ void DpsWarlockStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "decimation", NextAction::array(0, new NextAction("soul fire", 16.0f), NULL))); + + triggers.push_back(new TriggerNode( + "metamorphosis", + NextAction::array(0, new NextAction("metamorphosis", 20.0f), NULL))); } void DpsAoeWarlockStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("rain of fire", 37.0f), nullptr))); triggers.push_back(new TriggerNode("corruption on attacker", NextAction::array(0, new NextAction("corruption on attacker", 27.0f), nullptr))); - // triggers.push_back(new TriggerNode("curse of agony on attacker", NextAction::array(0, new NextAction("curse of agony on attacker", 28.0f), nullptr))); triggers.push_back(new TriggerNode("unstable affliction on attacker", NextAction::array(0, new NextAction("unstable affliction on attacker", 26.0f), NULL))); + triggers.push_back(new TriggerNode("curse of agony on attacker", NextAction::array(0, new NextAction("curse of agony on attacker", 25.0f), nullptr))); } void DpsWarlockDebuffStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("corruption", NextAction::array(0, new NextAction("corruption", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("curse of agony", NextAction::array(0, new NextAction("curse of agony", 20.0f), nullptr))); triggers.push_back(new TriggerNode("unstable affliction", NextAction::array(0, new NextAction("unstable affliction", 21.0f), NULL))); + triggers.push_back(new TriggerNode("curse of agony", NextAction::array(0, new NextAction("curse of agony", 20.0f), nullptr))); } diff --git a/src/strategy/warrior/FuryWarriorStrategy.cpp b/src/strategy/warrior/FuryWarriorStrategy.cpp index 2f39cb5d..c277065e 100644 --- a/src/strategy/warrior/FuryWarriorStrategy.cpp +++ b/src/strategy/warrior/FuryWarriorStrategy.cpp @@ -63,6 +63,6 @@ void FuryWarriorStrategy::InitTriggers(std::vector &triggers) triggers.push_back(new TriggerNode("berserker rage", NextAction::array(0, new NextAction("berserker rage", ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode("death wish", NextAction::array(0, new NextAction("death wish", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode("rampage", NextAction::array(0, new NextAction("rampage", ACTION_INTERRUPT + 1), nullptr))); + // triggers.push_back(new TriggerNode("rampage", NextAction::array(0, new NextAction("rampage", ACTION_INTERRUPT + 1), nullptr))); triggers.push_back(new TriggerNode("high rage available", NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH + 1), NULL))); }