From cd830dea8a50500bf61bc1c05e684a312a86427b Mon Sep 17 00:00:00 2001 From: Jasper <97269008+jads147@users.noreply.github.com> Date: Sat, 3 Jan 2026 23:18:59 +0100 Subject: [PATCH 1/2] Feature: Relaxed Follo: Only move if further than x meter but less then y meter away from following target. --- conf/playerbots.conf.dist | 3 ++ src/PlayerbotAIConfig.cpp | 1 + src/PlayerbotAIConfig.h | 2 +- src/strategy/StrategyContext.h | 3 ++ src/strategy/actions/FollowActions.cpp | 33 ++++++++++++++++++- .../generic/RelaxedFollowStrategy.cpp | 8 +++++ src/strategy/generic/RelaxedFollowStrategy.h | 21 ++++++++++++ 7 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 src/strategy/generic/RelaxedFollowStrategy.cpp create mode 100644 src/strategy/generic/RelaxedFollowStrategy.h diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 2c317a4aa9..01791ed821 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -370,6 +370,9 @@ AiPlayerbot.AggroDistance = 22 AiPlayerbot.TooCloseDistance = 5.0 AiPlayerbot.MeleeDistance = 0.75 AiPlayerbot.FollowDistance = 1.5 +# Distance to maintain when using "relaxed follow" strategy +# Bots move to this distance from master when they get too far +AiPlayerbot.RelaxedFollowDistance = 1.0 AiPlayerbot.WhisperDistance = 6000.0 AiPlayerbot.ContactDistance = 0.45 AiPlayerbot.AoeRadius = 10 diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index d8a8b0b4cd..fcc50c11d6 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -98,6 +98,7 @@ bool PlayerbotAIConfig::Initialize() tooCloseDistance = sConfigMgr->GetOption("AiPlayerbot.TooCloseDistance", 5.0f); meleeDistance = sConfigMgr->GetOption("AiPlayerbot.MeleeDistance", 0.75f); followDistance = sConfigMgr->GetOption("AiPlayerbot.FollowDistance", 1.5f); + relaxedFollowDistance = sConfigMgr->GetOption("AiPlayerbot.RelaxedFollowDistance", 1.0f); whisperDistance = sConfigMgr->GetOption("AiPlayerbot.WhisperDistance", 6000.0f); contactDistance = sConfigMgr->GetOption("AiPlayerbot.ContactDistance", 0.45f); aoeRadius = sConfigMgr->GetOption("AiPlayerbot.AoeRadius", 10.0f); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index fb112fc907..2346ef1591 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -85,7 +85,7 @@ class PlayerbotAIConfig dispelAuraDuration, passiveDelay, repeatDelay, errorDelay, rpgDelay, sitDelay, returnDelay, lootDelay; bool dynamicReactDelay; float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance, fleeDistance, - tooCloseDistance, meleeDistance, followDistance, whisperDistance, contactDistance, aoeRadius, rpgDistance, + tooCloseDistance, meleeDistance, followDistance, relaxedFollowDistance, whisperDistance, contactDistance, aoeRadius, rpgDistance, targetPosRecalcDistance, farDistance, healDistance, aggroDistance; uint32 criticalHealth, lowHealth, mediumHealth, almostFullHealth; uint32 lowMana, mediumMana, highMana; diff --git a/src/strategy/StrategyContext.h b/src/strategy/StrategyContext.h index 0cc6855f34..3953263562 100644 --- a/src/strategy/StrategyContext.h +++ b/src/strategy/StrategyContext.h @@ -39,6 +39,7 @@ #include "RTSCStrategy.h" #include "RacialsStrategy.h" #include "RangedCombatStrategy.h" +#include "RelaxedFollowStrategy.h" #include "ReturnStrategy.h" #include "RpgStrategy.h" #include "RunawayStrategy.h" @@ -122,6 +123,7 @@ class StrategyContext : public NamedObjectContext creators["worldbuff"] = &StrategyContext::world_buff; creators["use bobber"] = &StrategyContext::bobber_strategy; creators["master fishing"] = &StrategyContext::master_fishing; + creators["relaxed follow"] = &StrategyContext::relaxed_follow; } private: @@ -192,6 +194,7 @@ class StrategyContext : public NamedObjectContext static Strategy* world_buff(PlayerbotAI* botAI) { return new WorldBuffStrategy(botAI); } static Strategy* bobber_strategy(PlayerbotAI* botAI) { return new UseBobberStrategy(botAI); } static Strategy* master_fishing(PlayerbotAI* botAI) { return new MasterFishingStrategy(botAI); } + static Strategy* relaxed_follow(PlayerbotAI* botAI) { return new RelaxedFollowStrategy(botAI); } }; class MovementStrategyContext : public NamedObjectContext diff --git a/src/strategy/actions/FollowActions.cpp b/src/strategy/actions/FollowActions.cpp index 2593ea28e5..053ab2dbb6 100644 --- a/src/strategy/actions/FollowActions.cpp +++ b/src/strategy/actions/FollowActions.cpp @@ -23,7 +23,38 @@ bool FollowAction::Execute(Event event) bool moved = false; if (!target.empty()) { - moved = Follow(AI_VALUE(Unit*, target)); + // Relaxed follow: stay in radius, don't adjust angle/formation + if (botAI->HasStrategy("relaxed follow", BOT_STATE_NON_COMBAT)) + { + Unit* followTarget = AI_VALUE(Unit*, target); + if (!followTarget) + return false; + + // Only move if bot is too far away from target + float distance = sServerFacade->GetDistance2d(bot, followTarget); + float maxDistance = formation->GetMaxDistance(); + + if (distance > maxDistance) + { + // Calculate position at relaxedFollowDistance from master + // Move towards master but stop at configured distance + float keepDistance = sPlayerbotAIConfig->relaxedFollowDistance; + float angle = followTarget->GetAngle(bot); // Angle from master to bot + float targetX = followTarget->GetPositionX() + cos(angle) * keepDistance; + float targetY = followTarget->GetPositionY() + sin(angle) * keepDistance; + float targetZ = followTarget->GetPositionZ(); + + moved = MoveTo(followTarget->GetMapId(), + targetX, targetY, targetZ, + false, false, false, true, + botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL, + true); + } + } + else + { + moved = Follow(AI_VALUE(Unit*, target)); + } } else { diff --git a/src/strategy/generic/RelaxedFollowStrategy.cpp b/src/strategy/generic/RelaxedFollowStrategy.cpp new file mode 100644 index 0000000000..535aa335bf --- /dev/null +++ b/src/strategy/generic/RelaxedFollowStrategy.cpp @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "RelaxedFollowStrategy.h" + +#include "Playerbots.h" diff --git a/src/strategy/generic/RelaxedFollowStrategy.h b/src/strategy/generic/RelaxedFollowStrategy.h new file mode 100644 index 0000000000..0257b16346 --- /dev/null +++ b/src/strategy/generic/RelaxedFollowStrategy.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_RELAXEDFOLLOWSTRATEGY_H +#define _PLAYERBOT_RELAXEDFOLLOWSTRATEGY_H + +#include "Strategy.h" + +class PlayerbotAI; + +class RelaxedFollowStrategy : public Strategy +{ +public: + RelaxedFollowStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + + std::string const getName() override { return "relaxed follow"; } +}; + +#endif From 0fd0e71bbc3ec54b4208b513d852c566ca84ce16 Mon Sep 17 00:00:00 2001 From: Jasper <97269008+jads147@users.noreply.github.com> Date: Sun, 25 Jan 2026 19:45:16 +0100 Subject: [PATCH 2/2] Merge origin/master into feature/relaxed-follow-clean Resolved file location conflicts after directory restructuring: - src/strategy/generic/ -> src/Ai/Base/Strategy/ - RelaxedFollowStrategy.cpp and .h moved to new location Co-Authored-By: Claude Opus 4.5 --- .github/workflows/windows_build.yml | 6 +- PULL_REQUEST_TEMPLATE.md | 127 +++++ conf/playerbots.conf.dist | 71 ++- .../actions => Ai/Base}/ActionContext.h | 0 .../AcceptBattlegroundInvitationAction.cpp | 0 .../AcceptBattlegroundInvitationAction.h | 0 .../Base/Actions}/AcceptDuelAction.cpp | 0 .../Base/Actions}/AcceptDuelAction.h | 0 .../Base/Actions}/AcceptInvitationAction.cpp | 4 +- .../Base/Actions}/AcceptInvitationAction.h | 0 .../Base/Actions}/AcceptQuestAction.cpp | 0 .../Base/Actions}/AcceptQuestAction.h | 0 .../Base/Actions}/AcceptResurrectAction.cpp | 0 .../Base/Actions}/AcceptResurrectAction.h | 0 .../Base/Actions}/AddLootAction.cpp | 0 .../Base/Actions}/AddLootAction.h | 0 .../Base/Actions}/AreaTriggerAction.cpp | 0 .../Base/Actions}/AreaTriggerAction.h | 0 .../Base/Actions}/ArenaTeamActions.cpp | 0 .../Base/Actions}/ArenaTeamActions.h | 0 .../Base/Actions}/AttackAction.cpp | 2 +- .../Base/Actions}/AttackAction.h | 0 .../AutoMaintenanceOnLevelupAction.cpp | 96 ++-- .../Actions}/AutoMaintenanceOnLevelupAction.h | 1 - .../Base/Actions}/BankAction.cpp | 0 .../actions => Ai/Base/Actions}/BankAction.h | 0 .../Base/Actions}/BattleGroundJoinAction.cpp | 0 .../Base/Actions}/BattleGroundJoinAction.h | 0 .../Base/Actions}/BattleGroundTactics.cpp | 0 .../Base/Actions}/BattleGroundTactics.h | 0 .../Base/Actions}/BossAuraActions.cpp | 0 .../Base/Actions}/BossAuraActions.h | 0 .../Base/Actions}/BuffAction.cpp | 0 .../actions => Ai/Base/Actions}/BuffAction.h | 0 .../actions => Ai/Base/Actions}/BuyAction.cpp | 0 .../actions => Ai/Base/Actions}/BuyAction.h | 0 .../Base/Actions}/CancelChannelAction.cpp | 0 .../Base/Actions}/CancelChannelAction.h | 0 .../Base/Actions}/CastCustomSpellAction.cpp | 0 .../Base/Actions}/CastCustomSpellAction.h | 0 .../Base/Actions}/ChangeChatAction.cpp | 0 .../Base/Actions}/ChangeChatAction.h | 0 .../Base/Actions}/ChangeStrategyAction.cpp | 6 +- .../Base/Actions}/ChangeStrategyAction.h | 0 .../Base/Actions}/ChangeTalentsAction.cpp | 0 .../Base/Actions}/ChangeTalentsAction.h | 0 .../Base/Actions}/ChatShortcutActions.cpp | 0 .../Base/Actions}/ChatShortcutActions.h | 0 .../Base/Actions}/CheatAction.cpp | 0 .../actions => Ai/Base/Actions}/CheatAction.h | 0 .../Base/Actions}/CheckMailAction.cpp | 0 .../Base/Actions}/CheckMailAction.h | 0 .../Base/Actions}/CheckMountStateAction.cpp | 0 .../Base/Actions}/CheckMountStateAction.h | 0 .../Base/Actions}/CheckValuesAction.cpp | 0 .../Base/Actions}/CheckValuesAction.h | 0 .../Base/Actions}/ChooseRpgTargetAction.cpp | 9 +- .../Base/Actions}/ChooseRpgTargetAction.h | 0 .../Base/Actions}/ChooseTargetActions.cpp | 0 .../Base/Actions}/ChooseTargetActions.h | 0 .../Actions}/ChooseTravelTargetAction.cpp | 0 .../Base/Actions}/ChooseTravelTargetAction.h | 0 .../Base/Actions}/CombatActions.cpp | 0 .../Base/Actions}/CombatActions.h | 0 .../Actions}/CustomStrategyEditAction.cpp | 0 .../Base/Actions}/CustomStrategyEditAction.h | 0 .../Base/Actions}/DebugAction.cpp | 0 .../actions => Ai/Base/Actions}/DebugAction.h | 0 .../Base/Actions}/DelayAction.cpp | 0 .../actions => Ai/Base/Actions}/DelayAction.h | 0 .../Base/Actions}/DestroyItemAction.cpp | 0 .../Base/Actions}/DestroyItemAction.h | 0 .../Base/Actions}/DropQuestAction.cpp | 0 .../Base/Actions}/DropQuestAction.h | 0 .../Base/Actions}/EmoteAction.cpp | 0 .../actions => Ai/Base/Actions}/EmoteAction.h | 0 .../Base/Actions}/EquipAction.cpp | 0 .../actions => Ai/Base/Actions}/EquipAction.h | 0 .../Base/Actions}/EquipGlyphsAction.cpp | 0 .../Base/Actions}/EquipGlyphsAction.h | 0 .../Base/Actions}/FishingAction.cpp | 24 +- .../Base/Actions}/FishingAction.h | 0 .../Base/Actions}/FlagAction.cpp | 0 .../actions => Ai/Base/Actions}/FlagAction.h | 0 .../Base/Actions}/FollowActions.cpp | 0 .../Base/Actions}/FollowActions.h | 0 .../Base/Actions}/GenericActions.cpp | 0 .../Base/Actions}/GenericActions.h | 0 .../Base/Actions}/GenericBuffUtils.cpp | 0 .../Base/Actions}/GenericBuffUtils.h | 0 .../Base/Actions}/GenericSpellActions.cpp | 5 - .../Base/Actions}/GenericSpellActions.h | 14 +- .../Base/Actions}/GiveItemAction.cpp | 0 .../Base/Actions}/GiveItemAction.h | 0 .../actions => Ai/Base/Actions}/GoAction.cpp | 0 .../actions => Ai/Base/Actions}/GoAction.h | 0 .../Base/Actions}/GossipHelloAction.cpp | 0 .../Base/Actions}/GossipHelloAction.h | 0 .../Base/Actions}/GreetAction.cpp | 0 .../actions => Ai/Base/Actions}/GreetAction.h | 0 .../Base/Actions}/GuildAcceptAction.cpp | 0 .../Base/Actions}/GuildAcceptAction.h | 0 .../Base/Actions}/GuildBankAction.cpp | 0 .../Base/Actions}/GuildBankAction.h | 0 .../Base/Actions}/GuildCreateActions.cpp | 0 .../Base/Actions}/GuildCreateActions.h | 0 .../Base/Actions}/GuildManagementActions.cpp | 0 .../Base/Actions}/GuildManagementActions.h | 0 .../Base/Actions}/HelpAction.cpp | 0 .../actions => Ai/Base/Actions}/HelpAction.h | 0 .../Base/Actions}/HireAction.cpp | 0 .../actions => Ai/Base/Actions}/HireAction.h | 0 .../Base/Actions}/ImbueAction.cpp | 0 .../actions => Ai/Base/Actions}/ImbueAction.h | 0 .../Base/Actions}/InventoryAction.cpp | 0 .../Base/Actions}/InventoryAction.h | 0 .../Actions}/InventoryChangeFailureAction.cpp | 0 .../Actions}/InventoryChangeFailureAction.h | 0 .../Base/Actions}/InviteToGroupAction.cpp | 0 .../Base/Actions}/InviteToGroupAction.h | 0 .../Base/Actions}/LeaveGroupAction.cpp | 0 .../Base/Actions}/LeaveGroupAction.h | 0 .../Base/Actions}/LfgActions.cpp | 0 .../actions => Ai/Base/Actions}/LfgActions.h | 0 .../Base/Actions}/ListQuestsActions.cpp | 0 .../Base/Actions}/ListQuestsActions.h | 0 .../Base/Actions}/ListSpellsAction.cpp | 6 +- .../Base/Actions}/ListSpellsAction.h | 0 .../Base/Actions}/LogLevelAction.cpp | 0 .../Base/Actions}/LogLevelAction.h | 0 .../Base/Actions}/LootAction.cpp | 0 .../actions => Ai/Base/Actions}/LootAction.h | 0 .../Base/Actions}/LootRollAction.cpp | 0 .../Base/Actions}/LootRollAction.h | 0 .../Base/Actions}/LootStrategyAction.cpp | 0 .../Base/Actions}/LootStrategyAction.h | 0 .../Base/Actions}/MailAction.cpp | 0 .../actions => Ai/Base/Actions}/MailAction.h | 0 .../Base/Actions}/MoveToRpgTargetAction.cpp | 0 .../Base/Actions}/MoveToRpgTargetAction.h | 0 .../Actions}/MoveToTravelTargetAction.cpp | 0 .../Base/Actions}/MoveToTravelTargetAction.h | 0 .../Base/Actions}/MovementActions.cpp | 31 +- .../Base/Actions}/MovementActions.h | 0 .../Base/Actions}/NonCombatActions.cpp | 0 .../Base/Actions}/NonCombatActions.h | 0 .../Base/Actions}/OpenItemAction.cpp | 0 .../Base/Actions}/OpenItemAction.h | 0 .../Base/Actions}/OutfitAction.cpp | 0 .../Base/Actions}/OutfitAction.h | 0 .../Actions}/PassLeadershipToMasterAction.cpp | 0 .../Actions}/PassLeadershipToMasterAction.h | 0 .../Base/Actions}/PetitionSignAction.cpp | 0 .../Base/Actions}/PetitionSignAction.h | 0 .../Base/Actions}/PetsAction.cpp | 0 .../actions => Ai/Base/Actions}/PetsAction.h | 0 .../Base/Actions}/PositionAction.cpp | 0 .../Base/Actions}/PositionAction.h | 0 .../Base/Actions}/QueryItemUsageAction.cpp | 0 .../Base/Actions}/QueryItemUsageAction.h | 0 .../Base/Actions}/QueryQuestAction.cpp | 0 .../Base/Actions}/QueryQuestAction.h | 0 .../Base/Actions}/QuestAction.cpp | 0 .../actions => Ai/Base/Actions}/QuestAction.h | 0 .../Actions}/QuestConfirmAcceptAction.cpp | 0 .../Base/Actions}/QuestConfirmAcceptAction.h | 0 .../Base/Actions}/RandomBotUpdateAction.cpp | 0 .../Base/Actions}/RandomBotUpdateAction.h | 0 .../Base/Actions}/RangeAction.cpp | 0 .../actions => Ai/Base/Actions}/RangeAction.h | 0 .../Base/Actions}/ReachTargetActions.cpp | 0 .../Base/Actions}/ReachTargetActions.h | 0 .../Base/Actions}/ReadyCheckAction.cpp | 0 .../Base/Actions}/ReadyCheckAction.h | 0 .../Base/Actions}/ReleaseSpiritAction.cpp | 0 .../Base/Actions}/ReleaseSpiritAction.h | 0 .../Base/Actions}/RememberTaxiAction.cpp | 0 .../Base/Actions}/RememberTaxiAction.h | 0 .../Base/Actions}/RemoveAuraAction.cpp | 0 .../Base/Actions}/RemoveAuraAction.h | 0 .../Base/Actions}/RepairAllAction.cpp | 0 .../Base/Actions}/RepairAllAction.h | 0 .../Base/Actions}/ResetAiAction.cpp | 4 +- .../Base/Actions}/ResetAiAction.h | 0 .../Base/Actions}/ResetInstancesAction.cpp | 0 .../Base/Actions}/ResetInstancesAction.h | 0 .../Actions}/RevealGatheringItemAction.cpp | 0 .../Base/Actions}/RevealGatheringItemAction.h | 0 .../Base/Actions}/ReviveFromCorpseAction.cpp | 0 .../Base/Actions}/ReviveFromCorpseAction.h | 0 .../Base/Actions}/RewardAction.cpp | 0 .../Base/Actions}/RewardAction.h | 0 .../actions => Ai/Base/Actions}/RpgAction.cpp | 13 +- .../actions => Ai/Base/Actions}/RpgAction.h | 0 .../Base/Actions}/RpgSubActions.cpp | 0 .../Base/Actions}/RpgSubActions.h | 0 .../actions => Ai/Base/Actions}/RpgValues.h | 0 .../actions => Ai/Base/Actions}/RtiAction.cpp | 0 .../actions => Ai/Base/Actions}/RtiAction.h | 0 .../Base/Actions}/RtscAction.cpp | 0 .../actions => Ai/Base/Actions}/RtscAction.h | 0 .../Base/Actions}/SaveManaAction.cpp | 0 .../Base/Actions}/SaveManaAction.h | 0 .../actions => Ai/Base/Actions}/SayAction.cpp | 0 .../actions => Ai/Base/Actions}/SayAction.h | 0 .../Base/Actions}/SecurityCheckAction.cpp | 0 .../Base/Actions}/SecurityCheckAction.h | 0 .../Base/Actions}/SeeSpellAction.cpp | 0 .../Base/Actions}/SeeSpellAction.h | 0 .../Base/Actions}/SellAction.cpp | 0 .../actions => Ai/Base/Actions}/SellAction.h | 0 .../Base/Actions}/SendMailAction.cpp | 0 .../Base/Actions}/SendMailAction.h | 0 .../Base/Actions}/SetCraftAction.cpp | 0 .../Base/Actions}/SetCraftAction.h | 0 .../Base/Actions}/SetHomeAction.cpp | 0 .../Base/Actions}/SetHomeAction.h | 0 .../Base/Actions}/ShareQuestAction.cpp | 0 .../Base/Actions}/ShareQuestAction.h | 0 .../Base/Actions}/SkipSpellsListAction.cpp | 0 .../Base/Actions}/SkipSpellsListAction.h | 0 .../Base/Actions}/StatsAction.cpp | 0 .../actions => Ai/Base/Actions}/StatsAction.h | 0 .../Base/Actions}/StayActions.cpp | 0 .../actions => Ai/Base/Actions}/StayActions.h | 0 .../Base/Actions}/SuggestWhatToDoAction.cpp | 2 +- .../Base/Actions}/SuggestWhatToDoAction.h | 0 .../Base/Actions}/TalkToQuestGiverAction.cpp | 0 .../Base/Actions}/TalkToQuestGiverAction.h | 0 .../Base/Actions}/TameAction.cpp | 0 .../actions => Ai/Base/Actions}/TameAction.h | 0 .../Base/Actions}/TaxiAction.cpp | 0 .../actions => Ai/Base/Actions}/TaxiAction.h | 0 .../Base/Actions}/TeleportAction.cpp | 0 .../Base/Actions}/TeleportAction.h | 0 .../Base/Actions}/TellCastFailedAction.cpp | 0 .../Base/Actions}/TellCastFailedAction.h | 0 .../Base/Actions}/TellGlyphsAction.cpp | 0 .../Base/Actions}/TellGlyphsAction.h | 0 .../Base/Actions}/TellItemCountAction.cpp | 0 .../Base/Actions}/TellItemCountAction.h | 0 .../Base/Actions}/TellLosAction.cpp | 0 .../Base/Actions}/TellLosAction.h | 0 .../Base/Actions}/TellMasterAction.cpp | 0 .../Base/Actions}/TellMasterAction.h | 0 .../Base/Actions}/TellReputationAction.cpp | 0 .../Base/Actions}/TellReputationAction.h | 0 .../Base/Actions}/TellTargetAction.cpp | 0 .../Base/Actions}/TellTargetAction.h | 0 .../Base/Actions}/TradeAction.cpp | 0 .../actions => Ai/Base/Actions}/TradeAction.h | 0 .../Base/Actions}/TradeStatusAction.cpp | 0 .../Base/Actions}/TradeStatusAction.h | 0 .../Actions}/TradeStatusExtendedAction.cpp | 0 .../Base/Actions}/TradeStatusExtendedAction.h | 0 .../Base/Actions}/TradeValues.cpp | 0 .../actions => Ai/Base/Actions}/TradeValues.h | 0 .../Base/Actions}/TrainerAction.cpp | 59 +-- .../Base/Actions}/TrainerAction.h | 5 +- .../Base/Actions}/TravelAction.cpp | 2 +- .../Base/Actions}/TravelAction.h | 0 .../Base/Actions}/UnequipAction.cpp | 0 .../Base/Actions}/UnequipAction.h | 0 .../Base/Actions}/UnlockItemAction.cpp | 0 .../Base/Actions}/UnlockItemAction.h | 0 .../Base/Actions}/UnlockTradedItemAction.cpp | 0 .../Base/Actions}/UnlockTradedItemAction.h | 0 .../Base/Actions}/UseItemAction.cpp | 6 +- .../Base/Actions}/UseItemAction.h | 0 .../Base/Actions}/UseMeetingStoneAction.cpp | 24 +- .../Base/Actions}/UseMeetingStoneAction.h | 6 +- .../Base/Actions}/VehicleActions.cpp | 0 .../Base/Actions}/VehicleActions.h | 0 .../actions => Ai/Base/Actions}/WhoAction.cpp | 0 .../actions => Ai/Base/Actions}/WhoAction.h | 0 .../Base/Actions}/WipeAction.cpp | 0 .../actions => Ai/Base/Actions}/WipeAction.h | 0 .../Base/Actions}/WorldBuffAction.cpp | 0 .../Base/Actions}/WorldBuffAction.h | 0 .../actions => Ai/Base/Actions}/WtsAction.cpp | 0 .../actions => Ai/Base/Actions}/WtsAction.h | 0 .../Base/Actions}/XpGainAction.cpp | 0 .../Base/Actions}/XpGainAction.h | 0 .../actions => Ai/Base}/ChatActionContext.h | 0 .../triggers => Ai/Base}/ChatTriggerContext.h | 0 .../values => Ai/Base}/SharedValueContext.h | 0 .../Strategy}/AttackEnemyPlayersStrategy.cpp | 2 +- .../Strategy}/AttackEnemyPlayersStrategy.h | 0 src/Ai/Base/Strategy/BattlegroundStrategy.cpp | 87 ++++ .../Base/Strategy}/BattlegroundStrategy.h | 0 .../Base/Strategy}/CastTimeStrategy.cpp | 0 .../Base/Strategy}/CastTimeStrategy.h | 0 .../Strategy/ChatCommandHandlerStrategy.cpp | 193 ++++++++ .../Strategy}/ChatCommandHandlerStrategy.h | 0 src/Ai/Base/Strategy/CombatStrategy.cpp | 94 ++++ .../Base/Strategy}/CombatStrategy.h | 6 +- .../Base/Strategy}/ConserveManaStrategy.cpp | 0 .../Base/Strategy}/ConserveManaStrategy.h | 0 src/Ai/Base/Strategy/DeadStrategy.cpp | 32 ++ .../Base/Strategy}/DeadStrategy.h | 0 .../Base/Strategy}/DebugStrategy.cpp | 0 .../Base/Strategy}/DebugStrategy.h | 0 .../Base/Strategy}/DpsAssistStrategy.cpp | 4 +- .../Base/Strategy}/DpsAssistStrategy.h | 0 .../Base/Strategy}/DuelStrategy.cpp | 4 +- .../Base/Strategy}/DuelStrategy.h | 0 src/Ai/Base/Strategy/EmoteStrategy.cpp | 35 ++ .../Base/Strategy}/EmoteStrategy.h | 0 .../Base/Strategy}/FleeStrategy.cpp | 8 +- .../Base/Strategy}/FleeStrategy.h | 0 .../Base/Strategy}/FollowMasterStrategy.cpp | 8 +- .../Base/Strategy}/FollowMasterStrategy.h | 2 +- .../Base/Strategy}/GrindingStrategy.cpp | 29 +- .../Base/Strategy}/GrindingStrategy.h | 2 +- src/Ai/Base/Strategy/GroupStrategy.cpp | 16 + .../Base/Strategy}/GroupStrategy.h | 0 .../Base/Strategy}/GuardStrategy.cpp | 7 +- .../Base/Strategy}/GuardStrategy.h | 2 +- src/Ai/Base/Strategy/GuildStrategy.cpp | 22 + .../Base/Strategy}/GuildStrategy.h | 0 .../Base/Strategy}/KiteStrategy.cpp | 2 +- .../Base/Strategy}/KiteStrategy.h | 0 .../Base/Strategy}/LfgStrategy.cpp | 6 +- .../Base/Strategy}/LfgStrategy.h | 0 .../Base/Strategy/LootNonCombatStrategy.cpp | 37 ++ .../Base/Strategy}/LootNonCombatStrategy.h | 0 src/Ai/Base/Strategy/MaintenanceStrategy.cpp | 78 +++ .../Base/Strategy}/MaintenanceStrategy.h | 2 +- .../Base/Strategy}/MarkRtiStrategy.cpp | 2 +- .../Base/Strategy}/MarkRtiStrategy.h | 0 .../Base/Strategy}/MeleeCombatStrategy.cpp | 8 +- .../Base/Strategy}/MeleeCombatStrategy.h | 0 .../Base/Strategy}/MoveFromGroupStrategy.cpp | 6 +- .../Base/Strategy}/MoveFromGroupStrategy.h | 2 +- src/Ai/Base/Strategy/NonCombatStrategy.cpp | 65 +++ .../Base/Strategy}/NonCombatStrategy.h | 0 .../Base/Strategy}/PassTroughStrategy.cpp | 2 +- .../Base/Strategy}/PassTroughStrategy.h | 0 .../Base/Strategy}/PassiveStrategy.cpp | 0 .../Base/Strategy}/PassiveStrategy.h | 0 .../Base/Strategy}/PullStrategy.cpp | 17 +- .../Base/Strategy}/PullStrategy.h | 2 +- .../Base/Strategy}/QuestStrategies.cpp | 20 +- .../Base/Strategy}/QuestStrategies.h | 0 .../Base/Strategy}/RTSCStrategy.cpp | 0 .../Base/Strategy}/RTSCStrategy.h | 0 .../Base/Strategy}/RacialsStrategy.cpp | 19 +- .../Base/Strategy}/RacialsStrategy.h | 0 .../Base/Strategy}/RangedCombatStrategy.cpp | 4 +- .../Base/Strategy}/RangedCombatStrategy.h | 0 .../Base/Strategy}/RelaxedFollowStrategy.cpp | 0 .../Base/Strategy}/RelaxedFollowStrategy.h | 0 .../Base/Strategy}/ReturnStrategy.cpp | 4 +- .../Base/Strategy}/ReturnStrategy.h | 0 src/Ai/Base/Strategy/RpgStrategy.cpp | 171 +++++++ .../Base/Strategy}/RpgStrategy.h | 2 +- .../Base/Strategy}/RunawayStrategy.cpp | 2 +- .../Base/Strategy}/RunawayStrategy.h | 0 src/Ai/Base/Strategy/SayStrategy.cpp | 20 + .../Base/Strategy}/SayStrategy.h | 0 src/Ai/Base/Strategy/StayStrategy.cpp | 39 ++ .../Base/Strategy}/StayStrategy.h | 2 +- .../Base/Strategy}/TankAssistStrategy.cpp | 2 +- .../Base/Strategy}/TankAssistStrategy.h | 0 .../Base/Strategy}/TellTargetStrategy.cpp | 2 +- .../Base/Strategy}/TellTargetStrategy.h | 0 .../Base/Strategy}/ThreatStrategy.cpp | 0 .../Base/Strategy}/ThreatStrategy.h | 0 src/Ai/Base/Strategy/TravelStrategy.cpp | 37 ++ .../Base/Strategy}/TravelStrategy.h | 2 +- .../Base/Strategy}/UseFoodStrategy.cpp | 8 +- .../Base/Strategy}/UseFoodStrategy.h | 0 .../Base/Strategy}/UsePotionsStrategy.cpp | 10 +- .../Base/Strategy}/UsePotionsStrategy.h | 0 .../Strategy/WorldPacketHandlerStrategy.cpp | 99 ++++ .../Strategy}/WorldPacketHandlerStrategy.h | 0 src/{strategy => Ai/Base}/StrategyContext.h | 0 .../Base/Trigger}/BossAuraTriggers.cpp | 0 .../Base/Trigger}/BossAuraTriggers.h | 0 .../Base/Trigger}/ChatCommandTrigger.cpp | 0 .../Base/Trigger}/ChatCommandTrigger.h | 0 .../Base/Trigger}/CureTriggers.cpp | 0 .../Base/Trigger}/CureTriggers.h | 0 .../Base/Trigger}/FishingTriggers.cpp | 0 .../Base/Trigger}/FishingTriggers.h | 0 .../Base/Trigger}/GenericTriggers.cpp | 0 .../Base/Trigger}/GenericTriggers.h | 0 .../Base/Trigger}/GuildTriggers.cpp | 0 .../Base/Trigger}/GuildTriggers.h | 0 .../Base/Trigger}/HealthTriggers.cpp | 0 .../Base/Trigger}/HealthTriggers.h | 0 .../Base/Trigger}/LfgTriggers.cpp | 0 .../Base/Trigger}/LfgTriggers.h | 0 .../Base/Trigger}/LootTriggers.cpp | 0 .../Base/Trigger}/LootTriggers.h | 0 .../Base/Trigger}/PvpTriggers.cpp | 0 .../Base/Trigger}/PvpTriggers.h | 0 .../Base/Trigger}/RangeTriggers.cpp | 0 .../Base/Trigger}/RangeTriggers.h | 0 .../Base/Trigger}/RpgTriggers.cpp | 71 +-- .../Base/Trigger}/RpgTriggers.h | 0 .../Base/Trigger}/RtiTriggers.cpp | 0 .../Base/Trigger}/RtiTriggers.h | 0 .../Base/Trigger}/StuckTriggers.cpp | 0 .../Base/Trigger}/StuckTriggers.h | 0 .../Base/Trigger}/TravelTriggers.cpp | 0 .../Base/Trigger}/TravelTriggers.h | 0 .../Base/Trigger}/WithinAreaTrigger.cpp | 0 .../Base/Trigger}/WithinAreaTrigger.h | 0 .../Base/Trigger}/WorldPacketTrigger.cpp | 0 .../Base/Trigger}/WorldPacketTrigger.h | 0 .../triggers => Ai/Base}/TriggerContext.h | 0 .../Base/Value}/ActiveSpellValue.cpp | 0 .../Base/Value}/ActiveSpellValue.h | 0 .../Base/Value}/AlwaysLootListValue.cpp | 0 .../Base/Value}/AlwaysLootListValue.h | 0 .../Base/Value}/AoeHealValues.cpp | 0 .../values => Ai/Base/Value}/AoeHealValues.h | 0 .../values => Ai/Base/Value}/AoeValues.cpp | 0 .../values => Ai/Base/Value}/AoeValues.h | 0 .../values => Ai/Base/Value}/Arrow.cpp | 0 .../values => Ai/Base/Value}/Arrow.h | 0 .../Base/Value}/AttackerCountValues.cpp | 0 .../Base/Value}/AttackerCountValues.h | 0 .../Value}/AttackerWithoutAuraTargetValue.cpp | 0 .../Value}/AttackerWithoutAuraTargetValue.h | 0 .../Base/Value}/AttackersValue.cpp | 3 + .../values => Ai/Base/Value}/AttackersValue.h | 0 .../Base/Value}/AvailableLootValue.cpp | 0 .../Base/Value}/AvailableLootValue.h | 0 .../values => Ai/Base/Value}/BudgetValues.cpp | 27 +- .../values => Ai/Base/Value}/BudgetValues.h | 0 .../Base/Value}/CcTargetValue.cpp | 0 .../values => Ai/Base/Value}/CcTargetValue.h | 0 .../values => Ai/Base/Value}/ChatValue.h | 0 .../Base/Value}/CollisionValue.cpp | 0 .../values => Ai/Base/Value}/CollisionValue.h | 0 .../values => Ai/Base/Value}/CraftValue.h | 0 .../Base/Value}/CurrentCcTargetValue.cpp | 0 .../Base/Value}/CurrentCcTargetValue.h | 0 .../Base/Value}/CurrentTargetValue.cpp | 0 .../Base/Value}/CurrentTargetValue.h | 0 .../Base/Value}/DistanceValue.cpp | 0 .../values => Ai/Base/Value}/DistanceValue.h | 0 .../Base/Value}/DpsTargetValue.cpp | 0 .../values => Ai/Base/Value}/DpsTargetValue.h | 0 .../Base/Value}/DuelTargetValue.cpp | 0 .../Base/Value}/DuelTargetValue.h | 0 .../Base/Value}/EnemyHealerTargetValue.cpp | 0 .../Base/Value}/EnemyHealerTargetValue.h | 0 .../Base/Value}/EnemyPlayerValue.cpp | 0 .../Base/Value}/EnemyPlayerValue.h | 0 .../Base/Value}/EstimatedLifetimeValue.cpp | 0 .../Base/Value}/EstimatedLifetimeValue.h | 0 .../values => Ai/Base/Value}/FishValues.cpp | 0 .../values => Ai/Base/Value}/FishValues.h | 0 .../values => Ai/Base/Value}/Formations.cpp | 0 .../values => Ai/Base/Value}/Formations.h | 0 .../Base/Value}/GrindTargetValue.cpp | 10 +- .../Base/Value}/GrindTargetValue.h | 0 .../Base/Value}/GroupLeaderValue.cpp | 0 .../Base/Value}/GroupLeaderValue.h | 0 .../values => Ai/Base/Value}/GroupValues.cpp | 0 .../values => Ai/Base/Value}/GroupValues.h | 0 .../values => Ai/Base/Value}/GuildValues.cpp | 0 .../values => Ai/Base/Value}/GuildValues.h | 0 .../Base/Value}/HasAvailableLootValue.cpp | 0 .../Base/Value}/HasAvailableLootValue.h | 0 .../Base/Value}/HasTotemValue.cpp | 0 .../values => Ai/Base/Value}/HasTotemValue.h | 0 .../Base/Value}/InvalidTargetValue.cpp | 0 .../Base/Value}/InvalidTargetValue.h | 0 .../Base/Value}/IsBehindValue.cpp | 0 .../values => Ai/Base/Value}/IsBehindValue.h | 0 .../Base/Value}/IsFacingValue.cpp | 0 .../values => Ai/Base/Value}/IsFacingValue.h | 0 .../Base/Value}/IsMovingValue.cpp | 0 .../values => Ai/Base/Value}/IsMovingValue.h | 0 .../Base/Value}/ItemCountValue.cpp | 0 .../values => Ai/Base/Value}/ItemCountValue.h | 0 .../Base/Value}/ItemForSpellValue.cpp | 0 .../Base/Value}/ItemForSpellValue.h | 0 .../Base/Value}/ItemUsageValue.cpp | 0 .../values => Ai/Base/Value}/ItemUsageValue.h | 0 .../Base/Value}/LastMovementValue.cpp | 0 .../Base/Value}/LastMovementValue.h | 0 .../values => Ai/Base/Value}/LastSaidValue.h | 0 .../Base/Value}/LastSpellCastTimeValue.h | 0 .../Base/Value}/LastSpellCastValue.cpp | 0 .../Base/Value}/LastSpellCastValue.h | 0 .../Base/Value}/LeastHpTargetValue.cpp | 0 .../Base/Value}/LeastHpTargetValue.h | 0 .../values => Ai/Base/Value}/LfgValues.h | 0 .../Base/Value}/LineTargetValue.cpp | 0 .../Base/Value}/LineTargetValue.h | 0 .../values => Ai/Base/Value}/LogLevelValue.h | 0 .../Base/Value}/LootStrategyValue.cpp | 0 .../Base/Value}/LootStrategyValue.h | 0 .../values => Ai/Base/Value}/LootValues.cpp | 0 .../values => Ai/Base/Value}/LootValues.h | 0 .../Base/Value}/MaintenanceValues.cpp | 0 .../Base/Value}/MaintenanceValues.h | 0 .../Base/Value}/ManaSaveLevelValue.h | 0 .../Base/Value}/NearestAdsValue.cpp | 0 .../Base/Value}/NearestAdsValue.h | 0 .../Base/Value}/NearestCorpsesValue.cpp | 0 .../Base/Value}/NearestCorpsesValue.h | 0 .../Value}/NearestFriendlyPlayersValue.cpp | 0 .../Base/Value}/NearestFriendlyPlayersValue.h | 0 .../Base/Value}/NearestGameObjects.cpp | 0 .../Base/Value}/NearestGameObjects.h | 0 .../Base/Value}/NearestNonBotPlayersValue.cpp | 0 .../Base/Value}/NearestNonBotPlayersValue.h | 0 .../Base/Value}/NearestNpcsValue.cpp | 11 +- .../Base/Value}/NearestNpcsValue.h | 0 .../Base/Value}/NearestUnitsValue.cpp | 0 .../Base/Value}/NearestUnitsValue.h | 0 .../Base/Value}/NewPlayerNearbyValue.cpp | 0 .../Base/Value}/NewPlayerNearbyValue.h | 0 .../Base/Value}/OutfitListValue.cpp | 0 .../Base/Value}/OutfitListValue.h | 0 .../Base/Value}/PartyMemberToDispel.cpp | 0 .../Base/Value}/PartyMemberToDispel.h | 0 .../Base/Value}/PartyMemberToHeal.cpp | 0 .../Base/Value}/PartyMemberToHeal.h | 0 .../Base/Value}/PartyMemberToResurrect.cpp | 0 .../Base/Value}/PartyMemberToResurrect.h | 0 .../Base/Value}/PartyMemberValue.cpp | 0 .../Base/Value}/PartyMemberValue.h | 0 .../Value}/PartyMemberWithoutAuraValue.cpp | 0 .../Base/Value}/PartyMemberWithoutAuraValue.h | 0 .../Value}/PartyMemberWithoutItemValue.cpp | 0 .../Base/Value}/PartyMemberWithoutItemValue.h | 0 .../Base/Value}/PetTargetValue.cpp | 0 .../values => Ai/Base/Value}/PetTargetValue.h | 0 .../Base/Value}/PositionValue.cpp | 0 .../values => Ai/Base/Value}/PositionValue.h | 0 .../Base/Value}/PossibleRpgTargetsValue.cpp | 9 +- .../Base/Value}/PossibleRpgTargetsValue.h | 0 .../Base/Value}/PossibleTargetsValue.cpp | 0 .../Base/Value}/PossibleTargetsValue.h | 0 .../values => Ai/Base/Value}/PvpValues.cpp | 0 .../values => Ai/Base/Value}/PvpValues.h | 0 .../values => Ai/Base/Value}/QuestValues.cpp | 0 .../values => Ai/Base/Value}/QuestValues.h | 0 .../values => Ai/Base/Value}/RTSCValues.cpp | 0 .../values => Ai/Base/Value}/RTSCValues.h | 0 .../Base/Value}/RandomBotUpdateValue.h | 0 .../values => Ai/Base/Value}/RangeValues.cpp | 0 .../values => Ai/Base/Value}/RangeValues.h | 0 .../Base/Value}/RtiTargetValue.cpp | 0 .../values => Ai/Base/Value}/RtiTargetValue.h | 0 .../values => Ai/Base/Value}/RtiValue.cpp | 0 .../values => Ai/Base/Value}/RtiValue.h | 0 .../Base/Value}/SelfTargetValue.cpp | 0 .../Base/Value}/SelfTargetValue.h | 0 .../Base/Value}/SkipSpellsListValue.cpp | 0 .../Base/Value}/SkipSpellsListValue.h | 0 .../Base/Value}/SnareTargetValue.cpp | 0 .../Base/Value}/SnareTargetValue.h | 0 .../Base/Value}/SpellCastUsefulValue.cpp | 0 .../Base/Value}/SpellCastUsefulValue.h | 0 .../values => Ai/Base/Value}/SpellIdValue.cpp | 0 .../values => Ai/Base/Value}/SpellIdValue.h | 0 .../values => Ai/Base/Value}/Stances.cpp | 0 .../values => Ai/Base/Value}/Stances.h | 0 .../values => Ai/Base/Value}/StatsValues.cpp | 0 .../values => Ai/Base/Value}/StatsValues.h | 0 .../Base/Value}/TankTargetValue.cpp | 0 .../Base/Value}/TankTargetValue.h | 0 .../values => Ai/Base/Value}/TargetValue.cpp | 0 .../values => Ai/Base/Value}/TargetValue.h | 0 .../values => Ai/Base/Value}/ThreatValues.cpp | 0 .../values => Ai/Base/Value}/ThreatValues.h | 0 .../values => Ai/Base}/ValueContext.h | 0 .../Base}/WorldPacketActionContext.h | 0 .../Base}/WorldPacketTriggerContext.h | 0 .../Class/Dk/Action}/DKActions.cpp | 27 +- .../Class/Dk/Action}/DKActions.h | 22 +- .../Class/Dk}/DKAiObjectContext.cpp | 0 .../Class/Dk}/DKAiObjectContext.h | 0 src/Ai/Class/Dk/Strategy/BloodDKStrategy.cpp | 165 +++++++ .../Class/Dk/Strategy}/BloodDKStrategy.h | 2 +- src/Ai/Class/Dk/Strategy/FrostDKStrategy.cpp | 169 +++++++ .../Class/Dk/Strategy}/FrostDKStrategy.h | 2 +- .../Strategy}/GenericDKNonCombatStrategy.cpp | 25 +- .../Dk/Strategy}/GenericDKNonCombatStrategy.h | 0 .../Class/Dk/Strategy}/GenericDKStrategy.cpp | 111 ++--- .../Class/Dk/Strategy}/GenericDKStrategy.h | 0 src/Ai/Class/Dk/Strategy/UnholyDKStrategy.cpp | 192 ++++++++ .../Class/Dk/Strategy}/UnholyDKStrategy.h | 2 +- .../Class/Dk/Trigger}/DKTriggers.cpp | 0 .../Class/Dk/Trigger}/DKTriggers.h | 0 .../Class/Druid/Action}/DruidActions.cpp | 16 +- .../Class/Druid/Action}/DruidActions.h | 8 +- .../Class/Druid/Action}/DruidBearActions.cpp | 0 .../Class/Druid/Action}/DruidBearActions.h | 0 .../Class/Druid/Action}/DruidCatActions.cpp | 0 .../Class/Druid/Action}/DruidCatActions.h | 0 .../Druid/Action}/DruidShapeshiftActions.cpp | 4 +- .../Druid/Action}/DruidShapeshiftActions.h | 2 +- .../Class/Druid}/DruidAiObjectContext.cpp | 0 .../Class/Druid}/DruidAiObjectContext.h | 0 .../Druid/Strategy/BearTankDruidStrategy.cpp | 256 ++++++++++ .../Druid/Strategy}/BearTankDruidStrategy.h | 2 +- .../Druid/Strategy/CasterDruidStrategy.cpp | 254 ++++++++++ .../Druid/Strategy}/CasterDruidStrategy.h | 2 +- .../Druid/Strategy/CatDpsDruidStrategy.cpp | 314 ++++++++++++ .../Druid/Strategy}/CatDpsDruidStrategy.h | 2 +- .../Druid/Strategy}/FeralDruidStrategy.cpp | 64 ++- .../Druid/Strategy}/FeralDruidStrategy.h | 36 +- .../GenericDruidNonCombatStrategy.cpp | 194 ++++++++ .../Strategy}/GenericDruidNonCombatStrategy.h | 0 .../Druid/Strategy/GenericDruidStrategy.cpp | 158 ++++++ .../Druid/Strategy}/GenericDruidStrategy.h | 0 .../Druid/Strategy/HealDruidStrategy.cpp | 101 ++++ .../Class/Druid/Strategy}/HealDruidStrategy.h | 0 .../Druid/Strategy}/MeleeDruidStrategy.cpp | 18 +- .../Druid/Strategy}/MeleeDruidStrategy.h | 2 +- .../Strategy/OffhealDruidCatStrategy.cpp | 307 ++++++++++++ .../Druid/Strategy}/OffhealDruidCatStrategy.h | 2 +- .../Class/Druid/Trigger}/DruidTriggers.cpp | 0 .../Class/Druid/Trigger}/DruidTriggers.h | 0 .../Class/Hunter/Action}/HunterActions.cpp | 10 +- .../Class/Hunter/Action}/HunterActions.h | 2 +- .../Class/Hunter}/HunterAiObjectContext.cpp | 0 .../Class/Hunter}/HunterAiObjectContext.h | 0 .../Strategy}/BeastMasteryHunterStrategy.cpp | 94 +++- .../Strategy}/BeastMasteryHunterStrategy.h | 2 +- .../GenericHunterNonCombatStrategy.cpp | 65 +++ .../GenericHunterNonCombatStrategy.h | 0 .../Hunter/Strategy/GenericHunterStrategy.cpp | 157 ++++++ .../Hunter/Strategy}/GenericHunterStrategy.h | 0 .../Hunter/Strategy}/HunterBuffStrategies.cpp | 16 +- .../Hunter/Strategy}/HunterBuffStrategies.h | 0 .../Strategy}/MarksmanshipHunterStrategy.cpp | 100 ++-- .../Strategy}/MarksmanshipHunterStrategy.h | 2 +- .../Strategy/SurvivalHunterStrategy.cpp | 159 ++++++ .../Hunter/Strategy}/SurvivalHunterStrategy.h | 2 +- .../Class/Hunter/Trigger}/HunterTriggers.cpp | 0 .../Class/Hunter/Trigger}/HunterTriggers.h | 0 .../Class/Mage/Action}/MageActions.cpp | 0 .../Class/Mage/Action}/MageActions.h | 0 .../Class/Mage}/MageAiObjectContext.cpp | 0 .../Class/Mage}/MageAiObjectContext.h | 0 .../Mage/Strategy}/ArcaneMageStrategy.cpp | 39 +- .../Class/Mage/Strategy}/ArcaneMageStrategy.h | 2 +- .../Class/Mage/Strategy}/FireMageStrategy.cpp | 64 ++- .../Class/Mage/Strategy}/FireMageStrategy.h | 2 +- .../Mage/Strategy}/FrostFireMageStrategy.cpp | 51 +- .../Mage/Strategy}/FrostFireMageStrategy.h | 2 +- .../Class/Mage/Strategy/FrostMageStrategy.cpp | 142 ++++++ .../Class/Mage/Strategy}/FrostMageStrategy.h | 2 +- .../GenericMageNonCombatStrategy.cpp | 32 +- .../Strategy}/GenericMageNonCombatStrategy.h | 0 .../Mage/Strategy/GenericMageStrategy.cpp | 278 +++++++++++ .../Mage/Strategy}/GenericMageStrategy.h | 0 .../Class/Mage/Trigger}/MageTriggers.cpp | 0 .../Class/Mage/Trigger}/MageTriggers.h | 0 .../Class/Paladin/Action}/PaladinActions.cpp | 0 .../Class/Paladin/Action}/PaladinActions.h | 0 .../Class/Paladin}/PaladinAiObjectContext.cpp | 0 .../Class/Paladin}/PaladinAiObjectContext.h | 0 .../Paladin/Strategy/DpsPaladinStrategy.cpp | 212 ++++++++ .../Paladin/Strategy}/DpsPaladinStrategy.h | 2 +- .../GenericPaladinNonCombatStrategy.cpp | 14 +- .../GenericPaladinNonCombatStrategy.h | 0 .../Strategy/GenericPaladinStrategy.cpp | 87 ++++ .../Strategy}/GenericPaladinStrategy.h | 0 .../GenericPaladinStrategyActionNodeFactory.h | 170 +++---- .../Paladin/Strategy/HealPaladinStrategy.cpp | 124 +++++ .../Paladin/Strategy}/HealPaladinStrategy.h | 2 +- .../Strategy/OffhealRetPaladinStrategy.cpp | 243 +++++++++ .../Strategy}/OffhealRetPaladinStrategy.h | 2 +- .../Strategy}/PaladinBuffStrategies.cpp | 32 +- .../Paladin/Strategy}/PaladinBuffStrategies.h | 0 .../Paladin/Strategy/TankPaladinStrategy.cpp | 201 ++++++++ .../Paladin/Strategy}/TankPaladinStrategy.h | 2 +- .../Paladin/Trigger}/PaladinTriggers.cpp | 0 .../Class/Paladin/Trigger}/PaladinTriggers.h | 0 .../Class/Priest/Action}/PriestActions.cpp | 0 .../Class/Priest/Action}/PriestActions.h | 0 .../Class/Priest}/PriestAiObjectContext.cpp | 0 .../Class/Priest}/PriestAiObjectContext.h | 0 .../Priest/Strategy/GenericPriestStrategy.cpp | 92 ++++ .../Priest/Strategy}/GenericPriestStrategy.h | 0 .../GenericPriestStrategyActionNodeFactory.h | 257 ++++++++++ .../Priest/Strategy/HealPriestStrategy.cpp | 119 +++++ .../Priest/Strategy}/HealPriestStrategy.h | 2 +- .../Priest/Strategy/HolyPriestStrategy.cpp | 170 +++++++ .../Priest/Strategy}/HolyPriestStrategy.h | 4 +- .../Strategy/PriestNonCombatStrategy.cpp | 79 +++ .../Strategy}/PriestNonCombatStrategy.h | 0 ...PriestNonCombatStrategyActionNodeFactory.h | 98 ++-- .../Priest/Strategy/ShadowPriestStrategy.cpp | 142 ++++++ .../Priest/Strategy}/ShadowPriestStrategy.h | 2 +- .../ShadowPriestStrategyActionNodeFactory.h | 24 +- .../Class/Priest/Trigger}/PriestTriggers.cpp | 0 .../Class/Priest/Trigger}/PriestTriggers.h | 0 .../Class/Rogue/Action}/RogueActions.cpp | 0 .../Class/Rogue/Action}/RogueActions.h | 0 .../Class/Rogue/Action}/RogueComboActions.cpp | 0 .../Class/Rogue/Action}/RogueComboActions.h | 0 .../Rogue/Action}/RogueFinishingActions.h | 0 .../Rogue/Action}/RogueOpeningActions.cpp | 0 .../Class/Rogue/Action}/RogueOpeningActions.h | 0 .../Class/Rogue}/RogueAiObjectContext.cpp | 0 .../Class/Rogue}/RogueAiObjectContext.h | 0 .../Strategy/AssassinationRogueStrategy.cpp | 212 ++++++++ .../Strategy}/AssassinationRogueStrategy.h | 2 +- .../Class/Rogue/Strategy/DpsRogueStrategy.cpp | 466 ++++++++++++++++++ .../Class/Rogue/Strategy}/DpsRogueStrategy.h | 4 +- .../GenericRogueNonCombatStrategy.cpp | 24 +- .../Strategy}/GenericRogueNonCombatStrategy.h | 0 .../Class/Rogue/Trigger}/RogueTriggers.cpp | 0 .../Class/Rogue/Trigger}/RogueTriggers.h | 0 .../Class/Shaman/Action}/ShamanActions.cpp | 0 .../Class/Shaman/Action}/ShamanActions.h | 0 .../Class/Shaman}/ShamanAiObjectContext.cpp | 0 .../Class/Shaman}/ShamanAiObjectContext.h | 0 .../Strategy}/ElementalShamanStrategy.cpp | 99 +++- .../Strategy}/ElementalShamanStrategy.h | 2 +- .../Strategy/EnhancementShamanStrategy.cpp | 149 ++++++ .../Strategy}/EnhancementShamanStrategy.h | 2 +- .../Strategy}/GenericShamanStrategy.cpp | 110 ++--- .../Shaman/Strategy}/GenericShamanStrategy.h | 0 .../Shaman/Strategy}/RestoShamanStrategy.cpp | 102 ++-- .../Shaman/Strategy}/RestoShamanStrategy.h | 0 .../Strategy/ShamanNonCombatStrategy.cpp | 126 +++++ .../Strategy}/ShamanNonCombatStrategy.h | 0 .../Shaman/Strategy}/TotemsShamanStrategy.cpp | 76 +-- .../Shaman/Strategy}/TotemsShamanStrategy.h | 0 .../Class/Shaman/Trigger}/ShamanTriggers.cpp | 0 .../Class/Shaman/Trigger}/ShamanTriggers.h | 0 .../Class/Warlock/Action}/WarlockActions.cpp | 0 .../Class/Warlock/Action}/WarlockActions.h | 0 .../Strategy}/AfflictionWarlockStrategy.cpp | 129 +++-- .../Strategy}/AfflictionWarlockStrategy.h | 2 +- .../Strategy}/DemonologyWarlockStrategy.cpp | 157 ++++-- .../Strategy}/DemonologyWarlockStrategy.h | 2 +- .../Strategy}/DestructionWarlockStrategy.cpp | 128 +++-- .../Strategy}/DestructionWarlockStrategy.h | 2 +- .../GenericWarlockNonCombatStrategy.cpp | 92 ++-- .../GenericWarlockNonCombatStrategy.h | 0 .../Strategy/GenericWarlockStrategy.cpp | 261 ++++++++++ .../Strategy}/GenericWarlockStrategy.h | 2 +- .../Warlock/Strategy}/TankWarlockStrategy.cpp | 11 +- .../Warlock/Strategy}/TankWarlockStrategy.h | 2 +- .../Warlock/Trigger}/WarlockTriggers.cpp | 0 .../Class/Warlock/Trigger}/WarlockTriggers.h | 0 .../Class/Warlock}/WarlockAiObjectContext.cpp | 0 .../Class/Warlock}/WarlockAiObjectContext.h | 0 .../Class/Warrior/Action}/WarriorActions.cpp | 0 .../Class/Warrior/Action}/WarriorActions.h | 0 .../Warrior/Strategy/ArmsWarriorStrategy.cpp | 294 +++++++++++ .../Warrior/Strategy}/ArmsWarriorStrategy.h | 2 +- .../Warrior/Strategy/FuryWarriorStrategy.cpp | 206 ++++++++ .../Warrior/Strategy}/FuryWarriorStrategy.h | 2 +- .../GenericWarriorNonCombatStrategy.cpp | 4 +- .../GenericWarriorNonCombatStrategy.h | 0 .../Strategy/GenericWarriorStrategy.cpp | 52 ++ .../Warrior/Strategy/GenericWarriorStrategy.h | 236 +++++++++ .../Warrior/Strategy/TankWarriorStrategy.cpp | 369 ++++++++++++++ .../Warrior/Strategy}/TankWarriorStrategy.h | 2 +- .../Warrior/Trigger}/WarriorTriggers.cpp | 0 .../Class/Warrior/Trigger}/WarriorTriggers.h | 0 .../Class/Warrior}/WarriorAiObjectContext.cpp | 0 .../Class/Warrior}/WarriorAiObjectContext.h | 0 .../AzjolNerub/Action}/AzjolNerubActions.cpp | 0 .../AzjolNerub/Action}/AzjolNerubActions.h | 0 .../AzjolNerub}/AzjolNerubActionContext.h | 0 .../AzjolNerub}/AzjolNerubTriggerContext.h | 0 .../Multiplier}/AzjolNerubMultipliers.cpp | 0 .../Multiplier}/AzjolNerubMultipliers.h | 0 .../Strategy}/AzjolNerubStrategy.cpp | 8 +- .../AzjolNerub/Strategy}/AzjolNerubStrategy.h | 0 .../Trigger}/AzjolNerubTriggers.cpp | 0 .../AzjolNerub/Trigger}/AzjolNerubTriggers.h | 0 .../Action}/CullingOfStratholmeActions.cpp | 0 .../Action}/CullingOfStratholmeActions.h | 0 .../CullingOfStratholmeActionContext.h | 0 .../CullingOfStratholmeTriggerContext.h | 0 .../CullingOfStratholmeMultipliers.cpp | 0 .../CullingOfStratholmeMultipliers.h | 0 .../Strategy}/CullingOfStratholmeStrategy.cpp | 4 +- .../Strategy}/CullingOfStratholmeStrategy.h | 0 .../Trigger}/CullingOfStratholmeTriggers.cpp | 0 .../Trigger}/CullingOfStratholmeTriggers.h | 0 .../Action}/DrakTharonKeepActions.cpp | 0 .../Action}/DrakTharonKeepActions.h | 0 .../DrakTharonKeepActionContext.h | 0 .../DrakTharonKeepTriggerContext.h | 0 .../Multiplier}/DrakTharonKeepMultipliers.cpp | 0 .../Multiplier}/DrakTharonKeepMultipliers.h | 0 .../Strategy}/DrakTharonKeepStrategy.cpp | 18 +- .../Strategy}/DrakTharonKeepStrategy.h | 0 .../Trigger}/DrakTharonKeepTriggers.cpp | 0 .../Trigger}/DrakTharonKeepTriggers.h | 0 .../Dungeon}/DungeonStrategyContext.h | 30 +- .../Dungeon}/DungeonStrategyUtils.h | 0 .../Action}/ForgeOfSoulsActions.cpp | 0 .../Action}/ForgeOfSoulsActions.h | 0 .../ForgeOfSouls}/ForgeOfSoulsActionContext.h | 0 .../ForgeOfSoulsTriggerContext.h | 0 .../Multiplier}/ForgeOfSoulsMultipliers.cpp | 0 .../Multiplier}/ForgeOfSoulsMultipliers.h | 0 .../Strategy}/ForgeOfSoulsStrategy.cpp | 9 +- .../Strategy}/ForgeOfSoulsStrategy.h | 0 .../Trigger}/ForgeOfSoulsTriggers.cpp | 0 .../Trigger}/ForgeOfSoulsTriggers.h | 0 .../Gundrak/Action}/GundrakActions.cpp | 0 .../Dungeon/Gundrak/Action}/GundrakActions.h | 0 .../Dungeon/Gundrak}/GundrakActionContext.h | 0 .../Dungeon/Gundrak}/GundrakTriggerContext.h | 0 .../Multiplier}/GundrakMultipliers.cpp | 0 .../Gundrak/Multiplier}/GundrakMultipliers.h | 0 .../Gundrak/Strategy}/GundrakStrategy.cpp | 6 +- .../Gundrak/Strategy}/GundrakStrategy.h | 0 .../Gundrak/Trigger}/GundrakTriggers.cpp | 0 .../Gundrak/Trigger}/GundrakTriggers.h | 0 .../Action}/HallsOfLightningActions.cpp | 0 .../Action}/HallsOfLightningActions.h | 0 .../HallsOfLightningActionContext.h | 0 .../HallsOfLightningTriggerContext.h | 0 .../HallsOfLightningMultipliers.cpp | 0 .../Multiplier}/HallsOfLightningMultipliers.h | 0 .../Strategy}/HallsOfLightningStrategy.cpp | 18 +- .../Strategy}/HallsOfLightningStrategy.h | 0 .../Trigger}/HallsOfLightningTriggers.cpp | 0 .../Trigger}/HallsOfLightningTriggers.h | 0 .../Dungeon/HallsOfReflection}/TODO | 0 .../Action}/HallsOfStoneActions.cpp | 0 .../Action}/HallsOfStoneActions.h | 0 .../HallsOfStone}/HallsOfStoneActionContext.h | 0 .../HallsOfStoneTriggerContext.h | 0 .../Multiplier}/HallsOfStoneMultipliers.cpp | 0 .../Multiplier}/HallsOfStoneMultipliers.h | 0 .../Strategy}/HallsOfStoneStrategy.cpp | 4 +- .../Strategy}/HallsOfStoneStrategy.h | 0 .../Trigger}/HallsOfStoneTriggers.cpp | 0 .../Trigger}/HallsOfStoneTriggers.h | 0 .../Dungeon/Nexus/Action}/NexusActions.cpp | 0 .../Dungeon/Nexus/Action}/NexusActions.h | 0 .../Nexus/Multiplier}/NexusMultipliers.cpp | 0 .../Nexus/Multiplier}/NexusMultipliers.h | 0 .../Dungeon/Nexus}/NexusActionContext.h | 0 .../Dungeon/Nexus}/NexusTriggerContext.h | 0 .../Dungeon/Nexus/Strategy}/NexusStrategy.cpp | 16 +- .../Dungeon/Nexus/Strategy}/NexusStrategy.h | 0 .../Dungeon/Nexus/Trigger}/NexusTriggers.cpp | 0 .../Dungeon/Nexus/Trigger}/NexusTriggers.h | 0 .../Dungeon/Oculus/Action}/OculusActions.cpp | 20 +- .../Dungeon/Oculus/Action}/OculusActions.h | 0 .../Oculus/Multiplier}/OculusMultipliers.cpp | 0 .../Oculus/Multiplier}/OculusMultipliers.h | 0 .../Dungeon/Oculus}/OculusActionContext.h | 0 .../Dungeon/Oculus}/OculusTriggerContext.h | 0 .../Oculus/Strategy}/OculusStrategy.cpp | 16 +- .../Dungeon/Oculus/Strategy}/OculusStrategy.h | 0 .../Oculus/Trigger}/OculusTriggers.cpp | 0 .../Dungeon/Oculus/Trigger}/OculusTriggers.h | 0 .../OldKingdom/Action}/OldKingdomActions.cpp | 0 .../OldKingdom/Action}/OldKingdomActions.h | 0 .../Multiplier}/OldKingdomMultipliers.cpp | 0 .../Multiplier}/OldKingdomMultipliers.h | 0 .../OldKingdom}/OldKingdomActionContext.h | 0 .../OldKingdom}/OldKingdomTriggerContext.h | 0 .../Strategy}/OldKingdomStrategy.cpp | 6 +- .../OldKingdom/Strategy}/OldKingdomStrategy.h | 0 .../Trigger}/OldKingdomTriggers.cpp | 0 .../OldKingdom/Trigger}/OldKingdomTriggers.h | 0 .../PitOfSaron/Action}/PitOfSaronActions.cpp | 0 .../PitOfSaron/Action}/PitOfSaronActions.h | 0 .../Multiplier}/PitOfSaronMultipliers.cpp | 0 .../Multiplier}/PitOfSaronMultipliers.h | 0 .../PitOfSaron}/PitOfSaronActionContext.h | 0 .../PitOfSaron}/PitOfSaronTriggerContext.h | 0 .../Strategy}/PitOfSaronStrategy.cpp | 5 +- .../PitOfSaron/Strategy}/PitOfSaronStrategy.h | 0 .../Trigger}/PitOfSaronTriggers.cpp | 0 .../PitOfSaron/Trigger}/PitOfSaronTriggers.h | 0 .../Action}/TrialOfTheChampionActions.cpp | 2 +- .../Action}/TrialOfTheChampionActions.h | 0 .../TrialOfTheChampionMultipliers.cpp | 0 .../TrialOfTheChampionMultipliers.h | 0 .../Strategy}/TrialOfTheChampionStrategy.cpp | 11 +- .../Strategy}/TrialOfTheChampionStrategy.h | 0 .../TrialOfTheChampionActionContext.h | 0 .../TrialOfTheChampionTriggerContext.h | 0 .../Trigger}/TrialOfTheChampionTriggers.cpp | 0 .../Trigger}/TrialOfTheChampionTriggers.h | 0 .../Action}/UtgardeKeepActions.cpp | 0 .../UtgardeKeep/Action}/UtgardeKeepActions.h | 0 .../Multiplier}/UtgardeKeepMultipliers.cpp | 0 .../Multiplier}/UtgardeKeepMultipliers.h | 0 .../Strategy}/UtgardeKeepStrategy.cpp | 14 +- .../Strategy}/UtgardeKeepStrategy.h | 0 .../Trigger}/UtgardeKeepTriggers.cpp | 0 .../Trigger}/UtgardeKeepTriggers.h | 0 .../UtgardeKeep}/UtgardeKeepActionContext.h | 0 .../UtgardeKeep}/UtgardeKeepTriggerContext.h | 0 .../Action}/UtgardePinnacleActions.cpp | 0 .../Action}/UtgardePinnacleActions.h | 0 .../UtgardePinnacleMultipliers.cpp | 0 .../Multiplier}/UtgardePinnacleMultipliers.h | 0 .../Strategy}/UtgardePinnacleStrategy.cpp | 6 +- .../Strategy}/UtgardePinnacleStrategy.h | 0 .../Trigger}/UtgardePinnacleTriggers.cpp | 0 .../Trigger}/UtgardePinnacleTriggers.h | 0 .../UtgardePinnacleActionContext.h | 0 .../UtgardePinnacleTriggerContext.h | 0 .../VioletHold/Action}/VioletHoldActions.cpp | 0 .../VioletHold/Action}/VioletHoldActions.h | 0 .../Multiplier}/VioletHoldMultipliers.cpp | 0 .../Multiplier}/VioletHoldMultipliers.h | 0 .../Strategy}/VioletHoldStrategy.cpp | 10 +- .../VioletHold/Strategy}/VioletHoldStrategy.h | 0 .../Trigger}/VioletHoldTriggers.cpp | 0 .../VioletHold/Trigger}/VioletHoldTriggers.h | 0 .../VioletHold}/VioletHoldActionContext.h | 0 .../VioletHold}/VioletHoldTriggerContext.h | 0 src/Ai/Dungeon/WotlkDungeonActionContext.h | 21 + src/Ai/Dungeon/WotlkDungeonTriggerContext.h | 21 + .../Raid/Aq20/Action}/RaidAq20Actions.cpp | 0 .../Raid/Aq20/Action}/RaidAq20Actions.h | 0 .../Raid/Aq20}/RaidAq20ActionContext.h | 0 .../Raid/Aq20}/RaidAq20TriggerContext.h | 0 .../Raid/Aq20/Strategy}/RaidAq20Strategy.cpp | 2 +- .../Raid/Aq20/Strategy}/RaidAq20Strategy.h | 0 .../Raid/Aq20/Trigger}/RaidAq20Triggers.cpp | 0 .../Raid/Aq20/Trigger}/RaidAq20Triggers.h | 0 .../Raid/Aq20/Util}/RaidAq20Utils.cpp | 0 .../Raid/Aq20/Util}/RaidAq20Utils.h | 0 .../BlackwingLair/Action}/RaidBwlActions.cpp | 0 .../BlackwingLair/Action}/RaidBwlActions.h | 0 .../BlackwingLair}/RaidBwlActionContext.h | 0 .../BlackwingLair}/RaidBwlTriggerContext.h | 0 .../Strategy/RaidBwlStrategy.cpp | 15 + .../BlackwingLair/Strategy}/RaidBwlStrategy.h | 0 .../Trigger}/RaidBwlTriggers.cpp | 0 .../BlackwingLair/Trigger}/RaidBwlTriggers.h | 0 .../EyeOfEternity/Action}/RaidEoEActions.cpp | 0 .../EyeOfEternity/Action}/RaidEoEActions.h | 0 .../Multiplier}/RaidEoEMultipliers.cpp | 0 .../Multiplier}/RaidEoEMultipliers.h | 0 .../EyeOfEternity}/RaidEoEActionContext.h | 0 .../EyeOfEternity}/RaidEoETriggerContext.h | 0 .../Strategy/RaidEoEStrategy.cpp | 21 + .../EyeOfEternity/Strategy}/RaidEoEStrategy.h | 0 .../Trigger}/RaidEoETriggers.cpp | 0 .../EyeOfEternity/Trigger}/RaidEoETriggers.h | 0 .../Action}/RaidGruulsLairActions.cpp | 0 .../Action}/RaidGruulsLairActions.h | 0 .../Multiplier}/RaidGruulsLairMultipliers.cpp | 0 .../Multiplier}/RaidGruulsLairMultipliers.h | 0 .../GruulsLair}/RaidGruulsLairActionContext.h | 0 .../RaidGruulsLairTriggerContext.h | 0 .../Strategy/RaidGruulsLairStrategy.cpp | 56 +++ .../Strategy}/RaidGruulsLairStrategy.h | 0 .../Trigger}/RaidGruulsLairTriggers.cpp | 0 .../Trigger}/RaidGruulsLairTriggers.h | 0 .../Util}/RaidGruulsLairHelpers.cpp | 0 .../GruulsLair/Util}/RaidGruulsLairHelpers.h | 0 .../Raid/Icecrown/Action}/RaidIccActions.cpp | 2 +- .../Raid/Icecrown/Action}/RaidIccActions.h | 0 .../Multiplier}/RaidIccMultipliers.cpp | 0 .../Icecrown/Multiplier}/RaidIccMultipliers.h | 0 .../Raid/Icecrown}/RaidIccActionContext.h | 0 .../Raid/Icecrown}/RaidIccScripts.h | 0 .../Raid/Icecrown}/RaidIccTriggerContext.h | 0 .../Icecrown/Strategy/RaidIccStrategy.cpp | 186 +++++++ .../Raid/Icecrown/Strategy}/RaidIccStrategy.h | 0 .../Icecrown/Trigger}/RaidIccTriggers.cpp | 12 +- .../Raid/Icecrown/Trigger}/RaidIccTriggers.h | 0 .../Karazhan/Action}/RaidKarazhanActions.cpp | 0 .../Karazhan/Action}/RaidKarazhanActions.h | 0 .../Multiplier}/RaidKarazhanMultipliers.cpp | 0 .../Multiplier}/RaidKarazhanMultipliers.h | 0 .../Karazhan}/RaidKarazhanActionContext.h | 0 .../Karazhan}/RaidKarazhanTriggerContext.h | 0 .../Strategy}/RaidKarazhanStrategy.cpp | 74 +-- .../Karazhan/Strategy}/RaidKarazhanStrategy.h | 0 .../Trigger}/RaidKarazhanTriggers.cpp | 0 .../Karazhan/Trigger}/RaidKarazhanTriggers.h | 0 .../Karazhan/Util}/RaidKarazhanHelpers.cpp | 0 .../Raid/Karazhan/Util}/RaidKarazhanHelpers.h | 0 .../Action}/RaidMagtheridonActions.cpp | 0 .../Action}/RaidMagtheridonActions.h | 0 .../RaidMagtheridonMultipliers.cpp | 0 .../Multiplier}/RaidMagtheridonMultipliers.h | 0 .../RaidMagtheridonActionContext.h | 0 .../RaidMagtheridonTriggerContext.h | 0 .../Strategy/RaidMagtheridonStrategy.cpp | 42 ++ .../Strategy}/RaidMagtheridonStrategy.h | 0 .../Trigger}/RaidMagtheridonTriggers.cpp | 0 .../Trigger}/RaidMagtheridonTriggers.h | 0 .../Util}/RaidMagtheridonHelpers.cpp | 0 .../Util}/RaidMagtheridonHelpers.h | 0 .../Raid/MoltenCore/Action}/RaidMcActions.cpp | 0 .../Raid/MoltenCore/Action}/RaidMcActions.h | 0 .../Multiplier}/RaidMcMultipliers.cpp | 0 .../Multiplier}/RaidMcMultipliers.h | 0 .../Raid/MoltenCore}/RaidMcActionContext.h | 0 .../Raid/MoltenCore}/RaidMcHelpers.h | 0 .../Raid/MoltenCore}/RaidMcTriggerContext.h | 0 .../MoltenCore/Strategy}/RaidMcStrategy.cpp | 30 +- .../MoltenCore/Strategy}/RaidMcStrategy.h | 0 .../MoltenCore/Trigger}/RaidMcTriggers.cpp | 0 .../Raid/MoltenCore/Trigger}/RaidMcTriggers.h | 0 .../ObsidianSanctum/Action}/RaidOsActions.cpp | 0 .../ObsidianSanctum/Action}/RaidOsActions.h | 0 .../Multiplier}/RaidOsMultipliers.cpp | 0 .../Multiplier}/RaidOsMultipliers.h | 0 .../ObsidianSanctum}/RaidOsActionContext.h | 0 .../ObsidianSanctum}/RaidOsTriggerContext.h | 0 .../Strategy}/RaidOsStrategy.cpp | 14 +- .../Strategy}/RaidOsStrategy.h | 0 .../Trigger}/RaidOsTriggers.cpp | 6 +- .../ObsidianSanctum/Trigger}/RaidOsTriggers.h | 0 .../Raid/Onyxia/Action}/RaidOnyxiaActions.cpp | 17 +- .../Raid/Onyxia/Action}/RaidOnyxiaActions.h | 0 .../Raid/Onyxia}/RaidOnyxiaActionContext.h | 0 .../Raid/Onyxia}/RaidOnyxiaTriggerContext.h | 0 .../Onyxia/Strategy}/RaidOnyxiaStrategy.cpp | 10 +- .../Onyxia/Strategy}/RaidOnyxiaStrategy.h | 0 .../Onyxia/Trigger}/RaidOnyxiaTriggers.cpp | 6 +- .../Raid/Onyxia/Trigger}/RaidOnyxiaTriggers.h | 0 .../raids => Ai/Raid}/RaidStrategyContext.h | 0 .../Raid/Ulduar/Action}/RaidUlduarActions.cpp | 0 .../Raid/Ulduar/Action}/RaidUlduarActions.h | 0 .../Multiplier}/RaidUlduarMultipliers.cpp | 0 .../Multiplier}/RaidUlduarMultipliers.h | 2 +- .../Raid/Ulduar}/RaidUlduarActionContext.h | 0 .../Raid/Ulduar}/RaidUlduarBossHelper.cpp | 0 .../Raid/Ulduar}/RaidUlduarBossHelper.h | 0 .../Raid/Ulduar}/RaidUlduarScripts.h | 0 .../Raid/Ulduar}/RaidUlduarTriggerContext.h | 0 .../Ulduar/Strategy/RaidUlduarStrategy.cpp | 323 ++++++++++++ .../Ulduar/Strategy}/RaidUlduarStrategy.h | 0 .../Ulduar/Trigger}/RaidUlduarTriggers.cpp | 33 +- .../Raid/Ulduar/Trigger}/RaidUlduarTriggers.h | 0 .../Action}/RaidVoAActions.cpp | 0 .../VaultOfArchavon/Action}/RaidVoAActions.h | 0 .../VaultOfArchavon}/RaidVoAActionContext.h | 0 .../VaultOfArchavon}/RaidVoATriggerContext.h | 0 .../Strategy}/RaidVoAStrategy.cpp | 12 +- .../Strategy}/RaidVoAStrategy.h | 0 .../Trigger}/RaidVoATriggers.cpp | 0 .../Trigger}/RaidVoATriggers.h | 0 .../World/Rpg/Action}/NewRpgAction.cpp | 0 .../World/Rpg/Action}/NewRpgAction.h | 0 .../World/Rpg/Action}/NewRpgBaseAction.cpp | 26 +- .../World/Rpg/Action}/NewRpgBaseAction.h | 0 .../rpg => Ai/World/Rpg}/NewRpgInfo.cpp | 0 .../rpg => Ai/World/Rpg}/NewRpgInfo.h | 0 src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp | 75 +++ .../World/Rpg/Strategy}/NewRpgStrategy.h | 2 +- .../World/Rpg/Trigger}/NewRpgTrigger.cpp | 0 .../World/Rpg/Trigger}/NewRpgTriggers.h | 0 src/{ => Bot/Cmd}/ChatFilter.cpp | 0 src/{ => Bot/Cmd}/ChatFilter.h | 0 src/{ => Bot/Cmd}/ChatHelper.cpp | 0 src/{ => Bot/Cmd}/ChatHelper.h | 0 src/{ => Bot/Cmd}/PlayerbotCommandServer.cpp | 0 src/{ => Bot/Cmd}/PlayerbotCommandServer.h | 0 .../Debug/PerfMonitor.cpp} | 14 +- .../Debug/PerfMonitor.h} | 18 +- src/Bot/Engine/Action/Action.cpp | 20 + src/{strategy => Bot/Engine/Action}/Action.h | 87 ++-- src/{strategy => Bot/Engine}/AiObject.cpp | 0 src/{strategy => Bot/Engine}/AiObject.h | 69 --- .../Engine}/AiObjectContext.cpp | 52 +- .../Engine}/AiObjectContext.h | 0 src/{strategy => Bot/Engine}/Engine.cpp | 84 ++-- src/{strategy => Bot/Engine}/Engine.h | 2 +- .../Engine}/ExternalEventHelper.cpp | 0 .../Engine}/ExternalEventHelper.h | 0 src/{strategy => Bot/Engine}/Multiplier.h | 0 .../Engine}/NamedObjectContext.cpp | 0 .../Engine}/NamedObjectContext.h | 0 .../Engine}/PassiveMultiplier.cpp | 0 .../Engine}/PassiveMultiplier.h | 0 src/{ => Bot/Engine}/PlayerbotAIAware.h | 0 src/{ => Bot/Engine}/PlayerbotAIBase.cpp | 2 +- src/{ => Bot/Engine}/PlayerbotAIBase.h | 2 +- .../Engine/Strategy}/CustomStrategy.cpp | 32 +- .../Engine/Strategy}/CustomStrategy.h | 0 src/Bot/Engine/Strategy/Strategy.cpp | 145 ++++++ .../Engine/Strategy}/Strategy.h | 2 +- .../Engine/Trigger}/Trigger.cpp | 0 .../Engine/Trigger}/Trigger.h | 58 ++- src/{strategy => Bot/Engine/Value}/Value.cpp | 6 +- src/{strategy => Bot/Engine/Value}/Value.h | 12 +- .../Engine/WorldPacket}/Event.cpp | 0 .../Engine/WorldPacket}/Event.h | 0 src/{ => Bot/Factory}/AiFactory.cpp | 0 src/{ => Bot/Factory}/AiFactory.h | 0 .../Factory}/PlayerbotFactory.cpp | 145 +++--- .../Factory}/PlayerbotFactory.h | 1 - .../Factory}/RandomPlayerbotFactory.cpp | 0 .../Factory}/RandomPlayerbotFactory.h | 0 src/{ => Bot}/PlayerbotAI.cpp | 363 +++++++++----- src/{ => Bot}/PlayerbotAI.h | 14 +- src/{ => Bot}/PlayerbotMgr.cpp | 6 +- src/{ => Bot}/PlayerbotMgr.h | 0 src/{ => Bot}/RandomPlayerbotMgr.cpp | 39 +- src/{ => Bot}/RandomPlayerbotMgr.h | 5 +- src/Db/FlightMasterCache.cpp | 39 ++ src/Db/FlightMasterCache.h | 27 + .../PlayerbotDungeonRepository.cpp} | 6 +- .../PlayerbotDungeonRepository.h} | 16 +- .../PlayerbotRepository.cpp} | 12 +- .../PlayerbotRepository.h} | 16 +- .../PlayerbotSpellRepository.cpp} | 13 +- .../PlayerbotSpellRepository.h} | 14 +- src/Helpers.cpp | 50 -- src/Helpers.h | 55 --- src/LazyCalculatedValue.h | 39 -- src/{ => Mgr/Guild}/GuildTaskMgr.cpp | 0 src/{ => Mgr/Guild}/GuildTaskMgr.h | 0 src/{ => Mgr/Guild}/PlayerbotGuildMgr.cpp | 2 +- src/{ => Mgr/Guild}/PlayerbotGuildMgr.h | 0 src/{strategy => Mgr/Item}/ItemVisitors.cpp | 0 src/{strategy => Mgr/Item}/ItemVisitors.h | 0 src/{ => Mgr/Item}/LootObjectStack.cpp | 0 src/{ => Mgr/Item}/LootObjectStack.h | 0 src/{ => Mgr/Item}/RandomItemMgr.cpp | 16 +- src/{ => Mgr/Item}/RandomItemMgr.h | 0 src/{factory => Mgr/Item}/StatsCollector.cpp | 0 src/{factory => Mgr/Item}/StatsCollector.h | 0 .../Item}/StatsWeightCalculator.cpp | 0 .../Item}/StatsWeightCalculator.h | 0 src/{ => Mgr/Move}/FleeManager.cpp | 0 src/{ => Mgr/Move}/FleeManager.h | 0 src/{ => Mgr/Security}/PlayerbotSecurity.cpp | 0 src/{ => Mgr/Security}/PlayerbotSecurity.h | 0 src/{ => Mgr/Talent}/Talentspec.cpp | 0 src/{ => Mgr/Talent}/Talentspec.h | 0 src/{ => Mgr/Text}/PlayerbotTextMgr.cpp | 0 src/{ => Mgr/Text}/PlayerbotTextMgr.h | 0 src/{ => Mgr/Travel}/TravelMgr.cpp | 28 +- src/{ => Mgr/Travel}/TravelMgr.h | 0 src/{ => Mgr/Travel}/TravelNode.cpp | 0 src/{ => Mgr/Travel}/TravelNode.h | 0 src/PlayerbotAIConfig.cpp | 4 +- .../PlayerbotCommandScript.cpp} | 12 +- src/Script/PlayerbotCommandScript.h | 1 + src/{ => Script}/Playerbots.cpp | 8 +- src/{ => Script}/Playerbots.h | 0 src/{ => Script}/PlayerbotsSecureLogin.cpp | 0 .../WorldThr}/PlayerbotOperation.h | 0 .../WorldThr}/PlayerbotOperations.h | 4 +- .../PlayerbotWorldThreadProcessor.cpp | 0 .../WorldThr}/PlayerbotWorldThreadProcessor.h | 0 src/{strategy => Script/WorldThr}/Queue.cpp | 0 src/{strategy => Script/WorldThr}/Queue.h | 0 src/{ => Script}/playerbots_loader.cpp | 0 src/ServerFacade.h | 43 -- src/{ => Util}/BroadcastHelper.cpp | 0 src/{ => Util}/BroadcastHelper.h | 0 src/Util/Helpers.cpp | 114 +++++ src/Util/Helpers.h | 73 +++ src/Util/LazyCalculatedValue.h | 74 +++ src/{ => Util}/PlaceholderHelper.cpp | 0 src/{ => Util}/PlaceholderHelper.h | 2 +- src/{ => Util}/ServerFacade.cpp | 18 +- src/Util/ServerFacade.h | 129 +++++ src/cs_playerbots.h | 1 - src/strategy/Action.cpp | 104 ---- src/strategy/Strategy.cpp | 123 ----- src/strategy/deathknight/BloodDKStrategy.cpp | 111 ----- src/strategy/deathknight/FrostDKStrategy.cpp | 124 ----- src/strategy/deathknight/UnholyDKStrategy.cpp | 143 ------ src/strategy/druid/BearTankDruidStrategy.cpp | 176 ------- src/strategy/druid/CasterDruidStrategy.cpp | 167 ------- src/strategy/druid/CatDpsDruidStrategy.cpp | 179 ------- .../druid/GenericDruidNonCombatStrategy.cpp | 207 -------- src/strategy/druid/GenericDruidStrategy.cpp | 176 ------- src/strategy/druid/HealDruidStrategy.cpp | 129 ----- .../druid/OffhealDruidCatStrategy.cpp | 179 ------- .../wotlk/WotlkDungeonActionContext.h | 21 - .../wotlk/WotlkDungeonTriggerContext.h | 21 - src/strategy/generic/BattlegroundStrategy.cpp | 91 ---- .../generic/ChatCommandHandlerStrategy.cpp | 193 -------- src/strategy/generic/CombatStrategy.cpp | 102 ---- src/strategy/generic/DeadStrategy.cpp | 32 -- src/strategy/generic/EmoteStrategy.cpp | 35 -- src/strategy/generic/GroupStrategy.cpp | 16 - src/strategy/generic/GuildStrategy.cpp | 22 - .../generic/LootNonCombatStrategy.cpp | 37 -- src/strategy/generic/MaintenanceStrategy.cpp | 23 - src/strategy/generic/NonCombatStrategy.cpp | 49 -- src/strategy/generic/RpgStrategy.cpp | 77 --- src/strategy/generic/SayStrategy.cpp | 20 - src/strategy/generic/StayStrategy.cpp | 22 - src/strategy/generic/TravelStrategy.cpp | 23 - .../generic/WorldPacketHandlerStrategy.cpp | 100 ---- .../hunter/GenericHunterNonCombatStrategy.cpp | 68 --- src/strategy/hunter/GenericHunterStrategy.cpp | 157 ------ .../hunter/SurvivalHunterStrategy.cpp | 82 --- src/strategy/mage/FrostMageStrategy.cpp | 83 ---- src/strategy/mage/GenericMageStrategy.cpp | 278 ----------- src/strategy/paladin/DpsPaladinStrategy.cpp | 135 ----- .../paladin/GenericPaladinStrategy.cpp | 87 ---- src/strategy/paladin/HealPaladinStrategy.cpp | 83 ---- .../paladin/OffhealRetPaladinStrategy.cpp | 143 ------ src/strategy/paladin/TankPaladinStrategy.cpp | 117 ----- src/strategy/priest/GenericPriestStrategy.cpp | 111 ----- .../GenericPriestStrategyActionNodeFactory.h | 207 -------- src/strategy/priest/HealPriestStrategy.cpp | 103 ---- src/strategy/priest/HolyPriestStrategy.cpp | 114 ----- .../priest/PriestNonCombatStrategy.cpp | 95 ---- src/strategy/priest/ShadowPriestStrategy.cpp | 74 --- .../raids/blackwinglair/RaidBwlStrategy.cpp | 15 - .../raids/eyeofeternity/RaidEoEStrategy.cpp | 25 - .../gruulslair/RaidGruulsLairStrategy.cpp | 56 --- .../raids/icecrown/RaidIccStrategy.cpp | 186 ------- .../magtheridon/RaidMagtheridonStrategy.cpp | 42 -- .../raids/ulduar/RaidUlduarStrategy.cpp | 323 ------------ .../rogue/AssassinationRogueStrategy.cpp | 114 ----- src/strategy/rogue/DpsRogueStrategy.cpp | 263 ---------- src/strategy/rpg/NewRpgStrategy.cpp | 44 -- .../shaman/EnhancementShamanStrategy.cpp | 83 ---- .../shaman/ShamanNonCombatStrategy.cpp | 126 ----- .../warlock/GenericWarlockStrategy.cpp | 135 ----- src/strategy/warrior/ArmsWarriorStrategy.cpp | 143 ------ src/strategy/warrior/FuryWarriorStrategy.cpp | 99 ---- .../warrior/GenericWarriorStrategy.cpp | 69 --- src/strategy/warrior/GenericWarriorStrategy.h | 84 ---- src/strategy/warrior/TankWarriorStrategy.cpp | 148 ------ 1230 files changed, 12022 insertions(+), 8747 deletions(-) create mode 100644 PULL_REQUEST_TEMPLATE.md rename src/{strategy/actions => Ai/Base}/ActionContext.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptBattlegroundInvitationAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptBattlegroundInvitationAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptDuelAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptDuelAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptInvitationAction.cpp (95%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptInvitationAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptQuestAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptQuestAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptResurrectAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AcceptResurrectAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AddLootAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AddLootAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AreaTriggerAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/AreaTriggerAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ArenaTeamActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ArenaTeamActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AttackAction.cpp (98%) rename src/{strategy/actions => Ai/Base/Actions}/AttackAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/AutoMaintenanceOnLevelupAction.cpp (61%) rename src/{strategy/actions => Ai/Base/Actions}/AutoMaintenanceOnLevelupAction.h (93%) rename src/{strategy/actions => Ai/Base/Actions}/BankAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BankAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/BattleGroundJoinAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BattleGroundJoinAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/BattleGroundTactics.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BattleGroundTactics.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/BossAuraActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BossAuraActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/BuffAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BuffAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/BuyAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/BuyAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CancelChannelAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CancelChannelAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CastCustomSpellAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CastCustomSpellAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeChatAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeChatAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeStrategyAction.cpp (94%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeStrategyAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeTalentsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChangeTalentsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChatShortcutActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChatShortcutActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheatAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheatAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckMailAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckMailAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckMountStateAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckMountStateAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckValuesAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CheckValuesAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseRpgTargetAction.cpp (97%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseRpgTargetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseTargetActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseTargetActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseTravelTargetAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ChooseTravelTargetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CombatActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CombatActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/CustomStrategyEditAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/CustomStrategyEditAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/DebugAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/DebugAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/DelayAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/DelayAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/DestroyItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/DestroyItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/DropQuestAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/DropQuestAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/EmoteAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/EmoteAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/EquipAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/EquipAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/EquipGlyphsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/EquipGlyphsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/FishingAction.cpp (94%) rename src/{strategy/actions => Ai/Base/Actions}/FishingAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/FlagAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/FlagAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/FollowActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/FollowActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GenericActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GenericActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GenericBuffUtils.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GenericBuffUtils.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GenericSpellActions.cpp (99%) rename src/{strategy/actions => Ai/Base/Actions}/GenericSpellActions.h (97%) rename src/{strategy/actions => Ai/Base/Actions}/GiveItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GiveItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GoAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GoAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GossipHelloAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GossipHelloAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GreetAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GreetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildAcceptAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildAcceptAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildBankAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildBankAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildCreateActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildCreateActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildManagementActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/GuildManagementActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/HelpAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/HelpAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/HireAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/HireAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ImbueAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ImbueAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/InventoryAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/InventoryAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/InventoryChangeFailureAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/InventoryChangeFailureAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/InviteToGroupAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/InviteToGroupAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LeaveGroupAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LeaveGroupAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LfgActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LfgActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ListQuestsActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ListQuestsActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ListSpellsAction.cpp (98%) rename src/{strategy/actions => Ai/Base/Actions}/ListSpellsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LogLevelAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LogLevelAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootRollAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootRollAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootStrategyAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/LootStrategyAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/MailAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/MailAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/MoveToRpgTargetAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/MoveToRpgTargetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/MoveToTravelTargetAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/MoveToTravelTargetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/MovementActions.cpp (98%) rename src/{strategy/actions => Ai/Base/Actions}/MovementActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/NonCombatActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/NonCombatActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/OpenItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/OpenItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/OutfitAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/OutfitAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/PassLeadershipToMasterAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/PassLeadershipToMasterAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/PetitionSignAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/PetitionSignAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/PetsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/PetsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/PositionAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/PositionAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/QueryItemUsageAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/QueryItemUsageAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/QueryQuestAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/QueryQuestAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/QuestAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/QuestAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/QuestConfirmAcceptAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/QuestConfirmAcceptAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RandomBotUpdateAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RandomBotUpdateAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RangeAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RangeAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReachTargetActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReachTargetActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReadyCheckAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReadyCheckAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReleaseSpiritAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReleaseSpiritAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RememberTaxiAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RememberTaxiAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RemoveAuraAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RemoveAuraAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RepairAllAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RepairAllAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ResetAiAction.cpp (94%) rename src/{strategy/actions => Ai/Base/Actions}/ResetAiAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ResetInstancesAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ResetInstancesAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RevealGatheringItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RevealGatheringItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReviveFromCorpseAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ReviveFromCorpseAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RewardAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RewardAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RpgAction.cpp (92%) rename src/{strategy/actions => Ai/Base/Actions}/RpgAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RpgSubActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RpgSubActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RpgValues.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RtiAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RtiAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/RtscAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/RtscAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SaveManaAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SaveManaAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SayAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SayAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SecurityCheckAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SecurityCheckAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SeeSpellAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SeeSpellAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SellAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SellAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SendMailAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SendMailAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SetCraftAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SetCraftAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SetHomeAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SetHomeAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/ShareQuestAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/ShareQuestAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SkipSpellsListAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/SkipSpellsListAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/StatsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/StatsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/StayActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/StayActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/SuggestWhatToDoAction.cpp (99%) rename src/{strategy/actions => Ai/Base/Actions}/SuggestWhatToDoAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TalkToQuestGiverAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TalkToQuestGiverAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TameAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TameAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TaxiAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TaxiAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TeleportAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TeleportAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellCastFailedAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellCastFailedAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellGlyphsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellGlyphsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellItemCountAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellItemCountAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellLosAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellLosAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellMasterAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellMasterAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellReputationAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellReputationAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellTargetAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TellTargetAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeStatusAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeStatusAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeStatusExtendedAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeStatusExtendedAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeValues.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/TradeValues.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/TrainerAction.cpp (86%) rename src/{strategy/actions => Ai/Base/Actions}/TrainerAction.h (85%) rename src/{strategy/actions => Ai/Base/Actions}/TravelAction.cpp (98%) rename src/{strategy/actions => Ai/Base/Actions}/TravelAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnequipAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnequipAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnlockItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnlockItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnlockTradedItemAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/UnlockTradedItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/UseItemAction.cpp (98%) rename src/{strategy/actions => Ai/Base/Actions}/UseItemAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/UseMeetingStoneAction.cpp (90%) rename src/{strategy/actions => Ai/Base/Actions}/UseMeetingStoneAction.h (77%) rename src/{strategy/actions => Ai/Base/Actions}/VehicleActions.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/VehicleActions.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/WhoAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/WhoAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/WipeAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/WipeAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/WorldBuffAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/WorldBuffAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/WtsAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/WtsAction.h (100%) rename src/{strategy/actions => Ai/Base/Actions}/XpGainAction.cpp (100%) rename src/{strategy/actions => Ai/Base/Actions}/XpGainAction.h (100%) rename src/{strategy/actions => Ai/Base}/ChatActionContext.h (100%) rename src/{strategy/triggers => Ai/Base}/ChatTriggerContext.h (100%) rename src/{strategy/values => Ai/Base}/SharedValueContext.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/AttackEnemyPlayersStrategy.cpp (78%) rename src/{strategy/generic => Ai/Base/Strategy}/AttackEnemyPlayersStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/BattlegroundStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/BattlegroundStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/CastTimeStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/CastTimeStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/ChatCommandHandlerStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/CombatStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/CombatStrategy.h (88%) rename src/{strategy/generic => Ai/Base/Strategy}/ConserveManaStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/ConserveManaStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/DeadStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/DeadStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/DebugStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/DebugStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/DpsAssistStrategy.cpp (66%) rename src/{strategy/generic => Ai/Base/Strategy}/DpsAssistStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/DuelStrategy.cpp (74%) rename src/{strategy/generic => Ai/Base/Strategy}/DuelStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/EmoteStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/EmoteStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/FleeStrategy.cpp (53%) rename src/{strategy/generic => Ai/Base/Strategy}/FleeStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/FollowMasterStrategy.cpp (56%) rename src/{strategy/generic => Ai/Base/Strategy}/FollowMasterStrategy.h (91%) rename src/{strategy/generic => Ai/Base/Strategy}/GrindingStrategy.cpp (51%) rename src/{strategy/generic => Ai/Base/Strategy}/GrindingStrategy.h (94%) create mode 100644 src/Ai/Base/Strategy/GroupStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/GroupStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/GuardStrategy.cpp (74%) rename src/{strategy/generic => Ai/Base/Strategy}/GuardStrategy.h (91%) create mode 100644 src/Ai/Base/Strategy/GuildStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/GuildStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/KiteStrategy.cpp (77%) rename src/{strategy/generic => Ai/Base/Strategy}/KiteStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/LfgStrategy.cpp (58%) rename src/{strategy/generic => Ai/Base/Strategy}/LfgStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/LootNonCombatStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/LootNonCombatStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/MaintenanceStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/MaintenanceStrategy.h (92%) rename src/{strategy/generic => Ai/Base/Strategy}/MarkRtiStrategy.cpp (76%) rename src/{strategy/generic => Ai/Base/Strategy}/MarkRtiStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/MeleeCombatStrategy.cpp (53%) rename src/{strategy/generic => Ai/Base/Strategy}/MeleeCombatStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/MoveFromGroupStrategy.cpp (76%) rename src/{strategy/generic => Ai/Base/Strategy}/MoveFromGroupStrategy.h (91%) create mode 100644 src/Ai/Base/Strategy/NonCombatStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/NonCombatStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/PassTroughStrategy.cpp (80%) rename src/{strategy/generic => Ai/Base/Strategy}/PassTroughStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/PassiveStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/PassiveStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/PullStrategy.cpp (79%) rename src/{strategy/generic => Ai/Base/Strategy}/PullStrategy.h (94%) rename src/{strategy/generic => Ai/Base/Strategy}/QuestStrategies.cpp (50%) rename src/{strategy/generic => Ai/Base/Strategy}/QuestStrategies.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RTSCStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RTSCStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RacialsStrategy.cpp (54%) rename src/{strategy/generic => Ai/Base/Strategy}/RacialsStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RangedCombatStrategy.cpp (64%) rename src/{strategy/generic => Ai/Base/Strategy}/RangedCombatStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RelaxedFollowStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/RelaxedFollowStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/ReturnStrategy.cpp (71%) rename src/{strategy/generic => Ai/Base/Strategy}/ReturnStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/RpgStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/RpgStrategy.h (93%) rename src/{strategy/generic => Ai/Base/Strategy}/RunawayStrategy.cpp (75%) rename src/{strategy/generic => Ai/Base/Strategy}/RunawayStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/SayStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/SayStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/StayStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/StayStrategy.h (93%) rename src/{strategy/generic => Ai/Base/Strategy}/TankAssistStrategy.cpp (77%) rename src/{strategy/generic => Ai/Base/Strategy}/TankAssistStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/TellTargetStrategy.cpp (77%) rename src/{strategy/generic => Ai/Base/Strategy}/TellTargetStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/ThreatStrategy.cpp (100%) rename src/{strategy/generic => Ai/Base/Strategy}/ThreatStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/TravelStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/TravelStrategy.h (94%) rename src/{strategy/generic => Ai/Base/Strategy}/UseFoodStrategy.cpp (50%) rename src/{strategy/generic => Ai/Base/Strategy}/UseFoodStrategy.h (100%) rename src/{strategy/generic => Ai/Base/Strategy}/UsePotionsStrategy.cpp (68%) rename src/{strategy/generic => Ai/Base/Strategy}/UsePotionsStrategy.h (100%) create mode 100644 src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp rename src/{strategy/generic => Ai/Base/Strategy}/WorldPacketHandlerStrategy.h (100%) rename src/{strategy => Ai/Base}/StrategyContext.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/BossAuraTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/BossAuraTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/ChatCommandTrigger.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/ChatCommandTrigger.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/CureTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/CureTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/FishingTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/FishingTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/GenericTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/GenericTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/GuildTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/GuildTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/HealthTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/HealthTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/LfgTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/LfgTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/LootTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/LootTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/PvpTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/PvpTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/RangeTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/RangeTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/RpgTriggers.cpp (82%) rename src/{strategy/triggers => Ai/Base/Trigger}/RpgTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/RtiTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/RtiTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/StuckTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/StuckTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/TravelTriggers.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/TravelTriggers.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/WithinAreaTrigger.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/WithinAreaTrigger.h (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/WorldPacketTrigger.cpp (100%) rename src/{strategy/triggers => Ai/Base/Trigger}/WorldPacketTrigger.h (100%) rename src/{strategy/triggers => Ai/Base}/TriggerContext.h (100%) rename src/{strategy/values => Ai/Base/Value}/ActiveSpellValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/ActiveSpellValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/AlwaysLootListValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AlwaysLootListValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/AoeHealValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AoeHealValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/AoeValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AoeValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/Arrow.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/Arrow.h (100%) rename src/{strategy/values => Ai/Base/Value}/AttackerCountValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AttackerCountValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/AttackerWithoutAuraTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AttackerWithoutAuraTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/AttackersValue.cpp (99%) rename src/{strategy/values => Ai/Base/Value}/AttackersValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/AvailableLootValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/AvailableLootValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/BudgetValues.cpp (87%) rename src/{strategy/values => Ai/Base/Value}/BudgetValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/CcTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/CcTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/ChatValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/CollisionValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/CollisionValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/CraftValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/CurrentCcTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/CurrentCcTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/CurrentTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/CurrentTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/DistanceValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/DistanceValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/DpsTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/DpsTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/DuelTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/DuelTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/EnemyHealerTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/EnemyHealerTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/EnemyPlayerValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/EnemyPlayerValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/EstimatedLifetimeValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/EstimatedLifetimeValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/FishValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/FishValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/Formations.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/Formations.h (100%) rename src/{strategy/values => Ai/Base/Value}/GrindTargetValue.cpp (98%) rename src/{strategy/values => Ai/Base/Value}/GrindTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/GroupLeaderValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/GroupLeaderValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/GroupValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/GroupValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/GuildValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/GuildValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/HasAvailableLootValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/HasAvailableLootValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/HasTotemValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/HasTotemValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/InvalidTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/InvalidTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/IsBehindValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/IsBehindValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/IsFacingValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/IsFacingValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/IsMovingValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/IsMovingValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/ItemCountValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/ItemCountValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/ItemForSpellValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/ItemForSpellValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/ItemUsageValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/ItemUsageValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LastMovementValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LastMovementValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LastSaidValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LastSpellCastTimeValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LastSpellCastValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LastSpellCastValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LeastHpTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LeastHpTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LfgValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/LineTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LineTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LogLevelValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LootStrategyValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LootStrategyValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/LootValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/LootValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/MaintenanceValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/MaintenanceValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/ManaSaveLevelValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestAdsValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestAdsValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestCorpsesValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestCorpsesValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestFriendlyPlayersValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestFriendlyPlayersValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestGameObjects.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestGameObjects.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestNonBotPlayersValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestNonBotPlayersValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestNpcsValue.cpp (90%) rename src/{strategy/values => Ai/Base/Value}/NearestNpcsValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NearestUnitsValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NearestUnitsValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/NewPlayerNearbyValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/NewPlayerNearbyValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/OutfitListValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/OutfitListValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToDispel.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToDispel.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToHeal.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToHeal.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToResurrect.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberToResurrect.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberWithoutAuraValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberWithoutAuraValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberWithoutItemValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PartyMemberWithoutItemValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PetTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PetTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PositionValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PositionValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PossibleRpgTargetsValue.cpp (95%) rename src/{strategy/values => Ai/Base/Value}/PossibleRpgTargetsValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PossibleTargetsValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PossibleTargetsValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/PvpValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/PvpValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/QuestValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/QuestValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/RTSCValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/RTSCValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/RandomBotUpdateValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/RangeValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/RangeValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/RtiTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/RtiTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/RtiValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/RtiValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/SelfTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/SelfTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/SkipSpellsListValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/SkipSpellsListValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/SnareTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/SnareTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/SpellCastUsefulValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/SpellCastUsefulValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/SpellIdValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/SpellIdValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/Stances.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/Stances.h (100%) rename src/{strategy/values => Ai/Base/Value}/StatsValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/StatsValues.h (100%) rename src/{strategy/values => Ai/Base/Value}/TankTargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/TankTargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/TargetValue.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/TargetValue.h (100%) rename src/{strategy/values => Ai/Base/Value}/ThreatValues.cpp (100%) rename src/{strategy/values => Ai/Base/Value}/ThreatValues.h (100%) rename src/{strategy/values => Ai/Base}/ValueContext.h (100%) rename src/{strategy/actions => Ai/Base}/WorldPacketActionContext.h (100%) rename src/{strategy/triggers => Ai/Base}/WorldPacketTriggerContext.h (100%) rename src/{strategy/deathknight => Ai/Class/Dk/Action}/DKActions.cpp (50%) rename src/{strategy/deathknight => Ai/Class/Dk/Action}/DKActions.h (94%) rename src/{strategy/deathknight => Ai/Class/Dk}/DKAiObjectContext.cpp (100%) rename src/{strategy/deathknight => Ai/Class/Dk}/DKAiObjectContext.h (100%) create mode 100644 src/Ai/Class/Dk/Strategy/BloodDKStrategy.cpp rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/BloodDKStrategy.h (92%) create mode 100644 src/Ai/Class/Dk/Strategy/FrostDKStrategy.cpp rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/FrostDKStrategy.h (94%) rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/GenericDKNonCombatStrategy.cpp (57%) rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/GenericDKNonCombatStrategy.h (100%) rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/GenericDKStrategy.cpp (53%) rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/GenericDKStrategy.h (100%) create mode 100644 src/Ai/Class/Dk/Strategy/UnholyDKStrategy.cpp rename src/{strategy/deathknight => Ai/Class/Dk/Strategy}/UnholyDKStrategy.h (94%) rename src/{strategy/deathknight => Ai/Class/Dk/Trigger}/DKTriggers.cpp (100%) rename src/{strategy/deathknight => Ai/Class/Dk/Trigger}/DKTriggers.h (100%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidActions.cpp (83%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidActions.h (97%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidBearActions.cpp (100%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidBearActions.h (100%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidCatActions.cpp (100%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidCatActions.h (100%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidShapeshiftActions.cpp (92%) rename src/{strategy/druid => Ai/Class/Druid/Action}/DruidShapeshiftActions.h (97%) rename src/{strategy/druid => Ai/Class/Druid}/DruidAiObjectContext.cpp (100%) rename src/{strategy/druid => Ai/Class/Druid}/DruidAiObjectContext.h (100%) create mode 100644 src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/BearTankDruidStrategy.h (92%) create mode 100644 src/Ai/Class/Druid/Strategy/CasterDruidStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/CasterDruidStrategy.h (95%) create mode 100644 src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/CatDpsDruidStrategy.h (94%) rename src/{strategy/druid => Ai/Class/Druid/Strategy}/FeralDruidStrategy.cpp (50%) rename src/{strategy/druid => Ai/Class/Druid/Strategy}/FeralDruidStrategy.h (59%) create mode 100644 src/Ai/Class/Druid/Strategy/GenericDruidNonCombatStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/GenericDruidNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/GenericDruidStrategy.h (100%) create mode 100644 src/Ai/Class/Druid/Strategy/HealDruidStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/HealDruidStrategy.h (100%) rename src/{strategy/druid => Ai/Class/Druid/Strategy}/MeleeDruidStrategy.cpp (56%) rename src/{strategy/druid => Ai/Class/Druid/Strategy}/MeleeDruidStrategy.h (90%) create mode 100644 src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.cpp rename src/{strategy/druid => Ai/Class/Druid/Strategy}/OffhealDruidCatStrategy.h (93%) rename src/{strategy/druid => Ai/Class/Druid/Trigger}/DruidTriggers.cpp (100%) rename src/{strategy/druid => Ai/Class/Druid/Trigger}/DruidTriggers.h (100%) rename src/{strategy/hunter => Ai/Class/Hunter/Action}/HunterActions.cpp (93%) rename src/{strategy/hunter => Ai/Class/Hunter/Action}/HunterActions.h (99%) rename src/{strategy/hunter => Ai/Class/Hunter}/HunterAiObjectContext.cpp (100%) rename src/{strategy/hunter => Ai/Class/Hunter}/HunterAiObjectContext.h (100%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/BeastMasteryHunterStrategy.cpp (51%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/BeastMasteryHunterStrategy.h (91%) create mode 100644 src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.cpp rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/GenericHunterNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/GenericHunterStrategy.h (100%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/HunterBuffStrategies.cpp (66%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/HunterBuffStrategies.h (100%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/MarksmanshipHunterStrategy.cpp (52%) rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/MarksmanshipHunterStrategy.h (91%) create mode 100644 src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp rename src/{strategy/hunter => Ai/Class/Hunter/Strategy}/SurvivalHunterStrategy.h (91%) rename src/{strategy/hunter => Ai/Class/Hunter/Trigger}/HunterTriggers.cpp (100%) rename src/{strategy/hunter => Ai/Class/Hunter/Trigger}/HunterTriggers.h (100%) rename src/{strategy/mage => Ai/Class/Mage/Action}/MageActions.cpp (100%) rename src/{strategy/mage => Ai/Class/Mage/Action}/MageActions.h (100%) rename src/{strategy/mage => Ai/Class/Mage}/MageAiObjectContext.cpp (100%) rename src/{strategy/mage => Ai/Class/Mage}/MageAiObjectContext.h (100%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/ArcaneMageStrategy.cpp (59%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/ArcaneMageStrategy.h (91%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/FireMageStrategy.cpp (61%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/FireMageStrategy.h (93%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/FrostFireMageStrategy.cpp (62%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/FrostFireMageStrategy.h (91%) create mode 100644 src/Ai/Class/Mage/Strategy/FrostMageStrategy.cpp rename src/{strategy/mage => Ai/Class/Mage/Strategy}/FrostMageStrategy.h (91%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/GenericMageNonCombatStrategy.cpp (53%) rename src/{strategy/mage => Ai/Class/Mage/Strategy}/GenericMageNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp rename src/{strategy/mage => Ai/Class/Mage/Strategy}/GenericMageStrategy.h (100%) rename src/{strategy/mage => Ai/Class/Mage/Trigger}/MageTriggers.cpp (100%) rename src/{strategy/mage => Ai/Class/Mage/Trigger}/MageTriggers.h (100%) rename src/{strategy/paladin => Ai/Class/Paladin/Action}/PaladinActions.cpp (100%) rename src/{strategy/paladin => Ai/Class/Paladin/Action}/PaladinActions.h (100%) rename src/{strategy/paladin => Ai/Class/Paladin}/PaladinAiObjectContext.cpp (100%) rename src/{strategy/paladin => Ai/Class/Paladin}/PaladinAiObjectContext.h (100%) create mode 100644 src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.cpp rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/DpsPaladinStrategy.h (92%) rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/GenericPaladinNonCombatStrategy.cpp (60%) rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/GenericPaladinNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/GenericPaladinStrategy.h (100%) rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/GenericPaladinStrategyActionNodeFactory.h (56%) create mode 100644 src/Ai/Class/Paladin/Strategy/HealPaladinStrategy.cpp rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/HealPaladinStrategy.h (92%) create mode 100644 src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.cpp rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/OffhealRetPaladinStrategy.h (93%) rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/PaladinBuffStrategies.cpp (54%) rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/PaladinBuffStrategies.h (100%) create mode 100644 src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.cpp rename src/{strategy/paladin => Ai/Class/Paladin/Strategy}/TankPaladinStrategy.h (92%) rename src/{strategy/paladin => Ai/Class/Paladin/Trigger}/PaladinTriggers.cpp (100%) rename src/{strategy/paladin => Ai/Class/Paladin/Trigger}/PaladinTriggers.h (100%) rename src/{strategy/priest => Ai/Class/Priest/Action}/PriestActions.cpp (100%) rename src/{strategy/priest => Ai/Class/Priest/Action}/PriestActions.h (100%) rename src/{strategy/priest => Ai/Class/Priest}/PriestAiObjectContext.cpp (100%) rename src/{strategy/priest => Ai/Class/Priest}/PriestAiObjectContext.h (100%) create mode 100644 src/Ai/Class/Priest/Strategy/GenericPriestStrategy.cpp rename src/{strategy/priest => Ai/Class/Priest/Strategy}/GenericPriestStrategy.h (100%) create mode 100644 src/Ai/Class/Priest/Strategy/GenericPriestStrategyActionNodeFactory.h create mode 100644 src/Ai/Class/Priest/Strategy/HealPriestStrategy.cpp rename src/{strategy/priest => Ai/Class/Priest/Strategy}/HealPriestStrategy.h (92%) create mode 100644 src/Ai/Class/Priest/Strategy/HolyPriestStrategy.cpp rename src/{strategy/priest => Ai/Class/Priest/Strategy}/HolyPriestStrategy.h (90%) create mode 100644 src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.cpp rename src/{strategy/priest => Ai/Class/Priest/Strategy}/PriestNonCombatStrategy.h (100%) rename src/{strategy/priest => Ai/Class/Priest/Strategy}/PriestNonCombatStrategyActionNodeFactory.h (52%) create mode 100644 src/Ai/Class/Priest/Strategy/ShadowPriestStrategy.cpp rename src/{strategy/priest => Ai/Class/Priest/Strategy}/ShadowPriestStrategy.h (95%) rename src/{strategy/priest => Ai/Class/Priest/Strategy}/ShadowPriestStrategyActionNodeFactory.h (62%) rename src/{strategy/priest => Ai/Class/Priest/Trigger}/PriestTriggers.cpp (100%) rename src/{strategy/priest => Ai/Class/Priest/Trigger}/PriestTriggers.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueActions.cpp (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueActions.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueComboActions.cpp (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueComboActions.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueFinishingActions.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueOpeningActions.cpp (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Action}/RogueOpeningActions.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue}/RogueAiObjectContext.cpp (100%) rename src/{strategy/rogue => Ai/Class/Rogue}/RogueAiObjectContext.h (100%) create mode 100644 src/Ai/Class/Rogue/Strategy/AssassinationRogueStrategy.cpp rename src/{strategy/rogue => Ai/Class/Rogue/Strategy}/AssassinationRogueStrategy.h (88%) create mode 100644 src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.cpp rename src/{strategy/rogue => Ai/Class/Rogue/Strategy}/DpsRogueStrategy.h (94%) rename src/{strategy/rogue => Ai/Class/Rogue/Strategy}/GenericRogueNonCombatStrategy.cpp (52%) rename src/{strategy/rogue => Ai/Class/Rogue/Strategy}/GenericRogueNonCombatStrategy.h (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Trigger}/RogueTriggers.cpp (100%) rename src/{strategy/rogue => Ai/Class/Rogue/Trigger}/RogueTriggers.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Action}/ShamanActions.cpp (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Action}/ShamanActions.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman}/ShamanAiObjectContext.cpp (100%) rename src/{strategy/shaman => Ai/Class/Shaman}/ShamanAiObjectContext.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/ElementalShamanStrategy.cpp (51%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/ElementalShamanStrategy.h (92%) create mode 100644 src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/EnhancementShamanStrategy.h (92%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/GenericShamanStrategy.cpp (52%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/GenericShamanStrategy.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/RestoShamanStrategy.cpp (53%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/RestoShamanStrategy.h (100%) create mode 100644 src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/ShamanNonCombatStrategy.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/TotemsShamanStrategy.cpp (60%) rename src/{strategy/shaman => Ai/Class/Shaman/Strategy}/TotemsShamanStrategy.h (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Trigger}/ShamanTriggers.cpp (100%) rename src/{strategy/shaman => Ai/Class/Shaman/Trigger}/ShamanTriggers.h (100%) rename src/{strategy/warlock => Ai/Class/Warlock/Action}/WarlockActions.cpp (100%) rename src/{strategy/warlock => Ai/Class/Warlock/Action}/WarlockActions.h (100%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/AfflictionWarlockStrategy.cpp (50%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/AfflictionWarlockStrategy.h (91%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/DemonologyWarlockStrategy.cpp (51%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/DemonologyWarlockStrategy.h (94%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/DestructionWarlockStrategy.cpp (51%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/DestructionWarlockStrategy.h (92%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/GenericWarlockNonCombatStrategy.cpp (56%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/GenericWarlockNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/GenericWarlockStrategy.h (98%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/TankWarlockStrategy.cpp (82%) rename src/{strategy/warlock => Ai/Class/Warlock/Strategy}/TankWarlockStrategy.h (91%) rename src/{strategy/warlock => Ai/Class/Warlock/Trigger}/WarlockTriggers.cpp (100%) rename src/{strategy/warlock => Ai/Class/Warlock/Trigger}/WarlockTriggers.h (100%) rename src/{strategy/warlock => Ai/Class/Warlock}/WarlockAiObjectContext.cpp (100%) rename src/{strategy/warlock => Ai/Class/Warlock}/WarlockAiObjectContext.h (100%) rename src/{strategy/warrior => Ai/Class/Warrior/Action}/WarriorActions.cpp (100%) rename src/{strategy/warrior => Ai/Class/Warrior/Action}/WarriorActions.h (100%) create mode 100644 src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp rename src/{strategy/warrior => Ai/Class/Warrior/Strategy}/ArmsWarriorStrategy.h (92%) create mode 100644 src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp rename src/{strategy/warrior => Ai/Class/Warrior/Strategy}/FuryWarriorStrategy.h (92%) rename src/{strategy/warrior => Ai/Class/Warrior/Strategy}/GenericWarriorNonCombatStrategy.cpp (62%) rename src/{strategy/warrior => Ai/Class/Warrior/Strategy}/GenericWarriorNonCombatStrategy.h (100%) create mode 100644 src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp create mode 100644 src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h create mode 100644 src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp rename src/{strategy/warrior => Ai/Class/Warrior/Strategy}/TankWarriorStrategy.h (92%) rename src/{strategy/warrior => Ai/Class/Warrior/Trigger}/WarriorTriggers.cpp (100%) rename src/{strategy/warrior => Ai/Class/Warrior/Trigger}/WarriorTriggers.h (100%) rename src/{strategy/warrior => Ai/Class/Warrior}/WarriorAiObjectContext.cpp (100%) rename src/{strategy/warrior => Ai/Class/Warrior}/WarriorAiObjectContext.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Action}/AzjolNerubActions.cpp (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Action}/AzjolNerubActions.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub}/AzjolNerubActionContext.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub}/AzjolNerubTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Multiplier}/AzjolNerubMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Multiplier}/AzjolNerubMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Strategy}/AzjolNerubStrategy.cpp (75%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Strategy}/AzjolNerubStrategy.h (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Trigger}/AzjolNerubTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/azjolnerub => Ai/Dungeon/AzjolNerub/Trigger}/AzjolNerubTriggers.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Action}/CullingOfStratholmeActions.cpp (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Action}/CullingOfStratholmeActions.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme}/CullingOfStratholmeActionContext.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme}/CullingOfStratholmeTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Multiplier}/CullingOfStratholmeMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Multiplier}/CullingOfStratholmeMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Strategy}/CullingOfStratholmeStrategy.cpp (79%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Strategy}/CullingOfStratholmeStrategy.h (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Trigger}/CullingOfStratholmeTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/cullingofstratholme => Ai/Dungeon/CullingOfStratholme/Trigger}/CullingOfStratholmeTriggers.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Action}/DrakTharonKeepActions.cpp (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Action}/DrakTharonKeepActions.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep}/DrakTharonKeepActionContext.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep}/DrakTharonKeepTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Multiplier}/DrakTharonKeepMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Multiplier}/DrakTharonKeepMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Strategy}/DrakTharonKeepStrategy.cpp (59%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Strategy}/DrakTharonKeepStrategy.h (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Trigger}/DrakTharonKeepTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/draktharonkeep => Ai/Dungeon/DraktharonKeep/Trigger}/DrakTharonKeepTriggers.h (100%) rename src/{strategy/dungeons => Ai/Dungeon}/DungeonStrategyContext.h (83%) rename src/{strategy/dungeons => Ai/Dungeon}/DungeonStrategyUtils.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Action}/ForgeOfSoulsActions.cpp (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Action}/ForgeOfSoulsActions.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls}/ForgeOfSoulsActionContext.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls}/ForgeOfSoulsTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Multiplier}/ForgeOfSoulsMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Multiplier}/ForgeOfSoulsMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Strategy}/ForgeOfSoulsStrategy.cpp (54%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Strategy}/ForgeOfSoulsStrategy.h (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Trigger}/ForgeOfSoulsTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/forgeofsouls => Ai/Dungeon/ForgeOfSouls/Trigger}/ForgeOfSoulsTriggers.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Action}/GundrakActions.cpp (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Action}/GundrakActions.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak}/GundrakActionContext.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak}/GundrakTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Multiplier}/GundrakMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Multiplier}/GundrakMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Strategy}/GundrakStrategy.cpp (74%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Strategy}/GundrakStrategy.h (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Trigger}/GundrakTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/gundrak => Ai/Dungeon/Gundrak/Trigger}/GundrakTriggers.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Action}/HallsOfLightningActions.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Action}/HallsOfLightningActions.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning}/HallsOfLightningActionContext.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning}/HallsOfLightningTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Multiplier}/HallsOfLightningMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Multiplier}/HallsOfLightningMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Strategy}/HallsOfLightningStrategy.cpp (57%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Strategy}/HallsOfLightningStrategy.h (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Trigger}/HallsOfLightningTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsoflightning => Ai/Dungeon/HallsOfLightning/Trigger}/HallsOfLightningTriggers.h (100%) rename src/{strategy/dungeons/wotlk/hallsofreflection => Ai/Dungeon/HallsOfReflection}/TODO (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Action}/HallsOfStoneActions.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Action}/HallsOfStoneActions.h (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone}/HallsOfStoneActionContext.h (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone}/HallsOfStoneTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Multiplier}/HallsOfStoneMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Multiplier}/HallsOfStoneMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Strategy}/HallsOfStoneStrategy.cpp (84%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Strategy}/HallsOfStoneStrategy.h (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Trigger}/HallsOfStoneTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/hallsofstone => Ai/Dungeon/HallsOfStone/Trigger}/HallsOfStoneTriggers.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Action}/NexusActions.cpp (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Action}/NexusActions.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Multiplier}/NexusMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Multiplier}/NexusMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus}/NexusActionContext.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus}/NexusTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Strategy}/NexusStrategy.cpp (73%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Strategy}/NexusStrategy.h (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Trigger}/NexusTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/nexus => Ai/Dungeon/Nexus/Trigger}/NexusTriggers.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Action}/OculusActions.cpp (95%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Action}/OculusActions.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Multiplier}/OculusMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Multiplier}/OculusMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus}/OculusActionContext.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus}/OculusTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Strategy}/OculusStrategy.cpp (60%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Strategy}/OculusStrategy.h (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Trigger}/OculusTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/oculus => Ai/Dungeon/Oculus/Trigger}/OculusTriggers.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Action}/OldKingdomActions.cpp (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Action}/OldKingdomActions.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Multiplier}/OldKingdomMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Multiplier}/OldKingdomMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom}/OldKingdomActionContext.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom}/OldKingdomTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Strategy}/OldKingdomStrategy.cpp (80%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Strategy}/OldKingdomStrategy.h (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Trigger}/OldKingdomTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/oldkingdom => Ai/Dungeon/OldKingdom/Trigger}/OldKingdomTriggers.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Action}/PitOfSaronActions.cpp (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Action}/PitOfSaronActions.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Multiplier}/PitOfSaronMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Multiplier}/PitOfSaronMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron}/PitOfSaronActionContext.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron}/PitOfSaronTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Strategy}/PitOfSaronStrategy.cpp (62%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Strategy}/PitOfSaronStrategy.h (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Trigger}/PitOfSaronTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/pitofsaron => Ai/Dungeon/PitOfSaron/Trigger}/PitOfSaronTriggers.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Action}/TrialOfTheChampionActions.cpp (99%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Action}/TrialOfTheChampionActions.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Multiplier}/TrialOfTheChampionMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Multiplier}/TrialOfTheChampionMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Strategy}/TrialOfTheChampionStrategy.cpp (51%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Strategy}/TrialOfTheChampionStrategy.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion}/TrialOfTheChampionActionContext.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion}/TrialOfTheChampionTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Trigger}/TrialOfTheChampionTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/trialofthechampion => Ai/Dungeon/TrialOfTheChampion/Trigger}/TrialOfTheChampionTriggers.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Action}/UtgardeKeepActions.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Action}/UtgardeKeepActions.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Multiplier}/UtgardeKeepMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Multiplier}/UtgardeKeepMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Strategy}/UtgardeKeepStrategy.cpp (69%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Strategy}/UtgardeKeepStrategy.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Trigger}/UtgardeKeepTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep/Trigger}/UtgardeKeepTriggers.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep}/UtgardeKeepActionContext.h (100%) rename src/{strategy/dungeons/wotlk/utgardekeep => Ai/Dungeon/UtgardeKeep}/UtgardeKeepTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Action}/UtgardePinnacleActions.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Action}/UtgardePinnacleActions.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Multiplier}/UtgardePinnacleMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Multiplier}/UtgardePinnacleMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Strategy}/UtgardePinnacleStrategy.cpp (73%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Strategy}/UtgardePinnacleStrategy.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Trigger}/UtgardePinnacleTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle/Trigger}/UtgardePinnacleTriggers.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle}/UtgardePinnacleActionContext.h (100%) rename src/{strategy/dungeons/wotlk/utgardepinnacle => Ai/Dungeon/UtgardePinnacle}/UtgardePinnacleTriggerContext.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Action}/VioletHoldActions.cpp (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Action}/VioletHoldActions.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Multiplier}/VioletHoldMultipliers.cpp (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Multiplier}/VioletHoldMultipliers.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Strategy}/VioletHoldStrategy.cpp (71%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Strategy}/VioletHoldStrategy.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Trigger}/VioletHoldTriggers.cpp (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold/Trigger}/VioletHoldTriggers.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold}/VioletHoldActionContext.h (100%) rename src/{strategy/dungeons/wotlk/violethold => Ai/Dungeon/VioletHold}/VioletHoldTriggerContext.h (100%) create mode 100644 src/Ai/Dungeon/WotlkDungeonActionContext.h create mode 100644 src/Ai/Dungeon/WotlkDungeonTriggerContext.h rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Action}/RaidAq20Actions.cpp (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Action}/RaidAq20Actions.h (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20}/RaidAq20ActionContext.h (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20}/RaidAq20TriggerContext.h (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Strategy}/RaidAq20Strategy.cpp (68%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Strategy}/RaidAq20Strategy.h (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Trigger}/RaidAq20Triggers.cpp (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Trigger}/RaidAq20Triggers.h (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Util}/RaidAq20Utils.cpp (100%) rename src/{strategy/raids/aq20 => Ai/Raid/Aq20/Util}/RaidAq20Utils.h (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair/Action}/RaidBwlActions.cpp (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair/Action}/RaidBwlActions.h (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair}/RaidBwlActionContext.h (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair}/RaidBwlTriggerContext.h (100%) create mode 100644 src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair/Strategy}/RaidBwlStrategy.h (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair/Trigger}/RaidBwlTriggers.cpp (100%) rename src/{strategy/raids/blackwinglair => Ai/Raid/BlackwingLair/Trigger}/RaidBwlTriggers.h (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Action}/RaidEoEActions.cpp (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Action}/RaidEoEActions.h (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Multiplier}/RaidEoEMultipliers.cpp (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Multiplier}/RaidEoEMultipliers.h (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity}/RaidEoEActionContext.h (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity}/RaidEoETriggerContext.h (100%) create mode 100644 src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.cpp rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Strategy}/RaidEoEStrategy.h (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Trigger}/RaidEoETriggers.cpp (100%) rename src/{strategy/raids/eyeofeternity => Ai/Raid/EyeOfEternity/Trigger}/RaidEoETriggers.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Action}/RaidGruulsLairActions.cpp (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Action}/RaidGruulsLairActions.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Multiplier}/RaidGruulsLairMultipliers.cpp (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Multiplier}/RaidGruulsLairMultipliers.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair}/RaidGruulsLairActionContext.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair}/RaidGruulsLairTriggerContext.h (100%) create mode 100644 src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.cpp rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Strategy}/RaidGruulsLairStrategy.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Trigger}/RaidGruulsLairTriggers.cpp (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Trigger}/RaidGruulsLairTriggers.h (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Util}/RaidGruulsLairHelpers.cpp (100%) rename src/{strategy/raids/gruulslair => Ai/Raid/GruulsLair/Util}/RaidGruulsLairHelpers.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Action}/RaidIccActions.cpp (99%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Action}/RaidIccActions.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Multiplier}/RaidIccMultipliers.cpp (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Multiplier}/RaidIccMultipliers.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown}/RaidIccActionContext.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown}/RaidIccScripts.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown}/RaidIccTriggerContext.h (100%) create mode 100644 src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.cpp rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Strategy}/RaidIccStrategy.h (100%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Trigger}/RaidIccTriggers.cpp (99%) rename src/{strategy/raids/icecrown => Ai/Raid/Icecrown/Trigger}/RaidIccTriggers.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Action}/RaidKarazhanActions.cpp (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Action}/RaidKarazhanActions.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Multiplier}/RaidKarazhanMultipliers.cpp (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Multiplier}/RaidKarazhanMultipliers.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan}/RaidKarazhanActionContext.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan}/RaidKarazhanTriggerContext.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Strategy}/RaidKarazhanStrategy.cpp (55%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Strategy}/RaidKarazhanStrategy.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Trigger}/RaidKarazhanTriggers.cpp (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Trigger}/RaidKarazhanTriggers.h (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Util}/RaidKarazhanHelpers.cpp (100%) rename src/{strategy/raids/karazhan => Ai/Raid/Karazhan/Util}/RaidKarazhanHelpers.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Action}/RaidMagtheridonActions.cpp (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Action}/RaidMagtheridonActions.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Multiplier}/RaidMagtheridonMultipliers.cpp (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Multiplier}/RaidMagtheridonMultipliers.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon}/RaidMagtheridonActionContext.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon}/RaidMagtheridonTriggerContext.h (100%) create mode 100644 src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.cpp rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Strategy}/RaidMagtheridonStrategy.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Trigger}/RaidMagtheridonTriggers.cpp (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Trigger}/RaidMagtheridonTriggers.h (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Util}/RaidMagtheridonHelpers.cpp (100%) rename src/{strategy/raids/magtheridon => Ai/Raid/Magtheridon/Util}/RaidMagtheridonHelpers.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Action}/RaidMcActions.cpp (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Action}/RaidMcActions.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Multiplier}/RaidMcMultipliers.cpp (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Multiplier}/RaidMcMultipliers.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore}/RaidMcActionContext.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore}/RaidMcHelpers.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore}/RaidMcTriggerContext.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Strategy}/RaidMcStrategy.cpp (53%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Strategy}/RaidMcStrategy.h (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Trigger}/RaidMcTriggers.cpp (100%) rename src/{strategy/raids/moltencore => Ai/Raid/MoltenCore/Trigger}/RaidMcTriggers.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Action}/RaidOsActions.cpp (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Action}/RaidOsActions.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Multiplier}/RaidOsMultipliers.cpp (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Multiplier}/RaidOsMultipliers.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum}/RaidOsActionContext.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum}/RaidOsTriggerContext.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Strategy}/RaidOsStrategy.cpp (51%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Strategy}/RaidOsStrategy.h (100%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Trigger}/RaidOsTriggers.cpp (92%) rename src/{strategy/raids/obsidiansanctum => Ai/Raid/ObsidianSanctum/Trigger}/RaidOsTriggers.h (100%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Action}/RaidOnyxiaActions.cpp (87%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Action}/RaidOnyxiaActions.h (100%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia}/RaidOnyxiaActionContext.h (100%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia}/RaidOnyxiaTriggerContext.h (100%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Strategy}/RaidOnyxiaStrategy.cpp (51%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Strategy}/RaidOnyxiaStrategy.h (100%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Trigger}/RaidOnyxiaTriggers.cpp (92%) rename src/{strategy/raids/onyxia => Ai/Raid/Onyxia/Trigger}/RaidOnyxiaTriggers.h (100%) rename src/{strategy/raids => Ai/Raid}/RaidStrategyContext.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Action}/RaidUlduarActions.cpp (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Action}/RaidUlduarActions.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Multiplier}/RaidUlduarMultipliers.cpp (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Multiplier}/RaidUlduarMultipliers.h (86%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar}/RaidUlduarActionContext.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar}/RaidUlduarBossHelper.cpp (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar}/RaidUlduarBossHelper.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar}/RaidUlduarScripts.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar}/RaidUlduarTriggerContext.h (100%) create mode 100644 src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.cpp rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Strategy}/RaidUlduarStrategy.h (100%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Trigger}/RaidUlduarTriggers.cpp (98%) rename src/{strategy/raids/ulduar => Ai/Raid/Ulduar/Trigger}/RaidUlduarTriggers.h (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Action}/RaidVoAActions.cpp (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Action}/RaidVoAActions.h (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon}/RaidVoAActionContext.h (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon}/RaidVoATriggerContext.h (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Strategy}/RaidVoAStrategy.cpp (55%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Strategy}/RaidVoAStrategy.h (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Trigger}/RaidVoATriggers.cpp (100%) rename src/{strategy/raids/vaultofarchavon => Ai/Raid/VaultOfArchavon/Trigger}/RaidVoATriggers.h (100%) rename src/{strategy/rpg => Ai/World/Rpg/Action}/NewRpgAction.cpp (100%) rename src/{strategy/rpg => Ai/World/Rpg/Action}/NewRpgAction.h (100%) rename src/{strategy/rpg => Ai/World/Rpg/Action}/NewRpgBaseAction.cpp (97%) rename src/{strategy/rpg => Ai/World/Rpg/Action}/NewRpgBaseAction.h (100%) rename src/{strategy/rpg => Ai/World/Rpg}/NewRpgInfo.cpp (100%) rename src/{strategy/rpg => Ai/World/Rpg}/NewRpgInfo.h (100%) create mode 100644 src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp rename src/{strategy/rpg => Ai/World/Rpg/Strategy}/NewRpgStrategy.h (92%) rename src/{strategy/rpg => Ai/World/Rpg/Trigger}/NewRpgTrigger.cpp (100%) rename src/{strategy/rpg => Ai/World/Rpg/Trigger}/NewRpgTriggers.h (100%) rename src/{ => Bot/Cmd}/ChatFilter.cpp (100%) rename src/{ => Bot/Cmd}/ChatFilter.h (100%) rename src/{ => Bot/Cmd}/ChatHelper.cpp (100%) rename src/{ => Bot/Cmd}/ChatHelper.h (100%) rename src/{ => Bot/Cmd}/PlayerbotCommandServer.cpp (100%) rename src/{ => Bot/Cmd}/PlayerbotCommandServer.h (100%) rename src/{PerformanceMonitor.cpp => Bot/Debug/PerfMonitor.cpp} (96%) rename src/{PerformanceMonitor.h => Bot/Debug/PerfMonitor.h} (72%) create mode 100644 src/Bot/Engine/Action/Action.cpp rename src/{strategy => Bot/Engine/Action}/Action.h (60%) rename src/{strategy => Bot/Engine}/AiObject.cpp (100%) rename src/{strategy => Bot/Engine}/AiObject.h (85%) rename src/{strategy => Bot/Engine}/AiObjectContext.cpp (87%) rename src/{strategy => Bot/Engine}/AiObjectContext.h (100%) rename src/{strategy => Bot/Engine}/Engine.cpp (90%) rename src/{strategy => Bot/Engine}/Engine.h (97%) rename src/{strategy => Bot/Engine}/ExternalEventHelper.cpp (100%) rename src/{strategy => Bot/Engine}/ExternalEventHelper.h (100%) rename src/{strategy => Bot/Engine}/Multiplier.h (100%) rename src/{strategy => Bot/Engine}/NamedObjectContext.cpp (100%) rename src/{strategy => Bot/Engine}/NamedObjectContext.h (100%) rename src/{strategy => Bot/Engine}/PassiveMultiplier.cpp (100%) rename src/{strategy => Bot/Engine}/PassiveMultiplier.h (100%) rename src/{ => Bot/Engine}/PlayerbotAIAware.h (100%) rename src/{ => Bot/Engine}/PlayerbotAIBase.cpp (94%) rename src/{ => Bot/Engine}/PlayerbotAIBase.h (93%) rename src/{strategy => Bot/Engine/Strategy}/CustomStrategy.cpp (80%) rename src/{strategy => Bot/Engine/Strategy}/CustomStrategy.h (100%) create mode 100644 src/Bot/Engine/Strategy/Strategy.cpp rename src/{strategy => Bot/Engine/Strategy}/Strategy.h (96%) rename src/{strategy => Bot/Engine/Trigger}/Trigger.cpp (100%) rename src/{strategy => Bot/Engine/Trigger}/Trigger.h (51%) rename src/{strategy => Bot/Engine/Value}/Value.cpp (95%) rename src/{strategy => Bot/Engine/Value}/Value.h (95%) rename src/{strategy => Bot/Engine/WorldPacket}/Event.cpp (100%) rename src/{strategy => Bot/Engine/WorldPacket}/Event.h (100%) rename src/{ => Bot/Factory}/AiFactory.cpp (100%) rename src/{ => Bot/Factory}/AiFactory.h (100%) rename src/{factory => Bot/Factory}/PlayerbotFactory.cpp (97%) rename src/{factory => Bot/Factory}/PlayerbotFactory.h (99%) rename src/{ => Bot/Factory}/RandomPlayerbotFactory.cpp (100%) rename src/{ => Bot/Factory}/RandomPlayerbotFactory.h (100%) rename src/{ => Bot}/PlayerbotAI.cpp (96%) rename src/{ => Bot}/PlayerbotAI.h (97%) rename src/{ => Bot}/PlayerbotMgr.cpp (99%) rename src/{ => Bot}/PlayerbotMgr.h (100%) rename src/{ => Bot}/RandomPlayerbotMgr.cpp (99%) rename src/{ => Bot}/RandomPlayerbotMgr.h (98%) create mode 100644 src/Db/FlightMasterCache.cpp create mode 100644 src/Db/FlightMasterCache.h rename src/{PlayerbotDungeonSuggestionMgr.cpp => Db/PlayerbotDungeonRepository.cpp} (88%) rename src/{PlayerbotDungeonSuggestionMgr.h => Db/PlayerbotDungeonRepository.h} (63%) rename src/{PlayerbotDbStore.cpp => Db/PlayerbotRepository.cpp} (88%) rename src/{PlayerbotDbStore.h => Db/PlayerbotRepository.h} (66%) rename src/{database/PlayerbotSpellCache.cpp => Db/PlayerbotSpellRepository.cpp} (76%) rename src/{database/PlayerbotSpellCache.h => Db/PlayerbotSpellRepository.h} (63%) delete mode 100644 src/Helpers.cpp delete mode 100644 src/Helpers.h delete mode 100644 src/LazyCalculatedValue.h rename src/{ => Mgr/Guild}/GuildTaskMgr.cpp (100%) rename src/{ => Mgr/Guild}/GuildTaskMgr.h (100%) rename src/{ => Mgr/Guild}/PlayerbotGuildMgr.cpp (99%) rename src/{ => Mgr/Guild}/PlayerbotGuildMgr.h (100%) rename src/{strategy => Mgr/Item}/ItemVisitors.cpp (100%) rename src/{strategy => Mgr/Item}/ItemVisitors.h (100%) rename src/{ => Mgr/Item}/LootObjectStack.cpp (100%) rename src/{ => Mgr/Item}/LootObjectStack.h (100%) rename src/{ => Mgr/Item}/RandomItemMgr.cpp (99%) rename src/{ => Mgr/Item}/RandomItemMgr.h (100%) rename src/{factory => Mgr/Item}/StatsCollector.cpp (100%) rename src/{factory => Mgr/Item}/StatsCollector.h (100%) rename src/{factory => Mgr/Item}/StatsWeightCalculator.cpp (100%) rename src/{factory => Mgr/Item}/StatsWeightCalculator.h (100%) rename src/{ => Mgr/Move}/FleeManager.cpp (100%) rename src/{ => Mgr/Move}/FleeManager.h (100%) rename src/{ => Mgr/Security}/PlayerbotSecurity.cpp (100%) rename src/{ => Mgr/Security}/PlayerbotSecurity.h (100%) rename src/{ => Mgr/Talent}/Talentspec.cpp (100%) rename src/{ => Mgr/Talent}/Talentspec.h (100%) rename src/{ => Mgr/Text}/PlayerbotTextMgr.cpp (100%) rename src/{ => Mgr/Text}/PlayerbotTextMgr.h (100%) rename src/{ => Mgr/Travel}/TravelMgr.cpp (99%) rename src/{ => Mgr/Travel}/TravelMgr.h (100%) rename src/{ => Mgr/Travel}/TravelNode.cpp (100%) rename src/{ => Mgr/Travel}/TravelNode.h (100%) rename src/{cs_playerbots.cpp => Script/PlayerbotCommandScript.cpp} (95%) create mode 100644 src/Script/PlayerbotCommandScript.h rename src/{ => Script}/Playerbots.cpp (99%) rename src/{ => Script}/Playerbots.h (100%) rename src/{ => Script}/PlayerbotsSecureLogin.cpp (100%) rename src/{ => Script/WorldThr}/PlayerbotOperation.h (100%) rename src/{ => Script/WorldThr}/PlayerbotOperations.h (99%) rename src/{ => Script/WorldThr}/PlayerbotWorldThreadProcessor.cpp (100%) rename src/{ => Script/WorldThr}/PlayerbotWorldThreadProcessor.h (100%) rename src/{strategy => Script/WorldThr}/Queue.cpp (100%) rename src/{strategy => Script/WorldThr}/Queue.h (100%) rename src/{ => Script}/playerbots_loader.cpp (100%) delete mode 100644 src/ServerFacade.h rename src/{ => Util}/BroadcastHelper.cpp (100%) rename src/{ => Util}/BroadcastHelper.h (100%) create mode 100644 src/Util/Helpers.cpp create mode 100644 src/Util/Helpers.h create mode 100644 src/Util/LazyCalculatedValue.h rename src/{ => Util}/PlaceholderHelper.cpp (100%) rename src/{ => Util}/PlaceholderHelper.h (95%) rename src/{ => Util}/ServerFacade.cpp (86%) create mode 100644 src/Util/ServerFacade.h delete mode 100644 src/cs_playerbots.h delete mode 100644 src/strategy/Action.cpp delete mode 100644 src/strategy/Strategy.cpp delete mode 100644 src/strategy/deathknight/BloodDKStrategy.cpp delete mode 100644 src/strategy/deathknight/FrostDKStrategy.cpp delete mode 100644 src/strategy/deathknight/UnholyDKStrategy.cpp delete mode 100644 src/strategy/druid/BearTankDruidStrategy.cpp delete mode 100644 src/strategy/druid/CasterDruidStrategy.cpp delete mode 100644 src/strategy/druid/CatDpsDruidStrategy.cpp delete mode 100644 src/strategy/druid/GenericDruidNonCombatStrategy.cpp delete mode 100644 src/strategy/druid/GenericDruidStrategy.cpp delete mode 100644 src/strategy/druid/HealDruidStrategy.cpp delete mode 100644 src/strategy/druid/OffhealDruidCatStrategy.cpp delete mode 100644 src/strategy/dungeons/wotlk/WotlkDungeonActionContext.h delete mode 100644 src/strategy/dungeons/wotlk/WotlkDungeonTriggerContext.h delete mode 100644 src/strategy/generic/BattlegroundStrategy.cpp delete mode 100644 src/strategy/generic/ChatCommandHandlerStrategy.cpp delete mode 100644 src/strategy/generic/CombatStrategy.cpp delete mode 100644 src/strategy/generic/DeadStrategy.cpp delete mode 100644 src/strategy/generic/EmoteStrategy.cpp delete mode 100644 src/strategy/generic/GroupStrategy.cpp delete mode 100644 src/strategy/generic/GuildStrategy.cpp delete mode 100644 src/strategy/generic/LootNonCombatStrategy.cpp delete mode 100644 src/strategy/generic/MaintenanceStrategy.cpp delete mode 100644 src/strategy/generic/NonCombatStrategy.cpp delete mode 100644 src/strategy/generic/RpgStrategy.cpp delete mode 100644 src/strategy/generic/SayStrategy.cpp delete mode 100644 src/strategy/generic/StayStrategy.cpp delete mode 100644 src/strategy/generic/TravelStrategy.cpp delete mode 100644 src/strategy/generic/WorldPacketHandlerStrategy.cpp delete mode 100644 src/strategy/hunter/GenericHunterNonCombatStrategy.cpp delete mode 100644 src/strategy/hunter/GenericHunterStrategy.cpp delete mode 100644 src/strategy/hunter/SurvivalHunterStrategy.cpp delete mode 100644 src/strategy/mage/FrostMageStrategy.cpp delete mode 100644 src/strategy/mage/GenericMageStrategy.cpp delete mode 100644 src/strategy/paladin/DpsPaladinStrategy.cpp delete mode 100644 src/strategy/paladin/GenericPaladinStrategy.cpp delete mode 100644 src/strategy/paladin/HealPaladinStrategy.cpp delete mode 100644 src/strategy/paladin/OffhealRetPaladinStrategy.cpp delete mode 100644 src/strategy/paladin/TankPaladinStrategy.cpp delete mode 100644 src/strategy/priest/GenericPriestStrategy.cpp delete mode 100644 src/strategy/priest/GenericPriestStrategyActionNodeFactory.h delete mode 100644 src/strategy/priest/HealPriestStrategy.cpp delete mode 100644 src/strategy/priest/HolyPriestStrategy.cpp delete mode 100644 src/strategy/priest/PriestNonCombatStrategy.cpp delete mode 100644 src/strategy/priest/ShadowPriestStrategy.cpp delete mode 100644 src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp delete mode 100644 src/strategy/raids/eyeofeternity/RaidEoEStrategy.cpp delete mode 100644 src/strategy/raids/gruulslair/RaidGruulsLairStrategy.cpp delete mode 100644 src/strategy/raids/icecrown/RaidIccStrategy.cpp delete mode 100644 src/strategy/raids/magtheridon/RaidMagtheridonStrategy.cpp delete mode 100644 src/strategy/raids/ulduar/RaidUlduarStrategy.cpp delete mode 100644 src/strategy/rogue/AssassinationRogueStrategy.cpp delete mode 100644 src/strategy/rogue/DpsRogueStrategy.cpp delete mode 100644 src/strategy/rpg/NewRpgStrategy.cpp delete mode 100644 src/strategy/shaman/EnhancementShamanStrategy.cpp delete mode 100644 src/strategy/shaman/ShamanNonCombatStrategy.cpp delete mode 100644 src/strategy/warlock/GenericWarlockStrategy.cpp delete mode 100644 src/strategy/warrior/ArmsWarriorStrategy.cpp delete mode 100644 src/strategy/warrior/FuryWarriorStrategy.cpp delete mode 100644 src/strategy/warrior/GenericWarriorStrategy.cpp delete mode 100644 src/strategy/warrior/GenericWarriorStrategy.h delete mode 100644 src/strategy/warrior/TankWarriorStrategy.cpp diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index e7d8b244da..49678c97aa 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -25,21 +25,25 @@ jobs: with: repository: 'mod-playerbots/azerothcore-wotlk' ref: 'Playerbot' + path: 'ac' - name: Checkout Playerbot Module uses: actions/checkout@v3 with: repository: 'mod-playerbots/mod-playerbots' - path: 'modules/mod-playerbots' + #path: 'modules/mod-playerbots' + path: ac/modules/mod-playerbots - name: ccache uses: hendrikmuhs/ccache-action@v1.2.13 - name: Configure OS shell: bash + working-directory: ac env: CONTINUOUS_INTEGRATION: true run: | ./acore.sh install-deps - name: Build shell: bash + working-directory: ac run: | export CTOOLS_BUILD=all ./acore.sh compiler build diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..63d8f2397f --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,127 @@ +# Pull Request + +Describe what this change does and why it is needed... + +--- + +## Design Philosophy + +We prioritize **stability, performance, and predictability** over behavioral realism. +Complex player-mimicking logic is intentionally limited due to its negative impact on scalability, maintainability, and +long-term robustness. + +Excessive processing overhead can lead to server hiccups, increased CPU usage, and degraded performance for all +participants. Because every action and +decision tree is executed **per bot and per trigger**, even small increases in logic complexity can scale poorly and +negatively affect both players and +world (random) bots. Bots are not expected to behave perfectly, and perfect simulation of human decision-making is not a +project goal. Increased behavioral +realism often introduces disproportionate cost, reduced predictability, and significantly higher maintenance overhead. + +Every additional branch of logic increases long-term responsibility. All decision paths must be tested, validated, and +maintained continuously as the system evolves. +If advanced or AI-intensive behavior is introduced, the **default configuration must remain the lightweight decision +model**. More complex behavior should only be +available as an **explicit opt-in option**, clearly documented as having a measurable performance cost. + +Principles: + +- **Stability before intelligence** + A stable system is always preferred over a smarter one. + +- **Performance is a shared resource** + Any increase in bot cost affects all players and all bots. + +- **Simple logic scales better than smart logic** + Predictable behavior under load is more valuable than perfect decisions. + +- **Complexity must justify itself** + If a feature cannot clearly explain its cost, it should not exist. + +- **Defaults must be cheap** + Expensive behavior must always be optional and clearly communicated. + +- **Bots should look reasonable, not perfect** + The goal is believable behavior, not human simulation. + +Before submitting, confirm that this change aligns with those principles. + +--- + +## Feature Evaluation + +Please answer the following: + +- Describe the **minimum logic** required to achieve the intended behavior? +- Describe the **cheapest implementation** that produces an acceptable result? +- Describe the **runtime cost** when this logic executes across many bots? + +--- + +## How to Test the Changes + +- Step-by-step instructions to test the change +- Any required setup (e.g. multiple players, bots, specific configuration) +- Expected behavior and how to verify it + +## Complexity & Impact + +- Does this change add new decision branches? + - [ ] No + - [ ] Yes (**explain below**) + +- Does this change increase per-bot or per-tick processing? + - [ ] No + - [ ] Yes (**describe and justify impact**) + +- Could this logic scale poorly under load? + - [ ] No + - [ ] Yes (**explain why**) + +--- + +## Defaults & Configuration + +- Does this change modify default bot behavior? + - [ ] No + - [ ] Yes (**explain why**) + +If this introduces more advanced or AI-heavy logic: + +- [ ] Lightweight mode remains the default +- [ ] More complex behavior is optional and thereby configurable + +--- + +## AI Assistance + +- Was AI assistance (e.g. ChatGPT or similar tools) used while working on this change? + - [ ] No + - [ ] Yes (**explain below**) + +If yes, please specify: + +- AI tool or model used (e.g. ChatGPT, GPT-4, Claude, etc.) +- Purpose of usage (e.g. brainstorming, refactoring, documentation, code generation) +- Which parts of the change were influenced or generated +- Whether the result was manually reviewed and adapted + +AI assistance is allowed, but all submitted code must be fully understood, reviewed, and owned by the contributor. +Any AI-influenced changes must be verified against existing CORE and PB logic. We expect contributors to be honest +about what they do and do not understand. + +--- + +## Final Checklist + +- [ ] Stability is not compromised +- [ ] Performance impact is understood, tested, and acceptable +- [ ] Added logic complexity is justified and explained +- [ ] Documentation updated if needed + +--- + +## Notes for Reviewers + +Anything that significantly improves realism at the cost of stability or performance should be carefully discussed +before merging. diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 01791ed821..910cc07a19 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -3,8 +3,9 @@ ################################################## # Overview -# "Randombot": randomly generated bots that log in separately from players and populate the world. Depending on settings, randombots may automatically grind, quest, and upgrade equipment and can be invited to groups and given commands. -# "Altbot": characters created on player accounts, which may be logged in by the player and invited to groups and given commands like randombots. Depending on settings, altbots can be limited to characters on the active player's account or in the active player's guild. +# "Randombot": randomly generated bots that log in separately from players and populate the world. Randombots may automatically grind, quest, level up, and upgrade equipment and can be invited to groups and given commands. +# "AddClass bot": bots from the AddClassAccountPoolSize accounts. They are used for quickly adding a leveled and geared bot of any class to your party. They are recommended for a quick formation of a party. +# "Altbot": characters created on player accounts, which may be logged in by the player and invited to groups and given commands like randombots. They are best suited for long-progression playthroughs. # Information about commands to control bots and set their strategies can be found on the wiki at https://github.com/mod-playerbots/mod-playerbots/wiki/Playerbot-Commands. #################################################################################################### @@ -21,7 +22,7 @@ # THRESHOLDS # QUESTS # COMBAT -# PALADIN BUFFS STRATEGIES +# GREATER BUFFS STRATEGIES # CHEATS # SPELLS # FLIGHTPATH @@ -91,17 +92,20 @@ AiPlayerbot.MinRandomBots = 500 AiPlayerbot.MaxRandomBots = 500 # Randombot accounts -# If you are not using any expansion at all, you may have to set this manually, in which case please ensure that RandomBotAccountCount is at least greater than (MaxRandomBots / 10 + AddClassAccountPoolSize) +# If you are not using any expansion at all, you may have to set this manually, in which case please +# ensure that RandomBotAccountCount is at least greater than (MaxRandomBots / 10 + AddClassAccountPoolSize) # Default: 0 (automatic) AiPlayerbot.RandomBotAccountCount = 0 # Delete all randombot accounts -# To apply this, set the number to 1 and run the Worldserver. Once deletion is complete, if you would like to recreate randombots, set the number back to 0 and rerun the Worldserver. +# To apply this, set the number to 1 and run the Worldserver. Once deletion is complete, if you would +# like to recreate randombots, set the number back to 0 and rerun the Worldserver. AiPlayerbot.DeleteRandomBotAccounts = 0 # Disable randombots when no real players are logged in # Default: 0 (randombots will login when server starts) -# If enabled, randombots will only log in 30 seconds (default) after a real player logs in, and will log out 300 seconds (default) after all real players log out +# If enabled, randombots will only log in 30 seconds (default) after a real player logs in, and will +# log out 300 seconds (default) after all real players log out AiPlayerbot.DisabledWithoutRealPlayer = 0 AiPlayerbot.DisabledWithoutRealPlayerLoginDelay = 30 AiPlayerbot.DisabledWithoutRealPlayerLogoutDelay = 300 @@ -153,7 +157,8 @@ AiPlayerbot.AllowGuildBots = 1 AiPlayerbot.AllowTrustedAccountBots = 1 # Randombots will create guilds with nearby randombots -# Note: currently, randombots will not invite more bots after a guild is created (i.e., randombot guilds will have only the 10 initial randombots needed to sign the charter) +# Note: currently, randombots will not invite more bots after a guild is created, +# meaning randombot guilds will have only the 10 initial randombots needed to sign the charter # Default: 0 (disabled) AiPlayerbot.RandomBotGuildNearby = 0 @@ -187,7 +192,8 @@ AiPlayerbot.AutoInitOnly = 0 # Default: 1.0 (same with the player) AiPlayerbot.AutoInitEquipLevelLimitRatio = 1.0 -# Bot automatically trains spells when talking to trainer (yes = train all available spells as long as the bot has the money, free = auto trains with no money cost, no = only list spells) +# Bot automatically trains spells when talking to trainer +# yes = train all available spells as long as the bot has the money, free = auto trains with no money cost, no = only list spells AiPlayerbot.AutoTrainSpells = yes # @@ -264,7 +270,7 @@ AiPlayerbot.UseFastFlyMountAtMinLevel = 70 AiPlayerbot.RandomBotShowHelmet = 1 AiPlayerbot.RandomBotShowCloak = 1 -# Randombots and altbots automatically equip upgrades (bots will equip any item obtained from looting or a quest if they are sufficient upgrades) +# Toggles whether altbots will automatically equip items in their inventory that are sufficient upgrades # Default: 1 (enabled) AiPlayerbot.AutoEquipUpgradeLoot = 1 @@ -312,7 +318,8 @@ AiPlayerbot.GlobalCooldown = 500 # Max wait time when moving AiPlayerbot.MaxWaitForMove = 5000 -# Disable use of MoveSplinePath for bot movement, will result in more erratic bot movement but means stun/snare/root/etc will work on bots (they wont reliably work when MoveSplinePath is enabled, though slowing effects still work ok) +# Enable/disable use of MoveSplinePath for bot movement +# Disabling will result in more erratic movement but is required for stuns, snares, and roots to work on bots # Default: 0 - MoveSplinePath enabled # 1 - MoveSplinePath disabled in BG/Arena only # 2 - MoveSplinePath disabled everywhere @@ -409,10 +416,11 @@ AiPlayerbot.HighMana = 65 # # -# Bots pick their quest rewards (yes = picks the most useful item, no = list all rewards, ask = pick useful item and lists if multiple) +# Bots pick their quest rewards +# yes = picks the most useful item, no = list all rewards, ask = pick useful item and lists if multiple AiPlayerbot.AutoPickReward = yes -# Sync quests with player (Bots will complete quests the moment you hand them in and will not loot quest items.) +# Sync quests with player (bots will complete quests the moment you hand them in and will not loot quest items.) # Default: 1 (enabled) AiPlayerbot.SyncQuestWithPlayer = 1 @@ -437,7 +445,7 @@ AiPlayerbot.DropObsoleteQuests = 1 # Auto add dungeon/raid strategies when entering the instance if implemented AiPlayerbot.ApplyInstanceStrategies = 1 -# Enable auto avoid aoe strategy (experimental) +# Enable auto avoid aoe strategy # Default: 1 (enabled) AiPlayerbot.AutoAvoidAoe = 1 @@ -464,7 +472,7 @@ AiPlayerbot.FleeingEnabled = 1 #################################################################################################### #################################################################################################### -# PALADIN BUFFS STRATEGIES +# GREATER BUFFS STRATEGIES # # @@ -487,12 +495,13 @@ AiPlayerbot.RPWarningCooldown = 30 # # Enable/Disable maintenance command -# Learn all available spells and skills, refresh consumables, repair, enchant equipment and socket gems if bot's level is above AiPlayerbot.MinEnchantingBotLevel +# Learn all available spells and skills, assign talent points, refresh consumables, repair, enchant equipment, socket gems, etc. +# Applies if bot's level is above AiPlayerbot.MinEnchantingBotLevel # Default: 1 (enabled) AiPlayerbot.MaintenanceCommand = 1 # Enable/Disable specific maintenance command functionality for alt bots -# Disable to prevent players from giving free bags, spells, skill levels etc to their alt bots +# Disable to prevent players from giving free bags, spells, skill levels, etc. to their alt bots # Default: 1 (enabled) AiPlayerbot.AltMaintenanceAmmo = 1 AiPlayerbot.AltMaintenanceFood = 1 @@ -504,6 +513,7 @@ AiPlayerbot.AltMaintenanceBags = 1 AiPlayerbot.AltMaintenanceMounts = 1 AiPlayerbot.AltMaintenanceSkills = 1 +# "Special Spells" consist of any spells listed in AiPlayerbot.RandomBotSpellIds and Death Gate for Death Knights AiPlayerbot.AltMaintenanceClassSpells = 1 AiPlayerbot.AltMaintenanceAvailableSpells = 1 AiPlayerbot.AltMaintenanceSpecialSpells = 1 @@ -518,8 +528,8 @@ AiPlayerbot.AltMaintenanceReputation = 1 AiPlayerbot.AltMaintenanceAttunementQuests = 1 AiPlayerbot.AltMaintenanceKeyring = 1 - -# Enable/Disable autogear command, which automatically upgrades bots' gear; the quality is limited by AutoGearQualityLimit and AutoGearScoreLimit +# Enable/Disable autogear command, which automatically upgrades bots' gear +# The quality is limited by AutoGearQualityLimit and AutoGearScoreLimit # Default: 1 (enabled) AiPlayerbot.AutoGearCommand = 1 @@ -585,15 +595,21 @@ AiPlayerbot.BotTaxiGapJitterMs = 100 #################################################################################################### # PROFESSIONS -# Random bots currently do not get professions. +# Note: Random bots currently do not get professions # -# EnableFishingWithMaster automatically adds the 'master fishing' strategy to bots that can fish that can. +# Automatically adds the 'master fishing' strategy to bots that have the fishing skill when the bots master fishes. # Default: 1 (Enabled) AiPlayerbot.EnableFishingWithMaster = 1 -#FishingDistance sets how far a bot without a master will search for water, while FishingDistanceFromMaster limits it to a closer range, and overrides the following distance to the same value. EndFishingWithMaster sets the distance from water a bot needs to have to automatically drop the 'master fishing' strategy. + +# Distance from itself (in yards) that a bot with a master will search for water to fish AiPlayerbot.FishingDistanceFromMaster = 10.0 + +# Distance from itself (in yards) that a bot without a master will search for water to fish +# Currently not relevant since masterless bots will not fish AiPlayerbot.FishingDistance = 40.0 + +# Distance from water (in yards) beyond which a bot will remove the 'master fishing' strategy AiPlayerbot.EndFishingWithMaster = 30.0 # @@ -657,7 +673,7 @@ AiPlayerbot.DisableDeathKnightLogin = 0 # Default: 0 (disabled) AiPlayerbot.LimitTalentsExpansion = 0 -# Configure randombots and addClass bot trading (0: Disabled, 1: Enabled, 2: Only Buy, 3: Only Sell) +# Configure randombot trading (0: Disabled, 1: Enabled, 2: Only Buy, 3: Only Sell) # Default: 1 (enabled) AiPlayerbot.EnableRandomBotTrading = 1 @@ -722,7 +738,7 @@ AiPlayerbot.RandomGearQualityLimit = 3 # Max iLVL Phase 1(MC, Ony, ZG) = 78 | Phase 2(BWL) = 83 | Phase 2.5(AQ40) = 88 | Phase 3(Naxx40) = 92 # TBC # Max iLVL Tier 4 = 120 | Tier 5 = 133 | Tier 6 = 164 -# Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 1.5(ZA) = 138 | Phase 2(SC, TK) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164 +# Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 2(SSC, TK, ZA) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164 # Wotlk # Max iLVL Tier 7(10/25) = 200/213 | Tier 8(10/25) = 225/232 | Tier 9(10/25) = 232/245 | Tier 10(10/25/HC) = 251/264/290 # Max iLVL Phase 1(Naxx) = 224 | Phase 2(Ulduar) = 245 | Phase 3(ToC) = 258 | Phase 4(ICC) = 290 @@ -733,7 +749,8 @@ AiPlayerbot.RandomGearScoreLimit = 0 # Default: 1 (enabled) AiPlayerbot.IncrementalGearInit = 1 -# Set minimum level of bots that will enchant their equipment (if greater than RandomBotMaxlevel, bots will not enchant equipment) +# Set minimum level of bots that will enchant and socket gems into their equipment with maintenance +# If greater than RandomBotMaxlevel, bots will not automatically enchant equipment or socket gems # Default: 60 AiPlayerbot.MinEnchantingBotLevel = 60 @@ -885,13 +902,15 @@ AiPlayerbot.OpenGoSpell = 6477 # # Additional randombot strategies -# Strategies added here are applied to all randombots, in addition (or subtraction) to spec/role-based default strategies. These rules are processed after the defaults. +# Strategies added here are applied to all randombots, in addition (or subtraction) to spec/role-based default strategies. +# These rules are processed after the defaults. # Example: "+threat,-potions" AiPlayerbot.RandomBotCombatStrategies = "" AiPlayerbot.RandomBotNonCombatStrategies = "" # Additional altbot strategies -# Strategies added here are applied to all altbots, in addition (or subtraction) to spec/role-based default strategies. These rules are processed after the defaults. +# Strategies added here are applied to all altbots, in addition (or subtraction) to spec/role-based default strategies. +# These rules are processed after the defaults. AiPlayerbot.CombatStrategies = "" AiPlayerbot.NonCombatStrategies = "" diff --git a/src/strategy/actions/ActionContext.h b/src/Ai/Base/ActionContext.h similarity index 100% rename from src/strategy/actions/ActionContext.h rename to src/Ai/Base/ActionContext.h diff --git a/src/strategy/actions/AcceptBattlegroundInvitationAction.cpp b/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp similarity index 100% rename from src/strategy/actions/AcceptBattlegroundInvitationAction.cpp rename to src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.cpp diff --git a/src/strategy/actions/AcceptBattlegroundInvitationAction.h b/src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.h similarity index 100% rename from src/strategy/actions/AcceptBattlegroundInvitationAction.h rename to src/Ai/Base/Actions/AcceptBattlegroundInvitationAction.h diff --git a/src/strategy/actions/AcceptDuelAction.cpp b/src/Ai/Base/Actions/AcceptDuelAction.cpp similarity index 100% rename from src/strategy/actions/AcceptDuelAction.cpp rename to src/Ai/Base/Actions/AcceptDuelAction.cpp diff --git a/src/strategy/actions/AcceptDuelAction.h b/src/Ai/Base/Actions/AcceptDuelAction.h similarity index 100% rename from src/strategy/actions/AcceptDuelAction.h rename to src/Ai/Base/Actions/AcceptDuelAction.h diff --git a/src/strategy/actions/AcceptInvitationAction.cpp b/src/Ai/Base/Actions/AcceptInvitationAction.cpp similarity index 95% rename from src/strategy/actions/AcceptInvitationAction.cpp rename to src/Ai/Base/Actions/AcceptInvitationAction.cpp index 2d53c13e0e..5e0bffc47f 100644 --- a/src/strategy/actions/AcceptInvitationAction.cpp +++ b/src/Ai/Base/Actions/AcceptInvitationAction.cpp @@ -49,7 +49,7 @@ bool AcceptInvitationAction::Execute(Event event) if (sRandomPlayerbotMgr->IsRandomBot(bot)) botAI->SetMaster(inviter); // else - // sPlayerbotDbStore->Save(botAI); + // sPlayerbotRepository->Save(botAI); botAI->ResetStrategies(); botAI->ChangeStrategy("+follow,-lfg,-bg", BOT_STATE_NON_COMBAT); @@ -59,7 +59,7 @@ bool AcceptInvitationAction::Execute(Event event) if (sPlayerbotAIConfig->summonWhenGroup && bot->GetDistance(inviter) > sPlayerbotAIConfig->sightDistance) { - Teleport(inviter, bot); + Teleport(inviter, bot, true); } return true; } diff --git a/src/strategy/actions/AcceptInvitationAction.h b/src/Ai/Base/Actions/AcceptInvitationAction.h similarity index 100% rename from src/strategy/actions/AcceptInvitationAction.h rename to src/Ai/Base/Actions/AcceptInvitationAction.h diff --git a/src/strategy/actions/AcceptQuestAction.cpp b/src/Ai/Base/Actions/AcceptQuestAction.cpp similarity index 100% rename from src/strategy/actions/AcceptQuestAction.cpp rename to src/Ai/Base/Actions/AcceptQuestAction.cpp diff --git a/src/strategy/actions/AcceptQuestAction.h b/src/Ai/Base/Actions/AcceptQuestAction.h similarity index 100% rename from src/strategy/actions/AcceptQuestAction.h rename to src/Ai/Base/Actions/AcceptQuestAction.h diff --git a/src/strategy/actions/AcceptResurrectAction.cpp b/src/Ai/Base/Actions/AcceptResurrectAction.cpp similarity index 100% rename from src/strategy/actions/AcceptResurrectAction.cpp rename to src/Ai/Base/Actions/AcceptResurrectAction.cpp diff --git a/src/strategy/actions/AcceptResurrectAction.h b/src/Ai/Base/Actions/AcceptResurrectAction.h similarity index 100% rename from src/strategy/actions/AcceptResurrectAction.h rename to src/Ai/Base/Actions/AcceptResurrectAction.h diff --git a/src/strategy/actions/AddLootAction.cpp b/src/Ai/Base/Actions/AddLootAction.cpp similarity index 100% rename from src/strategy/actions/AddLootAction.cpp rename to src/Ai/Base/Actions/AddLootAction.cpp diff --git a/src/strategy/actions/AddLootAction.h b/src/Ai/Base/Actions/AddLootAction.h similarity index 100% rename from src/strategy/actions/AddLootAction.h rename to src/Ai/Base/Actions/AddLootAction.h diff --git a/src/strategy/actions/AreaTriggerAction.cpp b/src/Ai/Base/Actions/AreaTriggerAction.cpp similarity index 100% rename from src/strategy/actions/AreaTriggerAction.cpp rename to src/Ai/Base/Actions/AreaTriggerAction.cpp diff --git a/src/strategy/actions/AreaTriggerAction.h b/src/Ai/Base/Actions/AreaTriggerAction.h similarity index 100% rename from src/strategy/actions/AreaTriggerAction.h rename to src/Ai/Base/Actions/AreaTriggerAction.h diff --git a/src/strategy/actions/ArenaTeamActions.cpp b/src/Ai/Base/Actions/ArenaTeamActions.cpp similarity index 100% rename from src/strategy/actions/ArenaTeamActions.cpp rename to src/Ai/Base/Actions/ArenaTeamActions.cpp diff --git a/src/strategy/actions/ArenaTeamActions.h b/src/Ai/Base/Actions/ArenaTeamActions.h similarity index 100% rename from src/strategy/actions/ArenaTeamActions.h rename to src/Ai/Base/Actions/ArenaTeamActions.h diff --git a/src/strategy/actions/AttackAction.cpp b/src/Ai/Base/Actions/AttackAction.cpp similarity index 98% rename from src/strategy/actions/AttackAction.cpp rename to src/Ai/Base/Actions/AttackAction.cpp index d72b18c553..2b8c486f8b 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/Ai/Base/Actions/AttackAction.cpp @@ -159,7 +159,7 @@ bool AttackAction::Attack(Unit* target, bool /*with_pet*/ /*true*/) bot->StopMoving(); } - if (IsMovingAllowed() && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target)) + if (botAI->CanMove() && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target)) sServerFacade->SetFacingTo(bot, target); botAI->ChangeEngine(BOT_STATE_COMBAT); diff --git a/src/strategy/actions/AttackAction.h b/src/Ai/Base/Actions/AttackAction.h similarity index 100% rename from src/strategy/actions/AttackAction.h rename to src/Ai/Base/Actions/AttackAction.h diff --git a/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp similarity index 61% rename from src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp rename to src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp index ad6a00c6d6..6939e5c925 100644 --- a/src/strategy/actions/AutoMaintenanceOnLevelupAction.cpp +++ b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.cpp @@ -75,36 +75,79 @@ void AutoMaintenanceOnLevelupAction::LearnSpells(std::ostringstream* out) void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream* out) { PlayerbotFactory factory(bot, bot->GetLevel()); + factory.InitSkills(); factory.InitClassSpells(); factory.InitAvailableSpells(); - factory.InitSkills(); factory.InitPet(); } void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out) { - // CreatureTemplate const* co = sCreatureStorage.LookupEntry(id); ObjectMgr::QuestMap const& questTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator i = questTemplates.begin(); i != questTemplates.end(); ++i) { - //uint32 questId = i->first; //not used, line marked for removal. Quest const* quest = i->second; - if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10) + // only process class-specific quests to learn class-related spells, cuz + // we don't want all these bunch of entries to be handled! + if (!quest->GetRequiredClasses()) + continue; + + // skip quests that are repeatable, too low level, or above bots' level + if (quest->IsRepeatable() || quest->GetMinLevel() < 10 || quest->GetMinLevel() > bot->GetLevel()) + continue; + + // skip if bot doesnt satisfy class, race, or skill requirements + if (!bot->SatisfyQuestClass(quest, false) || !bot->SatisfyQuestRace(quest, false) || + !bot->SatisfyQuestSkill(quest, false)) continue; - if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->GetLevel() || - !bot->SatisfyQuestRace(quest, false)) + // use the same logic and impl from Player::learnQuestRewardedSpells + + int32 spellId = quest->GetRewSpellCast(); + if (!spellId) continue; - if (quest->GetRewSpellCast() > 0) + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + continue; + + // xinef: find effect with learn spell and check if we have this spell + bool found = false; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - LearnSpell(quest->GetRewSpellCast(), out); + if (spellInfo->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL && spellInfo->Effects[i].TriggerSpell && + !bot->HasSpell(spellInfo->Effects[i].TriggerSpell)) + { + // pusywizard: don't re-add profession specialties! + if (SpellInfo const* triggeredInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell)) + if (triggeredInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL) + break; // pussywizard: break and not cast the spell (found is false) + + found = true; + break; + } } - else if (quest->GetRewSpell() > 0) + + // xinef: we know the spell, continue + if (!found) + continue; + + bot->CastSpell(bot, spellId, true); + + // Check if RewardDisplaySpell is set to output the proper spell learned + // after processing quests. Output the original RewardSpell otherwise. + uint32 rewSpellId = quest->GetRewSpell(); + if (rewSpellId) { - LearnSpell(quest->GetRewSpell(), out); + if (SpellInfo const* rewSpellInfo = sSpellMgr->GetSpellInfo(rewSpellId)) + { + *out << FormatSpell(rewSpellInfo) << ", "; + continue; + } } + + *out << FormatSpell(spellInfo) << ", "; } } @@ -121,39 +164,6 @@ std::string const AutoMaintenanceOnLevelupAction::FormatSpell(SpellInfo const* s return out.str(); } -void AutoMaintenanceOnLevelupAction::LearnSpell(uint32 spellId, std::ostringstream* out) -{ - SpellInfo const* proto = sSpellMgr->GetSpellInfo(spellId); - if (!proto) - return; - - bool learned = false; - for (uint8 j = 0; j < 3; ++j) - { - if (proto->Effects[j].Effect == SPELL_EFFECT_LEARN_SPELL) - { - uint32 learnedSpell = proto->Effects[j].TriggerSpell; - - if (!bot->HasSpell(learnedSpell)) - { - bot->learnSpell(learnedSpell); - *out << FormatSpell(sSpellMgr->GetSpellInfo(learnedSpell)) << ", "; - } - - learned = true; - } - } - - if (!learned) - { - if (!bot->HasSpell(spellId)) - { - bot->learnSpell(spellId); - *out << FormatSpell(proto) << ", "; - } - } -} - void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip() { if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot)) diff --git a/src/strategy/actions/AutoMaintenanceOnLevelupAction.h b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.h similarity index 93% rename from src/strategy/actions/AutoMaintenanceOnLevelupAction.h rename to src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.h index 314d44bbe1..5399973cf4 100644 --- a/src/strategy/actions/AutoMaintenanceOnLevelupAction.h +++ b/src/Ai/Base/Actions/AutoMaintenanceOnLevelupAction.h @@ -28,7 +28,6 @@ class AutoMaintenanceOnLevelupAction : public Action void LearnSpells(std::ostringstream* out); void LearnTrainerSpells(std::ostringstream* out); void LearnQuestSpells(std::ostringstream* out); - void LearnSpell(uint32 spellId, std::ostringstream* out); std::string const FormatSpell(SpellInfo const* sInfo); }; diff --git a/src/strategy/actions/BankAction.cpp b/src/Ai/Base/Actions/BankAction.cpp similarity index 100% rename from src/strategy/actions/BankAction.cpp rename to src/Ai/Base/Actions/BankAction.cpp diff --git a/src/strategy/actions/BankAction.h b/src/Ai/Base/Actions/BankAction.h similarity index 100% rename from src/strategy/actions/BankAction.h rename to src/Ai/Base/Actions/BankAction.h diff --git a/src/strategy/actions/BattleGroundJoinAction.cpp b/src/Ai/Base/Actions/BattleGroundJoinAction.cpp similarity index 100% rename from src/strategy/actions/BattleGroundJoinAction.cpp rename to src/Ai/Base/Actions/BattleGroundJoinAction.cpp diff --git a/src/strategy/actions/BattleGroundJoinAction.h b/src/Ai/Base/Actions/BattleGroundJoinAction.h similarity index 100% rename from src/strategy/actions/BattleGroundJoinAction.h rename to src/Ai/Base/Actions/BattleGroundJoinAction.h diff --git a/src/strategy/actions/BattleGroundTactics.cpp b/src/Ai/Base/Actions/BattleGroundTactics.cpp similarity index 100% rename from src/strategy/actions/BattleGroundTactics.cpp rename to src/Ai/Base/Actions/BattleGroundTactics.cpp diff --git a/src/strategy/actions/BattleGroundTactics.h b/src/Ai/Base/Actions/BattleGroundTactics.h similarity index 100% rename from src/strategy/actions/BattleGroundTactics.h rename to src/Ai/Base/Actions/BattleGroundTactics.h diff --git a/src/strategy/actions/BossAuraActions.cpp b/src/Ai/Base/Actions/BossAuraActions.cpp similarity index 100% rename from src/strategy/actions/BossAuraActions.cpp rename to src/Ai/Base/Actions/BossAuraActions.cpp diff --git a/src/strategy/actions/BossAuraActions.h b/src/Ai/Base/Actions/BossAuraActions.h similarity index 100% rename from src/strategy/actions/BossAuraActions.h rename to src/Ai/Base/Actions/BossAuraActions.h diff --git a/src/strategy/actions/BuffAction.cpp b/src/Ai/Base/Actions/BuffAction.cpp similarity index 100% rename from src/strategy/actions/BuffAction.cpp rename to src/Ai/Base/Actions/BuffAction.cpp diff --git a/src/strategy/actions/BuffAction.h b/src/Ai/Base/Actions/BuffAction.h similarity index 100% rename from src/strategy/actions/BuffAction.h rename to src/Ai/Base/Actions/BuffAction.h diff --git a/src/strategy/actions/BuyAction.cpp b/src/Ai/Base/Actions/BuyAction.cpp similarity index 100% rename from src/strategy/actions/BuyAction.cpp rename to src/Ai/Base/Actions/BuyAction.cpp diff --git a/src/strategy/actions/BuyAction.h b/src/Ai/Base/Actions/BuyAction.h similarity index 100% rename from src/strategy/actions/BuyAction.h rename to src/Ai/Base/Actions/BuyAction.h diff --git a/src/strategy/actions/CancelChannelAction.cpp b/src/Ai/Base/Actions/CancelChannelAction.cpp similarity index 100% rename from src/strategy/actions/CancelChannelAction.cpp rename to src/Ai/Base/Actions/CancelChannelAction.cpp diff --git a/src/strategy/actions/CancelChannelAction.h b/src/Ai/Base/Actions/CancelChannelAction.h similarity index 100% rename from src/strategy/actions/CancelChannelAction.h rename to src/Ai/Base/Actions/CancelChannelAction.h diff --git a/src/strategy/actions/CastCustomSpellAction.cpp b/src/Ai/Base/Actions/CastCustomSpellAction.cpp similarity index 100% rename from src/strategy/actions/CastCustomSpellAction.cpp rename to src/Ai/Base/Actions/CastCustomSpellAction.cpp diff --git a/src/strategy/actions/CastCustomSpellAction.h b/src/Ai/Base/Actions/CastCustomSpellAction.h similarity index 100% rename from src/strategy/actions/CastCustomSpellAction.h rename to src/Ai/Base/Actions/CastCustomSpellAction.h diff --git a/src/strategy/actions/ChangeChatAction.cpp b/src/Ai/Base/Actions/ChangeChatAction.cpp similarity index 100% rename from src/strategy/actions/ChangeChatAction.cpp rename to src/Ai/Base/Actions/ChangeChatAction.cpp diff --git a/src/strategy/actions/ChangeChatAction.h b/src/Ai/Base/Actions/ChangeChatAction.h similarity index 100% rename from src/strategy/actions/ChangeChatAction.h rename to src/Ai/Base/Actions/ChangeChatAction.h diff --git a/src/strategy/actions/ChangeStrategyAction.cpp b/src/Ai/Base/Actions/ChangeStrategyAction.cpp similarity index 94% rename from src/strategy/actions/ChangeStrategyAction.cpp rename to src/Ai/Base/Actions/ChangeStrategyAction.cpp index 6d410c0d41..d17cd005d3 100644 --- a/src/strategy/actions/ChangeStrategyAction.cpp +++ b/src/Ai/Base/Actions/ChangeStrategyAction.cpp @@ -6,7 +6,7 @@ #include "ChangeStrategyAction.h" #include "Event.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "Playerbots.h" bool ChangeCombatStrategyAction::Execute(Event event) @@ -24,7 +24,7 @@ bool ChangeCombatStrategyAction::Execute(Event event) case '+': case '-': case '~': - sPlayerbotDbStore->Save(botAI); + sPlayerbotRepository->Save(botAI); break; case '?': break; @@ -62,7 +62,7 @@ bool ChangeNonCombatStrategyAction::Execute(Event event) case '+': case '-': case '~': - sPlayerbotDbStore->Save(botAI); + sPlayerbotRepository->Save(botAI); break; case '?': break; diff --git a/src/strategy/actions/ChangeStrategyAction.h b/src/Ai/Base/Actions/ChangeStrategyAction.h similarity index 100% rename from src/strategy/actions/ChangeStrategyAction.h rename to src/Ai/Base/Actions/ChangeStrategyAction.h diff --git a/src/strategy/actions/ChangeTalentsAction.cpp b/src/Ai/Base/Actions/ChangeTalentsAction.cpp similarity index 100% rename from src/strategy/actions/ChangeTalentsAction.cpp rename to src/Ai/Base/Actions/ChangeTalentsAction.cpp diff --git a/src/strategy/actions/ChangeTalentsAction.h b/src/Ai/Base/Actions/ChangeTalentsAction.h similarity index 100% rename from src/strategy/actions/ChangeTalentsAction.h rename to src/Ai/Base/Actions/ChangeTalentsAction.h diff --git a/src/strategy/actions/ChatShortcutActions.cpp b/src/Ai/Base/Actions/ChatShortcutActions.cpp similarity index 100% rename from src/strategy/actions/ChatShortcutActions.cpp rename to src/Ai/Base/Actions/ChatShortcutActions.cpp diff --git a/src/strategy/actions/ChatShortcutActions.h b/src/Ai/Base/Actions/ChatShortcutActions.h similarity index 100% rename from src/strategy/actions/ChatShortcutActions.h rename to src/Ai/Base/Actions/ChatShortcutActions.h diff --git a/src/strategy/actions/CheatAction.cpp b/src/Ai/Base/Actions/CheatAction.cpp similarity index 100% rename from src/strategy/actions/CheatAction.cpp rename to src/Ai/Base/Actions/CheatAction.cpp diff --git a/src/strategy/actions/CheatAction.h b/src/Ai/Base/Actions/CheatAction.h similarity index 100% rename from src/strategy/actions/CheatAction.h rename to src/Ai/Base/Actions/CheatAction.h diff --git a/src/strategy/actions/CheckMailAction.cpp b/src/Ai/Base/Actions/CheckMailAction.cpp similarity index 100% rename from src/strategy/actions/CheckMailAction.cpp rename to src/Ai/Base/Actions/CheckMailAction.cpp diff --git a/src/strategy/actions/CheckMailAction.h b/src/Ai/Base/Actions/CheckMailAction.h similarity index 100% rename from src/strategy/actions/CheckMailAction.h rename to src/Ai/Base/Actions/CheckMailAction.h diff --git a/src/strategy/actions/CheckMountStateAction.cpp b/src/Ai/Base/Actions/CheckMountStateAction.cpp similarity index 100% rename from src/strategy/actions/CheckMountStateAction.cpp rename to src/Ai/Base/Actions/CheckMountStateAction.cpp diff --git a/src/strategy/actions/CheckMountStateAction.h b/src/Ai/Base/Actions/CheckMountStateAction.h similarity index 100% rename from src/strategy/actions/CheckMountStateAction.h rename to src/Ai/Base/Actions/CheckMountStateAction.h diff --git a/src/strategy/actions/CheckValuesAction.cpp b/src/Ai/Base/Actions/CheckValuesAction.cpp similarity index 100% rename from src/strategy/actions/CheckValuesAction.cpp rename to src/Ai/Base/Actions/CheckValuesAction.cpp diff --git a/src/strategy/actions/CheckValuesAction.h b/src/Ai/Base/Actions/CheckValuesAction.h similarity index 100% rename from src/strategy/actions/CheckValuesAction.h rename to src/Ai/Base/Actions/CheckValuesAction.h diff --git a/src/strategy/actions/ChooseRpgTargetAction.cpp b/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp similarity index 97% rename from src/strategy/actions/ChooseRpgTargetAction.cpp rename to src/Ai/Base/Actions/ChooseRpgTargetAction.cpp index 0d441e9b67..a888aa14ee 100644 --- a/src/strategy/actions/ChooseRpgTargetAction.cpp +++ b/src/Ai/Base/Actions/ChooseRpgTargetAction.cpp @@ -78,20 +78,17 @@ float ChooseRpgTargetAction::getMaxRelevance(GuidPosition guidP) if (!trigger->IsActive()) continue; - NextAction** nextActions = triggerNode->getHandlers(); + std::vector nextActions = triggerNode->getHandlers(); bool isRpg = false; - for (int32 i = 0; i < NextAction::size(nextActions); i++) + for (NextAction nextAction : nextActions) { - NextAction* nextAction = nextActions[i]; - - Action* action = botAI->GetAiObjectContext()->GetAction(nextAction->getName()); + Action* action = botAI->GetAiObjectContext()->GetAction(nextAction.getName()); if (dynamic_cast(action)) isRpg = true; } - NextAction::destroy(nextActions); if (isRpg) { diff --git a/src/strategy/actions/ChooseRpgTargetAction.h b/src/Ai/Base/Actions/ChooseRpgTargetAction.h similarity index 100% rename from src/strategy/actions/ChooseRpgTargetAction.h rename to src/Ai/Base/Actions/ChooseRpgTargetAction.h diff --git a/src/strategy/actions/ChooseTargetActions.cpp b/src/Ai/Base/Actions/ChooseTargetActions.cpp similarity index 100% rename from src/strategy/actions/ChooseTargetActions.cpp rename to src/Ai/Base/Actions/ChooseTargetActions.cpp diff --git a/src/strategy/actions/ChooseTargetActions.h b/src/Ai/Base/Actions/ChooseTargetActions.h similarity index 100% rename from src/strategy/actions/ChooseTargetActions.h rename to src/Ai/Base/Actions/ChooseTargetActions.h diff --git a/src/strategy/actions/ChooseTravelTargetAction.cpp b/src/Ai/Base/Actions/ChooseTravelTargetAction.cpp similarity index 100% rename from src/strategy/actions/ChooseTravelTargetAction.cpp rename to src/Ai/Base/Actions/ChooseTravelTargetAction.cpp diff --git a/src/strategy/actions/ChooseTravelTargetAction.h b/src/Ai/Base/Actions/ChooseTravelTargetAction.h similarity index 100% rename from src/strategy/actions/ChooseTravelTargetAction.h rename to src/Ai/Base/Actions/ChooseTravelTargetAction.h diff --git a/src/strategy/actions/CombatActions.cpp b/src/Ai/Base/Actions/CombatActions.cpp similarity index 100% rename from src/strategy/actions/CombatActions.cpp rename to src/Ai/Base/Actions/CombatActions.cpp diff --git a/src/strategy/actions/CombatActions.h b/src/Ai/Base/Actions/CombatActions.h similarity index 100% rename from src/strategy/actions/CombatActions.h rename to src/Ai/Base/Actions/CombatActions.h diff --git a/src/strategy/actions/CustomStrategyEditAction.cpp b/src/Ai/Base/Actions/CustomStrategyEditAction.cpp similarity index 100% rename from src/strategy/actions/CustomStrategyEditAction.cpp rename to src/Ai/Base/Actions/CustomStrategyEditAction.cpp diff --git a/src/strategy/actions/CustomStrategyEditAction.h b/src/Ai/Base/Actions/CustomStrategyEditAction.h similarity index 100% rename from src/strategy/actions/CustomStrategyEditAction.h rename to src/Ai/Base/Actions/CustomStrategyEditAction.h diff --git a/src/strategy/actions/DebugAction.cpp b/src/Ai/Base/Actions/DebugAction.cpp similarity index 100% rename from src/strategy/actions/DebugAction.cpp rename to src/Ai/Base/Actions/DebugAction.cpp diff --git a/src/strategy/actions/DebugAction.h b/src/Ai/Base/Actions/DebugAction.h similarity index 100% rename from src/strategy/actions/DebugAction.h rename to src/Ai/Base/Actions/DebugAction.h diff --git a/src/strategy/actions/DelayAction.cpp b/src/Ai/Base/Actions/DelayAction.cpp similarity index 100% rename from src/strategy/actions/DelayAction.cpp rename to src/Ai/Base/Actions/DelayAction.cpp diff --git a/src/strategy/actions/DelayAction.h b/src/Ai/Base/Actions/DelayAction.h similarity index 100% rename from src/strategy/actions/DelayAction.h rename to src/Ai/Base/Actions/DelayAction.h diff --git a/src/strategy/actions/DestroyItemAction.cpp b/src/Ai/Base/Actions/DestroyItemAction.cpp similarity index 100% rename from src/strategy/actions/DestroyItemAction.cpp rename to src/Ai/Base/Actions/DestroyItemAction.cpp diff --git a/src/strategy/actions/DestroyItemAction.h b/src/Ai/Base/Actions/DestroyItemAction.h similarity index 100% rename from src/strategy/actions/DestroyItemAction.h rename to src/Ai/Base/Actions/DestroyItemAction.h diff --git a/src/strategy/actions/DropQuestAction.cpp b/src/Ai/Base/Actions/DropQuestAction.cpp similarity index 100% rename from src/strategy/actions/DropQuestAction.cpp rename to src/Ai/Base/Actions/DropQuestAction.cpp diff --git a/src/strategy/actions/DropQuestAction.h b/src/Ai/Base/Actions/DropQuestAction.h similarity index 100% rename from src/strategy/actions/DropQuestAction.h rename to src/Ai/Base/Actions/DropQuestAction.h diff --git a/src/strategy/actions/EmoteAction.cpp b/src/Ai/Base/Actions/EmoteAction.cpp similarity index 100% rename from src/strategy/actions/EmoteAction.cpp rename to src/Ai/Base/Actions/EmoteAction.cpp diff --git a/src/strategy/actions/EmoteAction.h b/src/Ai/Base/Actions/EmoteAction.h similarity index 100% rename from src/strategy/actions/EmoteAction.h rename to src/Ai/Base/Actions/EmoteAction.h diff --git a/src/strategy/actions/EquipAction.cpp b/src/Ai/Base/Actions/EquipAction.cpp similarity index 100% rename from src/strategy/actions/EquipAction.cpp rename to src/Ai/Base/Actions/EquipAction.cpp diff --git a/src/strategy/actions/EquipAction.h b/src/Ai/Base/Actions/EquipAction.h similarity index 100% rename from src/strategy/actions/EquipAction.h rename to src/Ai/Base/Actions/EquipAction.h diff --git a/src/strategy/actions/EquipGlyphsAction.cpp b/src/Ai/Base/Actions/EquipGlyphsAction.cpp similarity index 100% rename from src/strategy/actions/EquipGlyphsAction.cpp rename to src/Ai/Base/Actions/EquipGlyphsAction.cpp diff --git a/src/strategy/actions/EquipGlyphsAction.h b/src/Ai/Base/Actions/EquipGlyphsAction.h similarity index 100% rename from src/strategy/actions/EquipGlyphsAction.h rename to src/Ai/Base/Actions/EquipGlyphsAction.h diff --git a/src/strategy/actions/FishingAction.cpp b/src/Ai/Base/Actions/FishingAction.cpp similarity index 94% rename from src/strategy/actions/FishingAction.cpp rename to src/Ai/Base/Actions/FishingAction.cpp index 452288170d..dc431d3425 100644 --- a/src/strategy/actions/FishingAction.cpp +++ b/src/Ai/Base/Actions/FishingAction.cpp @@ -261,7 +261,9 @@ bool MoveNearWaterAction::isUseful() return false; FishingSpotValue* fishingSpotValueObject = (FishingSpotValue*)context->GetValue("fishing spot"); WorldPosition pos = fishingSpotValueObject->Get(); - return !pos.IsValid() || fishingSpotValueObject->IsStale(FISHING_LOCATION_TIMEOUT) || pos != bot->GetPosition(); + return !pos.IsValid() || fishingSpotValueObject->IsStale(FISHING_LOCATION_TIMEOUT) || + bot->GetExactDist(&pos) < 0.1f; + } bool MoveNearWaterAction::isPossible() @@ -299,6 +301,17 @@ bool MoveNearWaterAction::isPossible() } } } + // Can the bot fish from current position? + WorldPosition waterAtCurrentPos = + FindWaterRadial(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), bot->GetMap(), + bot->GetPhaseMask(), MIN_DISTANCE_TO_WATER, MAX_DISTANCE_TO_WATER, SEARCH_INCREMENT, true); + if (waterAtCurrentPos.IsValid()) + { + SET_AI_VALUE(WorldPosition, "fishing spot", + WorldPosition(WorldPosition(bot->GetMapId(), bot->GetPositionX(), bot->GetPositionY(), + bot->GetPositionZ()))); + return false; + } // Lets find some water where we can fish. WorldPosition water = FindWaterRadial( bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), @@ -417,7 +430,8 @@ bool FishingAction::Execute(Event event) { float angle = bot->GetAngle(pos.GetPositionX(), pos.GetPositionY()); bot->SetOrientation(angle); - bot->SendMovementFlagUpdate(); + if (!bot->IsRooted()) + bot->SendMovementFlagUpdate(); } EquipFishingPoleAction equipAction(botAI); @@ -434,10 +448,14 @@ bool FishingAction::isUseful() { if (!AI_VALUE(bool, "can fish")) return false; + FishingSpotValue* fishingSpotValueObject = (FishingSpotValue*)context->GetValue("fishing spot"); WorldPosition pos = fishingSpotValueObject->Get(); - return pos.IsValid() && !fishingSpotValueObject->IsStale(FISHING_LOCATION_TIMEOUT) && pos == bot->GetPosition(); + if (!pos.IsValid() || fishingSpotValueObject->IsStale(FISHING_LOCATION_TIMEOUT)) + return false; + + return bot->GetExactDist(&pos) < 0.1f; } bool UseBobberAction::isUseful() diff --git a/src/strategy/actions/FishingAction.h b/src/Ai/Base/Actions/FishingAction.h similarity index 100% rename from src/strategy/actions/FishingAction.h rename to src/Ai/Base/Actions/FishingAction.h diff --git a/src/strategy/actions/FlagAction.cpp b/src/Ai/Base/Actions/FlagAction.cpp similarity index 100% rename from src/strategy/actions/FlagAction.cpp rename to src/Ai/Base/Actions/FlagAction.cpp diff --git a/src/strategy/actions/FlagAction.h b/src/Ai/Base/Actions/FlagAction.h similarity index 100% rename from src/strategy/actions/FlagAction.h rename to src/Ai/Base/Actions/FlagAction.h diff --git a/src/strategy/actions/FollowActions.cpp b/src/Ai/Base/Actions/FollowActions.cpp similarity index 100% rename from src/strategy/actions/FollowActions.cpp rename to src/Ai/Base/Actions/FollowActions.cpp diff --git a/src/strategy/actions/FollowActions.h b/src/Ai/Base/Actions/FollowActions.h similarity index 100% rename from src/strategy/actions/FollowActions.h rename to src/Ai/Base/Actions/FollowActions.h diff --git a/src/strategy/actions/GenericActions.cpp b/src/Ai/Base/Actions/GenericActions.cpp similarity index 100% rename from src/strategy/actions/GenericActions.cpp rename to src/Ai/Base/Actions/GenericActions.cpp diff --git a/src/strategy/actions/GenericActions.h b/src/Ai/Base/Actions/GenericActions.h similarity index 100% rename from src/strategy/actions/GenericActions.h rename to src/Ai/Base/Actions/GenericActions.h diff --git a/src/strategy/actions/GenericBuffUtils.cpp b/src/Ai/Base/Actions/GenericBuffUtils.cpp similarity index 100% rename from src/strategy/actions/GenericBuffUtils.cpp rename to src/Ai/Base/Actions/GenericBuffUtils.cpp diff --git a/src/strategy/actions/GenericBuffUtils.h b/src/Ai/Base/Actions/GenericBuffUtils.h similarity index 100% rename from src/strategy/actions/GenericBuffUtils.h rename to src/Ai/Base/Actions/GenericBuffUtils.h diff --git a/src/strategy/actions/GenericSpellActions.cpp b/src/Ai/Base/Actions/GenericSpellActions.cpp similarity index 99% rename from src/strategy/actions/GenericSpellActions.cpp rename to src/Ai/Base/Actions/GenericSpellActions.cpp index b30975ad14..af06a457f0 100644 --- a/src/strategy/actions/GenericSpellActions.cpp +++ b/src/Ai/Base/Actions/GenericSpellActions.cpp @@ -265,11 +265,6 @@ CastShootAction::CastShootAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "s } } -NextAction** CastSpellAction::getPrerequisites() -{ - return nullptr; -} - Value* CastDebuffSpellOnAttackerAction::GetTargetValue() { return context->GetValue("attacker without aura", spell); diff --git a/src/strategy/actions/GenericSpellActions.h b/src/Ai/Base/Actions/GenericSpellActions.h similarity index 97% rename from src/strategy/actions/GenericSpellActions.h rename to src/Ai/Base/Actions/GenericSpellActions.h index e2435a579c..b148b93ff6 100644 --- a/src/strategy/actions/GenericSpellActions.h +++ b/src/Ai/Base/Actions/GenericSpellActions.h @@ -27,7 +27,11 @@ class CastSpellAction : public Action bool isUseful() override; ActionThreatType getThreatType() override { return ActionThreatType::Single; } - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override + { + return {}; + } + std::string const getSpell() { return spell; } protected: @@ -193,10 +197,12 @@ class ResurrectPartyMemberAction : public CastSpellAction ResurrectPartyMemberAction(PlayerbotAI* botAI, std::string const spell) : CastSpellAction(botAI, spell) {} std::string const GetTargetName() override { return "party member to resurrect"; } - NextAction** getPrerequisites() override + std::vector getPrerequisites() override { - return NextAction::merge(NextAction::array(0, new NextAction("reach party member to resurrect"), NULL), - Action::getPrerequisites()); + return NextAction::merge( + { NextAction("reach party member to resurrect") }, + Action::getPrerequisites() + ); } }; diff --git a/src/strategy/actions/GiveItemAction.cpp b/src/Ai/Base/Actions/GiveItemAction.cpp similarity index 100% rename from src/strategy/actions/GiveItemAction.cpp rename to src/Ai/Base/Actions/GiveItemAction.cpp diff --git a/src/strategy/actions/GiveItemAction.h b/src/Ai/Base/Actions/GiveItemAction.h similarity index 100% rename from src/strategy/actions/GiveItemAction.h rename to src/Ai/Base/Actions/GiveItemAction.h diff --git a/src/strategy/actions/GoAction.cpp b/src/Ai/Base/Actions/GoAction.cpp similarity index 100% rename from src/strategy/actions/GoAction.cpp rename to src/Ai/Base/Actions/GoAction.cpp diff --git a/src/strategy/actions/GoAction.h b/src/Ai/Base/Actions/GoAction.h similarity index 100% rename from src/strategy/actions/GoAction.h rename to src/Ai/Base/Actions/GoAction.h diff --git a/src/strategy/actions/GossipHelloAction.cpp b/src/Ai/Base/Actions/GossipHelloAction.cpp similarity index 100% rename from src/strategy/actions/GossipHelloAction.cpp rename to src/Ai/Base/Actions/GossipHelloAction.cpp diff --git a/src/strategy/actions/GossipHelloAction.h b/src/Ai/Base/Actions/GossipHelloAction.h similarity index 100% rename from src/strategy/actions/GossipHelloAction.h rename to src/Ai/Base/Actions/GossipHelloAction.h diff --git a/src/strategy/actions/GreetAction.cpp b/src/Ai/Base/Actions/GreetAction.cpp similarity index 100% rename from src/strategy/actions/GreetAction.cpp rename to src/Ai/Base/Actions/GreetAction.cpp diff --git a/src/strategy/actions/GreetAction.h b/src/Ai/Base/Actions/GreetAction.h similarity index 100% rename from src/strategy/actions/GreetAction.h rename to src/Ai/Base/Actions/GreetAction.h diff --git a/src/strategy/actions/GuildAcceptAction.cpp b/src/Ai/Base/Actions/GuildAcceptAction.cpp similarity index 100% rename from src/strategy/actions/GuildAcceptAction.cpp rename to src/Ai/Base/Actions/GuildAcceptAction.cpp diff --git a/src/strategy/actions/GuildAcceptAction.h b/src/Ai/Base/Actions/GuildAcceptAction.h similarity index 100% rename from src/strategy/actions/GuildAcceptAction.h rename to src/Ai/Base/Actions/GuildAcceptAction.h diff --git a/src/strategy/actions/GuildBankAction.cpp b/src/Ai/Base/Actions/GuildBankAction.cpp similarity index 100% rename from src/strategy/actions/GuildBankAction.cpp rename to src/Ai/Base/Actions/GuildBankAction.cpp diff --git a/src/strategy/actions/GuildBankAction.h b/src/Ai/Base/Actions/GuildBankAction.h similarity index 100% rename from src/strategy/actions/GuildBankAction.h rename to src/Ai/Base/Actions/GuildBankAction.h diff --git a/src/strategy/actions/GuildCreateActions.cpp b/src/Ai/Base/Actions/GuildCreateActions.cpp similarity index 100% rename from src/strategy/actions/GuildCreateActions.cpp rename to src/Ai/Base/Actions/GuildCreateActions.cpp diff --git a/src/strategy/actions/GuildCreateActions.h b/src/Ai/Base/Actions/GuildCreateActions.h similarity index 100% rename from src/strategy/actions/GuildCreateActions.h rename to src/Ai/Base/Actions/GuildCreateActions.h diff --git a/src/strategy/actions/GuildManagementActions.cpp b/src/Ai/Base/Actions/GuildManagementActions.cpp similarity index 100% rename from src/strategy/actions/GuildManagementActions.cpp rename to src/Ai/Base/Actions/GuildManagementActions.cpp diff --git a/src/strategy/actions/GuildManagementActions.h b/src/Ai/Base/Actions/GuildManagementActions.h similarity index 100% rename from src/strategy/actions/GuildManagementActions.h rename to src/Ai/Base/Actions/GuildManagementActions.h diff --git a/src/strategy/actions/HelpAction.cpp b/src/Ai/Base/Actions/HelpAction.cpp similarity index 100% rename from src/strategy/actions/HelpAction.cpp rename to src/Ai/Base/Actions/HelpAction.cpp diff --git a/src/strategy/actions/HelpAction.h b/src/Ai/Base/Actions/HelpAction.h similarity index 100% rename from src/strategy/actions/HelpAction.h rename to src/Ai/Base/Actions/HelpAction.h diff --git a/src/strategy/actions/HireAction.cpp b/src/Ai/Base/Actions/HireAction.cpp similarity index 100% rename from src/strategy/actions/HireAction.cpp rename to src/Ai/Base/Actions/HireAction.cpp diff --git a/src/strategy/actions/HireAction.h b/src/Ai/Base/Actions/HireAction.h similarity index 100% rename from src/strategy/actions/HireAction.h rename to src/Ai/Base/Actions/HireAction.h diff --git a/src/strategy/actions/ImbueAction.cpp b/src/Ai/Base/Actions/ImbueAction.cpp similarity index 100% rename from src/strategy/actions/ImbueAction.cpp rename to src/Ai/Base/Actions/ImbueAction.cpp diff --git a/src/strategy/actions/ImbueAction.h b/src/Ai/Base/Actions/ImbueAction.h similarity index 100% rename from src/strategy/actions/ImbueAction.h rename to src/Ai/Base/Actions/ImbueAction.h diff --git a/src/strategy/actions/InventoryAction.cpp b/src/Ai/Base/Actions/InventoryAction.cpp similarity index 100% rename from src/strategy/actions/InventoryAction.cpp rename to src/Ai/Base/Actions/InventoryAction.cpp diff --git a/src/strategy/actions/InventoryAction.h b/src/Ai/Base/Actions/InventoryAction.h similarity index 100% rename from src/strategy/actions/InventoryAction.h rename to src/Ai/Base/Actions/InventoryAction.h diff --git a/src/strategy/actions/InventoryChangeFailureAction.cpp b/src/Ai/Base/Actions/InventoryChangeFailureAction.cpp similarity index 100% rename from src/strategy/actions/InventoryChangeFailureAction.cpp rename to src/Ai/Base/Actions/InventoryChangeFailureAction.cpp diff --git a/src/strategy/actions/InventoryChangeFailureAction.h b/src/Ai/Base/Actions/InventoryChangeFailureAction.h similarity index 100% rename from src/strategy/actions/InventoryChangeFailureAction.h rename to src/Ai/Base/Actions/InventoryChangeFailureAction.h diff --git a/src/strategy/actions/InviteToGroupAction.cpp b/src/Ai/Base/Actions/InviteToGroupAction.cpp similarity index 100% rename from src/strategy/actions/InviteToGroupAction.cpp rename to src/Ai/Base/Actions/InviteToGroupAction.cpp diff --git a/src/strategy/actions/InviteToGroupAction.h b/src/Ai/Base/Actions/InviteToGroupAction.h similarity index 100% rename from src/strategy/actions/InviteToGroupAction.h rename to src/Ai/Base/Actions/InviteToGroupAction.h diff --git a/src/strategy/actions/LeaveGroupAction.cpp b/src/Ai/Base/Actions/LeaveGroupAction.cpp similarity index 100% rename from src/strategy/actions/LeaveGroupAction.cpp rename to src/Ai/Base/Actions/LeaveGroupAction.cpp diff --git a/src/strategy/actions/LeaveGroupAction.h b/src/Ai/Base/Actions/LeaveGroupAction.h similarity index 100% rename from src/strategy/actions/LeaveGroupAction.h rename to src/Ai/Base/Actions/LeaveGroupAction.h diff --git a/src/strategy/actions/LfgActions.cpp b/src/Ai/Base/Actions/LfgActions.cpp similarity index 100% rename from src/strategy/actions/LfgActions.cpp rename to src/Ai/Base/Actions/LfgActions.cpp diff --git a/src/strategy/actions/LfgActions.h b/src/Ai/Base/Actions/LfgActions.h similarity index 100% rename from src/strategy/actions/LfgActions.h rename to src/Ai/Base/Actions/LfgActions.h diff --git a/src/strategy/actions/ListQuestsActions.cpp b/src/Ai/Base/Actions/ListQuestsActions.cpp similarity index 100% rename from src/strategy/actions/ListQuestsActions.cpp rename to src/Ai/Base/Actions/ListQuestsActions.cpp diff --git a/src/strategy/actions/ListQuestsActions.h b/src/Ai/Base/Actions/ListQuestsActions.h similarity index 100% rename from src/strategy/actions/ListQuestsActions.h rename to src/Ai/Base/Actions/ListQuestsActions.h diff --git a/src/strategy/actions/ListSpellsAction.cpp b/src/Ai/Base/Actions/ListSpellsAction.cpp similarity index 98% rename from src/strategy/actions/ListSpellsAction.cpp rename to src/Ai/Base/Actions/ListSpellsAction.cpp index 6d7741152b..6f67aef1aa 100644 --- a/src/strategy/actions/ListSpellsAction.cpp +++ b/src/Ai/Base/Actions/ListSpellsAction.cpp @@ -7,7 +7,7 @@ #include "Event.h" #include "Playerbots.h" -#include "PlayerbotSpellCache.h" +#include "PlayerbotSpellRepository.h" using SpellListEntry = std::pair; @@ -136,7 +136,7 @@ std::vector> ListSpellsAction::GetSpellList(std:: if (spellInfo->IsPassive()) continue; - SkillLineAbilityEntry const* skillLine = sPlayerbotSpellCache->GetSkillLine(itr->first); + SkillLineAbilityEntry const* skillLine = sPlayerbotSpellRepository->GetSkillLine(itr->first); if (skill != SKILL_NONE && (!skillLine || skillLine->SkillLine != skill)) continue; @@ -175,7 +175,7 @@ std::vector> ListSpellsAction::GetSpellList(std:: FindItemByIdVisitor visitor(itemid); uint32 reagentsInInventory = InventoryAction::GetItemCount(&visitor); - bool buyable = sPlayerbotSpellCache->IsItemBuyable(itemid); + bool buyable = sPlayerbotSpellRepository->IsItemBuyable(itemid); if (!buyable) { uint32 craftable = reagentsInInventory / reagentsRequired; diff --git a/src/strategy/actions/ListSpellsAction.h b/src/Ai/Base/Actions/ListSpellsAction.h similarity index 100% rename from src/strategy/actions/ListSpellsAction.h rename to src/Ai/Base/Actions/ListSpellsAction.h diff --git a/src/strategy/actions/LogLevelAction.cpp b/src/Ai/Base/Actions/LogLevelAction.cpp similarity index 100% rename from src/strategy/actions/LogLevelAction.cpp rename to src/Ai/Base/Actions/LogLevelAction.cpp diff --git a/src/strategy/actions/LogLevelAction.h b/src/Ai/Base/Actions/LogLevelAction.h similarity index 100% rename from src/strategy/actions/LogLevelAction.h rename to src/Ai/Base/Actions/LogLevelAction.h diff --git a/src/strategy/actions/LootAction.cpp b/src/Ai/Base/Actions/LootAction.cpp similarity index 100% rename from src/strategy/actions/LootAction.cpp rename to src/Ai/Base/Actions/LootAction.cpp diff --git a/src/strategy/actions/LootAction.h b/src/Ai/Base/Actions/LootAction.h similarity index 100% rename from src/strategy/actions/LootAction.h rename to src/Ai/Base/Actions/LootAction.h diff --git a/src/strategy/actions/LootRollAction.cpp b/src/Ai/Base/Actions/LootRollAction.cpp similarity index 100% rename from src/strategy/actions/LootRollAction.cpp rename to src/Ai/Base/Actions/LootRollAction.cpp diff --git a/src/strategy/actions/LootRollAction.h b/src/Ai/Base/Actions/LootRollAction.h similarity index 100% rename from src/strategy/actions/LootRollAction.h rename to src/Ai/Base/Actions/LootRollAction.h diff --git a/src/strategy/actions/LootStrategyAction.cpp b/src/Ai/Base/Actions/LootStrategyAction.cpp similarity index 100% rename from src/strategy/actions/LootStrategyAction.cpp rename to src/Ai/Base/Actions/LootStrategyAction.cpp diff --git a/src/strategy/actions/LootStrategyAction.h b/src/Ai/Base/Actions/LootStrategyAction.h similarity index 100% rename from src/strategy/actions/LootStrategyAction.h rename to src/Ai/Base/Actions/LootStrategyAction.h diff --git a/src/strategy/actions/MailAction.cpp b/src/Ai/Base/Actions/MailAction.cpp similarity index 100% rename from src/strategy/actions/MailAction.cpp rename to src/Ai/Base/Actions/MailAction.cpp diff --git a/src/strategy/actions/MailAction.h b/src/Ai/Base/Actions/MailAction.h similarity index 100% rename from src/strategy/actions/MailAction.h rename to src/Ai/Base/Actions/MailAction.h diff --git a/src/strategy/actions/MoveToRpgTargetAction.cpp b/src/Ai/Base/Actions/MoveToRpgTargetAction.cpp similarity index 100% rename from src/strategy/actions/MoveToRpgTargetAction.cpp rename to src/Ai/Base/Actions/MoveToRpgTargetAction.cpp diff --git a/src/strategy/actions/MoveToRpgTargetAction.h b/src/Ai/Base/Actions/MoveToRpgTargetAction.h similarity index 100% rename from src/strategy/actions/MoveToRpgTargetAction.h rename to src/Ai/Base/Actions/MoveToRpgTargetAction.h diff --git a/src/strategy/actions/MoveToTravelTargetAction.cpp b/src/Ai/Base/Actions/MoveToTravelTargetAction.cpp similarity index 100% rename from src/strategy/actions/MoveToTravelTargetAction.cpp rename to src/Ai/Base/Actions/MoveToTravelTargetAction.cpp diff --git a/src/strategy/actions/MoveToTravelTargetAction.h b/src/Ai/Base/Actions/MoveToTravelTargetAction.h similarity index 100% rename from src/strategy/actions/MoveToTravelTargetAction.h rename to src/Ai/Base/Actions/MoveToTravelTargetAction.h diff --git a/src/strategy/actions/MovementActions.cpp b/src/Ai/Base/Actions/MovementActions.cpp similarity index 98% rename from src/strategy/actions/MovementActions.cpp rename to src/Ai/Base/Actions/MovementActions.cpp index ed650fbf28..69e5c278ba 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/Ai/Base/Actions/MovementActions.cpp @@ -946,36 +946,7 @@ bool MovementAction::IsWaitingForLastMove(MovementPriority priority) bool MovementAction::IsMovingAllowed() { - // Most common checks: confused, stunned, fleeing, jumping, charging. All these - // states are set when handling certain aura effects. We don't check against - // UNIT_STATE_ROOT here, because this state is used by vehicles. - if (bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) - return false; - - // Death state (w/o spirit release) and Spirit of Redemption aura (priest) - if ((bot->isDead() && !bot->HasPlayerFlag(PLAYER_FLAGS_GHOST)) || bot->HasSpiritOfRedemptionAura()) - return false; - - // Common CC effects, ordered by frequency: rooted > frozen > polymorphed - if (bot->IsRooted() || bot->isFrozen() || bot->IsPolymorphed()) - return false; - - // Check for the MM controlled slot types: feared, confused, fleeing, etc. - if (bot->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_CONTROLLED) != NULL_MOTION_TYPE) - return false; - - // Traveling state: taxi flight and being teleported (relatively rare) - if (bot->IsInFlight() || bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE || - bot->IsBeingTeleported()) - return false; - - // Vehicle state: is in the vehicle and can control it (rare, content-specific). - // We need to check charmed state AFTER vehicle one, cuz that's how it works: - // passengers are set to charmed by vehicle with CHARM_TYPE_VEHICLE. - if ((bot->GetVehicle() && !botAI->IsInVehicle(true)) || bot->IsCharmed()) - return false; - - return true; + return botAI->CanMove(); } bool MovementAction::Follow(Unit* target, float distance) { return Follow(target, distance, GetFollowAngle()); } diff --git a/src/strategy/actions/MovementActions.h b/src/Ai/Base/Actions/MovementActions.h similarity index 100% rename from src/strategy/actions/MovementActions.h rename to src/Ai/Base/Actions/MovementActions.h diff --git a/src/strategy/actions/NonCombatActions.cpp b/src/Ai/Base/Actions/NonCombatActions.cpp similarity index 100% rename from src/strategy/actions/NonCombatActions.cpp rename to src/Ai/Base/Actions/NonCombatActions.cpp diff --git a/src/strategy/actions/NonCombatActions.h b/src/Ai/Base/Actions/NonCombatActions.h similarity index 100% rename from src/strategy/actions/NonCombatActions.h rename to src/Ai/Base/Actions/NonCombatActions.h diff --git a/src/strategy/actions/OpenItemAction.cpp b/src/Ai/Base/Actions/OpenItemAction.cpp similarity index 100% rename from src/strategy/actions/OpenItemAction.cpp rename to src/Ai/Base/Actions/OpenItemAction.cpp diff --git a/src/strategy/actions/OpenItemAction.h b/src/Ai/Base/Actions/OpenItemAction.h similarity index 100% rename from src/strategy/actions/OpenItemAction.h rename to src/Ai/Base/Actions/OpenItemAction.h diff --git a/src/strategy/actions/OutfitAction.cpp b/src/Ai/Base/Actions/OutfitAction.cpp similarity index 100% rename from src/strategy/actions/OutfitAction.cpp rename to src/Ai/Base/Actions/OutfitAction.cpp diff --git a/src/strategy/actions/OutfitAction.h b/src/Ai/Base/Actions/OutfitAction.h similarity index 100% rename from src/strategy/actions/OutfitAction.h rename to src/Ai/Base/Actions/OutfitAction.h diff --git a/src/strategy/actions/PassLeadershipToMasterAction.cpp b/src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp similarity index 100% rename from src/strategy/actions/PassLeadershipToMasterAction.cpp rename to src/Ai/Base/Actions/PassLeadershipToMasterAction.cpp diff --git a/src/strategy/actions/PassLeadershipToMasterAction.h b/src/Ai/Base/Actions/PassLeadershipToMasterAction.h similarity index 100% rename from src/strategy/actions/PassLeadershipToMasterAction.h rename to src/Ai/Base/Actions/PassLeadershipToMasterAction.h diff --git a/src/strategy/actions/PetitionSignAction.cpp b/src/Ai/Base/Actions/PetitionSignAction.cpp similarity index 100% rename from src/strategy/actions/PetitionSignAction.cpp rename to src/Ai/Base/Actions/PetitionSignAction.cpp diff --git a/src/strategy/actions/PetitionSignAction.h b/src/Ai/Base/Actions/PetitionSignAction.h similarity index 100% rename from src/strategy/actions/PetitionSignAction.h rename to src/Ai/Base/Actions/PetitionSignAction.h diff --git a/src/strategy/actions/PetsAction.cpp b/src/Ai/Base/Actions/PetsAction.cpp similarity index 100% rename from src/strategy/actions/PetsAction.cpp rename to src/Ai/Base/Actions/PetsAction.cpp diff --git a/src/strategy/actions/PetsAction.h b/src/Ai/Base/Actions/PetsAction.h similarity index 100% rename from src/strategy/actions/PetsAction.h rename to src/Ai/Base/Actions/PetsAction.h diff --git a/src/strategy/actions/PositionAction.cpp b/src/Ai/Base/Actions/PositionAction.cpp similarity index 100% rename from src/strategy/actions/PositionAction.cpp rename to src/Ai/Base/Actions/PositionAction.cpp diff --git a/src/strategy/actions/PositionAction.h b/src/Ai/Base/Actions/PositionAction.h similarity index 100% rename from src/strategy/actions/PositionAction.h rename to src/Ai/Base/Actions/PositionAction.h diff --git a/src/strategy/actions/QueryItemUsageAction.cpp b/src/Ai/Base/Actions/QueryItemUsageAction.cpp similarity index 100% rename from src/strategy/actions/QueryItemUsageAction.cpp rename to src/Ai/Base/Actions/QueryItemUsageAction.cpp diff --git a/src/strategy/actions/QueryItemUsageAction.h b/src/Ai/Base/Actions/QueryItemUsageAction.h similarity index 100% rename from src/strategy/actions/QueryItemUsageAction.h rename to src/Ai/Base/Actions/QueryItemUsageAction.h diff --git a/src/strategy/actions/QueryQuestAction.cpp b/src/Ai/Base/Actions/QueryQuestAction.cpp similarity index 100% rename from src/strategy/actions/QueryQuestAction.cpp rename to src/Ai/Base/Actions/QueryQuestAction.cpp diff --git a/src/strategy/actions/QueryQuestAction.h b/src/Ai/Base/Actions/QueryQuestAction.h similarity index 100% rename from src/strategy/actions/QueryQuestAction.h rename to src/Ai/Base/Actions/QueryQuestAction.h diff --git a/src/strategy/actions/QuestAction.cpp b/src/Ai/Base/Actions/QuestAction.cpp similarity index 100% rename from src/strategy/actions/QuestAction.cpp rename to src/Ai/Base/Actions/QuestAction.cpp diff --git a/src/strategy/actions/QuestAction.h b/src/Ai/Base/Actions/QuestAction.h similarity index 100% rename from src/strategy/actions/QuestAction.h rename to src/Ai/Base/Actions/QuestAction.h diff --git a/src/strategy/actions/QuestConfirmAcceptAction.cpp b/src/Ai/Base/Actions/QuestConfirmAcceptAction.cpp similarity index 100% rename from src/strategy/actions/QuestConfirmAcceptAction.cpp rename to src/Ai/Base/Actions/QuestConfirmAcceptAction.cpp diff --git a/src/strategy/actions/QuestConfirmAcceptAction.h b/src/Ai/Base/Actions/QuestConfirmAcceptAction.h similarity index 100% rename from src/strategy/actions/QuestConfirmAcceptAction.h rename to src/Ai/Base/Actions/QuestConfirmAcceptAction.h diff --git a/src/strategy/actions/RandomBotUpdateAction.cpp b/src/Ai/Base/Actions/RandomBotUpdateAction.cpp similarity index 100% rename from src/strategy/actions/RandomBotUpdateAction.cpp rename to src/Ai/Base/Actions/RandomBotUpdateAction.cpp diff --git a/src/strategy/actions/RandomBotUpdateAction.h b/src/Ai/Base/Actions/RandomBotUpdateAction.h similarity index 100% rename from src/strategy/actions/RandomBotUpdateAction.h rename to src/Ai/Base/Actions/RandomBotUpdateAction.h diff --git a/src/strategy/actions/RangeAction.cpp b/src/Ai/Base/Actions/RangeAction.cpp similarity index 100% rename from src/strategy/actions/RangeAction.cpp rename to src/Ai/Base/Actions/RangeAction.cpp diff --git a/src/strategy/actions/RangeAction.h b/src/Ai/Base/Actions/RangeAction.h similarity index 100% rename from src/strategy/actions/RangeAction.h rename to src/Ai/Base/Actions/RangeAction.h diff --git a/src/strategy/actions/ReachTargetActions.cpp b/src/Ai/Base/Actions/ReachTargetActions.cpp similarity index 100% rename from src/strategy/actions/ReachTargetActions.cpp rename to src/Ai/Base/Actions/ReachTargetActions.cpp diff --git a/src/strategy/actions/ReachTargetActions.h b/src/Ai/Base/Actions/ReachTargetActions.h similarity index 100% rename from src/strategy/actions/ReachTargetActions.h rename to src/Ai/Base/Actions/ReachTargetActions.h diff --git a/src/strategy/actions/ReadyCheckAction.cpp b/src/Ai/Base/Actions/ReadyCheckAction.cpp similarity index 100% rename from src/strategy/actions/ReadyCheckAction.cpp rename to src/Ai/Base/Actions/ReadyCheckAction.cpp diff --git a/src/strategy/actions/ReadyCheckAction.h b/src/Ai/Base/Actions/ReadyCheckAction.h similarity index 100% rename from src/strategy/actions/ReadyCheckAction.h rename to src/Ai/Base/Actions/ReadyCheckAction.h diff --git a/src/strategy/actions/ReleaseSpiritAction.cpp b/src/Ai/Base/Actions/ReleaseSpiritAction.cpp similarity index 100% rename from src/strategy/actions/ReleaseSpiritAction.cpp rename to src/Ai/Base/Actions/ReleaseSpiritAction.cpp diff --git a/src/strategy/actions/ReleaseSpiritAction.h b/src/Ai/Base/Actions/ReleaseSpiritAction.h similarity index 100% rename from src/strategy/actions/ReleaseSpiritAction.h rename to src/Ai/Base/Actions/ReleaseSpiritAction.h diff --git a/src/strategy/actions/RememberTaxiAction.cpp b/src/Ai/Base/Actions/RememberTaxiAction.cpp similarity index 100% rename from src/strategy/actions/RememberTaxiAction.cpp rename to src/Ai/Base/Actions/RememberTaxiAction.cpp diff --git a/src/strategy/actions/RememberTaxiAction.h b/src/Ai/Base/Actions/RememberTaxiAction.h similarity index 100% rename from src/strategy/actions/RememberTaxiAction.h rename to src/Ai/Base/Actions/RememberTaxiAction.h diff --git a/src/strategy/actions/RemoveAuraAction.cpp b/src/Ai/Base/Actions/RemoveAuraAction.cpp similarity index 100% rename from src/strategy/actions/RemoveAuraAction.cpp rename to src/Ai/Base/Actions/RemoveAuraAction.cpp diff --git a/src/strategy/actions/RemoveAuraAction.h b/src/Ai/Base/Actions/RemoveAuraAction.h similarity index 100% rename from src/strategy/actions/RemoveAuraAction.h rename to src/Ai/Base/Actions/RemoveAuraAction.h diff --git a/src/strategy/actions/RepairAllAction.cpp b/src/Ai/Base/Actions/RepairAllAction.cpp similarity index 100% rename from src/strategy/actions/RepairAllAction.cpp rename to src/Ai/Base/Actions/RepairAllAction.cpp diff --git a/src/strategy/actions/RepairAllAction.h b/src/Ai/Base/Actions/RepairAllAction.h similarity index 100% rename from src/strategy/actions/RepairAllAction.h rename to src/Ai/Base/Actions/RepairAllAction.h diff --git a/src/strategy/actions/ResetAiAction.cpp b/src/Ai/Base/Actions/ResetAiAction.cpp similarity index 94% rename from src/strategy/actions/ResetAiAction.cpp rename to src/Ai/Base/Actions/ResetAiAction.cpp index e97d090575..3df6bbcd2a 100644 --- a/src/strategy/actions/ResetAiAction.cpp +++ b/src/Ai/Base/Actions/ResetAiAction.cpp @@ -8,7 +8,7 @@ #include "Event.h" #include "Group.h" #include "ObjectGuid.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "Playerbots.h" #include "WorldPacket.h" @@ -44,7 +44,7 @@ bool ResetAiAction::Execute(Event event) } } } - sPlayerbotDbStore->Reset(botAI); + sPlayerbotRepository->Reset(botAI); botAI->ResetStrategies(false); botAI->TellMaster("AI was reset to defaults"); return true; diff --git a/src/strategy/actions/ResetAiAction.h b/src/Ai/Base/Actions/ResetAiAction.h similarity index 100% rename from src/strategy/actions/ResetAiAction.h rename to src/Ai/Base/Actions/ResetAiAction.h diff --git a/src/strategy/actions/ResetInstancesAction.cpp b/src/Ai/Base/Actions/ResetInstancesAction.cpp similarity index 100% rename from src/strategy/actions/ResetInstancesAction.cpp rename to src/Ai/Base/Actions/ResetInstancesAction.cpp diff --git a/src/strategy/actions/ResetInstancesAction.h b/src/Ai/Base/Actions/ResetInstancesAction.h similarity index 100% rename from src/strategy/actions/ResetInstancesAction.h rename to src/Ai/Base/Actions/ResetInstancesAction.h diff --git a/src/strategy/actions/RevealGatheringItemAction.cpp b/src/Ai/Base/Actions/RevealGatheringItemAction.cpp similarity index 100% rename from src/strategy/actions/RevealGatheringItemAction.cpp rename to src/Ai/Base/Actions/RevealGatheringItemAction.cpp diff --git a/src/strategy/actions/RevealGatheringItemAction.h b/src/Ai/Base/Actions/RevealGatheringItemAction.h similarity index 100% rename from src/strategy/actions/RevealGatheringItemAction.h rename to src/Ai/Base/Actions/RevealGatheringItemAction.h diff --git a/src/strategy/actions/ReviveFromCorpseAction.cpp b/src/Ai/Base/Actions/ReviveFromCorpseAction.cpp similarity index 100% rename from src/strategy/actions/ReviveFromCorpseAction.cpp rename to src/Ai/Base/Actions/ReviveFromCorpseAction.cpp diff --git a/src/strategy/actions/ReviveFromCorpseAction.h b/src/Ai/Base/Actions/ReviveFromCorpseAction.h similarity index 100% rename from src/strategy/actions/ReviveFromCorpseAction.h rename to src/Ai/Base/Actions/ReviveFromCorpseAction.h diff --git a/src/strategy/actions/RewardAction.cpp b/src/Ai/Base/Actions/RewardAction.cpp similarity index 100% rename from src/strategy/actions/RewardAction.cpp rename to src/Ai/Base/Actions/RewardAction.cpp diff --git a/src/strategy/actions/RewardAction.h b/src/Ai/Base/Actions/RewardAction.h similarity index 100% rename from src/strategy/actions/RewardAction.h rename to src/Ai/Base/Actions/RewardAction.h diff --git a/src/strategy/actions/RpgAction.cpp b/src/Ai/Base/Actions/RpgAction.cpp similarity index 92% rename from src/strategy/actions/RpgAction.cpp rename to src/Ai/Base/Actions/RpgAction.cpp index ae6a50fddb..6002eaf63a 100644 --- a/src/strategy/actions/RpgAction.cpp +++ b/src/Ai/Base/Actions/RpgAction.cpp @@ -68,17 +68,15 @@ bool RpgAction::SetNextRpgAction() triggerNode->setTrigger(trigger); - NextAction** nextActions = triggerNode->getHandlers(); + std::vector nextActions = triggerNode->getHandlers(); Trigger* trigger = triggerNode->getTrigger(); bool isChecked = false; - for (int32 i = 0; i < NextAction::size(nextActions); i++) + for (NextAction nextAction : nextActions) { - NextAction* nextAction = nextActions[i]; - - if (nextAction->getRelevance() > 5.0f) + if (nextAction.getRelevance() > 5.0f) continue; if (!isChecked && !trigger->IsActive()) @@ -86,14 +84,13 @@ bool RpgAction::SetNextRpgAction() isChecked = true; - Action* action = botAI->GetAiObjectContext()->GetAction(nextAction->getName()); + Action* action = botAI->GetAiObjectContext()->GetAction(nextAction.getName()); if (!dynamic_cast(action) || !action->isPossible() || !action->isUseful()) continue; actions.push_back(action); - relevances.push_back((nextAction->getRelevance() - 1) * 500); + relevances.push_back((nextAction.getRelevance() - 1) * 500); } - NextAction::destroy(nextActions); } } diff --git a/src/strategy/actions/RpgAction.h b/src/Ai/Base/Actions/RpgAction.h similarity index 100% rename from src/strategy/actions/RpgAction.h rename to src/Ai/Base/Actions/RpgAction.h diff --git a/src/strategy/actions/RpgSubActions.cpp b/src/Ai/Base/Actions/RpgSubActions.cpp similarity index 100% rename from src/strategy/actions/RpgSubActions.cpp rename to src/Ai/Base/Actions/RpgSubActions.cpp diff --git a/src/strategy/actions/RpgSubActions.h b/src/Ai/Base/Actions/RpgSubActions.h similarity index 100% rename from src/strategy/actions/RpgSubActions.h rename to src/Ai/Base/Actions/RpgSubActions.h diff --git a/src/strategy/actions/RpgValues.h b/src/Ai/Base/Actions/RpgValues.h similarity index 100% rename from src/strategy/actions/RpgValues.h rename to src/Ai/Base/Actions/RpgValues.h diff --git a/src/strategy/actions/RtiAction.cpp b/src/Ai/Base/Actions/RtiAction.cpp similarity index 100% rename from src/strategy/actions/RtiAction.cpp rename to src/Ai/Base/Actions/RtiAction.cpp diff --git a/src/strategy/actions/RtiAction.h b/src/Ai/Base/Actions/RtiAction.h similarity index 100% rename from src/strategy/actions/RtiAction.h rename to src/Ai/Base/Actions/RtiAction.h diff --git a/src/strategy/actions/RtscAction.cpp b/src/Ai/Base/Actions/RtscAction.cpp similarity index 100% rename from src/strategy/actions/RtscAction.cpp rename to src/Ai/Base/Actions/RtscAction.cpp diff --git a/src/strategy/actions/RtscAction.h b/src/Ai/Base/Actions/RtscAction.h similarity index 100% rename from src/strategy/actions/RtscAction.h rename to src/Ai/Base/Actions/RtscAction.h diff --git a/src/strategy/actions/SaveManaAction.cpp b/src/Ai/Base/Actions/SaveManaAction.cpp similarity index 100% rename from src/strategy/actions/SaveManaAction.cpp rename to src/Ai/Base/Actions/SaveManaAction.cpp diff --git a/src/strategy/actions/SaveManaAction.h b/src/Ai/Base/Actions/SaveManaAction.h similarity index 100% rename from src/strategy/actions/SaveManaAction.h rename to src/Ai/Base/Actions/SaveManaAction.h diff --git a/src/strategy/actions/SayAction.cpp b/src/Ai/Base/Actions/SayAction.cpp similarity index 100% rename from src/strategy/actions/SayAction.cpp rename to src/Ai/Base/Actions/SayAction.cpp diff --git a/src/strategy/actions/SayAction.h b/src/Ai/Base/Actions/SayAction.h similarity index 100% rename from src/strategy/actions/SayAction.h rename to src/Ai/Base/Actions/SayAction.h diff --git a/src/strategy/actions/SecurityCheckAction.cpp b/src/Ai/Base/Actions/SecurityCheckAction.cpp similarity index 100% rename from src/strategy/actions/SecurityCheckAction.cpp rename to src/Ai/Base/Actions/SecurityCheckAction.cpp diff --git a/src/strategy/actions/SecurityCheckAction.h b/src/Ai/Base/Actions/SecurityCheckAction.h similarity index 100% rename from src/strategy/actions/SecurityCheckAction.h rename to src/Ai/Base/Actions/SecurityCheckAction.h diff --git a/src/strategy/actions/SeeSpellAction.cpp b/src/Ai/Base/Actions/SeeSpellAction.cpp similarity index 100% rename from src/strategy/actions/SeeSpellAction.cpp rename to src/Ai/Base/Actions/SeeSpellAction.cpp diff --git a/src/strategy/actions/SeeSpellAction.h b/src/Ai/Base/Actions/SeeSpellAction.h similarity index 100% rename from src/strategy/actions/SeeSpellAction.h rename to src/Ai/Base/Actions/SeeSpellAction.h diff --git a/src/strategy/actions/SellAction.cpp b/src/Ai/Base/Actions/SellAction.cpp similarity index 100% rename from src/strategy/actions/SellAction.cpp rename to src/Ai/Base/Actions/SellAction.cpp diff --git a/src/strategy/actions/SellAction.h b/src/Ai/Base/Actions/SellAction.h similarity index 100% rename from src/strategy/actions/SellAction.h rename to src/Ai/Base/Actions/SellAction.h diff --git a/src/strategy/actions/SendMailAction.cpp b/src/Ai/Base/Actions/SendMailAction.cpp similarity index 100% rename from src/strategy/actions/SendMailAction.cpp rename to src/Ai/Base/Actions/SendMailAction.cpp diff --git a/src/strategy/actions/SendMailAction.h b/src/Ai/Base/Actions/SendMailAction.h similarity index 100% rename from src/strategy/actions/SendMailAction.h rename to src/Ai/Base/Actions/SendMailAction.h diff --git a/src/strategy/actions/SetCraftAction.cpp b/src/Ai/Base/Actions/SetCraftAction.cpp similarity index 100% rename from src/strategy/actions/SetCraftAction.cpp rename to src/Ai/Base/Actions/SetCraftAction.cpp diff --git a/src/strategy/actions/SetCraftAction.h b/src/Ai/Base/Actions/SetCraftAction.h similarity index 100% rename from src/strategy/actions/SetCraftAction.h rename to src/Ai/Base/Actions/SetCraftAction.h diff --git a/src/strategy/actions/SetHomeAction.cpp b/src/Ai/Base/Actions/SetHomeAction.cpp similarity index 100% rename from src/strategy/actions/SetHomeAction.cpp rename to src/Ai/Base/Actions/SetHomeAction.cpp diff --git a/src/strategy/actions/SetHomeAction.h b/src/Ai/Base/Actions/SetHomeAction.h similarity index 100% rename from src/strategy/actions/SetHomeAction.h rename to src/Ai/Base/Actions/SetHomeAction.h diff --git a/src/strategy/actions/ShareQuestAction.cpp b/src/Ai/Base/Actions/ShareQuestAction.cpp similarity index 100% rename from src/strategy/actions/ShareQuestAction.cpp rename to src/Ai/Base/Actions/ShareQuestAction.cpp diff --git a/src/strategy/actions/ShareQuestAction.h b/src/Ai/Base/Actions/ShareQuestAction.h similarity index 100% rename from src/strategy/actions/ShareQuestAction.h rename to src/Ai/Base/Actions/ShareQuestAction.h diff --git a/src/strategy/actions/SkipSpellsListAction.cpp b/src/Ai/Base/Actions/SkipSpellsListAction.cpp similarity index 100% rename from src/strategy/actions/SkipSpellsListAction.cpp rename to src/Ai/Base/Actions/SkipSpellsListAction.cpp diff --git a/src/strategy/actions/SkipSpellsListAction.h b/src/Ai/Base/Actions/SkipSpellsListAction.h similarity index 100% rename from src/strategy/actions/SkipSpellsListAction.h rename to src/Ai/Base/Actions/SkipSpellsListAction.h diff --git a/src/strategy/actions/StatsAction.cpp b/src/Ai/Base/Actions/StatsAction.cpp similarity index 100% rename from src/strategy/actions/StatsAction.cpp rename to src/Ai/Base/Actions/StatsAction.cpp diff --git a/src/strategy/actions/StatsAction.h b/src/Ai/Base/Actions/StatsAction.h similarity index 100% rename from src/strategy/actions/StatsAction.h rename to src/Ai/Base/Actions/StatsAction.h diff --git a/src/strategy/actions/StayActions.cpp b/src/Ai/Base/Actions/StayActions.cpp similarity index 100% rename from src/strategy/actions/StayActions.cpp rename to src/Ai/Base/Actions/StayActions.cpp diff --git a/src/strategy/actions/StayActions.h b/src/Ai/Base/Actions/StayActions.h similarity index 100% rename from src/strategy/actions/StayActions.h rename to src/Ai/Base/Actions/StayActions.h diff --git a/src/strategy/actions/SuggestWhatToDoAction.cpp b/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp similarity index 99% rename from src/strategy/actions/SuggestWhatToDoAction.cpp rename to src/Ai/Base/Actions/SuggestWhatToDoAction.cpp index 96cc7f52ac..159bfd4ebb 100644 --- a/src/strategy/actions/SuggestWhatToDoAction.cpp +++ b/src/Ai/Base/Actions/SuggestWhatToDoAction.cpp @@ -260,7 +260,7 @@ SuggestDungeonAction::SuggestDungeonAction(PlayerbotAI* botAI) : SuggestWhatToDo bool SuggestDungeonAction::Execute(Event event) { - // TODO: use sPlayerbotDungeonSuggestionMgr + // TODO: use sPlayerbotDungeonRepository if (!sPlayerbotAIConfig->randomBotSuggestDungeons || bot->GetGroup()) return false; diff --git a/src/strategy/actions/SuggestWhatToDoAction.h b/src/Ai/Base/Actions/SuggestWhatToDoAction.h similarity index 100% rename from src/strategy/actions/SuggestWhatToDoAction.h rename to src/Ai/Base/Actions/SuggestWhatToDoAction.h diff --git a/src/strategy/actions/TalkToQuestGiverAction.cpp b/src/Ai/Base/Actions/TalkToQuestGiverAction.cpp similarity index 100% rename from src/strategy/actions/TalkToQuestGiverAction.cpp rename to src/Ai/Base/Actions/TalkToQuestGiverAction.cpp diff --git a/src/strategy/actions/TalkToQuestGiverAction.h b/src/Ai/Base/Actions/TalkToQuestGiverAction.h similarity index 100% rename from src/strategy/actions/TalkToQuestGiverAction.h rename to src/Ai/Base/Actions/TalkToQuestGiverAction.h diff --git a/src/strategy/actions/TameAction.cpp b/src/Ai/Base/Actions/TameAction.cpp similarity index 100% rename from src/strategy/actions/TameAction.cpp rename to src/Ai/Base/Actions/TameAction.cpp diff --git a/src/strategy/actions/TameAction.h b/src/Ai/Base/Actions/TameAction.h similarity index 100% rename from src/strategy/actions/TameAction.h rename to src/Ai/Base/Actions/TameAction.h diff --git a/src/strategy/actions/TaxiAction.cpp b/src/Ai/Base/Actions/TaxiAction.cpp similarity index 100% rename from src/strategy/actions/TaxiAction.cpp rename to src/Ai/Base/Actions/TaxiAction.cpp diff --git a/src/strategy/actions/TaxiAction.h b/src/Ai/Base/Actions/TaxiAction.h similarity index 100% rename from src/strategy/actions/TaxiAction.h rename to src/Ai/Base/Actions/TaxiAction.h diff --git a/src/strategy/actions/TeleportAction.cpp b/src/Ai/Base/Actions/TeleportAction.cpp similarity index 100% rename from src/strategy/actions/TeleportAction.cpp rename to src/Ai/Base/Actions/TeleportAction.cpp diff --git a/src/strategy/actions/TeleportAction.h b/src/Ai/Base/Actions/TeleportAction.h similarity index 100% rename from src/strategy/actions/TeleportAction.h rename to src/Ai/Base/Actions/TeleportAction.h diff --git a/src/strategy/actions/TellCastFailedAction.cpp b/src/Ai/Base/Actions/TellCastFailedAction.cpp similarity index 100% rename from src/strategy/actions/TellCastFailedAction.cpp rename to src/Ai/Base/Actions/TellCastFailedAction.cpp diff --git a/src/strategy/actions/TellCastFailedAction.h b/src/Ai/Base/Actions/TellCastFailedAction.h similarity index 100% rename from src/strategy/actions/TellCastFailedAction.h rename to src/Ai/Base/Actions/TellCastFailedAction.h diff --git a/src/strategy/actions/TellGlyphsAction.cpp b/src/Ai/Base/Actions/TellGlyphsAction.cpp similarity index 100% rename from src/strategy/actions/TellGlyphsAction.cpp rename to src/Ai/Base/Actions/TellGlyphsAction.cpp diff --git a/src/strategy/actions/TellGlyphsAction.h b/src/Ai/Base/Actions/TellGlyphsAction.h similarity index 100% rename from src/strategy/actions/TellGlyphsAction.h rename to src/Ai/Base/Actions/TellGlyphsAction.h diff --git a/src/strategy/actions/TellItemCountAction.cpp b/src/Ai/Base/Actions/TellItemCountAction.cpp similarity index 100% rename from src/strategy/actions/TellItemCountAction.cpp rename to src/Ai/Base/Actions/TellItemCountAction.cpp diff --git a/src/strategy/actions/TellItemCountAction.h b/src/Ai/Base/Actions/TellItemCountAction.h similarity index 100% rename from src/strategy/actions/TellItemCountAction.h rename to src/Ai/Base/Actions/TellItemCountAction.h diff --git a/src/strategy/actions/TellLosAction.cpp b/src/Ai/Base/Actions/TellLosAction.cpp similarity index 100% rename from src/strategy/actions/TellLosAction.cpp rename to src/Ai/Base/Actions/TellLosAction.cpp diff --git a/src/strategy/actions/TellLosAction.h b/src/Ai/Base/Actions/TellLosAction.h similarity index 100% rename from src/strategy/actions/TellLosAction.h rename to src/Ai/Base/Actions/TellLosAction.h diff --git a/src/strategy/actions/TellMasterAction.cpp b/src/Ai/Base/Actions/TellMasterAction.cpp similarity index 100% rename from src/strategy/actions/TellMasterAction.cpp rename to src/Ai/Base/Actions/TellMasterAction.cpp diff --git a/src/strategy/actions/TellMasterAction.h b/src/Ai/Base/Actions/TellMasterAction.h similarity index 100% rename from src/strategy/actions/TellMasterAction.h rename to src/Ai/Base/Actions/TellMasterAction.h diff --git a/src/strategy/actions/TellReputationAction.cpp b/src/Ai/Base/Actions/TellReputationAction.cpp similarity index 100% rename from src/strategy/actions/TellReputationAction.cpp rename to src/Ai/Base/Actions/TellReputationAction.cpp diff --git a/src/strategy/actions/TellReputationAction.h b/src/Ai/Base/Actions/TellReputationAction.h similarity index 100% rename from src/strategy/actions/TellReputationAction.h rename to src/Ai/Base/Actions/TellReputationAction.h diff --git a/src/strategy/actions/TellTargetAction.cpp b/src/Ai/Base/Actions/TellTargetAction.cpp similarity index 100% rename from src/strategy/actions/TellTargetAction.cpp rename to src/Ai/Base/Actions/TellTargetAction.cpp diff --git a/src/strategy/actions/TellTargetAction.h b/src/Ai/Base/Actions/TellTargetAction.h similarity index 100% rename from src/strategy/actions/TellTargetAction.h rename to src/Ai/Base/Actions/TellTargetAction.h diff --git a/src/strategy/actions/TradeAction.cpp b/src/Ai/Base/Actions/TradeAction.cpp similarity index 100% rename from src/strategy/actions/TradeAction.cpp rename to src/Ai/Base/Actions/TradeAction.cpp diff --git a/src/strategy/actions/TradeAction.h b/src/Ai/Base/Actions/TradeAction.h similarity index 100% rename from src/strategy/actions/TradeAction.h rename to src/Ai/Base/Actions/TradeAction.h diff --git a/src/strategy/actions/TradeStatusAction.cpp b/src/Ai/Base/Actions/TradeStatusAction.cpp similarity index 100% rename from src/strategy/actions/TradeStatusAction.cpp rename to src/Ai/Base/Actions/TradeStatusAction.cpp diff --git a/src/strategy/actions/TradeStatusAction.h b/src/Ai/Base/Actions/TradeStatusAction.h similarity index 100% rename from src/strategy/actions/TradeStatusAction.h rename to src/Ai/Base/Actions/TradeStatusAction.h diff --git a/src/strategy/actions/TradeStatusExtendedAction.cpp b/src/Ai/Base/Actions/TradeStatusExtendedAction.cpp similarity index 100% rename from src/strategy/actions/TradeStatusExtendedAction.cpp rename to src/Ai/Base/Actions/TradeStatusExtendedAction.cpp diff --git a/src/strategy/actions/TradeStatusExtendedAction.h b/src/Ai/Base/Actions/TradeStatusExtendedAction.h similarity index 100% rename from src/strategy/actions/TradeStatusExtendedAction.h rename to src/Ai/Base/Actions/TradeStatusExtendedAction.h diff --git a/src/strategy/actions/TradeValues.cpp b/src/Ai/Base/Actions/TradeValues.cpp similarity index 100% rename from src/strategy/actions/TradeValues.cpp rename to src/Ai/Base/Actions/TradeValues.cpp diff --git a/src/strategy/actions/TradeValues.h b/src/Ai/Base/Actions/TradeValues.h similarity index 100% rename from src/strategy/actions/TradeValues.h rename to src/Ai/Base/Actions/TradeValues.h diff --git a/src/strategy/actions/TrainerAction.cpp b/src/Ai/Base/Actions/TrainerAction.cpp similarity index 86% rename from src/strategy/actions/TrainerAction.cpp rename to src/Ai/Base/Actions/TrainerAction.cpp index e2e89115b9..bca7406012 100644 --- a/src/strategy/actions/TrainerAction.cpp +++ b/src/Ai/Base/Actions/TrainerAction.cpp @@ -10,7 +10,7 @@ #include "PlayerbotFactory.h" #include "Playerbots.h" -void TrainerAction::Learn(uint32 cost, TrainerSpell const* tSpell, std::ostringstream& msg) +void TrainerAction::Learn(uint32 cost, const Trainer::Spell tSpell, std::ostringstream& msg) { if (sPlayerbotAIConfig->autoTrainSpells != "free" && !botAI->HasCheat(BotCheatMask::gold)) { @@ -23,7 +23,7 @@ void TrainerAction::Learn(uint32 cost, TrainerSpell const* tSpell, std::ostrings bot->ModifyMoney(-int32(cost)); } - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(tSpell->spell); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(tSpell.SpellId); if (!spellInfo) return; @@ -41,10 +41,8 @@ void TrainerAction::Learn(uint32 cost, TrainerSpell const* tSpell, std::ostrings } } - if (!learned && !bot->HasSpell(tSpell->spell)) - { - bot->learnSpell(tSpell->spell); - } + if (!learned && !bot->HasSpell(tSpell.SpellId)) + bot->learnSpell(tSpell.SpellId); msg << " - learned"; } @@ -53,37 +51,35 @@ void TrainerAction::Iterate(Creature* creature, TrainerSpellAction action, Spell { TellHeader(creature); - TrainerSpellData const* trainer_spells = creature->GetTrainerSpells(); + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(creature->GetEntry()); + + if (!trainer) + return; + float fDiscountMod = bot->GetReputationPriceDiscount(creature); uint32 totalCost = 0; - for (TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); - itr != trainer_spells->spellList.end(); ++itr) + for (auto& spell : trainer->GetSpells()) { - TrainerSpell const* tSpell = &itr->second; - if (!tSpell) + if (!trainer->CanTeachSpell(bot, trainer->GetSpell(spell.SpellId))) continue; - TrainerSpellState state = bot->GetTrainerSpellState(tSpell); - if (state != TRAINER_SPELL_GREEN) + if (!spells.empty() && spells.find(spell.SpellId) == spells.end()) continue; - uint32 spellId = tSpell->spell; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo) - continue; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell.SpellId); - if (!spells.empty() && spells.find(tSpell->spell) == spells.end()) + if (!spellInfo) continue; - uint32 cost = uint32(floor(tSpell->spellCost * fDiscountMod)); + uint32 cost = uint32(floor(spell.MoneyCost * fDiscountMod)); totalCost += cost; std::ostringstream out; out << chat->FormatSpell(spellInfo) << chat->formatMoney(cost); if (action) - (this->*action)(cost, tSpell, out); + (this->*action)(cost, spell, out); botAI->TellMaster(out); } @@ -112,15 +108,14 @@ bool TrainerAction::Execute(Event event) if (!creature || !creature->IsTrainer()) return false; - if (!creature->IsValidTrainerForPlayer(bot)) - { - botAI->TellError("This trainer cannot teach me"); + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(creature->GetEntry()); + + if (!trainer || !trainer->IsTrainerValidForPlayer(bot)) return false; - } - // check present spell in trainer spell list - TrainerSpellData const* cSpells = creature->GetTrainerSpells(); - if (!cSpells) + std::vector trainer_spells = trainer->GetSpells(); + + if (trainer_spells.empty()) { botAI->TellError("No spells can be learned from this trainer"); return false; @@ -133,7 +128,7 @@ bool TrainerAction::Execute(Event event) if (text.find("learn") != std::string::npos || sRandomPlayerbotMgr->IsRandomBot(bot) || (sPlayerbotAIConfig->autoTrainSpells != "no" && - (creature->GetCreatureTemplate()->trainer_type != TRAINER_TYPE_TRADESKILLS || + (trainer->GetTrainerType() != Trainer::Type::Tradeskill || !botAI->HasActivePlayerMaster()))) // Todo rewrite to only exclude start primary profession skills and make // config dependent. Iterate(creature, &TrainerAction::Learn, spells); @@ -183,9 +178,9 @@ bool MaintenanceAction::Execute(Event event) factory.InitTalentsTree(true); factory.InitPet(); factory.InitPetTalents(); + factory.InitSkills(); factory.InitClassSpells(); factory.InitAvailableSpells(); - factory.InitSkills(); factory.InitReputation(); factory.InitSpecialSpells(); factory.InitMounts(); @@ -226,15 +221,15 @@ bool MaintenanceAction::Execute(Event event) if (sPlayerbotAIConfig->altMaintenancePetTalents) factory.InitPetTalents(); + if (sPlayerbotAIConfig->altMaintenanceSkills) + factory.InitSkills(); + if (sPlayerbotAIConfig->altMaintenanceClassSpells) factory.InitClassSpells(); if (sPlayerbotAIConfig->altMaintenanceAvailableSpells) factory.InitAvailableSpells(); - if (sPlayerbotAIConfig->altMaintenanceSkills) - factory.InitSkills(); - if (sPlayerbotAIConfig->altMaintenanceReputation) factory.InitReputation(); diff --git a/src/strategy/actions/TrainerAction.h b/src/Ai/Base/Actions/TrainerAction.h similarity index 85% rename from src/strategy/actions/TrainerAction.h rename to src/Ai/Base/Actions/TrainerAction.h index 10f8a11920..e6046c3a2c 100644 --- a/src/strategy/actions/TrainerAction.h +++ b/src/Ai/Base/Actions/TrainerAction.h @@ -8,6 +8,7 @@ #include "Action.h" #include "ChatHelper.h" +#include "Trainer.h" class Creature; class PlayerbotAI; @@ -22,9 +23,9 @@ class TrainerAction : public Action bool Execute(Event event) override; private: - typedef void (TrainerAction::*TrainerSpellAction)(uint32, TrainerSpell const*, std::ostringstream& msg); + typedef void (TrainerAction::*TrainerSpellAction)(uint32, const Trainer::Spell, std::ostringstream& msg); void Iterate(Creature* creature, TrainerSpellAction action, SpellIds& spells); - void Learn(uint32 cost, TrainerSpell const* tSpell, std::ostringstream& msg); + void Learn(uint32 cost, const Trainer::Spell tSpell, std::ostringstream& msg); void TellHeader(Creature* creature); void TellFooter(uint32 totalCost); }; diff --git a/src/strategy/actions/TravelAction.cpp b/src/Ai/Base/Actions/TravelAction.cpp similarity index 98% rename from src/strategy/actions/TravelAction.cpp rename to src/Ai/Base/Actions/TravelAction.cpp index f99f8b29d3..a290605718 100644 --- a/src/strategy/actions/TravelAction.cpp +++ b/src/Ai/Base/Actions/TravelAction.cpp @@ -28,7 +28,7 @@ bool TravelAction::Execute(Event event) for (Unit* unit : targets) { newTarget = unit; - if (!newTarget) + if (!newTarget || !newTarget->IsInWorld() || newTarget->IsDuringRemoveFromWorld()) continue; if (newTarget->GetMapId() != bot->GetMapId()) diff --git a/src/strategy/actions/TravelAction.h b/src/Ai/Base/Actions/TravelAction.h similarity index 100% rename from src/strategy/actions/TravelAction.h rename to src/Ai/Base/Actions/TravelAction.h diff --git a/src/strategy/actions/UnequipAction.cpp b/src/Ai/Base/Actions/UnequipAction.cpp similarity index 100% rename from src/strategy/actions/UnequipAction.cpp rename to src/Ai/Base/Actions/UnequipAction.cpp diff --git a/src/strategy/actions/UnequipAction.h b/src/Ai/Base/Actions/UnequipAction.h similarity index 100% rename from src/strategy/actions/UnequipAction.h rename to src/Ai/Base/Actions/UnequipAction.h diff --git a/src/strategy/actions/UnlockItemAction.cpp b/src/Ai/Base/Actions/UnlockItemAction.cpp similarity index 100% rename from src/strategy/actions/UnlockItemAction.cpp rename to src/Ai/Base/Actions/UnlockItemAction.cpp diff --git a/src/strategy/actions/UnlockItemAction.h b/src/Ai/Base/Actions/UnlockItemAction.h similarity index 100% rename from src/strategy/actions/UnlockItemAction.h rename to src/Ai/Base/Actions/UnlockItemAction.h diff --git a/src/strategy/actions/UnlockTradedItemAction.cpp b/src/Ai/Base/Actions/UnlockTradedItemAction.cpp similarity index 100% rename from src/strategy/actions/UnlockTradedItemAction.cpp rename to src/Ai/Base/Actions/UnlockTradedItemAction.cpp diff --git a/src/strategy/actions/UnlockTradedItemAction.h b/src/Ai/Base/Actions/UnlockTradedItemAction.h similarity index 100% rename from src/strategy/actions/UnlockTradedItemAction.h rename to src/Ai/Base/Actions/UnlockTradedItemAction.h diff --git a/src/strategy/actions/UseItemAction.cpp b/src/Ai/Base/Actions/UseItemAction.cpp similarity index 98% rename from src/strategy/actions/UseItemAction.cpp rename to src/Ai/Base/Actions/UseItemAction.cpp index 690d2d4b77..bfb86ef0bd 100644 --- a/src/strategy/actions/UseItemAction.cpp +++ b/src/Ai/Base/Actions/UseItemAction.cpp @@ -245,8 +245,10 @@ bool UseItemAction::UseItem(Item* item, ObjectGuid goGuid, Item* itemTarget, Uni { packet << unitTarget->GetGUID(); targetSelected = true; - // If the target is bot or is an enemy, say "on self" - if (unitTarget == bot || (unitTarget->IsHostileTo(bot))) + + if (unitTarget == bot || !unitTarget->IsInWorld() || unitTarget->IsDuringRemoveFromWorld()) + out << " on self"; + else if (unitTarget->IsHostileTo(bot)) out << " on self"; else out << " on " << unitTarget->GetName(); diff --git a/src/strategy/actions/UseItemAction.h b/src/Ai/Base/Actions/UseItemAction.h similarity index 100% rename from src/strategy/actions/UseItemAction.h rename to src/Ai/Base/Actions/UseItemAction.h diff --git a/src/strategy/actions/UseMeetingStoneAction.cpp b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp similarity index 90% rename from src/strategy/actions/UseMeetingStoneAction.cpp rename to src/Ai/Base/Actions/UseMeetingStoneAction.cpp index 6e902730b8..323d9d5859 100644 --- a/src/strategy/actions/UseMeetingStoneAction.cpp +++ b/src/Ai/Base/Actions/UseMeetingStoneAction.cpp @@ -52,7 +52,7 @@ bool UseMeetingStoneAction::Execute(Event event) if (!goInfo || goInfo->entry != 179944) return false; - return Teleport(master, bot); + return Teleport(master, bot, false); } bool SummonAction::Execute(Event event) @@ -70,16 +70,16 @@ bool SummonAction::Execute(Event event) { // botAI->GetAiObjectContext()->GetValue("prioritized targets")->Set({}); AI_VALUE(std::list&, "recently flee info").clear(); - return Teleport(master, bot); + return Teleport(master, bot, true); } - if (SummonUsingGos(master, bot) || SummonUsingNpcs(master, bot)) + if (SummonUsingGos(master, bot, true) || SummonUsingNpcs(master, bot, true)) { botAI->TellMasterNoFacing("Hello!"); return true; } - if (SummonUsingGos(bot, master) || SummonUsingNpcs(bot, master)) + if (SummonUsingGos(bot, master, true) || SummonUsingNpcs(bot, master, true)) { botAI->TellMasterNoFacing("Welcome!"); return true; @@ -88,7 +88,7 @@ bool SummonAction::Execute(Event event) return false; } -bool SummonAction::SummonUsingGos(Player* summoner, Player* player) +bool SummonAction::SummonUsingGos(Player* summoner, Player* player, bool preserveAuras) { std::list targets; AnyGameObjectInObjectRangeCheck u_check(summoner, sPlayerbotAIConfig->sightDistance); @@ -98,14 +98,14 @@ bool SummonAction::SummonUsingGos(Player* summoner, Player* player) for (GameObject* go : targets) { if (go->isSpawned() && go->GetGoType() == GAMEOBJECT_TYPE_MEETINGSTONE) - return Teleport(summoner, player); + return Teleport(summoner, player, preserveAuras); } botAI->TellError(summoner == bot ? "There is no meeting stone nearby" : "There is no meeting stone near you"); return false; } -bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player) +bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player, bool preserveAuras) { if (!sPlayerbotAIConfig->summonAtInnkeepersEnabled) return false; @@ -139,7 +139,7 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player) Spell spell(player, spellInfo, TRIGGERED_NONE); spell.SendSpellCooldown(); - return Teleport(summoner, player); + return Teleport(summoner, player, preserveAuras); } } @@ -147,7 +147,7 @@ bool SummonAction::SummonUsingNpcs(Player* summoner, Player* player) return false; } -bool SummonAction::Teleport(Player* summoner, Player* player) +bool SummonAction::Teleport(Player* summoner, Player* player, bool preserveAuras) { // Player* master = GetMaster(); if (!summoner) @@ -208,7 +208,11 @@ bool SummonAction::Teleport(Player* summoner, Player* player) player->GetMotionMaster()->Clear(); AI_VALUE(LastMovement&, "last movement").clear(); - player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TELEPORTED | AURA_INTERRUPT_FLAG_CHANGE_MAP); + + if (!preserveAuras) + player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TELEPORTED | + AURA_INTERRUPT_FLAG_CHANGE_MAP); + player->TeleportTo(mapId, x, y, z, 0); if (botAI->HasStrategy("stay", botAI->GetState())) diff --git a/src/strategy/actions/UseMeetingStoneAction.h b/src/Ai/Base/Actions/UseMeetingStoneAction.h similarity index 77% rename from src/strategy/actions/UseMeetingStoneAction.h rename to src/Ai/Base/Actions/UseMeetingStoneAction.h index f3b59549e8..ff1282284e 100644 --- a/src/strategy/actions/UseMeetingStoneAction.h +++ b/src/Ai/Base/Actions/UseMeetingStoneAction.h @@ -19,9 +19,9 @@ class SummonAction : public MovementAction bool Execute(Event event) override; protected: - bool Teleport(Player* summoner, Player* player); - bool SummonUsingGos(Player* summoner, Player* player); - bool SummonUsingNpcs(Player* summoner, Player* player); + bool Teleport(Player* summoner, Player* player, bool preserveAuras); + bool SummonUsingGos(Player* summoner, Player* player, bool preserveAuras); + bool SummonUsingNpcs(Player* summoner, Player* player, bool preserveAuras); }; class UseMeetingStoneAction : public SummonAction diff --git a/src/strategy/actions/VehicleActions.cpp b/src/Ai/Base/Actions/VehicleActions.cpp similarity index 100% rename from src/strategy/actions/VehicleActions.cpp rename to src/Ai/Base/Actions/VehicleActions.cpp diff --git a/src/strategy/actions/VehicleActions.h b/src/Ai/Base/Actions/VehicleActions.h similarity index 100% rename from src/strategy/actions/VehicleActions.h rename to src/Ai/Base/Actions/VehicleActions.h diff --git a/src/strategy/actions/WhoAction.cpp b/src/Ai/Base/Actions/WhoAction.cpp similarity index 100% rename from src/strategy/actions/WhoAction.cpp rename to src/Ai/Base/Actions/WhoAction.cpp diff --git a/src/strategy/actions/WhoAction.h b/src/Ai/Base/Actions/WhoAction.h similarity index 100% rename from src/strategy/actions/WhoAction.h rename to src/Ai/Base/Actions/WhoAction.h diff --git a/src/strategy/actions/WipeAction.cpp b/src/Ai/Base/Actions/WipeAction.cpp similarity index 100% rename from src/strategy/actions/WipeAction.cpp rename to src/Ai/Base/Actions/WipeAction.cpp diff --git a/src/strategy/actions/WipeAction.h b/src/Ai/Base/Actions/WipeAction.h similarity index 100% rename from src/strategy/actions/WipeAction.h rename to src/Ai/Base/Actions/WipeAction.h diff --git a/src/strategy/actions/WorldBuffAction.cpp b/src/Ai/Base/Actions/WorldBuffAction.cpp similarity index 100% rename from src/strategy/actions/WorldBuffAction.cpp rename to src/Ai/Base/Actions/WorldBuffAction.cpp diff --git a/src/strategy/actions/WorldBuffAction.h b/src/Ai/Base/Actions/WorldBuffAction.h similarity index 100% rename from src/strategy/actions/WorldBuffAction.h rename to src/Ai/Base/Actions/WorldBuffAction.h diff --git a/src/strategy/actions/WtsAction.cpp b/src/Ai/Base/Actions/WtsAction.cpp similarity index 100% rename from src/strategy/actions/WtsAction.cpp rename to src/Ai/Base/Actions/WtsAction.cpp diff --git a/src/strategy/actions/WtsAction.h b/src/Ai/Base/Actions/WtsAction.h similarity index 100% rename from src/strategy/actions/WtsAction.h rename to src/Ai/Base/Actions/WtsAction.h diff --git a/src/strategy/actions/XpGainAction.cpp b/src/Ai/Base/Actions/XpGainAction.cpp similarity index 100% rename from src/strategy/actions/XpGainAction.cpp rename to src/Ai/Base/Actions/XpGainAction.cpp diff --git a/src/strategy/actions/XpGainAction.h b/src/Ai/Base/Actions/XpGainAction.h similarity index 100% rename from src/strategy/actions/XpGainAction.h rename to src/Ai/Base/Actions/XpGainAction.h diff --git a/src/strategy/actions/ChatActionContext.h b/src/Ai/Base/ChatActionContext.h similarity index 100% rename from src/strategy/actions/ChatActionContext.h rename to src/Ai/Base/ChatActionContext.h diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/Ai/Base/ChatTriggerContext.h similarity index 100% rename from src/strategy/triggers/ChatTriggerContext.h rename to src/Ai/Base/ChatTriggerContext.h diff --git a/src/strategy/values/SharedValueContext.h b/src/Ai/Base/SharedValueContext.h similarity index 100% rename from src/strategy/values/SharedValueContext.h rename to src/Ai/Base/SharedValueContext.h diff --git a/src/strategy/generic/AttackEnemyPlayersStrategy.cpp b/src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.cpp similarity index 78% rename from src/strategy/generic/AttackEnemyPlayersStrategy.cpp rename to src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.cpp index 1c3b843e8a..a43269976d 100644 --- a/src/strategy/generic/AttackEnemyPlayersStrategy.cpp +++ b/src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.cpp @@ -10,5 +10,5 @@ void AttackEnemyPlayersStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("enemy player near", - NextAction::array(0, new NextAction("attack enemy player", 55.0f), nullptr))); + { NextAction("attack enemy player", 55.0f) })); } diff --git a/src/strategy/generic/AttackEnemyPlayersStrategy.h b/src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.h similarity index 100% rename from src/strategy/generic/AttackEnemyPlayersStrategy.h rename to src/Ai/Base/Strategy/AttackEnemyPlayersStrategy.h diff --git a/src/Ai/Base/Strategy/BattlegroundStrategy.cpp b/src/Ai/Base/Strategy/BattlegroundStrategy.cpp new file mode 100644 index 0000000000..41c726cc2b --- /dev/null +++ b/src/Ai/Base/Strategy/BattlegroundStrategy.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "BattlegroundStrategy.h" + +#include "Playerbots.h" + +void BGStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("often", { NextAction("bg join", relevance)})); + triggers.push_back(new TriggerNode("bg invite active", { NextAction("bg status check", relevance)})); + triggers.push_back(new TriggerNode("timer", { NextAction("bg strategy check", relevance)})); +} + +BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} + +void BattlegroundStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("bg waiting", { NextAction("bg move to start", ACTION_BG)})); + triggers.push_back(new TriggerNode("bg active", { NextAction("bg move to objective", ACTION_BG)})); + triggers.push_back(new TriggerNode("often", { NextAction("bg check objective", ACTION_BG + 1)})); + triggers.push_back(new TriggerNode("dead", { NextAction("bg reset objective force", ACTION_EMERGENCY)})); +} + +void WarsongStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY )})); + triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID + 1.0f)})); + triggers.push_back(new TriggerNode("team flagcarrier near", { NextAction("bg protect fc", ACTION_RAID)})); + triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)})); + triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("player has flag", { NextAction("bg move to objective", ACTION_EMERGENCY)})); + triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)})); +} + +void AlteracStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("alliance no snowfall gy", { NextAction("bg move to objective", ACTION_EMERGENCY)})); + triggers.push_back(new TriggerNode("timer bg", { NextAction("bg reset objective force", ACTION_EMERGENCY)})); +} + +void ArathiStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)})); + triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)})); + triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)})); +} + +void EyeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_EMERGENCY)})); + triggers.push_back(new TriggerNode("often", { NextAction("bg use buff", ACTION_BG)})); + triggers.push_back(new TriggerNode("low health", { NextAction("bg use buff", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("low mana", { NextAction("bg use buff", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("enemy flagcarrier near", { NextAction("attack enemy flag carrier", ACTION_RAID)})); + triggers.push_back(new TriggerNode("player has flag",{ NextAction("bg move to objective", ACTION_EMERGENCY)})); +} + +//TODO: Do Priorities +void IsleStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("bg active", { NextAction("bg check flag", ACTION_MOVE)})); + triggers.push_back(new TriggerNode("timer", { NextAction("enter vehicle", ACTION_MOVE + 8.0f)})); + triggers.push_back(new TriggerNode("random", { NextAction("leave vehicle", ACTION_MOVE + 7.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("hurl boulder", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("fire cannon", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("napalm", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("enemy is close", { NextAction("steam blast", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("ram", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("enemy is close", { NextAction("ram", ACTION_MOVE + 9.1f)})); + triggers.push_back(new TriggerNode("enemy out of melee", { NextAction("steam rush", ACTION_MOVE + 9.2f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("incendiary rocket", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("rocket blast", ACTION_MOVE + 9.0f)})); + // this is bugged: it doesn't work, and stops glaive throw working (which is needed to take down gate) + // triggers.push_back(new TriggerNode("in vehicle", { NextAction("blade salvo", ACTION_MOVE + 9.0f)})); + triggers.push_back(new TriggerNode("in vehicle", { NextAction("glaive throw", ACTION_MOVE + 9.0f)})); +} + +void ArenaStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("no possible targets", { NextAction("arena tactics", ACTION_BG)})); +} diff --git a/src/strategy/generic/BattlegroundStrategy.h b/src/Ai/Base/Strategy/BattlegroundStrategy.h similarity index 100% rename from src/strategy/generic/BattlegroundStrategy.h rename to src/Ai/Base/Strategy/BattlegroundStrategy.h diff --git a/src/strategy/generic/CastTimeStrategy.cpp b/src/Ai/Base/Strategy/CastTimeStrategy.cpp similarity index 100% rename from src/strategy/generic/CastTimeStrategy.cpp rename to src/Ai/Base/Strategy/CastTimeStrategy.cpp diff --git a/src/strategy/generic/CastTimeStrategy.h b/src/Ai/Base/Strategy/CastTimeStrategy.h similarity index 100% rename from src/strategy/generic/CastTimeStrategy.h rename to src/Ai/Base/Strategy/CastTimeStrategy.h diff --git a/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp new file mode 100644 index 0000000000..0a81686a9d --- /dev/null +++ b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "ChatCommandHandlerStrategy.h" + +#include "Playerbots.h" + +class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory +{ +public: + ChatCommandActionNodeFactoryInternal() { creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut; } + +private: + static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI) + { + return new ActionNode("tank attack chat shortcut", + /*P*/ {}, + /*A*/ {}, + /*C*/ { NextAction("attack my target", 100.0f) }); + } +}; + +void ChatCommandHandlerStrategy::InitTriggers(std::vector& triggers) +{ + PassTroughStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("rep", { NextAction("reputation", relevance) })); + triggers.push_back(new TriggerNode("q", { NextAction("query quest", relevance), + NextAction("query item usage", relevance) })); + triggers.push_back(new TriggerNode("add all loot", { NextAction("add all loot", relevance), + NextAction("loot", relevance) })); + triggers.push_back(new TriggerNode("u", { NextAction("use", relevance) })); + triggers.push_back(new TriggerNode("c", { NextAction("item count", relevance) })); + triggers.push_back( + new TriggerNode("items", { NextAction("item count", relevance) })); + triggers.push_back(new TriggerNode("inv", { NextAction("item count", relevance) })); + triggers.push_back(new TriggerNode("e", { NextAction("equip", relevance) })); + triggers.push_back(new TriggerNode("ue", { NextAction("unequip", relevance) })); + triggers.push_back(new TriggerNode("t", { NextAction("trade", relevance) })); + triggers.push_back(new TriggerNode("nt", { NextAction("trade", relevance) })); + triggers.push_back(new TriggerNode("s", { NextAction("sell", relevance) })); + triggers.push_back(new TriggerNode("b", { NextAction("buy", relevance) })); + triggers.push_back(new TriggerNode("r", { NextAction("reward", relevance) })); + triggers.push_back( + new TriggerNode("attack", { NextAction("attack my target", relevance) })); + triggers.push_back( + new TriggerNode("accept", { NextAction("accept quest", relevance) })); + triggers.push_back( + new TriggerNode("follow", { NextAction("follow chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("stay", { NextAction("stay chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("move from group", { NextAction("move from group chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("flee", { NextAction("flee chat shortcut", relevance) })); + triggers.push_back(new TriggerNode( + "tank attack", { NextAction("tank attack chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("grind", { NextAction("grind chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("talk", { NextAction("gossip hello", relevance), + NextAction("talk to quest giver", relevance) })); + triggers.push_back( + new TriggerNode("enter vehicle", { NextAction("enter vehicle", relevance) })); + triggers.push_back( + new TriggerNode("leave vehicle", { NextAction("leave vehicle", relevance) })); + triggers.push_back( + new TriggerNode("cast", { NextAction("cast custom spell", relevance) })); + triggers.push_back( + new TriggerNode("castnc", { NextAction("cast custom nc spell", relevance) })); + triggers.push_back( + new TriggerNode("revive", { NextAction("spirit healer", relevance) })); + triggers.push_back( + new TriggerNode("runaway", { NextAction("runaway chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("warning", { NextAction("runaway chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("max dps", { NextAction("max dps chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("attackers", { NextAction("tell attackers", relevance) })); + triggers.push_back( + new TriggerNode("target", { NextAction("tell target", relevance) })); + triggers.push_back( + new TriggerNode("ready", { NextAction("ready check", relevance) })); + triggers.push_back( + new TriggerNode("bwl", { NextAction("bwl chat shortcut", relevance) })); + triggers.push_back( + new TriggerNode("dps", { NextAction("tell estimated dps", relevance) })); + triggers.push_back( + new TriggerNode("disperse", { NextAction("disperse set", relevance) })); + triggers.push_back( + new TriggerNode("open items", { NextAction("open items", relevance) })); + triggers.push_back( + new TriggerNode("qi", { NextAction("query item usage", relevance) })); + triggers.push_back( + new TriggerNode("unlock items", { NextAction("unlock items", relevance) })); + triggers.push_back( + new TriggerNode("unlock traded item", { NextAction("unlock traded item", relevance) })); + triggers.push_back( + new TriggerNode("wipe", { NextAction("wipe", relevance) })); + triggers.push_back(new TriggerNode("tame", { NextAction("tame", relevance) })); + triggers.push_back(new TriggerNode("glyphs", { NextAction("glyphs", relevance) })); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", { NextAction("glyph equip", relevance) })); // Added for custom Glyphs + triggers.push_back(new TriggerNode("pet", { NextAction("pet", relevance) })); + triggers.push_back(new TriggerNode("pet attack", { NextAction("pet attack", relevance) })); + triggers.push_back(new TriggerNode("roll", { NextAction("roll", relevance) })); +} + +ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) +{ + actionNodeFactories.Add(new ChatCommandActionNodeFactoryInternal()); + + supported.push_back("quests"); + supported.push_back("stats"); + supported.push_back("leave"); + supported.push_back("reputation"); + supported.push_back("log"); + supported.push_back("los"); + supported.push_back("rpg status"); + supported.push_back("rpg do quest"); + supported.push_back("aura"); + supported.push_back("drop"); + supported.push_back("share"); + supported.push_back("ll"); + supported.push_back("ss"); + supported.push_back("release"); + supported.push_back("teleport"); + supported.push_back("taxi"); + supported.push_back("repair"); + supported.push_back("talents"); + supported.push_back("spells"); + supported.push_back("co"); + supported.push_back("nc"); + supported.push_back("de"); + supported.push_back("trainer"); + supported.push_back("maintenance"); + supported.push_back("remove glyph"); + supported.push_back("autogear"); + supported.push_back("equip upgrade"); + supported.push_back("chat"); + supported.push_back("home"); + supported.push_back("destroy"); + supported.push_back("reset botAI"); + supported.push_back("emote"); + supported.push_back("buff"); + supported.push_back("help"); + supported.push_back("gb"); + supported.push_back("bank"); + supported.push_back("invite"); + supported.push_back("lfg"); + supported.push_back("spell"); + supported.push_back("rti"); + supported.push_back("position"); + supported.push_back("summon"); + supported.push_back("who"); + supported.push_back("save mana"); + supported.push_back("formation"); + supported.push_back("stance"); + supported.push_back("sendmail"); + supported.push_back("mail"); + supported.push_back("outfit"); + supported.push_back("go"); + supported.push_back("debug"); + supported.push_back("cdebug"); + supported.push_back("cs"); + supported.push_back("wts"); + supported.push_back("hire"); + supported.push_back("craft"); + supported.push_back("flag"); + supported.push_back("range"); + supported.push_back("ra"); + supported.push_back("give leader"); + supported.push_back("cheat"); + supported.push_back("ginvite"); + supported.push_back("guild promote"); + supported.push_back("guild demote"); + supported.push_back("guild remove"); + supported.push_back("guild leave"); + supported.push_back("rtsc"); + supported.push_back("drink"); + supported.push_back("calc"); + supported.push_back("open items"); + supported.push_back("qi"); + supported.push_back("unlock items"); + supported.push_back("unlock traded item"); + supported.push_back("tame"); + supported.push_back("glyphs"); // Added for custom Glyphs + supported.push_back("glyph equip"); // Added for custom Glyphs + supported.push_back("pet"); + supported.push_back("pet attack"); +} diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.h b/src/Ai/Base/Strategy/ChatCommandHandlerStrategy.h similarity index 100% rename from src/strategy/generic/ChatCommandHandlerStrategy.h rename to src/Ai/Base/Strategy/ChatCommandHandlerStrategy.h diff --git a/src/Ai/Base/Strategy/CombatStrategy.cpp b/src/Ai/Base/Strategy/CombatStrategy.cpp new file mode 100644 index 0000000000..75700e9a6d --- /dev/null +++ b/src/Ai/Base/Strategy/CombatStrategy.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "CombatStrategy.h" + +#include "Playerbots.h" +#include "Strategy.h" + +void CombatStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "enemy out of spell", + { + NextAction("reach spell", ACTION_HIGH) + } + ) + ); + // drop target relevance 99 (lower than Worldpacket triggers) + triggers.push_back( + new TriggerNode( + "invalid target", + { + NextAction("drop target", 99) + } + ) + ); + triggers.push_back( + new TriggerNode( + "mounted", + { + NextAction("check mount state", 54) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combat stuck", + { + NextAction("reset", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "not facing target", + { + NextAction("set facing", ACTION_MOVE + 7) + } + ) + ); + // The pet-attack trigger is commented out because it was forcing the bot's pet to attack, overriding stay and follow commands. + // Pets will automatically attack the bot's enemy if they are in "defensive" or "aggressive" + // stance, or if the master issues an attack command. +} + +AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + +std::vector AvoidAoeStrategy::getDefaultActions() +{ + return { + NextAction("avoid aoe", ACTION_EMERGENCY) + }; +} + +void AvoidAoeStrategy::InitTriggers(std::vector& triggers) +{ +} + +void AvoidAoeStrategy::InitMultipliers(std::vector& multipliers) +{ +} + +TankFaceStrategy::TankFaceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + +std::vector TankFaceStrategy::getDefaultActions() +{ + return { + NextAction("tank face", ACTION_MOVE) + }; +} + +void TankFaceStrategy::InitTriggers(std::vector& triggers) +{ +} + +std::vector CombatFormationStrategy::getDefaultActions() +{ + return { + NextAction("combat formation move", ACTION_NORMAL) + }; +} diff --git a/src/strategy/generic/CombatStrategy.h b/src/Ai/Base/Strategy/CombatStrategy.h similarity index 88% rename from src/strategy/generic/CombatStrategy.h rename to src/Ai/Base/Strategy/CombatStrategy.h index 3f3019f224..3296d8bc7c 100644 --- a/src/strategy/generic/CombatStrategy.h +++ b/src/Ai/Base/Strategy/CombatStrategy.h @@ -24,7 +24,7 @@ class AvoidAoeStrategy : public Strategy public: explicit AvoidAoeStrategy(PlayerbotAI* ai); const std::string getName() override { return "avoid aoe"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitMultipliers(std::vector& multipliers) override; void InitTriggers(std::vector& triggers) override; }; @@ -34,7 +34,7 @@ class TankFaceStrategy : public Strategy public: explicit TankFaceStrategy(PlayerbotAI* ai); const std::string getName() override { return "tank face"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; @@ -43,7 +43,7 @@ class CombatFormationStrategy : public Strategy public: CombatFormationStrategy(PlayerbotAI* ai) : Strategy(ai) {} const std::string getName() override { return "formation"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/generic/ConserveManaStrategy.cpp b/src/Ai/Base/Strategy/ConserveManaStrategy.cpp similarity index 100% rename from src/strategy/generic/ConserveManaStrategy.cpp rename to src/Ai/Base/Strategy/ConserveManaStrategy.cpp diff --git a/src/strategy/generic/ConserveManaStrategy.h b/src/Ai/Base/Strategy/ConserveManaStrategy.h similarity index 100% rename from src/strategy/generic/ConserveManaStrategy.h rename to src/Ai/Base/Strategy/ConserveManaStrategy.h diff --git a/src/Ai/Base/Strategy/DeadStrategy.cpp b/src/Ai/Base/Strategy/DeadStrategy.cpp new file mode 100644 index 0000000000..61399fa10e --- /dev/null +++ b/src/Ai/Base/Strategy/DeadStrategy.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "DeadStrategy.h" + +#include "Playerbots.h" + +void DeadStrategy::InitTriggers(std::vector& triggers) +{ + PassTroughStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode("often", { NextAction("auto release", relevance) })); + triggers.push_back( + new TriggerNode("bg active", { NextAction("auto release", relevance) })); + triggers.push_back( + new TriggerNode("dead", { NextAction("find corpse", relevance) })); + triggers.push_back(new TriggerNode( + "corpse near", { NextAction("revive from corpse", relevance - 1.0f) })); + triggers.push_back(new TriggerNode("resurrect request", + { NextAction("accept resurrect", relevance) })); + triggers.push_back( + new TriggerNode("falling far", { NextAction("repop", relevance + 1.f) })); + triggers.push_back( + new TriggerNode("location stuck", { NextAction("repop", relevance + 1) })); + triggers.push_back(new TriggerNode( + "can self resurrect", { NextAction("self resurrect", relevance + 2.0f) })); +} + +DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} diff --git a/src/strategy/generic/DeadStrategy.h b/src/Ai/Base/Strategy/DeadStrategy.h similarity index 100% rename from src/strategy/generic/DeadStrategy.h rename to src/Ai/Base/Strategy/DeadStrategy.h diff --git a/src/strategy/generic/DebugStrategy.cpp b/src/Ai/Base/Strategy/DebugStrategy.cpp similarity index 100% rename from src/strategy/generic/DebugStrategy.cpp rename to src/Ai/Base/Strategy/DebugStrategy.cpp diff --git a/src/strategy/generic/DebugStrategy.h b/src/Ai/Base/Strategy/DebugStrategy.h similarity index 100% rename from src/strategy/generic/DebugStrategy.h rename to src/Ai/Base/Strategy/DebugStrategy.h diff --git a/src/strategy/generic/DpsAssistStrategy.cpp b/src/Ai/Base/Strategy/DpsAssistStrategy.cpp similarity index 66% rename from src/strategy/generic/DpsAssistStrategy.cpp rename to src/Ai/Base/Strategy/DpsAssistStrategy.cpp index 1997623356..8ead279bd4 100644 --- a/src/strategy/generic/DpsAssistStrategy.cpp +++ b/src/Ai/Base/Strategy/DpsAssistStrategy.cpp @@ -10,11 +10,11 @@ void DpsAssistStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("not dps target active", NextAction::array(0, new NextAction("dps assist", 50.0f), nullptr))); + new TriggerNode("not dps target active", { NextAction("dps assist", 50.0f) })); } void DpsAoeStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("not dps aoe target active", NextAction::array(0, new NextAction("dps aoe", 50.0f), nullptr))); + new TriggerNode("not dps aoe target active", { NextAction("dps aoe", 50.0f) })); } diff --git a/src/strategy/generic/DpsAssistStrategy.h b/src/Ai/Base/Strategy/DpsAssistStrategy.h similarity index 100% rename from src/strategy/generic/DpsAssistStrategy.h rename to src/Ai/Base/Strategy/DpsAssistStrategy.h diff --git a/src/strategy/generic/DuelStrategy.cpp b/src/Ai/Base/Strategy/DuelStrategy.cpp similarity index 74% rename from src/strategy/generic/DuelStrategy.cpp rename to src/Ai/Base/Strategy/DuelStrategy.cpp index 5a571e0f89..4c08397e6b 100644 --- a/src/strategy/generic/DuelStrategy.cpp +++ b/src/Ai/Base/Strategy/DuelStrategy.cpp @@ -12,9 +12,9 @@ void DuelStrategy::InitTriggers(std::vector& triggers) PassTroughStrategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("duel requested", NextAction::array(0, new NextAction("accept duel", relevance), nullptr))); + new TriggerNode("duel requested", { NextAction("accept duel", relevance) })); triggers.push_back( - new TriggerNode("no attackers", NextAction::array(0, new NextAction("attack duel opponent", 70.0f), nullptr))); + new TriggerNode("no attackers", { NextAction("attack duel opponent", 70.0f) })); } DuelStrategy::DuelStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} diff --git a/src/strategy/generic/DuelStrategy.h b/src/Ai/Base/Strategy/DuelStrategy.h similarity index 100% rename from src/strategy/generic/DuelStrategy.h rename to src/Ai/Base/Strategy/DuelStrategy.h diff --git a/src/Ai/Base/Strategy/EmoteStrategy.cpp b/src/Ai/Base/Strategy/EmoteStrategy.cpp new file mode 100644 index 0000000000..9419e0c386 --- /dev/null +++ b/src/Ai/Base/Strategy/EmoteStrategy.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "EmoteStrategy.h" + +#include "Playerbots.h" + +void EmoteStrategy::InitTriggers(std::vector& triggers) +{ + if (sPlayerbotAIConfig->randomBotEmote) + { + triggers.push_back(new TriggerNode("often", { NextAction("talk", 1.0f) })); + triggers.push_back(new TriggerNode("seldom", { NextAction("emote", 1.0f) })); + triggers.push_back( + new TriggerNode("receive text emote", { NextAction("emote", 10.0f) })); + triggers.push_back( + new TriggerNode("receive emote", { NextAction("emote", 10.0f) })); + } + + if (sPlayerbotAIConfig->randomBotTalk) + { + triggers.push_back(new TriggerNode( + "often", + { NextAction("suggest what to do", 10.0f), NextAction("suggest dungeon", 3.0f), + NextAction("suggest trade", 3.0f) })); + } + + if (sPlayerbotAIConfig->enableGreet) + triggers.push_back( + new TriggerNode("new player nearby", { NextAction("greet", 1.0f) })); + + triggers.push_back(new TriggerNode("often", { NextAction("rpg mount anim", 1.0f) })); +} diff --git a/src/strategy/generic/EmoteStrategy.h b/src/Ai/Base/Strategy/EmoteStrategy.h similarity index 100% rename from src/strategy/generic/EmoteStrategy.h rename to src/Ai/Base/Strategy/EmoteStrategy.h diff --git a/src/strategy/generic/FleeStrategy.cpp b/src/Ai/Base/Strategy/FleeStrategy.cpp similarity index 53% rename from src/strategy/generic/FleeStrategy.cpp rename to src/Ai/Base/Strategy/FleeStrategy.cpp index a2eeb9ba29..663738306b 100644 --- a/src/strategy/generic/FleeStrategy.cpp +++ b/src/Ai/Base/Strategy/FleeStrategy.cpp @@ -10,15 +10,15 @@ void FleeStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("panic", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr))); + new TriggerNode("panic", { NextAction("flee", ACTION_EMERGENCY + 9) })); triggers.push_back( - new TriggerNode("outnumbered", NextAction::array(0, new NextAction("flee", ACTION_EMERGENCY + 9), nullptr))); + new TriggerNode("outnumbered", { NextAction("flee", ACTION_EMERGENCY + 9) })); triggers.push_back( - new TriggerNode("critical health", NextAction::array(0, new NextAction("flee", ACTION_MEDIUM_HEAL), nullptr))); + new TriggerNode("critical health", { NextAction("flee", ACTION_MEDIUM_HEAL) })); } void FleeFromAddsStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("has nearest adds", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr))); + new TriggerNode("has nearest adds", { NextAction("runaway", 50.0f) })); } diff --git a/src/strategy/generic/FleeStrategy.h b/src/Ai/Base/Strategy/FleeStrategy.h similarity index 100% rename from src/strategy/generic/FleeStrategy.h rename to src/Ai/Base/Strategy/FleeStrategy.h diff --git a/src/strategy/generic/FollowMasterStrategy.cpp b/src/Ai/Base/Strategy/FollowMasterStrategy.cpp similarity index 56% rename from src/strategy/generic/FollowMasterStrategy.cpp rename to src/Ai/Base/Strategy/FollowMasterStrategy.cpp index 771bcffb39..0308b113f9 100644 --- a/src/strategy/generic/FollowMasterStrategy.cpp +++ b/src/Ai/Base/Strategy/FollowMasterStrategy.cpp @@ -7,13 +7,13 @@ #include "Playerbots.h" -NextAction** FollowMasterStrategy::getDefaultActions() +std::vector FollowMasterStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("follow", 1.0f), nullptr); + return { + NextAction("follow", 1.0f) + }; } void FollowMasterStrategy::InitTriggers(std::vector& triggers) { - // triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", - // ACTION_HIGH), nullptr))); } diff --git a/src/strategy/generic/FollowMasterStrategy.h b/src/Ai/Base/Strategy/FollowMasterStrategy.h similarity index 91% rename from src/strategy/generic/FollowMasterStrategy.h rename to src/Ai/Base/Strategy/FollowMasterStrategy.h index d751741eb1..9d7e3431f7 100644 --- a/src/strategy/generic/FollowMasterStrategy.h +++ b/src/Ai/Base/Strategy/FollowMasterStrategy.h @@ -16,7 +16,7 @@ class FollowMasterStrategy : public NonCombatStrategy FollowMasterStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {} std::string const getName() override { return "follow"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; diff --git a/src/strategy/generic/GrindingStrategy.cpp b/src/Ai/Base/Strategy/GrindingStrategy.cpp similarity index 51% rename from src/strategy/generic/GrindingStrategy.cpp rename to src/Ai/Base/Strategy/GrindingStrategy.cpp index 62237fa481..2db8cd87d6 100644 --- a/src/strategy/generic/GrindingStrategy.cpp +++ b/src/Ai/Base/Strategy/GrindingStrategy.cpp @@ -7,22 +7,35 @@ #include "Playerbots.h" -NextAction** GrindingStrategy::getDefaultActions() +std::vector GrindingStrategy::getDefaultActions() { - return NextAction::array(0, - new NextAction("drink", 4.2f), - new NextAction("food", 4.1f), - nullptr); + return { + NextAction("drink", 4.2f), + NextAction("food", 4.1f), + }; } void GrindingStrategy::InitTriggers(std::vector& triggers) { // reduce lower than loot triggers.push_back( - new TriggerNode("no target", NextAction::array(0, new NextAction("attack anything", 4.0f), nullptr))); + new TriggerNode( + "no target", + { + NextAction("attack anything", 4.0f) + } + ) + ); } void MoveRandomStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("move random", 1.5f), NULL))); -} \ No newline at end of file + triggers.push_back( + new TriggerNode( + "often", + { + NextAction("move random", 1.5f) + } + ) + ); +} diff --git a/src/strategy/generic/GrindingStrategy.h b/src/Ai/Base/Strategy/GrindingStrategy.h similarity index 94% rename from src/strategy/generic/GrindingStrategy.h rename to src/Ai/Base/Strategy/GrindingStrategy.h index 5ce9c4f73b..e093c7a584 100644 --- a/src/strategy/generic/GrindingStrategy.h +++ b/src/Ai/Base/Strategy/GrindingStrategy.h @@ -17,7 +17,7 @@ class GrindingStrategy : public NonCombatStrategy std::string const getName() override { return "grind"; } uint32 GetType() const override { return STRATEGY_TYPE_DPS; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; diff --git a/src/Ai/Base/Strategy/GroupStrategy.cpp b/src/Ai/Base/Strategy/GroupStrategy.cpp new file mode 100644 index 0000000000..1b81faa9ff --- /dev/null +++ b/src/Ai/Base/Strategy/GroupStrategy.cpp @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GroupStrategy.h" + +#include "Playerbots.h" + +void GroupStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("often", { NextAction("invite nearby", 4.0f) })); + triggers.push_back(new TriggerNode("random", { NextAction("invite guild", 4.0f) })); + triggers.push_back(new TriggerNode("random", { NextAction("leave far away", 4.0f) })); + triggers.push_back(new TriggerNode("seldom", { NextAction("reset instances", 1.0f) })); +} diff --git a/src/strategy/generic/GroupStrategy.h b/src/Ai/Base/Strategy/GroupStrategy.h similarity index 100% rename from src/strategy/generic/GroupStrategy.h rename to src/Ai/Base/Strategy/GroupStrategy.h diff --git a/src/strategy/generic/GuardStrategy.cpp b/src/Ai/Base/Strategy/GuardStrategy.cpp similarity index 74% rename from src/strategy/generic/GuardStrategy.cpp rename to src/Ai/Base/Strategy/GuardStrategy.cpp index 68ce2d00d9..9a396ac57f 100644 --- a/src/strategy/generic/GuardStrategy.cpp +++ b/src/Ai/Base/Strategy/GuardStrategy.cpp @@ -7,6 +7,11 @@ #include "Playerbots.h" -NextAction** GuardStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("guard", 4.0f), nullptr); } +std::vector GuardStrategy::getDefaultActions() +{ + return { + NextAction("guard", 4.0f) + }; +} void GuardStrategy::InitTriggers(std::vector& triggers) {} diff --git a/src/strategy/generic/GuardStrategy.h b/src/Ai/Base/Strategy/GuardStrategy.h similarity index 91% rename from src/strategy/generic/GuardStrategy.h rename to src/Ai/Base/Strategy/GuardStrategy.h index c6902cedba..98c6b2a6fe 100644 --- a/src/strategy/generic/GuardStrategy.h +++ b/src/Ai/Base/Strategy/GuardStrategy.h @@ -16,7 +16,7 @@ class GuardStrategy : public NonCombatStrategy GuardStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) {} std::string const getName() override { return "guard"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; diff --git a/src/Ai/Base/Strategy/GuildStrategy.cpp b/src/Ai/Base/Strategy/GuildStrategy.cpp new file mode 100644 index 0000000000..d2594504d5 --- /dev/null +++ b/src/Ai/Base/Strategy/GuildStrategy.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GuildStrategy.h" + +#include "Playerbots.h" + +void GuildStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("often", { NextAction("offer petition nearby", 4.0f) })); + triggers.push_back( + new TriggerNode("often", { NextAction("guild manage nearby", 4.0f) })); + triggers.push_back( + new TriggerNode("petition signed", { NextAction("turn in petition", 10.0f) })); + triggers.push_back( + new TriggerNode("buy tabard", { NextAction("buy tabard", 10.0f) })); + triggers.push_back( + new TriggerNode("leave large guild", { NextAction("guild leave", 4.0f) })); +} diff --git a/src/strategy/generic/GuildStrategy.h b/src/Ai/Base/Strategy/GuildStrategy.h similarity index 100% rename from src/strategy/generic/GuildStrategy.h rename to src/Ai/Base/Strategy/GuildStrategy.h diff --git a/src/strategy/generic/KiteStrategy.cpp b/src/Ai/Base/Strategy/KiteStrategy.cpp similarity index 77% rename from src/strategy/generic/KiteStrategy.cpp rename to src/Ai/Base/Strategy/KiteStrategy.cpp index 011650df83..2d4964460e 100644 --- a/src/strategy/generic/KiteStrategy.cpp +++ b/src/Ai/Base/Strategy/KiteStrategy.cpp @@ -11,5 +11,5 @@ KiteStrategy::KiteStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} void KiteStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("has aggro", NextAction::array(0, new NextAction("runaway", 51.0f), nullptr))); + triggers.push_back(new TriggerNode("has aggro", { NextAction("runaway", 51.0f) })); } diff --git a/src/strategy/generic/KiteStrategy.h b/src/Ai/Base/Strategy/KiteStrategy.h similarity index 100% rename from src/strategy/generic/KiteStrategy.h rename to src/Ai/Base/Strategy/KiteStrategy.h diff --git a/src/strategy/generic/LfgStrategy.cpp b/src/Ai/Base/Strategy/LfgStrategy.cpp similarity index 58% rename from src/strategy/generic/LfgStrategy.cpp rename to src/Ai/Base/Strategy/LfgStrategy.cpp index 1607d8e5c4..b6057881ca 100644 --- a/src/strategy/generic/LfgStrategy.cpp +++ b/src/Ai/Base/Strategy/LfgStrategy.cpp @@ -9,11 +9,11 @@ void LfgStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("lfg join", relevance), nullptr))); + triggers.push_back(new TriggerNode("random", { NextAction("lfg join", relevance) })); triggers.push_back( - new TriggerNode("seldom", NextAction::array(0, new NextAction("lfg leave", relevance), nullptr))); + new TriggerNode("seldom", { NextAction("lfg leave", relevance) })); triggers.push_back(new TriggerNode( - "unknown dungeon", NextAction::array(0, new NextAction("give leader in dungeon", relevance), nullptr))); + "unknown dungeon", { NextAction("give leader in dungeon", relevance) })); } LfgStrategy::LfgStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} diff --git a/src/strategy/generic/LfgStrategy.h b/src/Ai/Base/Strategy/LfgStrategy.h similarity index 100% rename from src/strategy/generic/LfgStrategy.h rename to src/Ai/Base/Strategy/LfgStrategy.h diff --git a/src/Ai/Base/Strategy/LootNonCombatStrategy.cpp b/src/Ai/Base/Strategy/LootNonCombatStrategy.cpp new file mode 100644 index 0000000000..5ecbb6959f --- /dev/null +++ b/src/Ai/Base/Strategy/LootNonCombatStrategy.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "LootNonCombatStrategy.h" + +#include "Playerbots.h" + +void LootNonCombatStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("loot available", { NextAction("loot", 6.0f) })); + triggers.push_back( + new TriggerNode("far from loot target", { NextAction("move to loot", 7.0f) })); + triggers.push_back(new TriggerNode("can loot", { NextAction("open loot", 8.0f) })); + triggers.push_back(new TriggerNode("often", { NextAction("add all loot", 5.0f) })); +} + +void GatherStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("timer", { NextAction("add gathering loot", 5.0f) })); +} + +void RevealStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("often", { NextAction("reveal gathering item", 50.0f) })); +} + +void UseBobberStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("can use fishing bobber", { NextAction("use fishing bobber", 20.0f) })); + triggers.push_back( + new TriggerNode("random", { NextAction("remove bobber strategy", 20.0f) })); +} diff --git a/src/strategy/generic/LootNonCombatStrategy.h b/src/Ai/Base/Strategy/LootNonCombatStrategy.h similarity index 100% rename from src/strategy/generic/LootNonCombatStrategy.h rename to src/Ai/Base/Strategy/LootNonCombatStrategy.h diff --git a/src/Ai/Base/Strategy/MaintenanceStrategy.cpp b/src/Ai/Base/Strategy/MaintenanceStrategy.cpp new file mode 100644 index 0000000000..855555edda --- /dev/null +++ b/src/Ai/Base/Strategy/MaintenanceStrategy.cpp @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "MaintenanceStrategy.h" + +#include "Playerbots.h" + +std::vector MaintenanceStrategy::getDefaultActions() { return {}; } + +void MaintenanceStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("clean quest log", 6.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("use random recipe", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("disenchant random item", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("enchant random item", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("smart destroy item", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "move stuck", + { + NextAction("reset", 1.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("use random quest item", 0.9f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("auto share quest", 0.9f) + } + ) + ); +} diff --git a/src/strategy/generic/MaintenanceStrategy.h b/src/Ai/Base/Strategy/MaintenanceStrategy.h similarity index 92% rename from src/strategy/generic/MaintenanceStrategy.h rename to src/Ai/Base/Strategy/MaintenanceStrategy.h index 5a7025bee8..44bfadd03a 100644 --- a/src/strategy/generic/MaintenanceStrategy.h +++ b/src/Ai/Base/Strategy/MaintenanceStrategy.h @@ -17,7 +17,7 @@ class MaintenanceStrategy : public NonCombatStrategy std::string const getName() override { return "maintenance"; } uint32 GetType() const override { return STRATEGY_TYPE_NONCOMBAT; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; diff --git a/src/strategy/generic/MarkRtiStrategy.cpp b/src/Ai/Base/Strategy/MarkRtiStrategy.cpp similarity index 76% rename from src/strategy/generic/MarkRtiStrategy.cpp rename to src/Ai/Base/Strategy/MarkRtiStrategy.cpp index bf5fb8de9f..8d49c9a8a0 100644 --- a/src/strategy/generic/MarkRtiStrategy.cpp +++ b/src/Ai/Base/Strategy/MarkRtiStrategy.cpp @@ -10,5 +10,5 @@ void MarkRtiStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("no rti target", NextAction::array(0, new NextAction("mark rti", ACTION_NORMAL), nullptr))); + new TriggerNode("no rti target", { NextAction("mark rti", ACTION_NORMAL) })); } diff --git a/src/strategy/generic/MarkRtiStrategy.h b/src/Ai/Base/Strategy/MarkRtiStrategy.h similarity index 100% rename from src/strategy/generic/MarkRtiStrategy.h rename to src/Ai/Base/Strategy/MarkRtiStrategy.h diff --git a/src/strategy/generic/MeleeCombatStrategy.cpp b/src/Ai/Base/Strategy/MeleeCombatStrategy.cpp similarity index 53% rename from src/strategy/generic/MeleeCombatStrategy.cpp rename to src/Ai/Base/Strategy/MeleeCombatStrategy.cpp index de3ba39a0d..bc2d189134 100644 --- a/src/strategy/generic/MeleeCombatStrategy.cpp +++ b/src/Ai/Base/Strategy/MeleeCombatStrategy.cpp @@ -11,12 +11,8 @@ void MeleeCombatStrategy::InitTriggers(std::vector& triggers) { CombatStrategy::InitTriggers(triggers); - // triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", - // ACTION_MOVE + 7), nullptr))); triggers.push_back(new TriggerNode( - "enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), 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))); + "enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) })); } void SetBehindCombatStrategy::InitTriggers(std::vector& triggers) @@ -24,5 +20,5 @@ void SetBehindCombatStrategy::InitTriggers(std::vector& triggers) CombatStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode("not behind target", - NextAction::array(0, new NextAction("set behind", ACTION_MOVE + 7), nullptr))); + { NextAction("set behind", ACTION_MOVE + 7) })); } diff --git a/src/strategy/generic/MeleeCombatStrategy.h b/src/Ai/Base/Strategy/MeleeCombatStrategy.h similarity index 100% rename from src/strategy/generic/MeleeCombatStrategy.h rename to src/Ai/Base/Strategy/MeleeCombatStrategy.h diff --git a/src/strategy/generic/MoveFromGroupStrategy.cpp b/src/Ai/Base/Strategy/MoveFromGroupStrategy.cpp similarity index 76% rename from src/strategy/generic/MoveFromGroupStrategy.cpp rename to src/Ai/Base/Strategy/MoveFromGroupStrategy.cpp index 3ceccce249..247abc88ec 100644 --- a/src/strategy/generic/MoveFromGroupStrategy.cpp +++ b/src/Ai/Base/Strategy/MoveFromGroupStrategy.cpp @@ -7,9 +7,11 @@ #include "PassiveMultiplier.h" #include "Playerbots.h" -NextAction** MoveFromGroupStrategy::getDefaultActions() +std::vector MoveFromGroupStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("move from group", 1.0f), nullptr); + return { + NextAction("move from group", 1.0f) + }; } void MoveFromGroupStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/strategy/generic/MoveFromGroupStrategy.h b/src/Ai/Base/Strategy/MoveFromGroupStrategy.h similarity index 91% rename from src/strategy/generic/MoveFromGroupStrategy.h rename to src/Ai/Base/Strategy/MoveFromGroupStrategy.h index 3fb17f37f9..53aa1c99ac 100644 --- a/src/strategy/generic/MoveFromGroupStrategy.h +++ b/src/Ai/Base/Strategy/MoveFromGroupStrategy.h @@ -16,7 +16,7 @@ class MoveFromGroupStrategy : public Strategy MoveFromGroupStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} std::string const getName() override { return "move from group"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitMultipliers(std::vector& multipliers) override; }; diff --git a/src/Ai/Base/Strategy/NonCombatStrategy.cpp b/src/Ai/Base/Strategy/NonCombatStrategy.cpp new file mode 100644 index 0000000000..6b8f76ac95 --- /dev/null +++ b/src/Ai/Base/Strategy/NonCombatStrategy.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "NonCombatStrategy.h" + +#include "Playerbots.h" + +void NonCombatStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("random", { NextAction("clean quest log", 1.0f) })); + triggers.push_back(new TriggerNode("timer", { NextAction("check mount state", 1.0f) })); +} + +void CollisionStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("collision", { NextAction("move out of collision", 2.0f) })); +} + +void MountStrategy::InitTriggers(std::vector& triggers) +{ +} + +void WorldBuffStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "need world buff", + { + NextAction("world buff", 1.0f) + } + ) + ); +} + +void MasterFishingStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "very often", + { + NextAction("move near water" , 10.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "very often", + { + NextAction("go fishing" , 10.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "random", + { + NextAction("end master fishing", 12.0f), + NextAction("equip upgrades", 6.0f) + } + ) + ); +} diff --git a/src/strategy/generic/NonCombatStrategy.h b/src/Ai/Base/Strategy/NonCombatStrategy.h similarity index 100% rename from src/strategy/generic/NonCombatStrategy.h rename to src/Ai/Base/Strategy/NonCombatStrategy.h diff --git a/src/strategy/generic/PassTroughStrategy.cpp b/src/Ai/Base/Strategy/PassTroughStrategy.cpp similarity index 80% rename from src/strategy/generic/PassTroughStrategy.cpp rename to src/Ai/Base/Strategy/PassTroughStrategy.cpp index e9365bad20..228106df44 100644 --- a/src/strategy/generic/PassTroughStrategy.cpp +++ b/src/Ai/Base/Strategy/PassTroughStrategy.cpp @@ -11,5 +11,5 @@ void PassTroughStrategy::InitTriggers(std::vector& triggers) { for (std::vector::iterator i = supported.begin(); i != supported.end(); i++) triggers.push_back( - new TriggerNode(i->c_str(), NextAction::array(0, new NextAction(i->c_str(), relevance), nullptr))); + new TriggerNode(i->c_str(), { NextAction(i->c_str(), relevance) })); } diff --git a/src/strategy/generic/PassTroughStrategy.h b/src/Ai/Base/Strategy/PassTroughStrategy.h similarity index 100% rename from src/strategy/generic/PassTroughStrategy.h rename to src/Ai/Base/Strategy/PassTroughStrategy.h diff --git a/src/strategy/generic/PassiveStrategy.cpp b/src/Ai/Base/Strategy/PassiveStrategy.cpp similarity index 100% rename from src/strategy/generic/PassiveStrategy.cpp rename to src/Ai/Base/Strategy/PassiveStrategy.cpp diff --git a/src/strategy/generic/PassiveStrategy.h b/src/Ai/Base/Strategy/PassiveStrategy.h similarity index 100% rename from src/strategy/generic/PassiveStrategy.h rename to src/Ai/Base/Strategy/PassiveStrategy.h diff --git a/src/strategy/generic/PullStrategy.cpp b/src/Ai/Base/Strategy/PullStrategy.cpp similarity index 79% rename from src/strategy/generic/PullStrategy.cpp rename to src/Ai/Base/Strategy/PullStrategy.cpp index 70111ef80f..d0c7c9eacb 100644 --- a/src/strategy/generic/PullStrategy.cpp +++ b/src/Ai/Base/Strategy/PullStrategy.cpp @@ -31,10 +31,13 @@ float MagePullMultiplier::GetValue(Action* action) return PassiveMultiplier::GetValue(action); } -NextAction** PullStrategy::getDefaultActions() +std::vector PullStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction(action, 105.0f), new NextAction("follow", 104.0f), - new NextAction("end pull", 103.0f), nullptr); + return { + NextAction(action, 105.0f), + NextAction("follow", 104.0f), + NextAction("end pull", 103.0f), + }; } void PullStrategy::InitTriggers(std::vector& triggers) { CombatStrategy::InitTriggers(triggers); } @@ -50,5 +53,11 @@ void PossibleAddsStrategy::InitTriggers(std::vector& triggers) Strategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("possible adds", NextAction::array(0, new NextAction("flee with pet", 60), nullptr))); + new TriggerNode( + "possible adds", + { + NextAction("flee with pet", 60) + } + ) + ); } diff --git a/src/strategy/generic/PullStrategy.h b/src/Ai/Base/Strategy/PullStrategy.h similarity index 94% rename from src/strategy/generic/PullStrategy.h rename to src/Ai/Base/Strategy/PullStrategy.h index 354760df50..bdd7332f3b 100644 --- a/src/strategy/generic/PullStrategy.h +++ b/src/Ai/Base/Strategy/PullStrategy.h @@ -18,7 +18,7 @@ class PullStrategy : public CombatStrategy void InitTriggers(std::vector& triggers) override; void InitMultipliers(std::vector& multipliers) override; std::string const getName() override { return "pull"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; private: std::string const action; diff --git a/src/strategy/generic/QuestStrategies.cpp b/src/Ai/Base/Strategy/QuestStrategies.cpp similarity index 50% rename from src/strategy/generic/QuestStrategies.cpp rename to src/Ai/Base/Strategy/QuestStrategies.cpp index bdc1e9b71c..adcc4b22b5 100644 --- a/src/strategy/generic/QuestStrategies.cpp +++ b/src/Ai/Base/Strategy/QuestStrategies.cpp @@ -14,7 +14,7 @@ void QuestStrategy::InitTriggers(std::vector& triggers) PassTroughStrategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("quest share", NextAction::array(0, new NextAction("accept quest share", relevance), nullptr))); + new TriggerNode("quest share", { NextAction("accept quest share", relevance) })); } void DefaultQuestStrategy::InitTriggers(std::vector& triggers) @@ -22,11 +22,11 @@ void DefaultQuestStrategy::InitTriggers(std::vector& triggers) QuestStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode( - "use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr))); + "use game object", { NextAction("talk to quest giver", relevance) })); triggers.push_back(new TriggerNode( - "gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr))); + "gossip hello", { NextAction("talk to quest giver", relevance) })); triggers.push_back(new TriggerNode( - "complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), nullptr))); + "complete quest", { NextAction("talk to quest giver", relevance) })); } DefaultQuestStrategy::DefaultQuestStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI) {} @@ -36,14 +36,14 @@ void AcceptAllQuestsStrategy::InitTriggers(std::vector& triggers) QuestStrategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("use game object", NextAction::array(0, new NextAction("talk to quest giver", relevance), - new NextAction("accept all quests", relevance), nullptr))); + new TriggerNode("use game object", { NextAction("talk to quest giver", relevance), + NextAction("accept all quests", relevance) })); triggers.push_back( - new TriggerNode("gossip hello", NextAction::array(0, new NextAction("talk to quest giver", relevance), - new NextAction("accept all quests", relevance), nullptr))); + new TriggerNode("gossip hello", { NextAction("talk to quest giver", relevance), + NextAction("accept all quests", relevance) })); triggers.push_back( - new TriggerNode("complete quest", NextAction::array(0, new NextAction("talk to quest giver", relevance), - new NextAction("accept all quests", relevance), nullptr))); + new TriggerNode("complete quest", { NextAction("talk to quest giver", relevance), + NextAction("accept all quests", relevance) })); } AcceptAllQuestsStrategy::AcceptAllQuestsStrategy(PlayerbotAI* botAI) : QuestStrategy(botAI) {} diff --git a/src/strategy/generic/QuestStrategies.h b/src/Ai/Base/Strategy/QuestStrategies.h similarity index 100% rename from src/strategy/generic/QuestStrategies.h rename to src/Ai/Base/Strategy/QuestStrategies.h diff --git a/src/strategy/generic/RTSCStrategy.cpp b/src/Ai/Base/Strategy/RTSCStrategy.cpp similarity index 100% rename from src/strategy/generic/RTSCStrategy.cpp rename to src/Ai/Base/Strategy/RTSCStrategy.cpp diff --git a/src/strategy/generic/RTSCStrategy.h b/src/Ai/Base/Strategy/RTSCStrategy.h similarity index 100% rename from src/strategy/generic/RTSCStrategy.h rename to src/Ai/Base/Strategy/RTSCStrategy.h diff --git a/src/strategy/generic/RacialsStrategy.cpp b/src/Ai/Base/Strategy/RacialsStrategy.cpp similarity index 54% rename from src/strategy/generic/RacialsStrategy.cpp rename to src/Ai/Base/Strategy/RacialsStrategy.cpp index 53f40ef8c7..f4f270b1b0 100644 --- a/src/strategy/generic/RacialsStrategy.cpp +++ b/src/Ai/Base/Strategy/RacialsStrategy.cpp @@ -16,26 +16,25 @@ class RacialsStrategyActionNodeFactory : public NamedObjectFactory static ActionNode* lifeblood(PlayerbotAI* botAI) { return new ActionNode("lifeblood", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("gift of the naaru"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("gift of the naaru") }, + /*C*/ {}); } }; void RacialsStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("lifeblood", ACTION_NORMAL + 5), nullptr))); + new TriggerNode("low health", { NextAction("lifeblood", ACTION_NORMAL + 5) })); triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("war stomp", ACTION_NORMAL + 5), nullptr))); + new TriggerNode("medium aoe", { NextAction("war stomp", ACTION_NORMAL + 5) })); triggers.push_back(new TriggerNode( - "low mana", NextAction::array(0, new NextAction("arcane torrent", ACTION_NORMAL + 5), nullptr))); + "low mana", { NextAction("arcane torrent", ACTION_NORMAL + 5) })); triggers.push_back(new TriggerNode( - "generic boost", NextAction::array(0, new NextAction("blood fury", ACTION_NORMAL + 5), - new NextAction("berserking", ACTION_NORMAL + 5), - new NextAction("use trinket", ACTION_NORMAL + 4), - nullptr))); + "generic boost", { NextAction("blood fury", ACTION_NORMAL + 5), + NextAction("berserking", ACTION_NORMAL + 5), + NextAction("use trinket", ACTION_NORMAL + 4) })); } diff --git a/src/strategy/generic/RacialsStrategy.h b/src/Ai/Base/Strategy/RacialsStrategy.h similarity index 100% rename from src/strategy/generic/RacialsStrategy.h rename to src/Ai/Base/Strategy/RacialsStrategy.h diff --git a/src/strategy/generic/RangedCombatStrategy.cpp b/src/Ai/Base/Strategy/RangedCombatStrategy.cpp similarity index 64% rename from src/strategy/generic/RangedCombatStrategy.cpp rename to src/Ai/Base/Strategy/RangedCombatStrategy.cpp index ec0f3fb30d..73f26423a2 100644 --- a/src/strategy/generic/RangedCombatStrategy.cpp +++ b/src/Ai/Base/Strategy/RangedCombatStrategy.cpp @@ -12,7 +12,5 @@ void RangedCombatStrategy::InitTriggers(std::vector& triggers) CombatStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode("enemy too close for spell", - NextAction::array(0, new NextAction("flee", ACTION_MOVE + 4), nullptr))); - // triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", - // ACTION_MOVE + 7), nullptr))); + { NextAction("flee", ACTION_MOVE + 4) })); } diff --git a/src/strategy/generic/RangedCombatStrategy.h b/src/Ai/Base/Strategy/RangedCombatStrategy.h similarity index 100% rename from src/strategy/generic/RangedCombatStrategy.h rename to src/Ai/Base/Strategy/RangedCombatStrategy.h diff --git a/src/strategy/generic/RelaxedFollowStrategy.cpp b/src/Ai/Base/Strategy/RelaxedFollowStrategy.cpp similarity index 100% rename from src/strategy/generic/RelaxedFollowStrategy.cpp rename to src/Ai/Base/Strategy/RelaxedFollowStrategy.cpp diff --git a/src/strategy/generic/RelaxedFollowStrategy.h b/src/Ai/Base/Strategy/RelaxedFollowStrategy.h similarity index 100% rename from src/strategy/generic/RelaxedFollowStrategy.h rename to src/Ai/Base/Strategy/RelaxedFollowStrategy.h diff --git a/src/strategy/generic/ReturnStrategy.cpp b/src/Ai/Base/Strategy/ReturnStrategy.cpp similarity index 71% rename from src/strategy/generic/ReturnStrategy.cpp rename to src/Ai/Base/Strategy/ReturnStrategy.cpp index 27fc7670c6..2c88e64fdc 100644 --- a/src/strategy/generic/ReturnStrategy.cpp +++ b/src/Ai/Base/Strategy/ReturnStrategy.cpp @@ -9,6 +9,6 @@ void ReturnStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("return", NextAction::array(0, new NextAction("set return position", 1.5f), - new NextAction("return", 1.0f), nullptr))); + triggers.push_back(new TriggerNode("return", { NextAction("set return position", 1.5f), + NextAction("return", 1.0f), })); } diff --git a/src/strategy/generic/ReturnStrategy.h b/src/Ai/Base/Strategy/ReturnStrategy.h similarity index 100% rename from src/strategy/generic/ReturnStrategy.h rename to src/Ai/Base/Strategy/ReturnStrategy.h diff --git a/src/Ai/Base/Strategy/RpgStrategy.cpp b/src/Ai/Base/Strategy/RpgStrategy.cpp new file mode 100644 index 0000000000..2c0b3544ef --- /dev/null +++ b/src/Ai/Base/Strategy/RpgStrategy.cpp @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "RpgStrategy.h" + +#include "Playerbots.h" +#include "RpgSubActions.h" + +float RpgActionMultiplier::GetValue(Action* action) +{ + if (action == nullptr) + return 1.0f; + + std::string const nextAction = AI_VALUE(std::string, "next rpg action"); + std::string const name = action->getName(); + + if (!nextAction.empty() && dynamic_cast(action) && name != nextAction) + return 0.0f; + + return 1.0f; +} + +RpgStrategy::RpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + +std::vector RpgStrategy::getDefaultActions() +{ + return { + NextAction("rpg", 1.0f) + }; +} + +void RpgStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "no rpg target", + { + NextAction("choose rpg target", 5.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "often", + { + NextAction("move random", 1.10f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "far from rpg target", + { + NextAction("move to rpg target", 5.0f) + } + ) + ); + + // Sub actions + triggers.push_back( + new TriggerNode( + "rpg", + { + NextAction("rpg stay", 1.101f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg", + { + NextAction("rpg work", 1.101f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg", + { + NextAction("rpg emote", 1.101f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "has rpg target", + { + NextAction("rpg cancel", 1.101f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg discover", + { + NextAction("rpg discover", 1.210f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg start quest", + { + NextAction("rpg start quest", 1.180f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg end quest", + { + NextAction("rpg end quest", 1.190f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg buy", + { + NextAction("rpg buy", 1.130f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg repair", + { + NextAction("rpg repair", 1.195f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg heal", + { + NextAction("rpg heal", 1.125f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg home bind", + { + NextAction("rpg home bind", 1.160f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg buy petition", + { + NextAction("rpg buy petition", 1.140f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rpg use", + { + NextAction("rpg use", 1.102f) + } + ) + ); +} + +void RpgStrategy::InitMultipliers(std::vector& multipliers) +{ + multipliers.push_back(new RpgActionMultiplier(botAI)); +} diff --git a/src/strategy/generic/RpgStrategy.h b/src/Ai/Base/Strategy/RpgStrategy.h similarity index 93% rename from src/strategy/generic/RpgStrategy.h rename to src/Ai/Base/Strategy/RpgStrategy.h index f81a5bdff3..cb1db70421 100644 --- a/src/strategy/generic/RpgStrategy.h +++ b/src/Ai/Base/Strategy/RpgStrategy.h @@ -24,7 +24,7 @@ class RpgStrategy : public Strategy RpgStrategy(PlayerbotAI* botAI); std::string const getName() override { return "rpg"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; void InitMultipliers(std::vector& multipliers) override; }; diff --git a/src/strategy/generic/RunawayStrategy.cpp b/src/Ai/Base/Strategy/RunawayStrategy.cpp similarity index 75% rename from src/strategy/generic/RunawayStrategy.cpp rename to src/Ai/Base/Strategy/RunawayStrategy.cpp index ae9cf12914..28868a48e8 100644 --- a/src/strategy/generic/RunawayStrategy.cpp +++ b/src/Ai/Base/Strategy/RunawayStrategy.cpp @@ -10,5 +10,5 @@ void RunawayStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("runaway", 50.0f), nullptr))); + new TriggerNode("enemy too close for spell", { NextAction("runaway", 50.0f) })); } diff --git a/src/strategy/generic/RunawayStrategy.h b/src/Ai/Base/Strategy/RunawayStrategy.h similarity index 100% rename from src/strategy/generic/RunawayStrategy.h rename to src/Ai/Base/Strategy/RunawayStrategy.h diff --git a/src/Ai/Base/Strategy/SayStrategy.cpp b/src/Ai/Base/Strategy/SayStrategy.cpp new file mode 100644 index 0000000000..71a72b79f8 --- /dev/null +++ b/src/Ai/Base/Strategy/SayStrategy.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "SayStrategy.h" + +#include "Playerbots.h" + +void SayStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("critical health", + { NextAction("say::critical health", 99.0f) })); + triggers.push_back( + new TriggerNode("low health", { NextAction("say::low health", 99.0f) })); + triggers.push_back( + new TriggerNode("low mana", { NextAction("say::low mana", 99.0f) })); + triggers.push_back(new TriggerNode("tank aoe", { NextAction("say::taunt", 99.0f) })); + triggers.push_back(new TriggerNode("medium aoe", { NextAction("say::aoe", 99.0f) })); +} diff --git a/src/strategy/generic/SayStrategy.h b/src/Ai/Base/Strategy/SayStrategy.h similarity index 100% rename from src/strategy/generic/SayStrategy.h rename to src/Ai/Base/Strategy/SayStrategy.h diff --git a/src/Ai/Base/Strategy/StayStrategy.cpp b/src/Ai/Base/Strategy/StayStrategy.cpp new file mode 100644 index 0000000000..a59f9461a5 --- /dev/null +++ b/src/Ai/Base/Strategy/StayStrategy.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "StayStrategy.h" + +#include "Playerbots.h" + +void StayStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "return to stay position", + { + NextAction("return to stay position", ACTION_MOVE) + } + ) + ); +} + +std::vector StayStrategy::getDefaultActions() +{ + return { + NextAction("stay", 1.0f) + }; +} + +void SitStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "sit", + { + NextAction("sit", 1.5f) + } + ) + ); +} diff --git a/src/strategy/generic/StayStrategy.h b/src/Ai/Base/Strategy/StayStrategy.h similarity index 93% rename from src/strategy/generic/StayStrategy.h rename to src/Ai/Base/Strategy/StayStrategy.h index 9028551645..0ee1c7d1c3 100644 --- a/src/strategy/generic/StayStrategy.h +++ b/src/Ai/Base/Strategy/StayStrategy.h @@ -17,7 +17,7 @@ class StayStrategy : public Strategy std::string const getName() override { return "stay"; } void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; class SitStrategy : public NonCombatStrategy diff --git a/src/strategy/generic/TankAssistStrategy.cpp b/src/Ai/Base/Strategy/TankAssistStrategy.cpp similarity index 77% rename from src/strategy/generic/TankAssistStrategy.cpp rename to src/Ai/Base/Strategy/TankAssistStrategy.cpp index 60106d43ca..4d4aae1a81 100644 --- a/src/strategy/generic/TankAssistStrategy.cpp +++ b/src/Ai/Base/Strategy/TankAssistStrategy.cpp @@ -10,5 +10,5 @@ void TankAssistStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("tank assist", NextAction::array(0, new NextAction("tank assist", 50.0f), nullptr))); + new TriggerNode("tank assist", { NextAction("tank assist", 50.0f) })); } diff --git a/src/strategy/generic/TankAssistStrategy.h b/src/Ai/Base/Strategy/TankAssistStrategy.h similarity index 100% rename from src/strategy/generic/TankAssistStrategy.h rename to src/Ai/Base/Strategy/TankAssistStrategy.h diff --git a/src/strategy/generic/TellTargetStrategy.cpp b/src/Ai/Base/Strategy/TellTargetStrategy.cpp similarity index 77% rename from src/strategy/generic/TellTargetStrategy.cpp rename to src/Ai/Base/Strategy/TellTargetStrategy.cpp index 4410dcbf41..c4c387f4fd 100644 --- a/src/strategy/generic/TellTargetStrategy.cpp +++ b/src/Ai/Base/Strategy/TellTargetStrategy.cpp @@ -10,5 +10,5 @@ void TellTargetStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( - new TriggerNode("target changed", NextAction::array(0, new NextAction("tell target", 51.0f), nullptr))); + new TriggerNode("target changed", { NextAction("tell target", 51.0f) })); } diff --git a/src/strategy/generic/TellTargetStrategy.h b/src/Ai/Base/Strategy/TellTargetStrategy.h similarity index 100% rename from src/strategy/generic/TellTargetStrategy.h rename to src/Ai/Base/Strategy/TellTargetStrategy.h diff --git a/src/strategy/generic/ThreatStrategy.cpp b/src/Ai/Base/Strategy/ThreatStrategy.cpp similarity index 100% rename from src/strategy/generic/ThreatStrategy.cpp rename to src/Ai/Base/Strategy/ThreatStrategy.cpp diff --git a/src/strategy/generic/ThreatStrategy.h b/src/Ai/Base/Strategy/ThreatStrategy.h similarity index 100% rename from src/strategy/generic/ThreatStrategy.h rename to src/Ai/Base/Strategy/ThreatStrategy.h diff --git a/src/Ai/Base/Strategy/TravelStrategy.cpp b/src/Ai/Base/Strategy/TravelStrategy.cpp new file mode 100644 index 0000000000..3b5c77ff3c --- /dev/null +++ b/src/Ai/Base/Strategy/TravelStrategy.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "TravelStrategy.h" + +#include "Playerbots.h" + +TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + +std::vector TravelStrategy::getDefaultActions() +{ + return { + NextAction("travel", 1.0f) + }; +} + +void TravelStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "no travel target", + { + NextAction("choose travel target", 6.f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "far from travel target", + { + NextAction("move to travel target", 1) + } + ) + ); +} diff --git a/src/strategy/generic/TravelStrategy.h b/src/Ai/Base/Strategy/TravelStrategy.h similarity index 94% rename from src/strategy/generic/TravelStrategy.h rename to src/Ai/Base/Strategy/TravelStrategy.h index bc5afc0d79..c0b0bd2d1e 100644 --- a/src/strategy/generic/TravelStrategy.h +++ b/src/Ai/Base/Strategy/TravelStrategy.h @@ -17,7 +17,7 @@ class TravelStrategy : public Strategy std::string const getName() override { return "travel"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; }; diff --git a/src/strategy/generic/UseFoodStrategy.cpp b/src/Ai/Base/Strategy/UseFoodStrategy.cpp similarity index 50% rename from src/strategy/generic/UseFoodStrategy.cpp rename to src/Ai/Base/Strategy/UseFoodStrategy.cpp index f945dad70d..939d655ff3 100644 --- a/src/strategy/generic/UseFoodStrategy.cpp +++ b/src/Ai/Base/Strategy/UseFoodStrategy.cpp @@ -13,12 +13,12 @@ void UseFoodStrategy::InitTriggers(std::vector& triggers) Strategy::InitTriggers(triggers); if (botAI->HasCheat(BotCheatMask::food)) { - triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("food", 3.0f), nullptr))); - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr))); + triggers.push_back(new TriggerNode("medium health", { NextAction("food", 3.0f) })); + triggers.push_back(new TriggerNode("high mana", { NextAction("drink", 3.0f) })); } else { - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", 3.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("drink", 3.0f), nullptr))); + triggers.push_back(new TriggerNode("low health", { NextAction("food", 3.0f) })); + triggers.push_back(new TriggerNode("low mana", { NextAction("drink", 3.0f) })); } } diff --git a/src/strategy/generic/UseFoodStrategy.h b/src/Ai/Base/Strategy/UseFoodStrategy.h similarity index 100% rename from src/strategy/generic/UseFoodStrategy.h rename to src/Ai/Base/Strategy/UseFoodStrategy.h diff --git a/src/strategy/generic/UsePotionsStrategy.cpp b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp similarity index 68% rename from src/strategy/generic/UsePotionsStrategy.cpp rename to src/Ai/Base/Strategy/UsePotionsStrategy.cpp index dc4bc9ad69..b0e0049269 100644 --- a/src/strategy/generic/UsePotionsStrategy.cpp +++ b/src/Ai/Base/Strategy/UsePotionsStrategy.cpp @@ -16,9 +16,9 @@ class UsePotionsStrategyActionNodeFactory : public NamedObjectFactory& triggers) Strategy::InitTriggers(triggers); triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("healthstone", ACTION_MEDIUM_HEAL + 1), nullptr))); + "critical health", { NextAction("healthstone", ACTION_MEDIUM_HEAL + 1) })); triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("mana potion", ACTION_EMERGENCY), nullptr))); + new TriggerNode("low mana", { NextAction("mana potion", ACTION_EMERGENCY) })); } diff --git a/src/strategy/generic/UsePotionsStrategy.h b/src/Ai/Base/Strategy/UsePotionsStrategy.h similarity index 100% rename from src/strategy/generic/UsePotionsStrategy.h rename to src/Ai/Base/Strategy/UsePotionsStrategy.h diff --git a/src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp b/src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp new file mode 100644 index 0000000000..cb37d27179 --- /dev/null +++ b/src/Ai/Base/Strategy/WorldPacketHandlerStrategy.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "WorldPacketHandlerStrategy.h" + +void WorldPacketHandlerStrategy::InitTriggers(std::vector& triggers) +{ + PassTroughStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode("group invite", { NextAction("accept invitation", relevance) })); + triggers.push_back( + new TriggerNode("uninvite", { NextAction("uninvite", relevance) })); + triggers.push_back( + new TriggerNode("uninvite guid", { NextAction("uninvite", relevance) })); + triggers.push_back( + new TriggerNode("group set leader", { /*NextAction("leader", relevance),*/ })); + triggers.push_back(new TriggerNode( + "not enough money", { NextAction("tell not enough money", relevance) })); + triggers.push_back( + new TriggerNode("not enough reputation", + { NextAction("tell not enough reputation", relevance) })); + triggers.push_back( + new TriggerNode("cannot equip", { NextAction("tell cannot equip", relevance) })); + triggers.push_back( + new TriggerNode("use game object", { NextAction("add loot", relevance), + NextAction("use meeting stone", relevance) })); + triggers.push_back( + new TriggerNode("gossip hello", { NextAction("trainer", relevance) })); + triggers.push_back(new TriggerNode("activate taxi", { NextAction("remember taxi", relevance), + NextAction("taxi", relevance) })); + triggers.push_back(new TriggerNode("taxi done", { NextAction("taxi", relevance) })); + triggers.push_back(new TriggerNode("trade status", { NextAction("accept trade", relevance), NextAction("equip upgrades", relevance) })); + triggers.push_back(new TriggerNode("trade status extended", { NextAction("trade status extended", relevance) })); + triggers.push_back(new TriggerNode("area trigger", { NextAction("reach area trigger", relevance) })); + triggers.push_back(new TriggerNode("within area trigger", { NextAction("area trigger", relevance) })); + triggers.push_back(new TriggerNode("loot response", { NextAction("store loot", relevance) })); + triggers.push_back(new TriggerNode("item push result", { NextAction("unlock items", relevance), + NextAction("open items", relevance), + NextAction("query item usage", relevance), + NextAction("equip upgrades", relevance) })); + triggers.push_back(new TriggerNode("item push result", { NextAction("quest item push result", relevance) })); + triggers.push_back(new TriggerNode("ready check finished", { NextAction("finish ready check", relevance) })); + // triggers.push_back(new TriggerNode("often", { NextAction("security check", relevance), NextAction("check mail", relevance) })); + triggers.push_back(new TriggerNode("guild invite", { NextAction("guild accept", relevance) })); + triggers.push_back(new TriggerNode("petition offer", { NextAction("petition sign", relevance) })); + triggers.push_back(new TriggerNode("lfg proposal", { NextAction("lfg accept", relevance) })); + triggers.push_back(new TriggerNode("lfg proposal active", { NextAction("lfg accept", relevance) })); + triggers.push_back(new TriggerNode("arena team invite", { NextAction("arena team accept", relevance) })); + //triggers.push_back(new TriggerNode("no non bot players around", { NextAction("delay", relevance) })); + triggers.push_back(new TriggerNode("bg status", { NextAction("bg status", relevance) })); + triggers.push_back(new TriggerNode("xpgain", { NextAction("xp gain", relevance) })); + triggers.push_back( + new TriggerNode("levelup", { NextAction("auto maintenance on levelup", relevance + 3) })); + // triggers.push_back(new TriggerNode("group destroyed", { NextAction("reset botAI", + // relevance) })); + triggers.push_back(new TriggerNode("group list", { NextAction("reset botAI", relevance) })); + triggers.push_back(new TriggerNode("see spell", { NextAction("see spell", relevance) })); + triggers.push_back(new TriggerNode("release spirit", { NextAction("release", relevance) })); + triggers.push_back(new TriggerNode("revive from corpse", { NextAction("revive from corpse", relevance) })); + triggers.push_back(new TriggerNode("master loot roll", { NextAction("master loot roll", relevance) })); + + // quest ? + //triggers.push_back(new TriggerNode("quest confirm", { NextAction("quest confirm", relevance) })); + triggers.push_back(new TriggerNode("questgiver quest details", { NextAction("turn in query quest", relevance) })); + + // loot roll + triggers.push_back(new TriggerNode("very often", { NextAction("loot roll", relevance) })); +} + +WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) +{ + supported.push_back("loot roll"); + supported.push_back("check mount state"); + supported.push_back("party command"); + supported.push_back("ready check"); + supported.push_back("uninvite"); + supported.push_back("lfg role check"); + supported.push_back("lfg teleport"); + supported.push_back("random bot update"); + supported.push_back("inventory change failure"); + supported.push_back("bg status"); + + // quests + supported.push_back("quest update add kill"); + // supported.push_back("quest update add item"); + supported.push_back("quest update failed"); + supported.push_back("quest update failed timer"); + supported.push_back("quest update complete"); + supported.push_back("confirm quest"); +} + +void ReadyCheckStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("timer", { NextAction("ready check", relevance) })); +} diff --git a/src/strategy/generic/WorldPacketHandlerStrategy.h b/src/Ai/Base/Strategy/WorldPacketHandlerStrategy.h similarity index 100% rename from src/strategy/generic/WorldPacketHandlerStrategy.h rename to src/Ai/Base/Strategy/WorldPacketHandlerStrategy.h diff --git a/src/strategy/StrategyContext.h b/src/Ai/Base/StrategyContext.h similarity index 100% rename from src/strategy/StrategyContext.h rename to src/Ai/Base/StrategyContext.h diff --git a/src/strategy/triggers/BossAuraTriggers.cpp b/src/Ai/Base/Trigger/BossAuraTriggers.cpp similarity index 100% rename from src/strategy/triggers/BossAuraTriggers.cpp rename to src/Ai/Base/Trigger/BossAuraTriggers.cpp diff --git a/src/strategy/triggers/BossAuraTriggers.h b/src/Ai/Base/Trigger/BossAuraTriggers.h similarity index 100% rename from src/strategy/triggers/BossAuraTriggers.h rename to src/Ai/Base/Trigger/BossAuraTriggers.h diff --git a/src/strategy/triggers/ChatCommandTrigger.cpp b/src/Ai/Base/Trigger/ChatCommandTrigger.cpp similarity index 100% rename from src/strategy/triggers/ChatCommandTrigger.cpp rename to src/Ai/Base/Trigger/ChatCommandTrigger.cpp diff --git a/src/strategy/triggers/ChatCommandTrigger.h b/src/Ai/Base/Trigger/ChatCommandTrigger.h similarity index 100% rename from src/strategy/triggers/ChatCommandTrigger.h rename to src/Ai/Base/Trigger/ChatCommandTrigger.h diff --git a/src/strategy/triggers/CureTriggers.cpp b/src/Ai/Base/Trigger/CureTriggers.cpp similarity index 100% rename from src/strategy/triggers/CureTriggers.cpp rename to src/Ai/Base/Trigger/CureTriggers.cpp diff --git a/src/strategy/triggers/CureTriggers.h b/src/Ai/Base/Trigger/CureTriggers.h similarity index 100% rename from src/strategy/triggers/CureTriggers.h rename to src/Ai/Base/Trigger/CureTriggers.h diff --git a/src/strategy/triggers/FishingTriggers.cpp b/src/Ai/Base/Trigger/FishingTriggers.cpp similarity index 100% rename from src/strategy/triggers/FishingTriggers.cpp rename to src/Ai/Base/Trigger/FishingTriggers.cpp diff --git a/src/strategy/triggers/FishingTriggers.h b/src/Ai/Base/Trigger/FishingTriggers.h similarity index 100% rename from src/strategy/triggers/FishingTriggers.h rename to src/Ai/Base/Trigger/FishingTriggers.h diff --git a/src/strategy/triggers/GenericTriggers.cpp b/src/Ai/Base/Trigger/GenericTriggers.cpp similarity index 100% rename from src/strategy/triggers/GenericTriggers.cpp rename to src/Ai/Base/Trigger/GenericTriggers.cpp diff --git a/src/strategy/triggers/GenericTriggers.h b/src/Ai/Base/Trigger/GenericTriggers.h similarity index 100% rename from src/strategy/triggers/GenericTriggers.h rename to src/Ai/Base/Trigger/GenericTriggers.h diff --git a/src/strategy/triggers/GuildTriggers.cpp b/src/Ai/Base/Trigger/GuildTriggers.cpp similarity index 100% rename from src/strategy/triggers/GuildTriggers.cpp rename to src/Ai/Base/Trigger/GuildTriggers.cpp diff --git a/src/strategy/triggers/GuildTriggers.h b/src/Ai/Base/Trigger/GuildTriggers.h similarity index 100% rename from src/strategy/triggers/GuildTriggers.h rename to src/Ai/Base/Trigger/GuildTriggers.h diff --git a/src/strategy/triggers/HealthTriggers.cpp b/src/Ai/Base/Trigger/HealthTriggers.cpp similarity index 100% rename from src/strategy/triggers/HealthTriggers.cpp rename to src/Ai/Base/Trigger/HealthTriggers.cpp diff --git a/src/strategy/triggers/HealthTriggers.h b/src/Ai/Base/Trigger/HealthTriggers.h similarity index 100% rename from src/strategy/triggers/HealthTriggers.h rename to src/Ai/Base/Trigger/HealthTriggers.h diff --git a/src/strategy/triggers/LfgTriggers.cpp b/src/Ai/Base/Trigger/LfgTriggers.cpp similarity index 100% rename from src/strategy/triggers/LfgTriggers.cpp rename to src/Ai/Base/Trigger/LfgTriggers.cpp diff --git a/src/strategy/triggers/LfgTriggers.h b/src/Ai/Base/Trigger/LfgTriggers.h similarity index 100% rename from src/strategy/triggers/LfgTriggers.h rename to src/Ai/Base/Trigger/LfgTriggers.h diff --git a/src/strategy/triggers/LootTriggers.cpp b/src/Ai/Base/Trigger/LootTriggers.cpp similarity index 100% rename from src/strategy/triggers/LootTriggers.cpp rename to src/Ai/Base/Trigger/LootTriggers.cpp diff --git a/src/strategy/triggers/LootTriggers.h b/src/Ai/Base/Trigger/LootTriggers.h similarity index 100% rename from src/strategy/triggers/LootTriggers.h rename to src/Ai/Base/Trigger/LootTriggers.h diff --git a/src/strategy/triggers/PvpTriggers.cpp b/src/Ai/Base/Trigger/PvpTriggers.cpp similarity index 100% rename from src/strategy/triggers/PvpTriggers.cpp rename to src/Ai/Base/Trigger/PvpTriggers.cpp diff --git a/src/strategy/triggers/PvpTriggers.h b/src/Ai/Base/Trigger/PvpTriggers.h similarity index 100% rename from src/strategy/triggers/PvpTriggers.h rename to src/Ai/Base/Trigger/PvpTriggers.h diff --git a/src/strategy/triggers/RangeTriggers.cpp b/src/Ai/Base/Trigger/RangeTriggers.cpp similarity index 100% rename from src/strategy/triggers/RangeTriggers.cpp rename to src/Ai/Base/Trigger/RangeTriggers.cpp diff --git a/src/strategy/triggers/RangeTriggers.h b/src/Ai/Base/Trigger/RangeTriggers.h similarity index 100% rename from src/strategy/triggers/RangeTriggers.h rename to src/Ai/Base/Trigger/RangeTriggers.h diff --git a/src/strategy/triggers/RpgTriggers.cpp b/src/Ai/Base/Trigger/RpgTriggers.cpp similarity index 82% rename from src/strategy/triggers/RpgTriggers.cpp rename to src/Ai/Base/Trigger/RpgTriggers.cpp index 90a43679ce..f390359be3 100644 --- a/src/strategy/triggers/RpgTriggers.cpp +++ b/src/Ai/Base/Trigger/RpgTriggers.cpp @@ -163,43 +163,18 @@ bool RpgRepairTrigger::IsActive() bool RpgTrainTrigger::IsTrainerOf(CreatureTemplate const* cInfo, Player* pPlayer) { - switch (cInfo->trainer_type) + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(cInfo->Entry); + + if (trainer->GetTrainerType() == Trainer::Type::Mount && trainer->GetTrainerRequirement() != pPlayer->getRace()) { - case TRAINER_TYPE_CLASS: - if (pPlayer->getClass() != cInfo->trainer_class) - { - return false; - } - break; - case TRAINER_TYPE_PETS: - if (pPlayer->getClass() != CLASS_HUNTER) - { - return false; - } - break; - case TRAINER_TYPE_MOUNTS: - if (cInfo->trainer_race && pPlayer->getRace() != cInfo->trainer_race) - { - // Allowed to train if exalted - if (FactionTemplateEntry const* faction_template = sFactionTemplateStore.LookupEntry(cInfo->faction)) - { - if (pPlayer->GetReputationRank(faction_template->faction) == REP_EXALTED) - return true; - } - return false; - } - break; - case TRAINER_TYPE_TRADESKILLS: - if (cInfo->trainer_spell && !pPlayer->HasSpell(cInfo->trainer_spell)) - { - return false; - } - break; - default: - return false; // checked and error output at creature_template loading + if (FactionTemplateEntry const* faction_template = sFactionTemplateStore.LookupEntry(cInfo->faction)) + if (pPlayer->GetReputationRank(faction_template->faction) == REP_EXALTED) + return true; + + return false; } - return true; + return trainer->IsTrainerValidForPlayer(pPlayer); } bool RpgTrainTrigger::IsActive() @@ -214,37 +189,17 @@ bool RpgTrainTrigger::IsActive() if (!IsTrainerOf(cInfo, bot)) return false; - // check present spell in trainer spell list - TrainerSpellData const* cSpells = sObjectMgr->GetNpcTrainerSpells(guidP.GetEntry()); - if (!cSpells) - { - return false; - } - + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(cInfo->Entry); FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction); float fDiscountMod = bot->GetReputationPriceDiscount(factionTemplate); - TrainerSpellMap trainer_spells; - if (cSpells) - trainer_spells.insert(cSpells->spellList.begin(), cSpells->spellList.end()); - - for (TrainerSpellMap::const_iterator itr = trainer_spells.begin(); itr != trainer_spells.end(); ++itr) + for (auto& spell : trainer->GetSpells()) { - TrainerSpell const* tSpell = &itr->second; - - if (!tSpell) - continue; - - TrainerSpellState state = bot->GetTrainerSpellState(tSpell); - if (state != TRAINER_SPELL_GREEN) + if (!trainer->CanTeachSpell(bot, trainer->GetSpell(spell.SpellId))) continue; - uint32 spellId = tSpell->spell; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo) - continue; + uint32 cost = uint32(floor(spell.MoneyCost * fDiscountMod)); - uint32 cost = uint32(floor(tSpell->spellCost * fDiscountMod)); if (cost > AI_VALUE2(uint32, "free money for", (uint32)NeedMoneyFor::spells)) continue; diff --git a/src/strategy/triggers/RpgTriggers.h b/src/Ai/Base/Trigger/RpgTriggers.h similarity index 100% rename from src/strategy/triggers/RpgTriggers.h rename to src/Ai/Base/Trigger/RpgTriggers.h diff --git a/src/strategy/triggers/RtiTriggers.cpp b/src/Ai/Base/Trigger/RtiTriggers.cpp similarity index 100% rename from src/strategy/triggers/RtiTriggers.cpp rename to src/Ai/Base/Trigger/RtiTriggers.cpp diff --git a/src/strategy/triggers/RtiTriggers.h b/src/Ai/Base/Trigger/RtiTriggers.h similarity index 100% rename from src/strategy/triggers/RtiTriggers.h rename to src/Ai/Base/Trigger/RtiTriggers.h diff --git a/src/strategy/triggers/StuckTriggers.cpp b/src/Ai/Base/Trigger/StuckTriggers.cpp similarity index 100% rename from src/strategy/triggers/StuckTriggers.cpp rename to src/Ai/Base/Trigger/StuckTriggers.cpp diff --git a/src/strategy/triggers/StuckTriggers.h b/src/Ai/Base/Trigger/StuckTriggers.h similarity index 100% rename from src/strategy/triggers/StuckTriggers.h rename to src/Ai/Base/Trigger/StuckTriggers.h diff --git a/src/strategy/triggers/TravelTriggers.cpp b/src/Ai/Base/Trigger/TravelTriggers.cpp similarity index 100% rename from src/strategy/triggers/TravelTriggers.cpp rename to src/Ai/Base/Trigger/TravelTriggers.cpp diff --git a/src/strategy/triggers/TravelTriggers.h b/src/Ai/Base/Trigger/TravelTriggers.h similarity index 100% rename from src/strategy/triggers/TravelTriggers.h rename to src/Ai/Base/Trigger/TravelTriggers.h diff --git a/src/strategy/triggers/WithinAreaTrigger.cpp b/src/Ai/Base/Trigger/WithinAreaTrigger.cpp similarity index 100% rename from src/strategy/triggers/WithinAreaTrigger.cpp rename to src/Ai/Base/Trigger/WithinAreaTrigger.cpp diff --git a/src/strategy/triggers/WithinAreaTrigger.h b/src/Ai/Base/Trigger/WithinAreaTrigger.h similarity index 100% rename from src/strategy/triggers/WithinAreaTrigger.h rename to src/Ai/Base/Trigger/WithinAreaTrigger.h diff --git a/src/strategy/triggers/WorldPacketTrigger.cpp b/src/Ai/Base/Trigger/WorldPacketTrigger.cpp similarity index 100% rename from src/strategy/triggers/WorldPacketTrigger.cpp rename to src/Ai/Base/Trigger/WorldPacketTrigger.cpp diff --git a/src/strategy/triggers/WorldPacketTrigger.h b/src/Ai/Base/Trigger/WorldPacketTrigger.h similarity index 100% rename from src/strategy/triggers/WorldPacketTrigger.h rename to src/Ai/Base/Trigger/WorldPacketTrigger.h diff --git a/src/strategy/triggers/TriggerContext.h b/src/Ai/Base/TriggerContext.h similarity index 100% rename from src/strategy/triggers/TriggerContext.h rename to src/Ai/Base/TriggerContext.h diff --git a/src/strategy/values/ActiveSpellValue.cpp b/src/Ai/Base/Value/ActiveSpellValue.cpp similarity index 100% rename from src/strategy/values/ActiveSpellValue.cpp rename to src/Ai/Base/Value/ActiveSpellValue.cpp diff --git a/src/strategy/values/ActiveSpellValue.h b/src/Ai/Base/Value/ActiveSpellValue.h similarity index 100% rename from src/strategy/values/ActiveSpellValue.h rename to src/Ai/Base/Value/ActiveSpellValue.h diff --git a/src/strategy/values/AlwaysLootListValue.cpp b/src/Ai/Base/Value/AlwaysLootListValue.cpp similarity index 100% rename from src/strategy/values/AlwaysLootListValue.cpp rename to src/Ai/Base/Value/AlwaysLootListValue.cpp diff --git a/src/strategy/values/AlwaysLootListValue.h b/src/Ai/Base/Value/AlwaysLootListValue.h similarity index 100% rename from src/strategy/values/AlwaysLootListValue.h rename to src/Ai/Base/Value/AlwaysLootListValue.h diff --git a/src/strategy/values/AoeHealValues.cpp b/src/Ai/Base/Value/AoeHealValues.cpp similarity index 100% rename from src/strategy/values/AoeHealValues.cpp rename to src/Ai/Base/Value/AoeHealValues.cpp diff --git a/src/strategy/values/AoeHealValues.h b/src/Ai/Base/Value/AoeHealValues.h similarity index 100% rename from src/strategy/values/AoeHealValues.h rename to src/Ai/Base/Value/AoeHealValues.h diff --git a/src/strategy/values/AoeValues.cpp b/src/Ai/Base/Value/AoeValues.cpp similarity index 100% rename from src/strategy/values/AoeValues.cpp rename to src/Ai/Base/Value/AoeValues.cpp diff --git a/src/strategy/values/AoeValues.h b/src/Ai/Base/Value/AoeValues.h similarity index 100% rename from src/strategy/values/AoeValues.h rename to src/Ai/Base/Value/AoeValues.h diff --git a/src/strategy/values/Arrow.cpp b/src/Ai/Base/Value/Arrow.cpp similarity index 100% rename from src/strategy/values/Arrow.cpp rename to src/Ai/Base/Value/Arrow.cpp diff --git a/src/strategy/values/Arrow.h b/src/Ai/Base/Value/Arrow.h similarity index 100% rename from src/strategy/values/Arrow.h rename to src/Ai/Base/Value/Arrow.h diff --git a/src/strategy/values/AttackerCountValues.cpp b/src/Ai/Base/Value/AttackerCountValues.cpp similarity index 100% rename from src/strategy/values/AttackerCountValues.cpp rename to src/Ai/Base/Value/AttackerCountValues.cpp diff --git a/src/strategy/values/AttackerCountValues.h b/src/Ai/Base/Value/AttackerCountValues.h similarity index 100% rename from src/strategy/values/AttackerCountValues.h rename to src/Ai/Base/Value/AttackerCountValues.h diff --git a/src/strategy/values/AttackerWithoutAuraTargetValue.cpp b/src/Ai/Base/Value/AttackerWithoutAuraTargetValue.cpp similarity index 100% rename from src/strategy/values/AttackerWithoutAuraTargetValue.cpp rename to src/Ai/Base/Value/AttackerWithoutAuraTargetValue.cpp diff --git a/src/strategy/values/AttackerWithoutAuraTargetValue.h b/src/Ai/Base/Value/AttackerWithoutAuraTargetValue.h similarity index 100% rename from src/strategy/values/AttackerWithoutAuraTargetValue.h rename to src/Ai/Base/Value/AttackerWithoutAuraTargetValue.h diff --git a/src/strategy/values/AttackersValue.cpp b/src/Ai/Base/Value/AttackersValue.cpp similarity index 99% rename from src/strategy/values/AttackersValue.cpp rename to src/Ai/Base/Value/AttackersValue.cpp index 3c9685895a..f6da0aa7a6 100644 --- a/src/strategy/values/AttackersValue.cpp +++ b/src/Ai/Base/Value/AttackersValue.cpp @@ -258,6 +258,9 @@ bool PossibleAddsValue::Calculate() if (Unit* add = botAI->GetUnit(guid)) { + if (!add->IsInWorld() || add->IsDuringRemoveFromWorld()) + continue; + if (!add->GetTarget() && !add->GetThreatMgr().getCurrentVictim() && add->IsHostileTo(bot)) { for (ObjectGuid const attackerGUID : attackers) diff --git a/src/strategy/values/AttackersValue.h b/src/Ai/Base/Value/AttackersValue.h similarity index 100% rename from src/strategy/values/AttackersValue.h rename to src/Ai/Base/Value/AttackersValue.h diff --git a/src/strategy/values/AvailableLootValue.cpp b/src/Ai/Base/Value/AvailableLootValue.cpp similarity index 100% rename from src/strategy/values/AvailableLootValue.cpp rename to src/Ai/Base/Value/AvailableLootValue.cpp diff --git a/src/strategy/values/AvailableLootValue.h b/src/Ai/Base/Value/AvailableLootValue.h similarity index 100% rename from src/strategy/values/AvailableLootValue.h rename to src/Ai/Base/Value/AvailableLootValue.h diff --git a/src/strategy/values/BudgetValues.cpp b/src/Ai/Base/Value/BudgetValues.cpp similarity index 87% rename from src/strategy/values/BudgetValues.cpp rename to src/Ai/Base/Value/BudgetValues.cpp index 6ef51f5fdb..daa7aca863 100644 --- a/src/strategy/values/BudgetValues.cpp +++ b/src/Ai/Base/Value/BudgetValues.cpp @@ -102,35 +102,24 @@ uint32 TrainCostValue::Calculate() { for (CreatureTemplateContainer::const_iterator itr = creatures->begin(); itr != creatures->end(); ++itr) { - if (itr->second.trainer_type != TRAINER_TYPE_CLASS && itr->second.trainer_type != TRAINER_TYPE_TRADESKILLS) - continue; + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(itr->first); - if (itr->second.trainer_type == TRAINER_TYPE_CLASS && itr->second.trainer_class != bot->getClass()) + if (!trainer) continue; - TrainerSpellData const* trainer_spells = sObjectMgr->GetNpcTrainerSpells(itr->first); - if (!trainer_spells) + if (trainer->GetTrainerType() != Trainer::Type::Class || !trainer->IsTrainerValidForPlayer(bot)) continue; - for (TrainerSpellMap::const_iterator iter = trainer_spells->spellList.begin(); - iter != trainer_spells->spellList.end(); ++iter) + for (auto& spell : trainer->GetSpells()) { - TrainerSpell const* tSpell = &iter->second; - if (!tSpell) - continue; - - TrainerSpellState state = bot->GetTrainerSpellState(tSpell); - if (state != TRAINER_SPELL_GREEN) - continue; - - if (itr->second.trainer_type == TRAINER_TYPE_TRADESKILLS) + if (!trainer->CanTeachSpell(bot, trainer->GetSpell(spell.SpellId))) continue; - if (spells.find(tSpell->spell) != spells.end()) + if (spells.find(spell.SpellId) != spells.end()) continue; - TotalCost += tSpell->spellCost; - spells.insert(tSpell->spell); + TotalCost += spell.MoneyCost; + spells.insert(spell.SpellId); } } } diff --git a/src/strategy/values/BudgetValues.h b/src/Ai/Base/Value/BudgetValues.h similarity index 100% rename from src/strategy/values/BudgetValues.h rename to src/Ai/Base/Value/BudgetValues.h diff --git a/src/strategy/values/CcTargetValue.cpp b/src/Ai/Base/Value/CcTargetValue.cpp similarity index 100% rename from src/strategy/values/CcTargetValue.cpp rename to src/Ai/Base/Value/CcTargetValue.cpp diff --git a/src/strategy/values/CcTargetValue.h b/src/Ai/Base/Value/CcTargetValue.h similarity index 100% rename from src/strategy/values/CcTargetValue.h rename to src/Ai/Base/Value/CcTargetValue.h diff --git a/src/strategy/values/ChatValue.h b/src/Ai/Base/Value/ChatValue.h similarity index 100% rename from src/strategy/values/ChatValue.h rename to src/Ai/Base/Value/ChatValue.h diff --git a/src/strategy/values/CollisionValue.cpp b/src/Ai/Base/Value/CollisionValue.cpp similarity index 100% rename from src/strategy/values/CollisionValue.cpp rename to src/Ai/Base/Value/CollisionValue.cpp diff --git a/src/strategy/values/CollisionValue.h b/src/Ai/Base/Value/CollisionValue.h similarity index 100% rename from src/strategy/values/CollisionValue.h rename to src/Ai/Base/Value/CollisionValue.h diff --git a/src/strategy/values/CraftValue.h b/src/Ai/Base/Value/CraftValue.h similarity index 100% rename from src/strategy/values/CraftValue.h rename to src/Ai/Base/Value/CraftValue.h diff --git a/src/strategy/values/CurrentCcTargetValue.cpp b/src/Ai/Base/Value/CurrentCcTargetValue.cpp similarity index 100% rename from src/strategy/values/CurrentCcTargetValue.cpp rename to src/Ai/Base/Value/CurrentCcTargetValue.cpp diff --git a/src/strategy/values/CurrentCcTargetValue.h b/src/Ai/Base/Value/CurrentCcTargetValue.h similarity index 100% rename from src/strategy/values/CurrentCcTargetValue.h rename to src/Ai/Base/Value/CurrentCcTargetValue.h diff --git a/src/strategy/values/CurrentTargetValue.cpp b/src/Ai/Base/Value/CurrentTargetValue.cpp similarity index 100% rename from src/strategy/values/CurrentTargetValue.cpp rename to src/Ai/Base/Value/CurrentTargetValue.cpp diff --git a/src/strategy/values/CurrentTargetValue.h b/src/Ai/Base/Value/CurrentTargetValue.h similarity index 100% rename from src/strategy/values/CurrentTargetValue.h rename to src/Ai/Base/Value/CurrentTargetValue.h diff --git a/src/strategy/values/DistanceValue.cpp b/src/Ai/Base/Value/DistanceValue.cpp similarity index 100% rename from src/strategy/values/DistanceValue.cpp rename to src/Ai/Base/Value/DistanceValue.cpp diff --git a/src/strategy/values/DistanceValue.h b/src/Ai/Base/Value/DistanceValue.h similarity index 100% rename from src/strategy/values/DistanceValue.h rename to src/Ai/Base/Value/DistanceValue.h diff --git a/src/strategy/values/DpsTargetValue.cpp b/src/Ai/Base/Value/DpsTargetValue.cpp similarity index 100% rename from src/strategy/values/DpsTargetValue.cpp rename to src/Ai/Base/Value/DpsTargetValue.cpp diff --git a/src/strategy/values/DpsTargetValue.h b/src/Ai/Base/Value/DpsTargetValue.h similarity index 100% rename from src/strategy/values/DpsTargetValue.h rename to src/Ai/Base/Value/DpsTargetValue.h diff --git a/src/strategy/values/DuelTargetValue.cpp b/src/Ai/Base/Value/DuelTargetValue.cpp similarity index 100% rename from src/strategy/values/DuelTargetValue.cpp rename to src/Ai/Base/Value/DuelTargetValue.cpp diff --git a/src/strategy/values/DuelTargetValue.h b/src/Ai/Base/Value/DuelTargetValue.h similarity index 100% rename from src/strategy/values/DuelTargetValue.h rename to src/Ai/Base/Value/DuelTargetValue.h diff --git a/src/strategy/values/EnemyHealerTargetValue.cpp b/src/Ai/Base/Value/EnemyHealerTargetValue.cpp similarity index 100% rename from src/strategy/values/EnemyHealerTargetValue.cpp rename to src/Ai/Base/Value/EnemyHealerTargetValue.cpp diff --git a/src/strategy/values/EnemyHealerTargetValue.h b/src/Ai/Base/Value/EnemyHealerTargetValue.h similarity index 100% rename from src/strategy/values/EnemyHealerTargetValue.h rename to src/Ai/Base/Value/EnemyHealerTargetValue.h diff --git a/src/strategy/values/EnemyPlayerValue.cpp b/src/Ai/Base/Value/EnemyPlayerValue.cpp similarity index 100% rename from src/strategy/values/EnemyPlayerValue.cpp rename to src/Ai/Base/Value/EnemyPlayerValue.cpp diff --git a/src/strategy/values/EnemyPlayerValue.h b/src/Ai/Base/Value/EnemyPlayerValue.h similarity index 100% rename from src/strategy/values/EnemyPlayerValue.h rename to src/Ai/Base/Value/EnemyPlayerValue.h diff --git a/src/strategy/values/EstimatedLifetimeValue.cpp b/src/Ai/Base/Value/EstimatedLifetimeValue.cpp similarity index 100% rename from src/strategy/values/EstimatedLifetimeValue.cpp rename to src/Ai/Base/Value/EstimatedLifetimeValue.cpp diff --git a/src/strategy/values/EstimatedLifetimeValue.h b/src/Ai/Base/Value/EstimatedLifetimeValue.h similarity index 100% rename from src/strategy/values/EstimatedLifetimeValue.h rename to src/Ai/Base/Value/EstimatedLifetimeValue.h diff --git a/src/strategy/values/FishValues.cpp b/src/Ai/Base/Value/FishValues.cpp similarity index 100% rename from src/strategy/values/FishValues.cpp rename to src/Ai/Base/Value/FishValues.cpp diff --git a/src/strategy/values/FishValues.h b/src/Ai/Base/Value/FishValues.h similarity index 100% rename from src/strategy/values/FishValues.h rename to src/Ai/Base/Value/FishValues.h diff --git a/src/strategy/values/Formations.cpp b/src/Ai/Base/Value/Formations.cpp similarity index 100% rename from src/strategy/values/Formations.cpp rename to src/Ai/Base/Value/Formations.cpp diff --git a/src/strategy/values/Formations.h b/src/Ai/Base/Value/Formations.h similarity index 100% rename from src/strategy/values/Formations.h rename to src/Ai/Base/Value/Formations.h diff --git a/src/strategy/values/GrindTargetValue.cpp b/src/Ai/Base/Value/GrindTargetValue.cpp similarity index 98% rename from src/strategy/values/GrindTargetValue.cpp rename to src/Ai/Base/Value/GrindTargetValue.cpp index d1d7f912ca..7e6168c776 100644 --- a/src/strategy/values/GrindTargetValue.cpp +++ b/src/Ai/Base/Value/GrindTargetValue.cpp @@ -59,26 +59,22 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount) for (ObjectGuid const guid : targets) { Unit* unit = botAI->GetUnit(guid); - if (!unit) continue; + if (!unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) + continue; + auto& rep = bot->ToPlayer()->GetReputationMgr(); if (unit->ToCreature() && !unit->ToCreature()->GetCreatureTemplate()->lootid && bot->GetReactionTo(unit) >= REP_NEUTRAL) - { continue; - } if (!bot->IsHostileTo(unit) && unit->GetNpcFlags() != UNIT_NPC_FLAG_NONE) - { continue; - } if (!bot->isHonorOrXPTarget(unit)) - { continue; - } if (abs(bot->GetPositionZ() - unit->GetPositionZ()) > INTERACTION_DISTANCE) continue; diff --git a/src/strategy/values/GrindTargetValue.h b/src/Ai/Base/Value/GrindTargetValue.h similarity index 100% rename from src/strategy/values/GrindTargetValue.h rename to src/Ai/Base/Value/GrindTargetValue.h diff --git a/src/strategy/values/GroupLeaderValue.cpp b/src/Ai/Base/Value/GroupLeaderValue.cpp similarity index 100% rename from src/strategy/values/GroupLeaderValue.cpp rename to src/Ai/Base/Value/GroupLeaderValue.cpp diff --git a/src/strategy/values/GroupLeaderValue.h b/src/Ai/Base/Value/GroupLeaderValue.h similarity index 100% rename from src/strategy/values/GroupLeaderValue.h rename to src/Ai/Base/Value/GroupLeaderValue.h diff --git a/src/strategy/values/GroupValues.cpp b/src/Ai/Base/Value/GroupValues.cpp similarity index 100% rename from src/strategy/values/GroupValues.cpp rename to src/Ai/Base/Value/GroupValues.cpp diff --git a/src/strategy/values/GroupValues.h b/src/Ai/Base/Value/GroupValues.h similarity index 100% rename from src/strategy/values/GroupValues.h rename to src/Ai/Base/Value/GroupValues.h diff --git a/src/strategy/values/GuildValues.cpp b/src/Ai/Base/Value/GuildValues.cpp similarity index 100% rename from src/strategy/values/GuildValues.cpp rename to src/Ai/Base/Value/GuildValues.cpp diff --git a/src/strategy/values/GuildValues.h b/src/Ai/Base/Value/GuildValues.h similarity index 100% rename from src/strategy/values/GuildValues.h rename to src/Ai/Base/Value/GuildValues.h diff --git a/src/strategy/values/HasAvailableLootValue.cpp b/src/Ai/Base/Value/HasAvailableLootValue.cpp similarity index 100% rename from src/strategy/values/HasAvailableLootValue.cpp rename to src/Ai/Base/Value/HasAvailableLootValue.cpp diff --git a/src/strategy/values/HasAvailableLootValue.h b/src/Ai/Base/Value/HasAvailableLootValue.h similarity index 100% rename from src/strategy/values/HasAvailableLootValue.h rename to src/Ai/Base/Value/HasAvailableLootValue.h diff --git a/src/strategy/values/HasTotemValue.cpp b/src/Ai/Base/Value/HasTotemValue.cpp similarity index 100% rename from src/strategy/values/HasTotemValue.cpp rename to src/Ai/Base/Value/HasTotemValue.cpp diff --git a/src/strategy/values/HasTotemValue.h b/src/Ai/Base/Value/HasTotemValue.h similarity index 100% rename from src/strategy/values/HasTotemValue.h rename to src/Ai/Base/Value/HasTotemValue.h diff --git a/src/strategy/values/InvalidTargetValue.cpp b/src/Ai/Base/Value/InvalidTargetValue.cpp similarity index 100% rename from src/strategy/values/InvalidTargetValue.cpp rename to src/Ai/Base/Value/InvalidTargetValue.cpp diff --git a/src/strategy/values/InvalidTargetValue.h b/src/Ai/Base/Value/InvalidTargetValue.h similarity index 100% rename from src/strategy/values/InvalidTargetValue.h rename to src/Ai/Base/Value/InvalidTargetValue.h diff --git a/src/strategy/values/IsBehindValue.cpp b/src/Ai/Base/Value/IsBehindValue.cpp similarity index 100% rename from src/strategy/values/IsBehindValue.cpp rename to src/Ai/Base/Value/IsBehindValue.cpp diff --git a/src/strategy/values/IsBehindValue.h b/src/Ai/Base/Value/IsBehindValue.h similarity index 100% rename from src/strategy/values/IsBehindValue.h rename to src/Ai/Base/Value/IsBehindValue.h diff --git a/src/strategy/values/IsFacingValue.cpp b/src/Ai/Base/Value/IsFacingValue.cpp similarity index 100% rename from src/strategy/values/IsFacingValue.cpp rename to src/Ai/Base/Value/IsFacingValue.cpp diff --git a/src/strategy/values/IsFacingValue.h b/src/Ai/Base/Value/IsFacingValue.h similarity index 100% rename from src/strategy/values/IsFacingValue.h rename to src/Ai/Base/Value/IsFacingValue.h diff --git a/src/strategy/values/IsMovingValue.cpp b/src/Ai/Base/Value/IsMovingValue.cpp similarity index 100% rename from src/strategy/values/IsMovingValue.cpp rename to src/Ai/Base/Value/IsMovingValue.cpp diff --git a/src/strategy/values/IsMovingValue.h b/src/Ai/Base/Value/IsMovingValue.h similarity index 100% rename from src/strategy/values/IsMovingValue.h rename to src/Ai/Base/Value/IsMovingValue.h diff --git a/src/strategy/values/ItemCountValue.cpp b/src/Ai/Base/Value/ItemCountValue.cpp similarity index 100% rename from src/strategy/values/ItemCountValue.cpp rename to src/Ai/Base/Value/ItemCountValue.cpp diff --git a/src/strategy/values/ItemCountValue.h b/src/Ai/Base/Value/ItemCountValue.h similarity index 100% rename from src/strategy/values/ItemCountValue.h rename to src/Ai/Base/Value/ItemCountValue.h diff --git a/src/strategy/values/ItemForSpellValue.cpp b/src/Ai/Base/Value/ItemForSpellValue.cpp similarity index 100% rename from src/strategy/values/ItemForSpellValue.cpp rename to src/Ai/Base/Value/ItemForSpellValue.cpp diff --git a/src/strategy/values/ItemForSpellValue.h b/src/Ai/Base/Value/ItemForSpellValue.h similarity index 100% rename from src/strategy/values/ItemForSpellValue.h rename to src/Ai/Base/Value/ItemForSpellValue.h diff --git a/src/strategy/values/ItemUsageValue.cpp b/src/Ai/Base/Value/ItemUsageValue.cpp similarity index 100% rename from src/strategy/values/ItemUsageValue.cpp rename to src/Ai/Base/Value/ItemUsageValue.cpp diff --git a/src/strategy/values/ItemUsageValue.h b/src/Ai/Base/Value/ItemUsageValue.h similarity index 100% rename from src/strategy/values/ItemUsageValue.h rename to src/Ai/Base/Value/ItemUsageValue.h diff --git a/src/strategy/values/LastMovementValue.cpp b/src/Ai/Base/Value/LastMovementValue.cpp similarity index 100% rename from src/strategy/values/LastMovementValue.cpp rename to src/Ai/Base/Value/LastMovementValue.cpp diff --git a/src/strategy/values/LastMovementValue.h b/src/Ai/Base/Value/LastMovementValue.h similarity index 100% rename from src/strategy/values/LastMovementValue.h rename to src/Ai/Base/Value/LastMovementValue.h diff --git a/src/strategy/values/LastSaidValue.h b/src/Ai/Base/Value/LastSaidValue.h similarity index 100% rename from src/strategy/values/LastSaidValue.h rename to src/Ai/Base/Value/LastSaidValue.h diff --git a/src/strategy/values/LastSpellCastTimeValue.h b/src/Ai/Base/Value/LastSpellCastTimeValue.h similarity index 100% rename from src/strategy/values/LastSpellCastTimeValue.h rename to src/Ai/Base/Value/LastSpellCastTimeValue.h diff --git a/src/strategy/values/LastSpellCastValue.cpp b/src/Ai/Base/Value/LastSpellCastValue.cpp similarity index 100% rename from src/strategy/values/LastSpellCastValue.cpp rename to src/Ai/Base/Value/LastSpellCastValue.cpp diff --git a/src/strategy/values/LastSpellCastValue.h b/src/Ai/Base/Value/LastSpellCastValue.h similarity index 100% rename from src/strategy/values/LastSpellCastValue.h rename to src/Ai/Base/Value/LastSpellCastValue.h diff --git a/src/strategy/values/LeastHpTargetValue.cpp b/src/Ai/Base/Value/LeastHpTargetValue.cpp similarity index 100% rename from src/strategy/values/LeastHpTargetValue.cpp rename to src/Ai/Base/Value/LeastHpTargetValue.cpp diff --git a/src/strategy/values/LeastHpTargetValue.h b/src/Ai/Base/Value/LeastHpTargetValue.h similarity index 100% rename from src/strategy/values/LeastHpTargetValue.h rename to src/Ai/Base/Value/LeastHpTargetValue.h diff --git a/src/strategy/values/LfgValues.h b/src/Ai/Base/Value/LfgValues.h similarity index 100% rename from src/strategy/values/LfgValues.h rename to src/Ai/Base/Value/LfgValues.h diff --git a/src/strategy/values/LineTargetValue.cpp b/src/Ai/Base/Value/LineTargetValue.cpp similarity index 100% rename from src/strategy/values/LineTargetValue.cpp rename to src/Ai/Base/Value/LineTargetValue.cpp diff --git a/src/strategy/values/LineTargetValue.h b/src/Ai/Base/Value/LineTargetValue.h similarity index 100% rename from src/strategy/values/LineTargetValue.h rename to src/Ai/Base/Value/LineTargetValue.h diff --git a/src/strategy/values/LogLevelValue.h b/src/Ai/Base/Value/LogLevelValue.h similarity index 100% rename from src/strategy/values/LogLevelValue.h rename to src/Ai/Base/Value/LogLevelValue.h diff --git a/src/strategy/values/LootStrategyValue.cpp b/src/Ai/Base/Value/LootStrategyValue.cpp similarity index 100% rename from src/strategy/values/LootStrategyValue.cpp rename to src/Ai/Base/Value/LootStrategyValue.cpp diff --git a/src/strategy/values/LootStrategyValue.h b/src/Ai/Base/Value/LootStrategyValue.h similarity index 100% rename from src/strategy/values/LootStrategyValue.h rename to src/Ai/Base/Value/LootStrategyValue.h diff --git a/src/strategy/values/LootValues.cpp b/src/Ai/Base/Value/LootValues.cpp similarity index 100% rename from src/strategy/values/LootValues.cpp rename to src/Ai/Base/Value/LootValues.cpp diff --git a/src/strategy/values/LootValues.h b/src/Ai/Base/Value/LootValues.h similarity index 100% rename from src/strategy/values/LootValues.h rename to src/Ai/Base/Value/LootValues.h diff --git a/src/strategy/values/MaintenanceValues.cpp b/src/Ai/Base/Value/MaintenanceValues.cpp similarity index 100% rename from src/strategy/values/MaintenanceValues.cpp rename to src/Ai/Base/Value/MaintenanceValues.cpp diff --git a/src/strategy/values/MaintenanceValues.h b/src/Ai/Base/Value/MaintenanceValues.h similarity index 100% rename from src/strategy/values/MaintenanceValues.h rename to src/Ai/Base/Value/MaintenanceValues.h diff --git a/src/strategy/values/ManaSaveLevelValue.h b/src/Ai/Base/Value/ManaSaveLevelValue.h similarity index 100% rename from src/strategy/values/ManaSaveLevelValue.h rename to src/Ai/Base/Value/ManaSaveLevelValue.h diff --git a/src/strategy/values/NearestAdsValue.cpp b/src/Ai/Base/Value/NearestAdsValue.cpp similarity index 100% rename from src/strategy/values/NearestAdsValue.cpp rename to src/Ai/Base/Value/NearestAdsValue.cpp diff --git a/src/strategy/values/NearestAdsValue.h b/src/Ai/Base/Value/NearestAdsValue.h similarity index 100% rename from src/strategy/values/NearestAdsValue.h rename to src/Ai/Base/Value/NearestAdsValue.h diff --git a/src/strategy/values/NearestCorpsesValue.cpp b/src/Ai/Base/Value/NearestCorpsesValue.cpp similarity index 100% rename from src/strategy/values/NearestCorpsesValue.cpp rename to src/Ai/Base/Value/NearestCorpsesValue.cpp diff --git a/src/strategy/values/NearestCorpsesValue.h b/src/Ai/Base/Value/NearestCorpsesValue.h similarity index 100% rename from src/strategy/values/NearestCorpsesValue.h rename to src/Ai/Base/Value/NearestCorpsesValue.h diff --git a/src/strategy/values/NearestFriendlyPlayersValue.cpp b/src/Ai/Base/Value/NearestFriendlyPlayersValue.cpp similarity index 100% rename from src/strategy/values/NearestFriendlyPlayersValue.cpp rename to src/Ai/Base/Value/NearestFriendlyPlayersValue.cpp diff --git a/src/strategy/values/NearestFriendlyPlayersValue.h b/src/Ai/Base/Value/NearestFriendlyPlayersValue.h similarity index 100% rename from src/strategy/values/NearestFriendlyPlayersValue.h rename to src/Ai/Base/Value/NearestFriendlyPlayersValue.h diff --git a/src/strategy/values/NearestGameObjects.cpp b/src/Ai/Base/Value/NearestGameObjects.cpp similarity index 100% rename from src/strategy/values/NearestGameObjects.cpp rename to src/Ai/Base/Value/NearestGameObjects.cpp diff --git a/src/strategy/values/NearestGameObjects.h b/src/Ai/Base/Value/NearestGameObjects.h similarity index 100% rename from src/strategy/values/NearestGameObjects.h rename to src/Ai/Base/Value/NearestGameObjects.h diff --git a/src/strategy/values/NearestNonBotPlayersValue.cpp b/src/Ai/Base/Value/NearestNonBotPlayersValue.cpp similarity index 100% rename from src/strategy/values/NearestNonBotPlayersValue.cpp rename to src/Ai/Base/Value/NearestNonBotPlayersValue.cpp diff --git a/src/strategy/values/NearestNonBotPlayersValue.h b/src/Ai/Base/Value/NearestNonBotPlayersValue.h similarity index 100% rename from src/strategy/values/NearestNonBotPlayersValue.h rename to src/Ai/Base/Value/NearestNonBotPlayersValue.h diff --git a/src/strategy/values/NearestNpcsValue.cpp b/src/Ai/Base/Value/NearestNpcsValue.cpp similarity index 90% rename from src/strategy/values/NearestNpcsValue.cpp rename to src/Ai/Base/Value/NearestNpcsValue.cpp index 1c188d2980..a32c007f10 100644 --- a/src/strategy/values/NearestNpcsValue.cpp +++ b/src/Ai/Base/Value/NearestNpcsValue.cpp @@ -27,7 +27,16 @@ void NearestHostileNpcsValue::FindUnits(std::list& targets) Cell::VisitObjects(bot, searcher, range); } -bool NearestHostileNpcsValue::AcceptUnit(Unit* unit) { return unit->IsHostileTo(bot) && !unit->IsPlayer(); } +bool NearestHostileNpcsValue::AcceptUnit(Unit* unit) +{ + if (!unit || !unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) + return false; + + if (unit->IsPlayer()) + return false; + + return unit->IsHostileTo(bot); +} void NearestVehiclesValue::FindUnits(std::list& targets) { diff --git a/src/strategy/values/NearestNpcsValue.h b/src/Ai/Base/Value/NearestNpcsValue.h similarity index 100% rename from src/strategy/values/NearestNpcsValue.h rename to src/Ai/Base/Value/NearestNpcsValue.h diff --git a/src/strategy/values/NearestUnitsValue.cpp b/src/Ai/Base/Value/NearestUnitsValue.cpp similarity index 100% rename from src/strategy/values/NearestUnitsValue.cpp rename to src/Ai/Base/Value/NearestUnitsValue.cpp diff --git a/src/strategy/values/NearestUnitsValue.h b/src/Ai/Base/Value/NearestUnitsValue.h similarity index 100% rename from src/strategy/values/NearestUnitsValue.h rename to src/Ai/Base/Value/NearestUnitsValue.h diff --git a/src/strategy/values/NewPlayerNearbyValue.cpp b/src/Ai/Base/Value/NewPlayerNearbyValue.cpp similarity index 100% rename from src/strategy/values/NewPlayerNearbyValue.cpp rename to src/Ai/Base/Value/NewPlayerNearbyValue.cpp diff --git a/src/strategy/values/NewPlayerNearbyValue.h b/src/Ai/Base/Value/NewPlayerNearbyValue.h similarity index 100% rename from src/strategy/values/NewPlayerNearbyValue.h rename to src/Ai/Base/Value/NewPlayerNearbyValue.h diff --git a/src/strategy/values/OutfitListValue.cpp b/src/Ai/Base/Value/OutfitListValue.cpp similarity index 100% rename from src/strategy/values/OutfitListValue.cpp rename to src/Ai/Base/Value/OutfitListValue.cpp diff --git a/src/strategy/values/OutfitListValue.h b/src/Ai/Base/Value/OutfitListValue.h similarity index 100% rename from src/strategy/values/OutfitListValue.h rename to src/Ai/Base/Value/OutfitListValue.h diff --git a/src/strategy/values/PartyMemberToDispel.cpp b/src/Ai/Base/Value/PartyMemberToDispel.cpp similarity index 100% rename from src/strategy/values/PartyMemberToDispel.cpp rename to src/Ai/Base/Value/PartyMemberToDispel.cpp diff --git a/src/strategy/values/PartyMemberToDispel.h b/src/Ai/Base/Value/PartyMemberToDispel.h similarity index 100% rename from src/strategy/values/PartyMemberToDispel.h rename to src/Ai/Base/Value/PartyMemberToDispel.h diff --git a/src/strategy/values/PartyMemberToHeal.cpp b/src/Ai/Base/Value/PartyMemberToHeal.cpp similarity index 100% rename from src/strategy/values/PartyMemberToHeal.cpp rename to src/Ai/Base/Value/PartyMemberToHeal.cpp diff --git a/src/strategy/values/PartyMemberToHeal.h b/src/Ai/Base/Value/PartyMemberToHeal.h similarity index 100% rename from src/strategy/values/PartyMemberToHeal.h rename to src/Ai/Base/Value/PartyMemberToHeal.h diff --git a/src/strategy/values/PartyMemberToResurrect.cpp b/src/Ai/Base/Value/PartyMemberToResurrect.cpp similarity index 100% rename from src/strategy/values/PartyMemberToResurrect.cpp rename to src/Ai/Base/Value/PartyMemberToResurrect.cpp diff --git a/src/strategy/values/PartyMemberToResurrect.h b/src/Ai/Base/Value/PartyMemberToResurrect.h similarity index 100% rename from src/strategy/values/PartyMemberToResurrect.h rename to src/Ai/Base/Value/PartyMemberToResurrect.h diff --git a/src/strategy/values/PartyMemberValue.cpp b/src/Ai/Base/Value/PartyMemberValue.cpp similarity index 100% rename from src/strategy/values/PartyMemberValue.cpp rename to src/Ai/Base/Value/PartyMemberValue.cpp diff --git a/src/strategy/values/PartyMemberValue.h b/src/Ai/Base/Value/PartyMemberValue.h similarity index 100% rename from src/strategy/values/PartyMemberValue.h rename to src/Ai/Base/Value/PartyMemberValue.h diff --git a/src/strategy/values/PartyMemberWithoutAuraValue.cpp b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp similarity index 100% rename from src/strategy/values/PartyMemberWithoutAuraValue.cpp rename to src/Ai/Base/Value/PartyMemberWithoutAuraValue.cpp diff --git a/src/strategy/values/PartyMemberWithoutAuraValue.h b/src/Ai/Base/Value/PartyMemberWithoutAuraValue.h similarity index 100% rename from src/strategy/values/PartyMemberWithoutAuraValue.h rename to src/Ai/Base/Value/PartyMemberWithoutAuraValue.h diff --git a/src/strategy/values/PartyMemberWithoutItemValue.cpp b/src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp similarity index 100% rename from src/strategy/values/PartyMemberWithoutItemValue.cpp rename to src/Ai/Base/Value/PartyMemberWithoutItemValue.cpp diff --git a/src/strategy/values/PartyMemberWithoutItemValue.h b/src/Ai/Base/Value/PartyMemberWithoutItemValue.h similarity index 100% rename from src/strategy/values/PartyMemberWithoutItemValue.h rename to src/Ai/Base/Value/PartyMemberWithoutItemValue.h diff --git a/src/strategy/values/PetTargetValue.cpp b/src/Ai/Base/Value/PetTargetValue.cpp similarity index 100% rename from src/strategy/values/PetTargetValue.cpp rename to src/Ai/Base/Value/PetTargetValue.cpp diff --git a/src/strategy/values/PetTargetValue.h b/src/Ai/Base/Value/PetTargetValue.h similarity index 100% rename from src/strategy/values/PetTargetValue.h rename to src/Ai/Base/Value/PetTargetValue.h diff --git a/src/strategy/values/PositionValue.cpp b/src/Ai/Base/Value/PositionValue.cpp similarity index 100% rename from src/strategy/values/PositionValue.cpp rename to src/Ai/Base/Value/PositionValue.cpp diff --git a/src/strategy/values/PositionValue.h b/src/Ai/Base/Value/PositionValue.h similarity index 100% rename from src/strategy/values/PositionValue.h rename to src/Ai/Base/Value/PositionValue.h diff --git a/src/strategy/values/PossibleRpgTargetsValue.cpp b/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp similarity index 95% rename from src/strategy/values/PossibleRpgTargetsValue.cpp rename to src/Ai/Base/Value/PossibleRpgTargetsValue.cpp index 6e78f37f9a..e9b79debf8 100644 --- a/src/strategy/values/PossibleRpgTargetsValue.cpp +++ b/src/Ai/Base/Value/PossibleRpgTargetsValue.cpp @@ -54,6 +54,9 @@ void PossibleRpgTargetsValue::FindUnits(std::list& targets) bool PossibleRpgTargetsValue::AcceptUnit(Unit* unit) { + if (!unit || !unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) + return false; + if (unit->IsHostileTo(bot) || unit->IsPlayer()) return false; @@ -70,7 +73,8 @@ bool PossibleRpgTargetsValue::AcceptUnit(Unit* unit) } TravelTarget* travelTarget = context->GetValue("travel target")->Get(); - if (travelTarget->getDestination() && travelTarget->getDestination()->getEntry() == unit->GetEntry()) + if (travelTarget && travelTarget->getDestination() && + travelTarget->getDestination()->getEntry() == unit->GetEntry()) return true; if (urand(1, 100) < 25 && unit->IsFriendlyTo(bot)) @@ -145,6 +149,9 @@ void PossibleNewRpgTargetsValue::FindUnits(std::list& targets) bool PossibleNewRpgTargetsValue::AcceptUnit(Unit* unit) { + if (!unit || !unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) + return false; + if (unit->IsHostileTo(bot) || unit->IsPlayer()) return false; diff --git a/src/strategy/values/PossibleRpgTargetsValue.h b/src/Ai/Base/Value/PossibleRpgTargetsValue.h similarity index 100% rename from src/strategy/values/PossibleRpgTargetsValue.h rename to src/Ai/Base/Value/PossibleRpgTargetsValue.h diff --git a/src/strategy/values/PossibleTargetsValue.cpp b/src/Ai/Base/Value/PossibleTargetsValue.cpp similarity index 100% rename from src/strategy/values/PossibleTargetsValue.cpp rename to src/Ai/Base/Value/PossibleTargetsValue.cpp diff --git a/src/strategy/values/PossibleTargetsValue.h b/src/Ai/Base/Value/PossibleTargetsValue.h similarity index 100% rename from src/strategy/values/PossibleTargetsValue.h rename to src/Ai/Base/Value/PossibleTargetsValue.h diff --git a/src/strategy/values/PvpValues.cpp b/src/Ai/Base/Value/PvpValues.cpp similarity index 100% rename from src/strategy/values/PvpValues.cpp rename to src/Ai/Base/Value/PvpValues.cpp diff --git a/src/strategy/values/PvpValues.h b/src/Ai/Base/Value/PvpValues.h similarity index 100% rename from src/strategy/values/PvpValues.h rename to src/Ai/Base/Value/PvpValues.h diff --git a/src/strategy/values/QuestValues.cpp b/src/Ai/Base/Value/QuestValues.cpp similarity index 100% rename from src/strategy/values/QuestValues.cpp rename to src/Ai/Base/Value/QuestValues.cpp diff --git a/src/strategy/values/QuestValues.h b/src/Ai/Base/Value/QuestValues.h similarity index 100% rename from src/strategy/values/QuestValues.h rename to src/Ai/Base/Value/QuestValues.h diff --git a/src/strategy/values/RTSCValues.cpp b/src/Ai/Base/Value/RTSCValues.cpp similarity index 100% rename from src/strategy/values/RTSCValues.cpp rename to src/Ai/Base/Value/RTSCValues.cpp diff --git a/src/strategy/values/RTSCValues.h b/src/Ai/Base/Value/RTSCValues.h similarity index 100% rename from src/strategy/values/RTSCValues.h rename to src/Ai/Base/Value/RTSCValues.h diff --git a/src/strategy/values/RandomBotUpdateValue.h b/src/Ai/Base/Value/RandomBotUpdateValue.h similarity index 100% rename from src/strategy/values/RandomBotUpdateValue.h rename to src/Ai/Base/Value/RandomBotUpdateValue.h diff --git a/src/strategy/values/RangeValues.cpp b/src/Ai/Base/Value/RangeValues.cpp similarity index 100% rename from src/strategy/values/RangeValues.cpp rename to src/Ai/Base/Value/RangeValues.cpp diff --git a/src/strategy/values/RangeValues.h b/src/Ai/Base/Value/RangeValues.h similarity index 100% rename from src/strategy/values/RangeValues.h rename to src/Ai/Base/Value/RangeValues.h diff --git a/src/strategy/values/RtiTargetValue.cpp b/src/Ai/Base/Value/RtiTargetValue.cpp similarity index 100% rename from src/strategy/values/RtiTargetValue.cpp rename to src/Ai/Base/Value/RtiTargetValue.cpp diff --git a/src/strategy/values/RtiTargetValue.h b/src/Ai/Base/Value/RtiTargetValue.h similarity index 100% rename from src/strategy/values/RtiTargetValue.h rename to src/Ai/Base/Value/RtiTargetValue.h diff --git a/src/strategy/values/RtiValue.cpp b/src/Ai/Base/Value/RtiValue.cpp similarity index 100% rename from src/strategy/values/RtiValue.cpp rename to src/Ai/Base/Value/RtiValue.cpp diff --git a/src/strategy/values/RtiValue.h b/src/Ai/Base/Value/RtiValue.h similarity index 100% rename from src/strategy/values/RtiValue.h rename to src/Ai/Base/Value/RtiValue.h diff --git a/src/strategy/values/SelfTargetValue.cpp b/src/Ai/Base/Value/SelfTargetValue.cpp similarity index 100% rename from src/strategy/values/SelfTargetValue.cpp rename to src/Ai/Base/Value/SelfTargetValue.cpp diff --git a/src/strategy/values/SelfTargetValue.h b/src/Ai/Base/Value/SelfTargetValue.h similarity index 100% rename from src/strategy/values/SelfTargetValue.h rename to src/Ai/Base/Value/SelfTargetValue.h diff --git a/src/strategy/values/SkipSpellsListValue.cpp b/src/Ai/Base/Value/SkipSpellsListValue.cpp similarity index 100% rename from src/strategy/values/SkipSpellsListValue.cpp rename to src/Ai/Base/Value/SkipSpellsListValue.cpp diff --git a/src/strategy/values/SkipSpellsListValue.h b/src/Ai/Base/Value/SkipSpellsListValue.h similarity index 100% rename from src/strategy/values/SkipSpellsListValue.h rename to src/Ai/Base/Value/SkipSpellsListValue.h diff --git a/src/strategy/values/SnareTargetValue.cpp b/src/Ai/Base/Value/SnareTargetValue.cpp similarity index 100% rename from src/strategy/values/SnareTargetValue.cpp rename to src/Ai/Base/Value/SnareTargetValue.cpp diff --git a/src/strategy/values/SnareTargetValue.h b/src/Ai/Base/Value/SnareTargetValue.h similarity index 100% rename from src/strategy/values/SnareTargetValue.h rename to src/Ai/Base/Value/SnareTargetValue.h diff --git a/src/strategy/values/SpellCastUsefulValue.cpp b/src/Ai/Base/Value/SpellCastUsefulValue.cpp similarity index 100% rename from src/strategy/values/SpellCastUsefulValue.cpp rename to src/Ai/Base/Value/SpellCastUsefulValue.cpp diff --git a/src/strategy/values/SpellCastUsefulValue.h b/src/Ai/Base/Value/SpellCastUsefulValue.h similarity index 100% rename from src/strategy/values/SpellCastUsefulValue.h rename to src/Ai/Base/Value/SpellCastUsefulValue.h diff --git a/src/strategy/values/SpellIdValue.cpp b/src/Ai/Base/Value/SpellIdValue.cpp similarity index 100% rename from src/strategy/values/SpellIdValue.cpp rename to src/Ai/Base/Value/SpellIdValue.cpp diff --git a/src/strategy/values/SpellIdValue.h b/src/Ai/Base/Value/SpellIdValue.h similarity index 100% rename from src/strategy/values/SpellIdValue.h rename to src/Ai/Base/Value/SpellIdValue.h diff --git a/src/strategy/values/Stances.cpp b/src/Ai/Base/Value/Stances.cpp similarity index 100% rename from src/strategy/values/Stances.cpp rename to src/Ai/Base/Value/Stances.cpp diff --git a/src/strategy/values/Stances.h b/src/Ai/Base/Value/Stances.h similarity index 100% rename from src/strategy/values/Stances.h rename to src/Ai/Base/Value/Stances.h diff --git a/src/strategy/values/StatsValues.cpp b/src/Ai/Base/Value/StatsValues.cpp similarity index 100% rename from src/strategy/values/StatsValues.cpp rename to src/Ai/Base/Value/StatsValues.cpp diff --git a/src/strategy/values/StatsValues.h b/src/Ai/Base/Value/StatsValues.h similarity index 100% rename from src/strategy/values/StatsValues.h rename to src/Ai/Base/Value/StatsValues.h diff --git a/src/strategy/values/TankTargetValue.cpp b/src/Ai/Base/Value/TankTargetValue.cpp similarity index 100% rename from src/strategy/values/TankTargetValue.cpp rename to src/Ai/Base/Value/TankTargetValue.cpp diff --git a/src/strategy/values/TankTargetValue.h b/src/Ai/Base/Value/TankTargetValue.h similarity index 100% rename from src/strategy/values/TankTargetValue.h rename to src/Ai/Base/Value/TankTargetValue.h diff --git a/src/strategy/values/TargetValue.cpp b/src/Ai/Base/Value/TargetValue.cpp similarity index 100% rename from src/strategy/values/TargetValue.cpp rename to src/Ai/Base/Value/TargetValue.cpp diff --git a/src/strategy/values/TargetValue.h b/src/Ai/Base/Value/TargetValue.h similarity index 100% rename from src/strategy/values/TargetValue.h rename to src/Ai/Base/Value/TargetValue.h diff --git a/src/strategy/values/ThreatValues.cpp b/src/Ai/Base/Value/ThreatValues.cpp similarity index 100% rename from src/strategy/values/ThreatValues.cpp rename to src/Ai/Base/Value/ThreatValues.cpp diff --git a/src/strategy/values/ThreatValues.h b/src/Ai/Base/Value/ThreatValues.h similarity index 100% rename from src/strategy/values/ThreatValues.h rename to src/Ai/Base/Value/ThreatValues.h diff --git a/src/strategy/values/ValueContext.h b/src/Ai/Base/ValueContext.h similarity index 100% rename from src/strategy/values/ValueContext.h rename to src/Ai/Base/ValueContext.h diff --git a/src/strategy/actions/WorldPacketActionContext.h b/src/Ai/Base/WorldPacketActionContext.h similarity index 100% rename from src/strategy/actions/WorldPacketActionContext.h rename to src/Ai/Base/WorldPacketActionContext.h diff --git a/src/strategy/triggers/WorldPacketTriggerContext.h b/src/Ai/Base/WorldPacketTriggerContext.h similarity index 100% rename from src/strategy/triggers/WorldPacketTriggerContext.h rename to src/Ai/Base/WorldPacketTriggerContext.h diff --git a/src/strategy/deathknight/DKActions.cpp b/src/Ai/Class/Dk/Action/DKActions.cpp similarity index 50% rename from src/strategy/deathknight/DKActions.cpp rename to src/Ai/Class/Dk/Action/DKActions.cpp index 2b5ce97706..7788e48190 100644 --- a/src/strategy/deathknight/DKActions.cpp +++ b/src/Ai/Class/Dk/Action/DKActions.cpp @@ -11,39 +11,40 @@ #include "SpellInfo.h" #include "SpellMgr.h" -NextAction** CastDeathchillAction::getPrerequisites() +std::vector CastDeathchillAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("frost presence"), nullptr), + return NextAction::merge({ NextAction("frost presence") }, CastSpellAction::getPrerequisites()); } -NextAction** CastUnholyMeleeSpellAction::getPrerequisites() +std::vector CastUnholyMeleeSpellAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("unholy presence"), nullptr), + return NextAction::merge({ NextAction("unholy presence") }, CastMeleeSpellAction::getPrerequisites()); } -NextAction** CastFrostMeleeSpellAction::getPrerequisites() +std::vector CastFrostMeleeSpellAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("frost presence"), nullptr), + return NextAction::merge({ NextAction("frost presence") }, CastMeleeSpellAction::getPrerequisites()); } -NextAction** CastBloodMeleeSpellAction::getPrerequisites() +std::vector CastBloodMeleeSpellAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("blood presence"), nullptr), + return NextAction::merge({ NextAction("blood presence") }, CastMeleeSpellAction::getPrerequisites()); } bool CastRaiseDeadAction::Execute(Event event) { - bool result = CastBuffSpellAction::Execute(event); + const bool result = CastBuffSpellAction::Execute(event); + if (!result) - { return false; - } - uint32 spellId = AI_VALUE2(uint32, "spell id", spell); - // SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellId); + + const uint32_t spellId = AI_VALUE2(uint32_t, "spell id", spell); + bot->AddSpellCooldown(spellId, 0, 3 * 60 * 1000); + return true; } diff --git a/src/strategy/deathknight/DKActions.h b/src/Ai/Class/Dk/Action/DKActions.h similarity index 94% rename from src/strategy/deathknight/DKActions.h rename to src/Ai/Class/Dk/Action/DKActions.h index a320a233ce..74e066cd51 100644 --- a/src/strategy/deathknight/DKActions.h +++ b/src/Ai/Class/Dk/Action/DKActions.h @@ -34,7 +34,7 @@ class CastDeathchillAction : public CastBuffSpellAction public: CastDeathchillAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "deathchill") {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; class CastDarkCommandAction : public CastSpellAction @@ -52,7 +52,7 @@ class CastUnholyMeleeSpellAction : public CastMeleeSpellAction public: CastUnholyMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; // Frost presence @@ -61,7 +61,7 @@ class CastFrostMeleeSpellAction : public CastMeleeSpellAction public: CastFrostMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; // Blood presence @@ -70,7 +70,7 @@ class CastBloodMeleeSpellAction : public CastMeleeSpellAction public: CastBloodMeleeSpellAction(PlayerbotAI* botAI, std::string const spell) : CastMeleeSpellAction(botAI, spell) {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; class CastRuneStrikeAction : public CastMeleeSpellAction @@ -79,10 +79,6 @@ class CastRuneStrikeAction : public CastMeleeSpellAction CastRuneStrikeAction(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, "rune strike") {} }; -// debuff -// BEGIN_DEBUFF_ACTION(CastPestilenceAction, "pestilence") -// END_SPELL_ACTION() - class CastPestilenceAction : public CastSpellAction { public: @@ -90,20 +86,12 @@ class CastPestilenceAction : public CastSpellAction ActionThreatType getThreatType() override { return ActionThreatType::None; } }; -// debuff -// BEGIN_DEBUFF_ACTION(CastHowlingBlastAction, "howling blast") -// END_SPELL_ACTION() - class CastHowlingBlastAction : public CastSpellAction { public: CastHowlingBlastAction(PlayerbotAI* ai) : CastSpellAction(ai, "howling blast") {} }; -// debuff it -// BEGIN_DEBUFF_ACTION(CastIcyTouchAction, "icy touch") -// END_SPELL_ACTION() - class CastIcyTouchAction : public CastSpellAction { public: @@ -126,8 +114,6 @@ class CastPlagueStrikeAction : public CastSpellAction public: CastPlagueStrikeAction(PlayerbotAI* ai) : CastSpellAction(ai, "plague strike") {} }; -// BEGIN_DEBUFF_ACTION(CastPlagueStrikeAction, "plague strike") -// END_SPELL_ACTION() class CastPlagueStrikeOnAttackerAction : public CastDebuffSpellOnMeleeAttackerAction { diff --git a/src/strategy/deathknight/DKAiObjectContext.cpp b/src/Ai/Class/Dk/DKAiObjectContext.cpp similarity index 100% rename from src/strategy/deathknight/DKAiObjectContext.cpp rename to src/Ai/Class/Dk/DKAiObjectContext.cpp diff --git a/src/strategy/deathknight/DKAiObjectContext.h b/src/Ai/Class/Dk/DKAiObjectContext.h similarity index 100% rename from src/strategy/deathknight/DKAiObjectContext.h rename to src/Ai/Class/Dk/DKAiObjectContext.h diff --git a/src/Ai/Class/Dk/Strategy/BloodDKStrategy.cpp b/src/Ai/Class/Dk/Strategy/BloodDKStrategy.cpp new file mode 100644 index 0000000000..344b3dc095 --- /dev/null +++ b/src/Ai/Class/Dk/Strategy/BloodDKStrategy.cpp @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "BloodDKStrategy.h" + +#include "Playerbots.h" + +class BloodDKStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + BloodDKStrategyActionNodeFactory() + { + creators["rune strike"] = &rune_strike; + creators["heart strike"] = &heart_strike; + creators["death strike"] = &death_strike; + creators["icy touch"] = &icy_touch; + creators["dark command"] = &dark_command; + creators["taunt spell"] = &dark_command; + } + +private: + static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rune strike", + { + NextAction("frost presence") + }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "icy touch", + { + NextAction("frost presence") + }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "heart strike", + { + NextAction("frost presence") + }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "death strike", + { + NextAction("frost presence") + }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* dark_command([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "dark command", + { + NextAction("frost presence") + }, + /*A*/ { + NextAction("death grip") + }, + /*C*/ {} + ); + } +}; + +BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) +{ + actionNodeFactories.Add(new BloodDKStrategyActionNodeFactory()); +} + +std::vector BloodDKStrategy::getDefaultActions() +{ + return { + NextAction("rune strike", ACTION_DEFAULT + 0.8f), + NextAction("icy touch", ACTION_DEFAULT + 0.7f), + NextAction("heart strike", ACTION_DEFAULT + 0.6f), + NextAction("blood strike", ACTION_DEFAULT + 0.5f), + NextAction("dancing rune weapon", ACTION_DEFAULT + 0.4f), + NextAction("death coil", ACTION_DEFAULT + 0.3f), + NextAction("plague strike", ACTION_DEFAULT + 0.2f), + NextAction("horn of winter", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void BloodDKStrategy::InitTriggers(std::vector& triggers) +{ + GenericDKStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "rune strike", + { + NextAction("rune strike", ACTION_NORMAL + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "blood tap", + { + NextAction("blood tap", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lose aggro", + { + NextAction("dark command", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("army of the dead", ACTION_HIGH + 4), + NextAction("death strike", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("vampiric blood", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "icy touch", + { + NextAction("icy touch", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "plague strike", + { + NextAction("plague strike", ACTION_HIGH + 2) + } + ) + ); +} diff --git a/src/strategy/deathknight/BloodDKStrategy.h b/src/Ai/Class/Dk/Strategy/BloodDKStrategy.h similarity index 92% rename from src/strategy/deathknight/BloodDKStrategy.h rename to src/Ai/Class/Dk/Strategy/BloodDKStrategy.h index e00101ad14..590727c934 100644 --- a/src/strategy/deathknight/BloodDKStrategy.h +++ b/src/Ai/Class/Dk/Strategy/BloodDKStrategy.h @@ -17,7 +17,7 @@ class BloodDKStrategy : public GenericDKStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "blood"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; } }; diff --git a/src/Ai/Class/Dk/Strategy/FrostDKStrategy.cpp b/src/Ai/Class/Dk/Strategy/FrostDKStrategy.cpp new file mode 100644 index 0000000000..d0b0ee2037 --- /dev/null +++ b/src/Ai/Class/Dk/Strategy/FrostDKStrategy.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "FrostDKStrategy.h" + +#include "Playerbots.h" + +class FrostDKStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + FrostDKStrategyActionNodeFactory() + { + creators["icy touch"] = &icy_touch; + creators["obliterate"] = &obliterate; + creators["howling blast"] = &howling_blast; + creators["frost strike"] = &frost_strike; + creators["rune strike"] = &rune_strike; + creators["unbreakable armor"] = &unbreakable_armor; + } + +private: + static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "icy touch", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* obliterate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "obliterate", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rune strike", + /*P*/ { NextAction("blood presence") }, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* frost_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "frost strike", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* howling_blast([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "howling blast", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* unbreakable_armor([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "unbreakable armor", + /*P*/ { NextAction("blood tap") }, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +FrostDKStrategy::FrostDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) +{ + actionNodeFactories.Add(new FrostDKStrategyActionNodeFactory()); +} + +std::vector FrostDKStrategy::getDefaultActions() +{ + return { + NextAction("obliterate", ACTION_DEFAULT + 0.7f), + NextAction("frost strike", ACTION_DEFAULT + 0.4f), + NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f), + NextAction("horn of winter", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void FrostDKStrategy::InitTriggers(std::vector& triggers) +{ + GenericDKStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "unbreakable armor", + { + NextAction("unbreakable armor", ACTION_DEFAULT + 0.6f) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "freezing fog", + { + NextAction("howling blast", ACTION_DEFAULT + 0.5f) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "high blood rune", + { + NextAction("blood strike", ACTION_DEFAULT + 0.2f) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "army of the dead", + { + NextAction("army of the dead", ACTION_HIGH + 6) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "icy touch", + { + NextAction("icy touch", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "plague strike", + { + NextAction("plague strike", ACTION_HIGH + 2) + } + ) + ); + +} + +void FrostDKAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("howling blast", ACTION_HIGH + 4) + } + ) + ); +} diff --git a/src/strategy/deathknight/FrostDKStrategy.h b/src/Ai/Class/Dk/Strategy/FrostDKStrategy.h similarity index 94% rename from src/strategy/deathknight/FrostDKStrategy.h rename to src/Ai/Class/Dk/Strategy/FrostDKStrategy.h index c305621ad1..9483391936 100644 --- a/src/strategy/deathknight/FrostDKStrategy.h +++ b/src/Ai/Class/Dk/Strategy/FrostDKStrategy.h @@ -17,7 +17,7 @@ class FrostDKStrategy : public GenericDKStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "frost"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp b/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp similarity index 57% rename from src/strategy/deathknight/GenericDKNonCombatStrategy.cpp rename to src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp index 5c095d2989..edead06755 100644 --- a/src/strategy/deathknight/GenericDKNonCombatStrategy.cpp +++ b/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.cpp @@ -20,17 +20,17 @@ class GenericDKNonCombatStrategyActionNodeFactory : public NamedObjectFactory& trigger NonCombatStrategy::InitTriggers(triggers); triggers.push_back( - new TriggerNode("no pet", NextAction::array(0, new NextAction("raise dead", ACTION_NORMAL + 1), nullptr))); + new TriggerNode("no pet", { NextAction("raise dead", ACTION_NORMAL + 1) })); triggers.push_back( - new TriggerNode("horn of winter", NextAction::array(0, new NextAction("horn of winter", 21.0f), nullptr))); + new TriggerNode("horn of winter", { NextAction("horn of winter", 21.0f) })); triggers.push_back( - new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", 21.0f), nullptr))); + new TriggerNode("bone shield", { NextAction("bone shield", 21.0f) })); triggers.push_back( - new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), NULL))); + new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f) })); triggers.push_back( - new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), NULL))); + new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); } void DKBuffDpsStrategy::InitTriggers(std::vector& triggers) { - // triggers.push_back(new TriggerNode("improved icy talons", NextAction::array(0, new NextAction("improved icy - // talons", 19.0f), nullptr))); + } diff --git a/src/strategy/deathknight/GenericDKNonCombatStrategy.h b/src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.h similarity index 100% rename from src/strategy/deathknight/GenericDKNonCombatStrategy.h rename to src/Ai/Class/Dk/Strategy/GenericDKNonCombatStrategy.h diff --git a/src/strategy/deathknight/GenericDKStrategy.cpp b/src/Ai/Class/Dk/Strategy/GenericDKStrategy.cpp similarity index 53% rename from src/strategy/deathknight/GenericDKStrategy.cpp rename to src/Ai/Class/Dk/Strategy/GenericDKStrategy.cpp index 4d52cbc362..61ff8c7489 100644 --- a/src/strategy/deathknight/GenericDKStrategy.cpp +++ b/src/Ai/Class/Dk/Strategy/GenericDKStrategy.cpp @@ -54,105 +54,105 @@ class GenericDKStrategyActionNodeFactory : public NamedObjectFactory static ActionNode* death_coil([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death coil", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* death_grip([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death grip", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("icy touch"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("icy touch") }, + /*C*/ {}); } static ActionNode* plague_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("plague strike", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("icy touch", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("heart strike", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* pestilence([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("pestilence", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* horn_of_winter([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("horn of winter", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* bone_shield([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("bone shield", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* killing_machine([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("killing machine", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("improved icy talons"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("improved icy talons") }, + /*C*/ {}); } static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("corpse explosion", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* death_and_decay([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("death and decay", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } static ActionNode* anti_magic_zone([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("anti magic zone", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("anti magic shell"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("anti magic shell") }, + /*C*/ {}); } static ActionNode* icebound_fortitude([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("icebound fortitude", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } }; @@ -165,36 +165,29 @@ void GenericDKStrategy::InitTriggers(std::vector& triggers) { MeleeCombatStrategy::InitTriggers(triggers); - // triggers.push_back(new TriggerNode("high aoe", NextAction::array(0, new NextAction("anti magic shell", - // ACTION_NORMAL + 3), nullptr))); triggers.push_back(new TriggerNode("death coil", NextAction::array(0, new - // NextAction("death coil", ACTION_NORMAL + 3), nullptr))); triggers.push_back(new TriggerNode("critical aoe heal", - // NextAction::array(0, new NextAction("anti magic zone", ACTION_EMERGENCY + 1), nullptr))); triggers.push_back( - new TriggerNode("no pet", NextAction::array(0, new NextAction("raise dead", ACTION_NORMAL + 5), nullptr))); + new TriggerNode("no pet", { NextAction("raise dead", ACTION_NORMAL + 5) })); triggers.push_back( - new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr))); + new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f) })); triggers.push_back( - new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); + new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); triggers.push_back( - new TriggerNode("mind freeze", NextAction::array(0, new NextAction("mind freeze", ACTION_HIGH + 1), nullptr))); + new TriggerNode("mind freeze", { NextAction("mind freeze", ACTION_HIGH + 1) })); triggers.push_back( new TriggerNode("mind freeze on enemy healer", - NextAction::array(0, new NextAction("mind freeze on enemy healer", ACTION_HIGH + 1), nullptr))); + { NextAction("mind freeze on enemy healer", ACTION_HIGH + 1) })); triggers.push_back(new TriggerNode( - "horn of winter", NextAction::array(0, new NextAction("horn of winter", ACTION_NORMAL + 1), nullptr))); + "horn of winter", { NextAction("horn of winter", ACTION_NORMAL + 1) })); triggers.push_back(new TriggerNode("critical health", - NextAction::array(0, new NextAction("death pact", ACTION_HIGH + 5), nullptr))); + { NextAction("death pact", ACTION_HIGH + 5) })); triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5), - new NextAction("rune tap", ACTION_HIGH + 4), nullptr))); + new TriggerNode("low health", { NextAction("icebound fortitude", ACTION_HIGH + 5), + NextAction("rune tap", ACTION_HIGH + 4) })); triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_HIGH + 9), - 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("pestilence", ACTION_NORMAL + 4), - // nullptr))); + new TriggerNode("medium aoe", { NextAction("death and decay", ACTION_HIGH + 9), + NextAction("pestilence", ACTION_NORMAL + 4), + NextAction("blood boil", ACTION_NORMAL + 3) })); triggers.push_back( - new TriggerNode("pestilence glyph", NextAction::array(0, new NextAction("pestilence", ACTION_HIGH + 9), NULL))); + new TriggerNode("pestilence glyph", { NextAction("pestilence", ACTION_HIGH + 9) })); } diff --git a/src/strategy/deathknight/GenericDKStrategy.h b/src/Ai/Class/Dk/Strategy/GenericDKStrategy.h similarity index 100% rename from src/strategy/deathknight/GenericDKStrategy.h rename to src/Ai/Class/Dk/Strategy/GenericDKStrategy.h diff --git a/src/Ai/Class/Dk/Strategy/UnholyDKStrategy.cpp b/src/Ai/Class/Dk/Strategy/UnholyDKStrategy.cpp new file mode 100644 index 0000000000..d94a94ec31 --- /dev/null +++ b/src/Ai/Class/Dk/Strategy/UnholyDKStrategy.cpp @@ -0,0 +1,192 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "UnholyDKStrategy.h" + +#include "Playerbots.h" + +class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + UnholyDKStrategyActionNodeFactory() + { + creators["death strike"] = &death_strike; + creators["scourge strike"] = &scourge_strike; + creators["ghoul frenzy"] = &ghoul_frenzy; + creators["corpse explosion"] = &corpse_explosion; + creators["icy touch"] = &icy_touch; + } + +private: + static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "death strike", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "ghoul frenzy", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "corpse explosion", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "scourge strike", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "icy touch", + /*P*/ { NextAction("blood presence") }, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) +{ + actionNodeFactories.Add(new UnholyDKStrategyActionNodeFactory()); +} + +std::vector UnholyDKStrategy::getDefaultActions() +{ + return { + NextAction("death and decay", ACTION_HIGH + 5), + NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f), + NextAction("horn of winter", ACTION_DEFAULT + 0.2f), + NextAction("death coil", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void UnholyDKStrategy::InitTriggers(std::vector& triggers) +{ + GenericDKStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "death and decay cooldown", + { + NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f), + NextAction("scourge strike", ACTION_DEFAULT + 0.8f), + NextAction("icy touch", ACTION_DEFAULT + 0.7f), + NextAction("blood strike", ACTION_DEFAULT + 0.6f), + NextAction("plague strike", ACTION_DEFAULT + 0.5f), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "dd cd and no desolation", + { + NextAction("blood strike", ACTION_DEFAULT + 0.75f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high frost rune", + { + NextAction("icy touch", ACTION_NORMAL + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high blood rune", + { + NextAction("blood strike", ACTION_NORMAL + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high unholy rune", + { + NextAction("plague strike", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode("dd cd and plague strike 3s", + { + NextAction("plague strike", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode("dd cd and icy touch 3s", + { + NextAction("icy touch", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode("no rune", + { + NextAction("empower rune weapon", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "army of the dead", + { + NextAction("army of the dead", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode("bone shield", + { + NextAction("bone shield", ACTION_HIGH + 3) + } + ) + ); +} + +void UnholyDKAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "loot available", + { + NextAction("corpse explosion", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("death and decay", ACTION_NORMAL + 3), + NextAction("corpse explosion", ACTION_NORMAL + 3) + } + ) + ); +} diff --git a/src/strategy/deathknight/UnholyDKStrategy.h b/src/Ai/Class/Dk/Strategy/UnholyDKStrategy.h similarity index 94% rename from src/strategy/deathknight/UnholyDKStrategy.h rename to src/Ai/Class/Dk/Strategy/UnholyDKStrategy.h index 512ddb0d38..65ee65d92f 100644 --- a/src/strategy/deathknight/UnholyDKStrategy.h +++ b/src/Ai/Class/Dk/Strategy/UnholyDKStrategy.h @@ -17,7 +17,7 @@ class UnholyDKStrategy : public GenericDKStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "unholy"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/deathknight/DKTriggers.cpp b/src/Ai/Class/Dk/Trigger/DKTriggers.cpp similarity index 100% rename from src/strategy/deathknight/DKTriggers.cpp rename to src/Ai/Class/Dk/Trigger/DKTriggers.cpp diff --git a/src/strategy/deathknight/DKTriggers.h b/src/Ai/Class/Dk/Trigger/DKTriggers.h similarity index 100% rename from src/strategy/deathknight/DKTriggers.h rename to src/Ai/Class/Dk/Trigger/DKTriggers.h diff --git a/src/strategy/druid/DruidActions.cpp b/src/Ai/Class/Druid/Action/DruidActions.cpp similarity index 83% rename from src/strategy/druid/DruidActions.cpp rename to src/Ai/Class/Druid/Action/DruidActions.cpp index 217db82508..13336a674a 100644 --- a/src/strategy/druid/DruidActions.cpp +++ b/src/Ai/Class/Druid/Action/DruidActions.cpp @@ -11,15 +11,15 @@ #include "AoeValues.h" #include "TargetValue.h" -NextAction** CastAbolishPoisonAction::getAlternatives() +std::vector CastAbolishPoisonAction::getAlternatives() { - return NextAction::merge(NextAction::array(0, new NextAction("cure poison"), nullptr), + return NextAction::merge({ NextAction("cure poison") }, CastSpellAction::getPrerequisites()); } -NextAction** CastAbolishPoisonOnPartyAction::getAlternatives() +std::vector CastAbolishPoisonOnPartyAction::getAlternatives() { - return NextAction::merge(NextAction::array(0, new NextAction("cure poison on party"), nullptr), + return NextAction::merge({ NextAction("cure poison on party") }, CastSpellAction::getPrerequisites()); } @@ -60,15 +60,15 @@ bool CastStarfallAction::isUseful() return true; } -NextAction** CastReviveAction::getPrerequisites() +std::vector CastReviveAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("caster form"), nullptr), + return NextAction::merge({ NextAction("caster form") }, ResurrectPartyMemberAction::getPrerequisites()); } -NextAction** CastRebirthAction::getPrerequisites() +std::vector CastRebirthAction::getPrerequisites() { - return NextAction::merge(NextAction::array(0, new NextAction("caster form"), nullptr), + return NextAction::merge({ NextAction("caster form") }, ResurrectPartyMemberAction::getPrerequisites()); } diff --git a/src/strategy/druid/DruidActions.h b/src/Ai/Class/Druid/Action/DruidActions.h similarity index 97% rename from src/strategy/druid/DruidActions.h rename to src/Ai/Class/Druid/Action/DruidActions.h index d0af6e5a49..e3e177590d 100644 --- a/src/strategy/druid/DruidActions.h +++ b/src/Ai/Class/Druid/Action/DruidActions.h @@ -74,7 +74,7 @@ class CastReviveAction : public ResurrectPartyMemberAction public: CastReviveAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "revive") {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; class CastRebirthAction : public ResurrectPartyMemberAction @@ -82,7 +82,7 @@ class CastRebirthAction : public ResurrectPartyMemberAction public: CastRebirthAction(PlayerbotAI* botAI) : ResurrectPartyMemberAction(botAI, "rebirth") {} - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; bool isUseful() override; }; @@ -223,7 +223,7 @@ class CastAbolishPoisonAction : public CastCureSpellAction { public: CastAbolishPoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "abolish poison") {} - NextAction** getAlternatives() override; + std::vector getAlternatives() override; }; class CastAbolishPoisonOnPartyAction : public CurePartyMemberAction @@ -233,7 +233,7 @@ class CastAbolishPoisonOnPartyAction : public CurePartyMemberAction { } - NextAction** getAlternatives() override; + std::vector getAlternatives() override; }; class CastBarkskinAction : public CastBuffSpellAction diff --git a/src/strategy/druid/DruidBearActions.cpp b/src/Ai/Class/Druid/Action/DruidBearActions.cpp similarity index 100% rename from src/strategy/druid/DruidBearActions.cpp rename to src/Ai/Class/Druid/Action/DruidBearActions.cpp diff --git a/src/strategy/druid/DruidBearActions.h b/src/Ai/Class/Druid/Action/DruidBearActions.h similarity index 100% rename from src/strategy/druid/DruidBearActions.h rename to src/Ai/Class/Druid/Action/DruidBearActions.h diff --git a/src/strategy/druid/DruidCatActions.cpp b/src/Ai/Class/Druid/Action/DruidCatActions.cpp similarity index 100% rename from src/strategy/druid/DruidCatActions.cpp rename to src/Ai/Class/Druid/Action/DruidCatActions.cpp diff --git a/src/strategy/druid/DruidCatActions.h b/src/Ai/Class/Druid/Action/DruidCatActions.h similarity index 100% rename from src/strategy/druid/DruidCatActions.h rename to src/Ai/Class/Druid/Action/DruidCatActions.h diff --git a/src/strategy/druid/DruidShapeshiftActions.cpp b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp similarity index 92% rename from src/strategy/druid/DruidShapeshiftActions.cpp rename to src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp index 0c3aab7bf5..4f4a4e5968 100644 --- a/src/strategy/druid/DruidShapeshiftActions.cpp +++ b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.cpp @@ -17,9 +17,9 @@ bool CastBearFormAction::isUseful() return CastBuffSpellAction::isUseful() && !botAI->HasAura("dire bear form", GetTarget()); } -NextAction** CastDireBearFormAction::getAlternatives() +std::vector CastDireBearFormAction::getAlternatives() { - return NextAction::merge(NextAction::array(0, new NextAction("bear form"), nullptr), + return NextAction::merge({ NextAction("bear form") }, CastSpellAction::getAlternatives()); } diff --git a/src/strategy/druid/DruidShapeshiftActions.h b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.h similarity index 97% rename from src/strategy/druid/DruidShapeshiftActions.h rename to src/Ai/Class/Druid/Action/DruidShapeshiftActions.h index 61a9a13894..26e14c42ca 100644 --- a/src/strategy/druid/DruidShapeshiftActions.h +++ b/src/Ai/Class/Druid/Action/DruidShapeshiftActions.h @@ -24,7 +24,7 @@ class CastDireBearFormAction : public CastBuffSpellAction public: CastDireBearFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "dire bear form") {} - NextAction** getAlternatives() override; + std::vector getAlternatives() override; }; class CastCatFormAction : public CastBuffSpellAction diff --git a/src/strategy/druid/DruidAiObjectContext.cpp b/src/Ai/Class/Druid/DruidAiObjectContext.cpp similarity index 100% rename from src/strategy/druid/DruidAiObjectContext.cpp rename to src/Ai/Class/Druid/DruidAiObjectContext.cpp diff --git a/src/strategy/druid/DruidAiObjectContext.h b/src/Ai/Class/Druid/DruidAiObjectContext.h similarity index 100% rename from src/strategy/druid/DruidAiObjectContext.h rename to src/Ai/Class/Druid/DruidAiObjectContext.h diff --git a/src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.cpp new file mode 100644 index 0000000000..4a60fbd3ea --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.cpp @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "BearTankDruidStrategy.h" + +#include "Playerbots.h" + +class BearTankDruidStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + BearTankDruidStrategyActionNodeFactory() + { + creators["melee"] = &melee; + creators["feral charge - bear"] = &feral_charge_bear; + creators["swipe (bear)"] = &swipe_bear; + creators["faerie fire (feral)"] = &faerie_fire_feral; + creators["bear form"] = &bear_form; + creators["dire bear form"] = &dire_bear_form; + creators["mangle (bear)"] = &mangle_bear; + creators["maul"] = &maul; + creators["bash"] = &bash; + creators["swipe"] = &swipe; + creators["lacerate"] = &lacerate; + creators["demoralizing roar"] = &demoralizing_roar; + creators["taunt spell"] = &growl; + } + +private: + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "melee", + /*P*/ { NextAction("feral charge - bear") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* feral_charge_bear([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "feral charge - bear", + /*P*/ {}, + /*A*/ { NextAction("reach melee") }, + /*C*/ {} + ); + } + + static ActionNode* swipe_bear([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "swipe (bear)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "faerie fire (feral)", + /*P*/ { NextAction("feral charge - bear") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* bear_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "bear form", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* dire_bear_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "dire bear form", + /*P*/ { NextAction("caster form") }, + /*A*/ { NextAction("bear form") }, + /*C*/ {} + ); + } + + static ActionNode* mangle_bear([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mangle (bear)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* maul([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "maul", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* bash([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "bash", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* swipe([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "swipe", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* lacerate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "lacerate", + /*P*/ {}, + /*A*/ { NextAction("maul") }, + /*C*/ {} + ); + } + + static ActionNode* growl([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "growl", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* demoralizing_roar([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "demoralizing roar", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +BearTankDruidStrategy::BearTankDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) +{ + actionNodeFactories.Add(new BearTankDruidStrategyActionNodeFactory()); +} + +std::vector BearTankDruidStrategy::getDefaultActions() +{ + return { + NextAction("mangle (bear)", ACTION_DEFAULT + 0.5f), + NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.4f), + NextAction("lacerate", ACTION_DEFAULT + 0.3f), + NextAction("maul", ACTION_DEFAULT + 0.2f), + NextAction("enrage", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void BearTankDruidStrategy::InitTriggers(std::vector& triggers) +{ + FeralDruidStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("feral charge - bear", ACTION_NORMAL + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bear form", + { + NextAction("dire bear form", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("frenzied regeneration", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "faerie fire (feral)", + { + NextAction("faerie fire (feral)", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lose aggro", + { + NextAction("growl", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("demoralizing roar", ACTION_HIGH + 6), + NextAction("swipe (bear)", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "light aoe", + { + NextAction("swipe (bear)", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bash", + { + NextAction("bash", ACTION_INTERRUPT + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bash on enemy healer", + { + NextAction("bash on enemy healer", ACTION_INTERRUPT + 1) + } + ) + ); +} diff --git a/src/strategy/druid/BearTankDruidStrategy.h b/src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.h similarity index 92% rename from src/strategy/druid/BearTankDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.h index 9b0595a185..2019bd0eba 100644 --- a/src/strategy/druid/BearTankDruidStrategy.h +++ b/src/Ai/Class/Druid/Strategy/BearTankDruidStrategy.h @@ -17,7 +17,7 @@ class BearTankDruidStrategy : public FeralDruidStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "bear"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; } }; diff --git a/src/Ai/Class/Druid/Strategy/CasterDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/CasterDruidStrategy.cpp new file mode 100644 index 0000000000..a91f3b5409 --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/CasterDruidStrategy.cpp @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "CasterDruidStrategy.h" + +#include "AiObjectContext.h" +#include "FeralDruidStrategy.h" + +class CasterDruidStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + CasterDruidStrategyActionNodeFactory() + { + creators["faerie fire"] = &faerie_fire; + creators["hibernate"] = &hibernate; + creators["entangling roots"] = &entangling_roots; + creators["entangling roots on cc"] = &entangling_roots_on_cc; + creators["wrath"] = &wrath; + creators["starfall"] = &starfall; + creators["insect swarm"] = &insect_swarm; + creators["moonfire"] = &moonfire; + creators["starfire"] = &starfire; + creators["moonkin form"] = &moonkin_form; + } + +private: + static ActionNode* faerie_fire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "faerie fire", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* hibernate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "hibernate", + /*P*/ { NextAction("moonkin form") }, + /*A*/ { NextAction("entangling roots") }, + /*C*/ {} + ); + } + + static ActionNode* entangling_roots([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "entangling roots", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "entangling roots on cc", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* wrath([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "wrath", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* starfall([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "starfall", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* insect_swarm([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "insect swarm", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* moonfire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "moonfire", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* starfire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "starfire", + /*P*/ { NextAction("moonkin form") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* moonkin_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "moonkin form", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +CasterDruidStrategy::CasterDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI) +{ + actionNodeFactories.Add(new CasterDruidStrategyActionNodeFactory()); + actionNodeFactories.Add(new ShapeshiftDruidStrategyActionNodeFactory()); +} + +std::vector CasterDruidStrategy::getDefaultActions() +{ + return { + NextAction("starfall", ACTION_HIGH + 1.0f), + NextAction("force of nature", ACTION_DEFAULT + 1.0f), + NextAction("wrath", ACTION_DEFAULT + 0.1f), + }; +} + +void CasterDruidStrategy::InitTriggers(std::vector& triggers) +{ + GenericDruidStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "eclipse (lunar) cooldown", + { + NextAction("starfire", ACTION_DEFAULT + 0.2f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "eclipse (solar) cooldown", + { + NextAction("wrath", ACTION_DEFAULT + 0.2f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "insect swarm", + { + NextAction("insect swarm", ACTION_NORMAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "moonfire", + { + NextAction("moonfire", ACTION_NORMAL + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "eclipse (solar)", + { + NextAction("wrath", ACTION_NORMAL + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "eclipse (lunar)", + { + NextAction("starfire", ACTION_NORMAL + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium mana", + { + NextAction("innervate", ACTION_HIGH + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy too close for spell", + { + NextAction("flee", ACTION_MOVE + 9) + } + ) + ); +} + +void CasterDruidAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "hurricane channel check", + { + NextAction("cancel channel", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("hurricane", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "light aoe", + { + NextAction("insect swarm on attacker", ACTION_NORMAL + 3), + NextAction("moonfire on attacker", ACTION_NORMAL + 3) + } + ) + ); +} + +void CasterDruidDebuffStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "faerie fire", + { + NextAction("faerie fire", ACTION_HIGH) + } + ) + ); +} diff --git a/src/strategy/druid/CasterDruidStrategy.h b/src/Ai/Class/Druid/Strategy/CasterDruidStrategy.h similarity index 95% rename from src/strategy/druid/CasterDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/CasterDruidStrategy.h index 0455b2f11a..45bc78dba8 100644 --- a/src/strategy/druid/CasterDruidStrategy.h +++ b/src/Ai/Class/Druid/Strategy/CasterDruidStrategy.h @@ -18,7 +18,7 @@ class CasterDruidStrategy : public GenericDruidStrategy public: void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "caster"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; } }; diff --git a/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp new file mode 100644 index 0000000000..fda1b5f94f --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.cpp @@ -0,0 +1,314 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "CatDpsDruidStrategy.h" + +#include "AiObjectContext.h" + +class CatDpsDruidStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + CatDpsDruidStrategyActionNodeFactory() + { + creators["faerie fire (feral)"] = &faerie_fire_feral; + creators["melee"] = &melee; + creators["feral charge - cat"] = &feral_charge_cat; + creators["cat form"] = &cat_form; + creators["claw"] = &claw; + creators["mangle (cat)"] = &mangle_cat; + creators["rake"] = &rake; + creators["ferocious bite"] = &ferocious_bite; + creators["rip"] = &rip; + creators["pounce"] = &pounce; + creators["ravage"] = &ravage; + } + +private: + static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "faerie fire (feral)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "melee", + /*P*/ { NextAction("feral charge - cat") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* feral_charge_cat([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "feral charge - cat", + /*P*/ {}, + /*A*/ { NextAction("reach melee") }, + /*C*/ {} + ); + } + + static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "cat form", + /*P*/ { NextAction("caster form") }, + /*A*/ { NextAction("bear form") }, + /*C*/ {} + ); + } + + static ActionNode* claw([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "claw", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mangle (cat)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rake", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "ferocious bite", + /*P*/ {}, + /*A*/ { NextAction("rip") }, + /*C*/ {} + ); + } + + static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rip", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* pounce([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "pounce", + /*P*/ {}, + /*A*/ { NextAction("ravage") }, + /*C*/ {} + ); + } + + static ActionNode* ravage([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "ravage", + /*P*/ {}, + /*A*/ { NextAction("shred") }, + /*C*/ {} + ); + } +}; + +CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) +{ + actionNodeFactories.Add(new CatDpsDruidStrategyActionNodeFactory()); +} + +std::vector CatDpsDruidStrategy::getDefaultActions() +{ + return { + NextAction("tiger's fury", ACTION_DEFAULT + 0.1f) + }; +} + +void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) +{ + FeralDruidStrategy::InitTriggers(triggers); + + // Default priority + triggers.push_back( + new TriggerNode( + "almost full energy available", + { + NextAction("shred", ACTION_DEFAULT + 0.4f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points not full", + { + NextAction("shred", ACTION_DEFAULT + 0.4f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "almost full energy available", + { + NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points not full and high energy", + { + NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "almost full energy available", + { + NextAction("claw", ACTION_DEFAULT + 0.2f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points not full and high energy", + { + NextAction("claw", ACTION_DEFAULT + 0.2f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "faerie fire (feral)", + { + NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.0f) + } + ) + ); + + // Main spell + triggers.push_back( + new TriggerNode( + "cat form", { + NextAction("cat form", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "savage roar", { + NextAction("savage roar", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points available", + { + NextAction("rip", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "ferocious bite time", + { + NextAction("ferocious bite", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target with combo points almost dead", + { + NextAction("ferocious bite", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "mangle (cat)", + { + NextAction("mangle (cat)", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rake", + { + NextAction("rake", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium threat", + { + NextAction("cower", ACTION_HIGH + 1) + } + ) + ); + + // AOE + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("swipe (cat)", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "light aoe", + { + NextAction("rake on attacker", ACTION_HIGH + 2) + } + ) + ); + // Reach target + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("feral charge - cat", ACTION_HIGH + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("dash", ACTION_HIGH + 8) + } + ) + ); +} + +void CatAoeDruidStrategy::InitTriggers(std::vector& triggers) {} diff --git a/src/strategy/druid/CatDpsDruidStrategy.h b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.h similarity index 94% rename from src/strategy/druid/CatDpsDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.h index bfe2450b0c..312e94d0f6 100644 --- a/src/strategy/druid/CatDpsDruidStrategy.h +++ b/src/Ai/Class/Druid/Strategy/CatDpsDruidStrategy.h @@ -18,7 +18,7 @@ class CatDpsDruidStrategy : public FeralDruidStrategy public: void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "cat"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/druid/FeralDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/FeralDruidStrategy.cpp similarity index 50% rename from src/strategy/druid/FeralDruidStrategy.cpp rename to src/Ai/Class/Druid/Strategy/FeralDruidStrategy.cpp index e5e4832526..894c05bff6 100644 --- a/src/strategy/druid/FeralDruidStrategy.cpp +++ b/src/Ai/Class/Druid/Strategy/FeralDruidStrategy.cpp @@ -26,65 +26,65 @@ class FeralDruidStrategyActionNodeFactory : public NamedObjectFactory& triggers) { GenericDruidStrategy::InitTriggers(triggers); - // 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 out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), 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))); + "enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) })); triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("survival instincts", ACTION_EMERGENCY + 1), nullptr))); + "critical health", { NextAction("survival instincts", ACTION_EMERGENCY + 1) })); triggers.push_back(new TriggerNode( - "omen of clarity", NextAction::array(0, new NextAction("omen of clarity", ACTION_HIGH + 9), nullptr))); + "omen of clarity", { NextAction("omen of clarity", ACTION_HIGH + 9) })); triggers.push_back(new TriggerNode("player has flag", - NextAction::array(0, new NextAction("dash", ACTION_EMERGENCY + 2), nullptr))); + { NextAction("dash", ACTION_EMERGENCY + 2) })); triggers.push_back(new TriggerNode("enemy flagcarrier near", - NextAction::array(0, new NextAction("dash", ACTION_EMERGENCY + 2), nullptr))); + { NextAction("dash", ACTION_EMERGENCY + 2) })); triggers.push_back( - new TriggerNode("berserk", NextAction::array(0, new NextAction("berserk", ACTION_HIGH + 6), nullptr))); + new TriggerNode("berserk", { NextAction("berserk", ACTION_HIGH + 6) })); } diff --git a/src/strategy/druid/FeralDruidStrategy.h b/src/Ai/Class/Druid/Strategy/FeralDruidStrategy.h similarity index 59% rename from src/strategy/druid/FeralDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/FeralDruidStrategy.h index dd1e7d006e..abf01c694c 100644 --- a/src/strategy/druid/FeralDruidStrategy.h +++ b/src/Ai/Class/Druid/Strategy/FeralDruidStrategy.h @@ -27,49 +27,49 @@ class ShapeshiftDruidStrategyActionNodeFactory : public NamedObjectFactory, released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericDruidNonCombatStrategy.h" + +#include "Playerbots.h" +#include "AiFactory.h" + +class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericDruidNonCombatStrategyActionNodeFactory() + { + creators["thorns"] = þs; + creators["thorns on party"] = þs_on_party; + creators["mark of the wild"] = &mark_of_the_wild; + creators["mark of the wild on party"] = &mark_of_the_wild_on_party; + // creators["innervate"] = &innervate; + creators["regrowth_on_party"] = ®rowth_on_party; + creators["rejuvenation on party"] = &rejuvenation_on_party; + creators["remove curse on party"] = &remove_curse_on_party; + creators["abolish poison on party"] = &abolish_poison_on_party; + creators["revive"] = &revive; + } + +private: + static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("thorns", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* thorns_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("thorns on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* mark_of_the_wild([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("mark of the wild", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* mark_of_the_wild_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("mark of the wild on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("regrowth on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("rejuvenation on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("remove curse on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("abolish poison on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + static ActionNode* revive([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("revive", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } +}; + +GenericDruidNonCombatStrategy::GenericDruidNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory()); +} + +void GenericDruidNonCombatStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("mark of the wild", { NextAction("mark of the wild", 14.0f) })); + triggers.push_back(new TriggerNode("party member cure poison", { NextAction("abolish poison on party", 20.0f) })); + triggers.push_back(new TriggerNode("party member dead", { NextAction("revive", ACTION_CRITICAL_HEAL + 10) })); + + triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) })); + + triggers.push_back( + new TriggerNode("party member critical health", + { + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5), + })); + + triggers.push_back( + new TriggerNode("party member low health", + { + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), + })); + + triggers.push_back( + new TriggerNode("party member medium health", + { NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1), + })); + + triggers.push_back( + new TriggerNode("party member almost full health", + { NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2) })); + + triggers.push_back( + new TriggerNode("party member remove curse", + { NextAction("remove curse on party", ACTION_DISPEL + 7) })); + triggers.push_back( + new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); + + triggers.push_back(new TriggerNode("party member critical health", { + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5), + })); + triggers.push_back(new TriggerNode("party member low health", { + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), + })); + triggers.push_back(new TriggerNode("party member medium health", { + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1), + })); + triggers.push_back(new TriggerNode("party member almost full health", { + NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), + NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2), + })); + triggers.push_back(new TriggerNode("party member remove curse", { + NextAction("remove curse on party", ACTION_DISPEL + 7), + })); + + int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot()); + if (specTab == 0 || specTab == 2) // Balance or Restoration + triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) })); + if (specTab == 1) // Feral + triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) })); + +} + +GenericDruidBuffStrategy::GenericDruidBuffStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory()); +} + +void GenericDruidBuffStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("mark of the wild on party", { + NextAction("mark of the wild on party", 13.0f), + })); + triggers.push_back(new TriggerNode("thorns on main tank", { + NextAction("thorns on main tank", 11.0f), + })); + triggers.push_back(new TriggerNode("thorns", { + NextAction("thorns", 10.0f), + })); +} diff --git a/src/strategy/druid/GenericDruidNonCombatStrategy.h b/src/Ai/Class/Druid/Strategy/GenericDruidNonCombatStrategy.h similarity index 100% rename from src/strategy/druid/GenericDruidNonCombatStrategy.h rename to src/Ai/Class/Druid/Strategy/GenericDruidNonCombatStrategy.h diff --git a/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp new file mode 100644 index 0000000000..d5ac8fcea5 --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.cpp @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericDruidStrategy.h" + +#include "Playerbots.h" + +class GenericDruidStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericDruidStrategyActionNodeFactory() + { + creators["melee"] = &melee; + creators["caster form"] = &caster_form; + creators["cure poison"] = &cure_poison; + creators["cure poison on party"] = &cure_poison_on_party; + creators["abolish poison"] = &abolish_poison; + creators["abolish poison on party"] = &abolish_poison_on_party; + creators["rebirth"] = &rebirth; + creators["entangling roots on cc"] = &entangling_roots_on_cc; + creators["innervate"] = &innervate; + } + +private: + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("melee", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* caster_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("caster form", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* cure_poison([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("cure poison", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* cure_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("cure poison on party", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* abolish_poison([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("abolish poison", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("abolish poison on party", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* rebirth([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("rebirth", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("entangling roots on cc", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("innervate", + /*P*/ {}, + /*A*/ { NextAction("mana potion") }, + /*C*/ {}); + } +}; + +GenericDruidStrategy::GenericDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericDruidStrategyActionNodeFactory()); +} + +void GenericDruidStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode("low health", { NextAction("barkskin", ACTION_HIGH + 7) })); + + triggers.push_back(new TriggerNode("combat party member dead", + { NextAction("rebirth", ACTION_HIGH + 9) })); + triggers.push_back(new TriggerNode("being attacked", + { NextAction("nature's grasp", ACTION_HIGH + 1) })); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); +} + +void DruidCureStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("party member cure poison", + { NextAction("abolish poison on party", ACTION_DISPEL + 1) })); + + triggers.push_back( + new TriggerNode("party member remove curse", + { NextAction("remove curse on party", ACTION_DISPEL + 7) })); + +} + +void DruidBoostStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode( + "nature's swiftness", { NextAction("nature's swiftness", ACTION_HIGH + 9) })); +} + +void DruidCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode( + "entangling roots", { NextAction("entangling roots on cc", ACTION_HIGH + 2) })); + triggers.push_back(new TriggerNode( + "entangling roots kite", { NextAction("entangling roots", ACTION_HIGH + 2) })); + triggers.push_back(new TriggerNode( + "hibernate", { NextAction("hibernate on cc", ACTION_HIGH + 3) })); +} + +void DruidHealerDpsStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("healer should attack", + { + NextAction("cancel tree form", ACTION_DEFAULT + 0.3f), + NextAction("moonfire", ACTION_DEFAULT + 0.2f), + NextAction("wrath", ACTION_DEFAULT + 0.1f), + NextAction("starfire", ACTION_DEFAULT), +})); + +} diff --git a/src/strategy/druid/GenericDruidStrategy.h b/src/Ai/Class/Druid/Strategy/GenericDruidStrategy.h similarity index 100% rename from src/strategy/druid/GenericDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/GenericDruidStrategy.h diff --git a/src/Ai/Class/Druid/Strategy/HealDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/HealDruidStrategy.cpp new file mode 100644 index 0000000000..5d2c4ce34c --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/HealDruidStrategy.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "HealDruidStrategy.h" + +#include "Playerbots.h" + +class HealDruidStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + HealDruidStrategyActionNodeFactory() { + creators["nourish on party"] = &nourtish_on_party; + } + +private: + static ActionNode* nourtish_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("nourish on party", + /*P*/ {}, + /*A*/ { NextAction("healing touch on party") }, + /*C*/ {}); + } +}; + +HealDruidStrategy::HealDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI) +{ + actionNodeFactories.Add(new HealDruidStrategyActionNodeFactory()); +} + +void HealDruidStrategy::InitTriggers(std::vector& triggers) +{ + GenericDruidStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode( + "party member to heal out of spell range", + { NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9) })); + + // CRITICAL + triggers.push_back( + new TriggerNode("party member critical health", + { + NextAction("tree form", ACTION_CRITICAL_HEAL + 4.1f), + NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 4), + NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 3), + NextAction("wild growth on party", ACTION_CRITICAL_HEAL + 2), + NextAction("nourish on party", ACTION_CRITICAL_HEAL + 1), + })); + + triggers.push_back( + new TriggerNode("party member critical health", + { NextAction("nature's swiftness", ACTION_CRITICAL_HEAL + 4) })); + + triggers.push_back(new TriggerNode( + "group heal setting", + { + NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f), + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f), + NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f), + })); + + triggers.push_back( + new TriggerNode("medium group heal setting", + { + NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f), + NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f) })); + + // LOW + triggers.push_back( + new TriggerNode("party member low health", + { NextAction("tree form", ACTION_MEDIUM_HEAL + 1.5f), + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 1.4f), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 1.3f), + NextAction("swiftmend on party", ACTION_MEDIUM_HEAL + 1.2), + NextAction("nourish on party", ACTION_MEDIUM_HEAL + 1.1f), + })); + + // MEDIUM + triggers.push_back( + new TriggerNode("party member medium health", + { + NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f), + NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f), + NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f), + NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 0.2f), + NextAction("nourish on party", ACTION_MEDIUM_HEAL + 0.1f) })); + + // almost full + triggers.push_back( + new TriggerNode("party member almost full health", + { NextAction("wild growth on party", ACTION_LIGHT_HEAL + 0.3f), + NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 0.2f), + NextAction("regrowth on party", ACTION_LIGHT_HEAL + 0.1f) })); + + triggers.push_back( + new TriggerNode("medium mana", { NextAction("innervate", ACTION_HIGH + 5) })); + + triggers.push_back(new TriggerNode("enemy too close for spell", + { NextAction("flee", ACTION_MOVE + 9) })); +} diff --git a/src/strategy/druid/HealDruidStrategy.h b/src/Ai/Class/Druid/Strategy/HealDruidStrategy.h similarity index 100% rename from src/strategy/druid/HealDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/HealDruidStrategy.h diff --git a/src/strategy/druid/MeleeDruidStrategy.cpp b/src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.cpp similarity index 56% rename from src/strategy/druid/MeleeDruidStrategy.cpp rename to src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.cpp index f474a97828..5dc0f85d91 100644 --- a/src/strategy/druid/MeleeDruidStrategy.cpp +++ b/src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.cpp @@ -9,16 +9,24 @@ MeleeDruidStrategy::MeleeDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} -NextAction** MeleeDruidStrategy::getDefaultActions() +std::vector MeleeDruidStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("faerie fire", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); + return { + NextAction("faerie fire", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; } void MeleeDruidStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode( - "omen of clarity", NextAction::array(0, new NextAction("omen of clarity", ACTION_HIGH + 9), nullptr))); + triggers.push_back( + new TriggerNode( + "omen of clarity", + { + NextAction("omen of clarity", ACTION_HIGH + 9) + } + ) + ); CombatStrategy::InitTriggers(triggers); } diff --git a/src/strategy/druid/MeleeDruidStrategy.h b/src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.h similarity index 90% rename from src/strategy/druid/MeleeDruidStrategy.h rename to src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.h index 95317360f9..67bbbbfed1 100644 --- a/src/strategy/druid/MeleeDruidStrategy.h +++ b/src/Ai/Class/Druid/Strategy/MeleeDruidStrategy.h @@ -15,7 +15,7 @@ class MeleeDruidStrategy : public CombatStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "melee"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.cpp b/src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.cpp new file mode 100644 index 0000000000..c472ce8d86 --- /dev/null +++ b/src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.cpp @@ -0,0 +1,307 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + + #include "OffhealDruidCatStrategy.h" + + #include "Playerbots.h" + #include "Strategy.h" + + class OffhealDruidCatStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + OffhealDruidCatStrategyActionNodeFactory() + { + creators["cat form"] = &cat_form; + creators["mangle (cat)"] = &mangle_cat; + creators["shred"] = &shred; + creators["rake"] = &rake; + creators["rip"] = &rip; + creators["ferocious bite"] = &ferocious_bite; + creators["savage roar"] = &savage_roar; + creators["faerie fire (feral)"] = &faerie_fire_feral; + creators["healing touch on party"] = &healing_touch_on_party; + creators["regrowth on party"] = ®rowth_on_party; + creators["rejuvenation on party"] = &rejuvenation_on_party; + } + +private: + static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "cat form", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mangle (cat)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* shred([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "shred", + /*P*/ {}, + /*A*/ { NextAction("claw") }, + /*C*/ {} + ); + } + + static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rake", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rip", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "ferocious bite", + /*P*/ {}, + /*A*/ { NextAction("rip") }, + /*C*/ {} + ); + } + + static ActionNode* savage_roar([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "savage roar", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "faerie fire (feral)", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* healing_touch_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "healing touch on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ { NextAction("cat form") } + ); + } + + static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "regrowth on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ { NextAction("cat form") } + ); + } + + static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rejuvenation on party", + /*P*/ { NextAction("caster form") }, + /*A*/ {}, + /*C*/ { NextAction("cat form") } + ); + } +}; + +OffhealDruidCatStrategy::OffhealDruidCatStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) +{ + actionNodeFactories.Add(new OffhealDruidCatStrategyActionNodeFactory()); +} + +std::vector OffhealDruidCatStrategy::getDefaultActions() +{ + return { + NextAction("mangle (cat)", ACTION_DEFAULT + 0.5f), + NextAction("shred", ACTION_DEFAULT + 0.4f), + NextAction("rake", ACTION_DEFAULT + 0.3f), + NextAction("melee", ACTION_DEFAULT), + NextAction("cat form", ACTION_DEFAULT - 0.1f) + }; +} + +void OffhealDruidCatStrategy::InitTriggers(std::vector& triggers) +{ + FeralDruidStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "cat form", + { + NextAction("cat form", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "savage roar", + { + NextAction("savage roar", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points available", + { + NextAction("rip", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "ferocious bite time", + { + NextAction("ferocious bite", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target with combo points almost dead", + { + NextAction("ferocious bite", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "mangle (cat)", + { + NextAction("mangle (cat)", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rake", + { + NextAction("rake", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "almost full energy available", + { + NextAction("shred", ACTION_DEFAULT + 0.4f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "combo points not full", + { + NextAction("shred", ACTION_DEFAULT + 0.4f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "faerie fire (feral)", + { + NextAction("faerie fire (feral)", ACTION_NORMAL) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("feral charge - cat", ACTION_HIGH + 9), + NextAction("dash", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("swipe (cat)", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low energy", + { + NextAction("tiger's fury", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member critical health", + { + NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 6), + NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member low health", + { + NextAction("healing touch on party", ACTION_MEDIUM_HEAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member medium health", + { + NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member to heal out of spell range", + { + NextAction("reach party member to heal", ACTION_EMERGENCY + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("innervate", ACTION_HIGH + 4) + } + ) + ); +} diff --git a/src/strategy/druid/OffhealDruidCatStrategy.h b/src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.h similarity index 93% rename from src/strategy/druid/OffhealDruidCatStrategy.h rename to src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.h index c90775d58f..736de37cda 100644 --- a/src/strategy/druid/OffhealDruidCatStrategy.h +++ b/src/Ai/Class/Druid/Strategy/OffhealDruidCatStrategy.h @@ -17,7 +17,7 @@ void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "offheal"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_HEAL | STRATEGY_TYPE_MELEE; diff --git a/src/strategy/druid/DruidTriggers.cpp b/src/Ai/Class/Druid/Trigger/DruidTriggers.cpp similarity index 100% rename from src/strategy/druid/DruidTriggers.cpp rename to src/Ai/Class/Druid/Trigger/DruidTriggers.cpp diff --git a/src/strategy/druid/DruidTriggers.h b/src/Ai/Class/Druid/Trigger/DruidTriggers.h similarity index 100% rename from src/strategy/druid/DruidTriggers.h rename to src/Ai/Class/Druid/Trigger/DruidTriggers.h diff --git a/src/strategy/hunter/HunterActions.cpp b/src/Ai/Class/Hunter/Action/HunterActions.cpp similarity index 93% rename from src/strategy/hunter/HunterActions.cpp rename to src/Ai/Class/Hunter/Action/HunterActions.cpp index 379cf0d595..a1588f8537 100644 --- a/src/strategy/hunter/HunterActions.cpp +++ b/src/Ai/Class/Hunter/Action/HunterActions.cpp @@ -103,9 +103,7 @@ bool CastScareBeastCcAction::Execute(Event event) { return botAI->CastSpell("sca bool CastWingClipAction::isUseful() { return CastSpellAction::isUseful() && !botAI->HasAura(spell, GetTarget()); } -NextAction** CastWingClipAction::getPrerequisites() { return nullptr; } - -// bool CastRaptorStrikeAction::isUseful() -// { -// return CastMeleeSpellAction::isUseful() && botAI->HasStrategy("close", BOT_STATE_COMBAT); -// } +std::vector CastWingClipAction::getPrerequisites() +{ + return {}; +} diff --git a/src/strategy/hunter/HunterActions.h b/src/Ai/Class/Hunter/Action/HunterActions.h similarity index 99% rename from src/strategy/hunter/HunterActions.h rename to src/Ai/Class/Hunter/Action/HunterActions.h index 6deaabaf4e..8e21135254 100644 --- a/src/strategy/hunter/HunterActions.h +++ b/src/Ai/Class/Hunter/Action/HunterActions.h @@ -418,7 +418,7 @@ class CastWingClipAction : public CastSpellAction CastWingClipAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "wing clip") {} bool isUseful() override; - NextAction** getPrerequisites() override; + std::vector getPrerequisites() override; }; class CastRaptorStrikeAction : public CastSpellAction diff --git a/src/strategy/hunter/HunterAiObjectContext.cpp b/src/Ai/Class/Hunter/HunterAiObjectContext.cpp similarity index 100% rename from src/strategy/hunter/HunterAiObjectContext.cpp rename to src/Ai/Class/Hunter/HunterAiObjectContext.cpp diff --git a/src/strategy/hunter/HunterAiObjectContext.h b/src/Ai/Class/Hunter/HunterAiObjectContext.h similarity index 100% rename from src/strategy/hunter/HunterAiObjectContext.h rename to src/Ai/Class/Hunter/HunterAiObjectContext.h diff --git a/src/strategy/hunter/BeastMasteryHunterStrategy.cpp b/src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.cpp similarity index 51% rename from src/strategy/hunter/BeastMasteryHunterStrategy.cpp rename to src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.cpp index 0b691357f2..a2c302d379 100644 --- a/src/strategy/hunter/BeastMasteryHunterStrategy.cpp +++ b/src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.cpp @@ -25,16 +25,16 @@ class BeastMasteryHunterStrategyActionNodeFactory : public NamedObjectFactory BeastMasteryHunterStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("bestial wrath", 19.0f), - new NextAction("kill command", 5.7f), - new NextAction("kill shot", 5.6f), - new NextAction("serpent sting", 5.5f), - new NextAction("aimed shot", 5.4f), - new NextAction("arcane shot", 5.3f), - new NextAction("steady shot", 5.2f), - new NextAction("auto shot", 5.1f), nullptr); + return { + NextAction("bestial wrath", 19.0f), + NextAction("kill command", 5.7f), + NextAction("kill shot", 5.6f), + NextAction("serpent sting", 5.5f), + NextAction("aimed shot", 5.4f), + NextAction("arcane shot", 5.3f), + NextAction("steady shot", 5.2f), + NextAction("auto shot", 5.1f) + }; } // ===== Trigger Initialization === void BeastMasteryHunterStrategy::InitTriggers(std::vector& triggers) { GenericHunterStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("intimidation", NextAction::array(0, new NextAction("intimidation", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("kill command", NextAction::array(0, new NextAction("kill command", 18.5f), nullptr))); - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("kill shot", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("viper sting", 17.5f), nullptr))); - triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr))); - triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "intimidation", + { + NextAction("intimidation", 40.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "kill command", + { + NextAction("kill command", 18.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("kill shot", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("viper sting", 17.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "no stings", + { + NextAction("serpent sting", 17.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "serpent sting on attacker", + { + NextAction("serpent sting on attacker", 16.5f) + } + ) + ); } diff --git a/src/strategy/hunter/BeastMasteryHunterStrategy.h b/src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.h similarity index 91% rename from src/strategy/hunter/BeastMasteryHunterStrategy.h rename to src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.h index 561ba0247a..5235aa861e 100644 --- a/src/strategy/hunter/BeastMasteryHunterStrategy.h +++ b/src/Ai/Class/Hunter/Strategy/BeastMasteryHunterStrategy.h @@ -18,7 +18,7 @@ class BeastMasteryHunterStrategy : public GenericHunterStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "bm"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.cpp b/src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.cpp new file mode 100644 index 0000000000..151feadf16 --- /dev/null +++ b/src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericHunterNonCombatStrategy.h" + +#include "Playerbots.h" + +class GenericHunterNonCombatStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericHunterNonCombatStrategyActionNodeFactory() + { + creators["rapid fire"] = &rapid_fire; + creators["boost"] = &rapid_fire; + creators["aspect of the pack"] = &aspect_of_the_pack; + } + +private: + static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("rapid fire", + /*P*/ {}, + /*A*/ { NextAction("readiness")}, + /*C*/ {}); + } + + static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("aspect of the pack", + /*P*/ {}, + /*A*/ { NextAction("aspect of the cheetah")}, + /*C*/ {}); + } +}; + +GenericHunterNonCombatStrategy::GenericHunterNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericHunterNonCombatStrategyActionNodeFactory()); +} + +void GenericHunterNonCombatStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("trueshot aura", { NextAction("trueshot aura", 2.0f)})); + triggers.push_back(new TriggerNode("often", { + NextAction("apply stone", 1.0f), + NextAction("apply oil", 1.0f), + })); + triggers.push_back(new TriggerNode("low ammo", { NextAction("say::low ammo", ACTION_NORMAL)})); + triggers.push_back(new TriggerNode("no track", { NextAction("track humanoids", ACTION_NORMAL)})); + triggers.push_back(new TriggerNode("no ammo", { NextAction("equip upgrades", ACTION_HIGH + 1)})); +} + +void HunterPetStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("no pet", { NextAction("call pet", 60.0f)})); + triggers.push_back(new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f)})); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f)})); + triggers.push_back(new TriggerNode("pet not happy", { NextAction("feed pet", 60.0f)})); + triggers.push_back(new TriggerNode("hunters pet medium health", { NextAction("mend pet", 60.0f)})); + triggers.push_back(new TriggerNode("hunters pet dead", { NextAction("revive pet", 60.0f)})); +} diff --git a/src/strategy/hunter/GenericHunterNonCombatStrategy.h b/src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.h similarity index 100% rename from src/strategy/hunter/GenericHunterNonCombatStrategy.h rename to src/Ai/Class/Hunter/Strategy/GenericHunterNonCombatStrategy.h diff --git a/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp b/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp new file mode 100644 index 0000000000..04afc6f766 --- /dev/null +++ b/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.cpp @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericHunterStrategy.h" + +#include "Playerbots.h" +#include "Strategy.h" + +class GenericHunterStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericHunterStrategyActionNodeFactory() + { + creators["rapid fire"] = &rapid_fire; + creators["boost"] = &rapid_fire; + creators["aspect of the pack"] = &aspect_of_the_pack; + creators["aspect of the dragonhawk"] = &aspect_of_the_dragonhawk; + creators["feign death"] = &feign_death; + creators["wing clip"] = &wing_clip; + creators["mongoose bite"] = &mongoose_bite; + creators["raptor strike"] = &raptor_strike; + creators["explosive trap"] = &explosive_trap; + } + +private: + static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("rapid fire", + /*P*/ {}, + /*A*/ { NextAction("readiness") }, + /*C*/ {}); + } + + static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("aspect of the pack", + /*P*/ {}, + /*A*/ { NextAction("aspect of the cheetah") }, + /*C*/ {}); + } + + static ActionNode* aspect_of_the_dragonhawk([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("aspect of the dragonhawk", + /*P*/ {}, + /*A*/ { NextAction("aspect of the hawk") }, + /*C*/ {}); + } + + static ActionNode* feign_death([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("feign death", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* wing_clip([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("wing clip", + /*P*/ {}, + // /*A*/ { NextAction("mongoose bite") }, + {}, + /*C*/ {}); + } + + static ActionNode* mongoose_bite([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("mongoose bite", + /*P*/ {}, + /*A*/ { NextAction("raptor strike") }, + /*C*/ {}); + } + + static ActionNode* raptor_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("raptor strike", + /*P*/ { NextAction("melee") }, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* explosive_trap([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("explosive trap", + /*P*/ {}, + /*A*/ { NextAction("immolation trap") }, + /*C*/ {}); + } +}; + +GenericHunterStrategy::GenericHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericHunterStrategyActionNodeFactory()); +} + +void GenericHunterStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + + // Mark/Ammo/Mana Triggers + triggers.push_back(new TriggerNode("no ammo", { NextAction("equip upgrades", 30.0f) })); + triggers.push_back(new TriggerNode("hunter's mark", { NextAction("hunter's mark", 29.5f) })); + triggers.push_back(new TriggerNode("rapid fire", { NextAction("rapid fire", 29.0f) })); + triggers.push_back(new TriggerNode("aspect of the viper", { NextAction("aspect of the viper", 28.0f) })); + triggers.push_back(new TriggerNode("aspect of the hawk", { NextAction("aspect of the dragonhawk", 27.5f) })); + + // Aggro/Threat/Defensive Triggers + triggers.push_back(new TriggerNode("has aggro", { NextAction("concussive shot", 20.0f) })); + triggers.push_back(new TriggerNode("low tank threat", { NextAction("misdirection on main tank", 27.0f) })); + triggers.push_back(new TriggerNode("low health", { NextAction("deterrence", 35.0f) })); + triggers.push_back(new TriggerNode("concussive shot on snare target", { NextAction("concussive shot", 20.0f) })); + triggers.push_back(new TriggerNode("medium threat", { NextAction("feign death", 35.0f) })); + triggers.push_back(new TriggerNode("hunters pet medium health", { NextAction("mend pet", 22.0f) })); + triggers.push_back(new TriggerNode("hunters pet low health", { NextAction("mend pet", 21.0f) })); + + // Dispel Triggers + triggers.push_back(new TriggerNode("tranquilizing shot enrage", { NextAction("tranquilizing shot", 61.0f) })); + triggers.push_back(new TriggerNode("tranquilizing shot magic", { NextAction("tranquilizing shot", 61.0f) })); + + // Ranged-based Triggers + triggers.push_back(new TriggerNode("enemy within melee", { + NextAction("explosive trap", 37.0f), + NextAction("mongoose bite", 22.0f), + NextAction("wing clip", 21.0f) })); + + triggers.push_back(new TriggerNode("enemy too close for auto shot", { + NextAction("disengage", 35.0f), + NextAction("flee", 34.0f) })); +} + +// ===== AoE Strategy, 2/3+ enemies ===== +AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} + +void AoEHunterStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("volley channel check", { NextAction("cancel channel", 23.0f) })); + triggers.push_back(new TriggerNode("medium aoe", { NextAction("volley", 22.0f) })); + triggers.push_back(new TriggerNode("light aoe", { NextAction("multi-shot", 21.0f) })); +} + +void HunterBoostStrategy::InitTriggers(std::vector& triggers) +{ +} + +void HunterCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("scare beast", { NextAction("scare beast on cc", 23.0f) })); + triggers.push_back(new TriggerNode("freezing trap", { NextAction("freezing trap on cc", 23.0f) })); +} + +void HunterTrapWeaveStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("immolation trap no cd", { NextAction("reach melee", 23.0f) })); +} diff --git a/src/strategy/hunter/GenericHunterStrategy.h b/src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.h similarity index 100% rename from src/strategy/hunter/GenericHunterStrategy.h rename to src/Ai/Class/Hunter/Strategy/GenericHunterStrategy.h diff --git a/src/strategy/hunter/HunterBuffStrategies.cpp b/src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.cpp similarity index 66% rename from src/strategy/hunter/HunterBuffStrategies.cpp rename to src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.cpp index 94e7e7dcf6..3601d77119 100644 --- a/src/strategy/hunter/HunterBuffStrategies.cpp +++ b/src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.cpp @@ -16,9 +16,9 @@ class BuffHunterStrategyActionNodeFactory : public NamedObjectFactory& triggers) { triggers.push_back( - new TriggerNode("aspect of the hawk", NextAction::array(0, new NextAction("aspect of the dragonhawk", 20.1f), - new NextAction("aspect of the hawk", 20.0f), nullptr))); + new TriggerNode("aspect of the hawk", { NextAction("aspect of the dragonhawk", 20.1f), + NextAction("aspect of the hawk", 20.0f) })); } void HunterNatureResistanceStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("aspect of the wild", - NextAction::array(0, new NextAction("aspect of the wild", 20.0f), nullptr))); + { NextAction("aspect of the wild", 20.0f) })); } void HunterBuffSpeedStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("aspect of the pack", - NextAction::array(0, new NextAction("aspect of the pack", 20.0f), nullptr))); + { NextAction("aspect of the pack", 20.0f) })); } void HunterBuffManaStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("aspect of the viper", - NextAction::array(0, new NextAction("aspect of the viper", 20.0f), nullptr))); + { NextAction("aspect of the viper", 20.0f) })); } diff --git a/src/strategy/hunter/HunterBuffStrategies.h b/src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.h similarity index 100% rename from src/strategy/hunter/HunterBuffStrategies.h rename to src/Ai/Class/Hunter/Strategy/HunterBuffStrategies.h diff --git a/src/strategy/hunter/MarksmanshipHunterStrategy.cpp b/src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.cpp similarity index 52% rename from src/strategy/hunter/MarksmanshipHunterStrategy.cpp rename to src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.cpp index 665de72751..e4e8a9a4f4 100644 --- a/src/strategy/hunter/MarksmanshipHunterStrategy.cpp +++ b/src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.cpp @@ -27,18 +27,18 @@ class MarksmanshipHunterStrategyActionNodeFactory : public NamedObjectFactory MarksmanshipHunterStrategy::getDefaultActions() { - return NextAction::array(0, - new NextAction("kill command", 5.8f), - new NextAction("kill shot", 5.7f), - new NextAction("serpent sting", 5.6f), - new NextAction("chimera shot", 5.5f), - new NextAction("aimed shot", 5.4f), - new NextAction("arcane shot", 5.3f), - new NextAction("steady shot", 5.2f), - new NextAction("auto shot", 5.1f), nullptr); + return { + NextAction("kill command", 5.8f), + NextAction("kill shot", 5.7f), + NextAction("serpent sting", 5.6f), + NextAction("chimera shot", 5.5f), + NextAction("aimed shot", 5.4f), + NextAction("arcane shot", 5.3f), + NextAction("steady shot", 5.2f), + NextAction("auto shot", 5.1f) + }; } // ===== Trigger Initialization === void MarksmanshipHunterStrategy::InitTriggers(std::vector& triggers) { GenericHunterStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("silencing shot", NextAction::array(0, new NextAction("silencing shot", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("kill command", NextAction::array(0, new NextAction("kill command", 18.5f), nullptr))); - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("kill shot", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("viper sting", 17.5f), nullptr))); - triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 17.0f), nullptr))); - triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 16.5f), nullptr))); + + triggers.push_back( + new TriggerNode( + "silencing shot", + { + NextAction("silencing shot", 40.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "kill command", + { + NextAction("kill command", 18.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("kill shot", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("viper sting", 17.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "no stings", + { + NextAction("serpent sting", 17.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "serpent sting on attacker", + { + NextAction("serpent sting on attacker", 16.5f) + } + ) + ); } diff --git a/src/strategy/hunter/MarksmanshipHunterStrategy.h b/src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.h similarity index 91% rename from src/strategy/hunter/MarksmanshipHunterStrategy.h rename to src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.h index e08de85cc6..800d40a8a2 100644 --- a/src/strategy/hunter/MarksmanshipHunterStrategy.h +++ b/src/Ai/Class/Hunter/Strategy/MarksmanshipHunterStrategy.h @@ -18,7 +18,7 @@ class MarksmanshipHunterStrategy : public GenericHunterStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "mm"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp b/src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp new file mode 100644 index 0000000000..796891a9b0 --- /dev/null +++ b/src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.cpp @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "SurvivalHunterStrategy.h" +#include "Playerbots.h" + +// ===== Action Node Factory ===== +class SurvivalHunterStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + SurvivalHunterStrategyActionNodeFactory() + { + creators["auto shot"] = &auto_shot; + creators["kill command"] = &kill_command; + creators["kill shot"] = &kill_shot; + creators["explosive shot"] = &explosive_shot; + creators["black arrow"] = &black_arrow; + creators["viper sting"] = &viper_sting; + creators["serpent sting"] = serpent_sting; + creators["aimed shot"] = &aimed_shot; + creators["arcane shot"] = &arcane_shot; + creators["steady shot"] = &steady_shot; + creators["multi-shot"] = &multi_shot; + creators["volley"] = &volley; + } + +private: + static ActionNode* auto_shot(PlayerbotAI*) { return new ActionNode("auto shot", {}, {}, {}); } + static ActionNode* kill_command(PlayerbotAI*) { return new ActionNode("kill command", {}, {}, {}); } + static ActionNode* kill_shot(PlayerbotAI*) { return new ActionNode("kill shot", {}, {}, {}); } + static ActionNode* explosive_shot(PlayerbotAI*) { return new ActionNode("explosive shot", {}, {}, {}); } + static ActionNode* black_arrow(PlayerbotAI*) { return new ActionNode("black arrow", {}, {}, {}); } + static ActionNode* viper_sting(PlayerbotAI*) { return new ActionNode("viper sting", {}, {}, {}); } + static ActionNode* serpent_sting(PlayerbotAI*) { return new ActionNode("serpent sting", {}, {}, {}); } + static ActionNode* aimed_shot(PlayerbotAI*) { return new ActionNode("aimed shot", {}, {}, {}); } + static ActionNode* arcane_shot(PlayerbotAI*) { return new ActionNode("arcane shot", {}, {}, {}); } + static ActionNode* steady_shot(PlayerbotAI*) { return new ActionNode("steady shot", {}, {}, {}); } + static ActionNode* multi_shot(PlayerbotAI*) { return new ActionNode("multi shot", {}, {}, {}); } + static ActionNode* volley(PlayerbotAI*) { return new ActionNode("volley", {}, {}, {}); } +}; + +// ===== Single Target Strategy ===== +SurvivalHunterStrategy::SurvivalHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI) +{ + actionNodeFactories.Add(new SurvivalHunterStrategyActionNodeFactory()); +} + +// ===== Default Actions ===== +std::vector SurvivalHunterStrategy::getDefaultActions() +{ + return { + NextAction("kill command", 5.9f), + NextAction("kill shot", 5.8f), + NextAction("explosive shot", 5.7f), + NextAction("black arrow", 5.6f), + NextAction("serpent sting", 5.5f), + NextAction("aimed shot", 5.4f), + NextAction("arcane shot", 5.3f), + NextAction("steady shot", 5.2f), + NextAction("auto shot", 5.1f) + }; +} + +// ===== Trigger Initialization === +void SurvivalHunterStrategy::InitTriggers(std::vector& triggers) +{ + GenericHunterStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "lock and load", + { + NextAction("explosive shot rank 4", 28.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lock and load", + { + NextAction("explosive shot rank 3", 27.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lock and load", + { + NextAction("explosive shot rank 2", 27.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lock and load", + { + NextAction("explosive shot rank 1", 26.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "kill command", + { + NextAction("kill command", 18.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("kill shot", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "explosive shot", + { + NextAction("explosive shot", 17.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "black arrow", + { + NextAction("black arrow", 16.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("viper sting", 16.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "no stings", + { + NextAction("serpent sting", 15.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "serpent sting on attacker", + { + NextAction("serpent sting on attacker", 15.0f) + } + ) + ); +} diff --git a/src/strategy/hunter/SurvivalHunterStrategy.h b/src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.h similarity index 91% rename from src/strategy/hunter/SurvivalHunterStrategy.h rename to src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.h index 573a3e8f76..2e2b52f13e 100644 --- a/src/strategy/hunter/SurvivalHunterStrategy.h +++ b/src/Ai/Class/Hunter/Strategy/SurvivalHunterStrategy.h @@ -18,7 +18,7 @@ class SurvivalHunterStrategy : public GenericHunterStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "surv"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/hunter/HunterTriggers.cpp b/src/Ai/Class/Hunter/Trigger/HunterTriggers.cpp similarity index 100% rename from src/strategy/hunter/HunterTriggers.cpp rename to src/Ai/Class/Hunter/Trigger/HunterTriggers.cpp diff --git a/src/strategy/hunter/HunterTriggers.h b/src/Ai/Class/Hunter/Trigger/HunterTriggers.h similarity index 100% rename from src/strategy/hunter/HunterTriggers.h rename to src/Ai/Class/Hunter/Trigger/HunterTriggers.h diff --git a/src/strategy/mage/MageActions.cpp b/src/Ai/Class/Mage/Action/MageActions.cpp similarity index 100% rename from src/strategy/mage/MageActions.cpp rename to src/Ai/Class/Mage/Action/MageActions.cpp diff --git a/src/strategy/mage/MageActions.h b/src/Ai/Class/Mage/Action/MageActions.h similarity index 100% rename from src/strategy/mage/MageActions.h rename to src/Ai/Class/Mage/Action/MageActions.h diff --git a/src/strategy/mage/MageAiObjectContext.cpp b/src/Ai/Class/Mage/MageAiObjectContext.cpp similarity index 100% rename from src/strategy/mage/MageAiObjectContext.cpp rename to src/Ai/Class/Mage/MageAiObjectContext.cpp diff --git a/src/strategy/mage/MageAiObjectContext.h b/src/Ai/Class/Mage/MageAiObjectContext.h similarity index 100% rename from src/strategy/mage/MageAiObjectContext.h rename to src/Ai/Class/Mage/MageAiObjectContext.h diff --git a/src/strategy/mage/ArcaneMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.cpp similarity index 59% rename from src/strategy/mage/ArcaneMageStrategy.cpp rename to src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.cpp index b3cf8a6345..4707231db1 100644 --- a/src/strategy/mage/ArcaneMageStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.cpp @@ -22,13 +22,13 @@ class ArcaneMageStrategyActionNodeFactory : public NamedObjectFactory ArcaneMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("arcane blast", 5.6f), - new NextAction("arcane missiles", 5.5f), - new NextAction("arcane barrage", 5.4f), // cast while moving - new NextAction("fire blast", 5.3f), // cast while moving if arcane barrage isn't available/learned - new NextAction("frostbolt", 5.2f), // for arcane immune targets - new NextAction("shoot", 5.1f), nullptr); + return { + NextAction("arcane blast", 5.6f), + NextAction("arcane missiles", 5.5f), + NextAction("arcane barrage", 5.4f), // cast while moving + NextAction("fire blast", 5.3f), // cast while moving if arcane barrage isn't available/learned + NextAction("frostbolt", 5.2f), // for arcane immune targets + NextAction("shoot", 5.1f) + }; } // ===== Trigger Initialization === @@ -54,5 +56,12 @@ void ArcaneMageStrategy::InitTriggers(std::vector& triggers) GenericMageStrategy::InitTriggers(triggers); // Proc Trigger - triggers.push_back(new TriggerNode("arcane blast 4 stacks and missile barrage", NextAction::array(0, new NextAction("arcane missiles", 15.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "arcane blast 4 stacks and missile barrage", + { + NextAction("arcane missiles", 15.0f) + } + ) + ); } diff --git a/src/strategy/mage/ArcaneMageStrategy.h b/src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.h similarity index 91% rename from src/strategy/mage/ArcaneMageStrategy.h rename to src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.h index c32f966f04..e654a655bb 100644 --- a/src/strategy/mage/ArcaneMageStrategy.h +++ b/src/Ai/Class/Mage/Strategy/ArcaneMageStrategy.h @@ -17,7 +17,7 @@ class ArcaneMageStrategy : public GenericMageStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "arcane"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/mage/FireMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/FireMageStrategy.cpp similarity index 61% rename from src/strategy/mage/FireMageStrategy.cpp rename to src/Ai/Class/Mage/Strategy/FireMageStrategy.cpp index 95cc6955a9..4914c72df6 100644 --- a/src/strategy/mage/FireMageStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/FireMageStrategy.cpp @@ -23,13 +23,13 @@ class FireMageStrategyActionNodeFactory : public NamedObjectFactory } private: - static ActionNode* fireball(PlayerbotAI*) { return new ActionNode("fireball", nullptr, nullptr, nullptr); } - static ActionNode* frostbolt(PlayerbotAI*) { return new ActionNode("frostbolt", nullptr, nullptr, nullptr); } - static ActionNode* fire_blast(PlayerbotAI*) { return new ActionNode("fire blast", nullptr, nullptr, nullptr); } - static ActionNode* pyroblast(PlayerbotAI*) { return new ActionNode("pyroblast", nullptr, nullptr, nullptr); } - static ActionNode* scorch(PlayerbotAI*) { return new ActionNode("scorch", nullptr, nullptr, nullptr); } - static ActionNode* living_bomb(PlayerbotAI*) { return new ActionNode("living bomb", nullptr, nullptr, nullptr); } - static ActionNode* combustion(PlayerbotAI*) { return new ActionNode("combustion", nullptr, nullptr, nullptr); } + static ActionNode* fireball(PlayerbotAI*) { return new ActionNode("fireball", {}, {}, {}); } + static ActionNode* frostbolt(PlayerbotAI*) { return new ActionNode("frostbolt", {}, {}, {}); } + static ActionNode* fire_blast(PlayerbotAI*) { return new ActionNode("fire blast", {}, {}, {}); } + static ActionNode* pyroblast(PlayerbotAI*) { return new ActionNode("pyroblast", {}, {}, {}); } + static ActionNode* scorch(PlayerbotAI*) { return new ActionNode("scorch", {}, {}, {}); } + static ActionNode* living_bomb(PlayerbotAI*) { return new ActionNode("living bomb", {}, {}, {}); } + static ActionNode* combustion(PlayerbotAI*) { return new ActionNode("combustion", {}, {}, {}); } }; // ===== Single Target Strategy ===== @@ -39,12 +39,14 @@ FireMageStrategy::FireMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy(bot } // ===== Default Actions ===== -NextAction** FireMageStrategy::getDefaultActions() +std::vector FireMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("fireball", 5.3f), - new NextAction("frostbolt", 5.2f), // fire immune target - new NextAction("fire blast", 5.1f), // cast during movement - new NextAction("shoot", 5.0f), nullptr); + return { + NextAction("fireball", 5.3f), + NextAction("frostbolt", 5.2f), // fire immune target + NextAction("fire blast", 5.1f), // cast during movement + NextAction("shoot", 5.0f) + }; } // ===== Trigger Initialization ===== @@ -53,11 +55,32 @@ void FireMageStrategy::InitTriggers(std::vector& triggers) GenericMageStrategy::InitTriggers(triggers); // Debuff Triggers - triggers.push_back(new TriggerNode("improved scorch", NextAction::array(0, new NextAction("scorch", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("living bomb", NextAction::array(0, new NextAction("living bomb", 18.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "improved scorch", + { + NextAction("scorch", 19.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "living bomb", + { + NextAction("living bomb", 18.5f) + } + ) + ); // Proc Trigger - triggers.push_back(new TriggerNode("hot streak", NextAction::array(0, new NextAction("pyroblast", 25.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "hot streak", + { + NextAction("pyroblast", 25.0f) + } + ) + ); } // Combat strategy to run to melee for Dragon's Breath and Blast Wave @@ -68,7 +91,12 @@ FirestarterStrategy::FirestarterStrategy(PlayerbotAI* botAI) : CombatStrategy(bo void FirestarterStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode( - "blast wave off cd and medium aoe", - NextAction::array(0, new NextAction("reach melee", 25.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "blast wave off cd and medium aoe", + { + NextAction("reach melee", 25.5f) + } + ) + ); } diff --git a/src/strategy/mage/FireMageStrategy.h b/src/Ai/Class/Mage/Strategy/FireMageStrategy.h similarity index 93% rename from src/strategy/mage/FireMageStrategy.h rename to src/Ai/Class/Mage/Strategy/FireMageStrategy.h index 5a5e1fa0db..03d50641b6 100644 --- a/src/strategy/mage/FireMageStrategy.h +++ b/src/Ai/Class/Mage/Strategy/FireMageStrategy.h @@ -17,7 +17,7 @@ class FireMageStrategy : public GenericMageStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "fire"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; class FirestarterStrategy : public CombatStrategy diff --git a/src/strategy/mage/FrostFireMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.cpp similarity index 62% rename from src/strategy/mage/FrostFireMageStrategy.cpp rename to src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.cpp index 0d6e1fec49..4448a43493 100644 --- a/src/strategy/mage/FrostFireMageStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.cpp @@ -22,13 +22,13 @@ class FrostFireMageStrategyActionNodeFactory : public NamedObjectFactory FrostFireMageStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("frostfire bolt", 5.2f), - new NextAction("fire blast", 5.1f), // cast during movement - new NextAction("shoot", 5.0f), nullptr); + return { + NextAction("frostfire bolt", 5.2f), + NextAction("fire blast", 5.1f), // cast during movement + NextAction("shoot", 5.0f) + }; } // ===== Trigger Initialization ===== @@ -51,9 +53,30 @@ void FrostFireMageStrategy::InitTriggers(std::vector& triggers) GenericMageStrategy::InitTriggers(triggers); // Debuff Triggers - triggers.push_back(new TriggerNode("improved scorch", NextAction::array(0, new NextAction("scorch", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("living bomb", NextAction::array(0, new NextAction("living bomb", 18.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "improved scorch", + { + NextAction("scorch", 19.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "living bomb", + { + NextAction("living bomb", 18.5f) + } + ) + ); // Proc Trigger - triggers.push_back(new TriggerNode("hot streak", NextAction::array(0, new NextAction("pyroblast", 25.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "hot streak", + { + NextAction("pyroblast", 25.0f) + } + ) + ); } diff --git a/src/strategy/mage/FrostFireMageStrategy.h b/src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.h similarity index 91% rename from src/strategy/mage/FrostFireMageStrategy.h rename to src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.h index 8d3a396314..00bbf03a54 100644 --- a/src/strategy/mage/FrostFireMageStrategy.h +++ b/src/Ai/Class/Mage/Strategy/FrostFireMageStrategy.h @@ -17,7 +17,7 @@ class FrostFireMageStrategy : public GenericMageStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "frostfire"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/Ai/Class/Mage/Strategy/FrostMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/FrostMageStrategy.cpp new file mode 100644 index 0000000000..34ed81dba1 --- /dev/null +++ b/src/Ai/Class/Mage/Strategy/FrostMageStrategy.cpp @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "FrostMageStrategy.h" + +#include "Playerbots.h" + +// ===== Action Node Factory ===== +class FrostMageStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + FrostMageStrategyActionNodeFactory() + { + creators["cold snap"] = &cold_snap; + creators["ice barrier"] = &ice_barrier; + creators["summon water elemental"] = &summon_water_elemental; + creators["deep freeze"] = &deep_freeze; + creators["icy veins"] = &icy_veins; + creators["frostbolt"] = &frostbolt; + creators["ice lance"] = &ice_lance; + creators["fire blast"] = &fire_blast; + creators["fireball"] = &fireball; + creators["frostfire bolt"] = &frostfire_bolt; + } + +private: + static ActionNode* cold_snap(PlayerbotAI*) { return new ActionNode("cold snap", {}, {}, {}); } + static ActionNode* ice_barrier(PlayerbotAI*) { return new ActionNode("ice barrier", {}, {}, {}); } + static ActionNode* summon_water_elemental(PlayerbotAI*) { return new ActionNode("summon water elemental", {}, {}, {}); } + static ActionNode* deep_freeze(PlayerbotAI*) { return new ActionNode("deep freeze", {}, {}, {}); } + static ActionNode* icy_veins(PlayerbotAI*) { return new ActionNode("icy veins", {}, {}, {}); } + static ActionNode* frostbolt(PlayerbotAI*) { return new ActionNode("frostbolt", {}, {}, {}); } + static ActionNode* ice_lance(PlayerbotAI*) { return new ActionNode("ice lance", {}, {}, {}); } + static ActionNode* fire_blast(PlayerbotAI*) { return new ActionNode("fire blast", {}, {}, {}); } + static ActionNode* fireball(PlayerbotAI*) { return new ActionNode("fireball", {}, {}, {}); } + static ActionNode* frostfire_bolt(PlayerbotAI*) { return new ActionNode("frostfire bolt", {}, {}, {}); } +}; + +// ===== Single Target Strategy ===== +FrostMageStrategy::FrostMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy(botAI) +{ + actionNodeFactories.Add(new FrostMageStrategyActionNodeFactory()); +} + +// ===== Default Actions ===== +std::vector FrostMageStrategy::getDefaultActions() +{ + return { + NextAction("frostbolt", 5.4f), + NextAction("ice lance", 5.3f), // cast during movement + NextAction("fire blast", 5.2f), // cast during movement if ice lance is not learned + NextAction("shoot", 5.1f), + NextAction("fireball", 5.0f) + }; +} + +// ===== Trigger Initialization === +void FrostMageStrategy::InitTriggers(std::vector& triggers) +{ + GenericMageStrategy::InitTriggers(triggers); + + // Pet/Defensive triggers + triggers.push_back( + new TriggerNode( + "no pet", + { + NextAction("summon water elemental", 30.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "has pet", + { + NextAction("toggle pet spell", 60.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "new pet", + { + NextAction("set pet stance", 60.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium health", + { + NextAction("ice barrier", 29.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "being attacked", + { + NextAction("ice barrier", 29.0f) + } + ) + ); + + // Proc/Freeze triggers + triggers.push_back( + new TriggerNode( + "brain freeze", + { + NextAction("frostfire bolt", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "fingers of frost", + { + NextAction("deep freeze", 19.0f), + NextAction("frostbolt", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "frostbite on target", + { + NextAction("deep freeze", 19.0f), + NextAction("frostbolt", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "frost nova on target", + { + NextAction("deep freeze", 19.0f), + NextAction("frostbolt", 18.0f) + } + ) + ); +} diff --git a/src/strategy/mage/FrostMageStrategy.h b/src/Ai/Class/Mage/Strategy/FrostMageStrategy.h similarity index 91% rename from src/strategy/mage/FrostMageStrategy.h rename to src/Ai/Class/Mage/Strategy/FrostMageStrategy.h index d0b3b37280..9b027fed8b 100644 --- a/src/strategy/mage/FrostMageStrategy.h +++ b/src/Ai/Class/Mage/Strategy/FrostMageStrategy.h @@ -17,7 +17,7 @@ class FrostMageStrategy : public GenericMageStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "frost"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/mage/GenericMageNonCombatStrategy.cpp b/src/Ai/Class/Mage/Strategy/GenericMageNonCombatStrategy.cpp similarity index 53% rename from src/strategy/mage/GenericMageNonCombatStrategy.cpp rename to src/Ai/Class/Mage/Strategy/GenericMageNonCombatStrategy.cpp index d83c0f5fa4..eab98ea5a2 100644 --- a/src/strategy/mage/GenericMageNonCombatStrategy.cpp +++ b/src/Ai/Class/Mage/Strategy/GenericMageNonCombatStrategy.cpp @@ -21,25 +21,25 @@ class GenericMageNonCombatStrategyActionNodeFactory : public NamedObjectFactory< static ActionNode* molten_armor([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("molten armor", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("mage armor"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("mage armor") }, + /*C*/ {}); } static ActionNode* mage_armor([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("mage armor", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("ice armor"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("ice armor") }, + /*C*/ {}); } static ActionNode* ice_armor([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("ice armor", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("frost armor"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("frost armor") }, + /*C*/ {}); } }; @@ -52,23 +52,23 @@ void GenericMageNonCombatStrategy::InitTriggers(std::vector& trigg { NonCombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("arcane intellect", NextAction::array(0, new NextAction("arcane intellect", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("no focus magic", NextAction::array(0, new NextAction("focus magic on party", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("no mana gem", NextAction::array(0, new NextAction("conjure mana gem", 20.0f), nullptr))); + triggers.push_back(new TriggerNode("arcane intellect", { NextAction("arcane intellect", 21.0f) })); + triggers.push_back(new TriggerNode("no focus magic", { NextAction("focus magic on party", 19.0f) })); + triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) })); + triggers.push_back(new TriggerNode("no mana gem", { NextAction("conjure mana gem", 20.0f) })); } void MageBuffManaStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("mage armor", NextAction::array(0, new NextAction("mage armor", 19.0f), nullptr))); + triggers.push_back(new TriggerNode("mage armor", { NextAction("mage armor", 19.0f) })); } void MageBuffDpsStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("mage armor", NextAction::array(0, new NextAction("molten armor", 19.0f), nullptr))); + triggers.push_back(new TriggerNode("mage armor", { NextAction("molten armor", 19.0f) })); } void MageBuffStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("arcane intellect on party", NextAction::array(0, new NextAction("arcane intellect on party", 20.0f), nullptr))); + triggers.push_back(new TriggerNode("arcane intellect on party", { NextAction("arcane intellect on party", 20.0f) })); } diff --git a/src/strategy/mage/GenericMageNonCombatStrategy.h b/src/Ai/Class/Mage/Strategy/GenericMageNonCombatStrategy.h similarity index 100% rename from src/strategy/mage/GenericMageNonCombatStrategy.h rename to src/Ai/Class/Mage/Strategy/GenericMageNonCombatStrategy.h diff --git a/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp new file mode 100644 index 0000000000..75a63efa47 --- /dev/null +++ b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericMageStrategy.h" +#include "AiFactory.h" +#include "Playerbots.h" +#include "RangedCombatStrategy.h" + +class GenericMageStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericMageStrategyActionNodeFactory() + { + creators["frostbolt"] = &frostbolt; + creators["frostfire bolt"] = &frostfire_bolt; + creators["ice lance"] = &ice_lance; + creators["fire blast"] = &fire_blast; + creators["scorch"] = &scorch; + creators["frost nova"] = &frost_nova; + creators["cone of cold"] = &cone_of_cold; + creators["icy veins"] = &icy_veins; + creators["combustion"] = &combustion; + creators["evocation"] = &evocation; + creators["dragon's breath"] = &dragons_breath; + creators["blast wave"] = &blast_wave; + creators["remove curse"] = &remove_curse; + creators["remove curse on party"] = &remove_curse_on_party; + creators["fireball"] = &fireball; + } + +private: + static ActionNode* frostbolt([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("frostbolt", + /*P*/ {}, + /*A*/ { NextAction("shoot") }, + /*C*/ {}); + } + + static ActionNode* frostfire_bolt([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("frostfire bolt", + /*P*/ {}, + /*A*/ { NextAction("fireball") }, + /*C*/ {}); + } + + static ActionNode* ice_lance([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("ice lance", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* fire_blast([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("fire blast", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* scorch([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("scorch", + /*P*/ {}, + /*A*/ { NextAction("shoot") }, + /*C*/ {}); + } + + static ActionNode* frost_nova([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("frost nova", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* cone_of_cold([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("cone of cold", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* icy_veins([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("icy veins", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* combustion([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("combustion", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* evocation([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("evocation", + /*P*/ {}, + /*A*/ { NextAction("mana potion") }, + /*C*/ {}); + } + + static ActionNode* dragons_breath([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("dragon's breath", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* blast_wave([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("blast wave", + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); + } + + static ActionNode* remove_curse([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("remove curse", + /*P*/ {}, + /*A*/ { NextAction("remove lesser curse") }, + /*C*/ {}); + } + + static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("remove curse on party", + /*P*/ {}, + /*A*/ { NextAction("remove lesser curse on party") }, + /*C*/ {}); + } + static ActionNode* fireball([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("fireball", + /*P*/ {}, + /*A*/ { NextAction("shoot") }, + /*C*/ {}); + } +}; + +GenericMageStrategy::GenericMageStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericMageStrategyActionNodeFactory()); +} + +void GenericMageStrategy::InitTriggers(std::vector& triggers) +{ + RangedCombatStrategy::InitTriggers(triggers); + + // Threat Triggers + triggers.push_back(new TriggerNode("high threat", { NextAction("mirror image", 60.0f) })); + triggers.push_back(new TriggerNode("medium threat", { NextAction("invisibility", 30.0f) })); + + // Defensive Triggers + triggers.push_back(new TriggerNode("critical health", { NextAction("ice block", 90.0f) })); + triggers.push_back(new TriggerNode("low health", { NextAction("mana shield", 85.0f) })); + triggers.push_back(new TriggerNode("fire ward", { NextAction("fire ward", 90.0f) })); + triggers.push_back(new TriggerNode("frost ward", { NextAction("frost ward", 90.0f) })); + triggers.push_back(new TriggerNode("enemy is close and no firestarter strategy", { NextAction("frost nova", 50.0f) })); + triggers.push_back(new TriggerNode("enemy too close for spell and no firestarter strategy", { NextAction("blink back", 35.0f) })); + + // Mana Threshold Triggers + Player* bot = botAI->GetBot(); + if (bot->HasSpell(42985)) // Mana Sapphire + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana sapphire", 90.0f) })); + else if (bot->HasSpell(27101)) // Mana Emerald + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana emerald", 90.0f) })); + else if (bot->HasSpell(10054)) // Mana Ruby + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana ruby", 90.0f) })); + else if (bot->HasSpell(10053)) // Mana Citrine + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana citrine", 90.0f) })); + else if (bot->HasSpell(3552)) // Mana Jade + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana jade", 90.0f) })); + else if (bot->HasSpell(759)) // Mana Agate + triggers.push_back(new TriggerNode("high mana", { NextAction("use mana agate", 90.0f) })); + + triggers.push_back(new TriggerNode("medium mana", { NextAction("mana potion", 90.0f) })); + triggers.push_back(new TriggerNode("low mana", { NextAction("evocation", 90.0f) })); + + // Counterspell / Spellsteal Triggers + triggers.push_back(new TriggerNode("spellsteal", { NextAction("spellsteal", 40.0f) })); + triggers.push_back(new TriggerNode("counterspell on enemy healer", { NextAction("counterspell on enemy healer", 40.0f) })); +} + +void MageCureStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("remove curse", { NextAction("remove curse", 41.0f) })); + triggers.push_back(new TriggerNode("remove curse on party", { NextAction("remove curse on party", 40.0f) })); +} + +void MageBoostStrategy::InitTriggers(std::vector& triggers) +{ + Player* bot = botAI->GetBot(); + int tab = AiFactory::GetPlayerSpecTab(bot); + + if (tab == 0) // Arcane + { + triggers.push_back(new TriggerNode("arcane power", { NextAction("arcane power", 29.0f) })); + triggers.push_back(new TriggerNode("icy veins", { NextAction("icy veins", 28.5f) })); + triggers.push_back(new TriggerNode("mirror image", { NextAction("mirror image", 28.0f) })); + } + else if (tab == 1) + { + if (bot->HasSpell(44614) /*Frostfire Bolt*/ && bot->HasAura(15047) /*Ice Shards*/) + { // Frostfire + triggers.push_back(new TriggerNode("combustion", { NextAction("combustion", 18.0f) })); + triggers.push_back(new TriggerNode("icy veins", { NextAction("icy veins", 17.5f) })); + triggers.push_back(new TriggerNode("mirror image", { NextAction("mirror image", 17.0f) })); + } + else + { // Fire + triggers.push_back(new TriggerNode("combustion", { NextAction("combustion", 18.0f) })); + triggers.push_back(new TriggerNode("mirror image", { NextAction("mirror image", 17.5f) })); + } + } + else if (tab == 2) // Frost + { + triggers.push_back(new TriggerNode("cold snap", { NextAction("cold snap", 28.0f) })); + triggers.push_back(new TriggerNode("icy veins", { NextAction("icy veins", 27.5f) })); + triggers.push_back(new TriggerNode("mirror image", { NextAction("mirror image", 26.0f) })); + } +} + +void MageCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("polymorph", { NextAction("polymorph", 30.0f) })); +} + +void MageAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("blizzard channel check", { NextAction("cancel channel", 26.0f) })); + + Player* bot = botAI->GetBot(); + int tab = AiFactory::GetPlayerSpecTab(bot); + + if (tab == 0) // Arcane + { + triggers.push_back(new TriggerNode("flamestrike active and medium aoe", { NextAction("blizzard", 24.0f) })); + triggers.push_back(new TriggerNode("medium aoe", { + NextAction("flamestrike", 23.0f), + NextAction("blizzard", 22.0f) })); + triggers.push_back(new TriggerNode("light aoe", { NextAction("arcane explosion", 21.0f) })); + } + else if (tab == 1) // Fire and Frostfire + { + triggers.push_back( + new TriggerNode("medium aoe", { + NextAction("dragon's breath", 39.0f), + NextAction("blast wave", 38.0f), + NextAction("flamestrike", 23.0f), + NextAction("blizzard", 22.0f) })); + + triggers.push_back(new TriggerNode("flamestrike active and medium aoe", { NextAction("blizzard", 24.0f) })); + triggers.push_back(new TriggerNode("firestarter", { NextAction("flamestrike", 40.0f) })); + triggers.push_back(new TriggerNode("living bomb on attackers", { NextAction("living bomb on attackers", 21.0f) })); + } + else if (tab == 2) // Frost + { + triggers.push_back(new TriggerNode("flamestrike active and medium aoe", { NextAction("blizzard", 24.0f) })); + triggers.push_back(new TriggerNode("medium aoe", { + NextAction("flamestrike", 23.0f), + NextAction("blizzard", 22.0f) })); + triggers.push_back(new TriggerNode("light aoe", { NextAction("cone of cold", 21.0f) })); + } +} diff --git a/src/strategy/mage/GenericMageStrategy.h b/src/Ai/Class/Mage/Strategy/GenericMageStrategy.h similarity index 100% rename from src/strategy/mage/GenericMageStrategy.h rename to src/Ai/Class/Mage/Strategy/GenericMageStrategy.h diff --git a/src/strategy/mage/MageTriggers.cpp b/src/Ai/Class/Mage/Trigger/MageTriggers.cpp similarity index 100% rename from src/strategy/mage/MageTriggers.cpp rename to src/Ai/Class/Mage/Trigger/MageTriggers.cpp diff --git a/src/strategy/mage/MageTriggers.h b/src/Ai/Class/Mage/Trigger/MageTriggers.h similarity index 100% rename from src/strategy/mage/MageTriggers.h rename to src/Ai/Class/Mage/Trigger/MageTriggers.h diff --git a/src/strategy/paladin/PaladinActions.cpp b/src/Ai/Class/Paladin/Action/PaladinActions.cpp similarity index 100% rename from src/strategy/paladin/PaladinActions.cpp rename to src/Ai/Class/Paladin/Action/PaladinActions.cpp diff --git a/src/strategy/paladin/PaladinActions.h b/src/Ai/Class/Paladin/Action/PaladinActions.h similarity index 100% rename from src/strategy/paladin/PaladinActions.h rename to src/Ai/Class/Paladin/Action/PaladinActions.h diff --git a/src/strategy/paladin/PaladinAiObjectContext.cpp b/src/Ai/Class/Paladin/PaladinAiObjectContext.cpp similarity index 100% rename from src/strategy/paladin/PaladinAiObjectContext.cpp rename to src/Ai/Class/Paladin/PaladinAiObjectContext.cpp diff --git a/src/strategy/paladin/PaladinAiObjectContext.h b/src/Ai/Class/Paladin/PaladinAiObjectContext.h similarity index 100% rename from src/strategy/paladin/PaladinAiObjectContext.h rename to src/Ai/Class/Paladin/PaladinAiObjectContext.h diff --git a/src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.cpp b/src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.cpp new file mode 100644 index 0000000000..185fb72d76 --- /dev/null +++ b/src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "DpsPaladinStrategy.h" + +#include "Playerbots.h" +#include "Strategy.h" + +class DpsPaladinStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + DpsPaladinStrategyActionNodeFactory() + { + creators["sanctity aura"] = &sanctity_aura; + creators["retribution aura"] = &retribution_aura; + creators["seal of corruption"] = &seal_of_corruption; + creators["seal of vengeance"] = &seal_of_vengeance; + creators["seal of command"] = &seal_of_command; + creators["blessing of might"] = &blessing_of_might; + creators["crusader strike"] = &crusader_strike; + creators["repentance"] = &repentance; + creators["repentance on enemy healer"] = &repentance_on_enemy_healer; + creators["repentance on snare target"] = &repentance_on_snare_target; + creators["repentance of shield"] = &repentance_or_shield; + } + +private: + static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of corruption", + /*P*/ {}, + /*A*/ { NextAction("seal of vengeance") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of vengeance", + /*P*/ {}, + /*A*/ { NextAction("seal of command") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of command", + /*P*/ {}, + /*A*/ { NextAction("seal of righteousness") }, + /*C*/ {} + ); + } + + static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "blessing of might", + /*P*/ {}, + /*A*/ { NextAction("blessing of kings") }, + /*C*/ {} + ); + } + + static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "crusader strike", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* repentance([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "repentance", + /*P*/ {}, + /*A*/ { NextAction("hammer of justice") }, + /*C*/ {} + ); + } + + static ActionNode* repentance_on_enemy_healer([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "repentance on enemy healer", + /*P*/ {}, + /*A*/ { NextAction("hammer of justice on enemy healer") }, + /*C*/ {} + ); + } + + static ActionNode* repentance_on_snare_target([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "repentance on snare target", + /*P*/ {}, + /*A*/ { NextAction("hammer of justice on snare target") }, + /*C*/ {} + ); + } + + static ActionNode* sanctity_aura([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "sanctity aura", + /*P*/ {}, + /*A*/ { NextAction("retribution aura") }, + /*C*/ {} + ); + } + + static ActionNode* retribution_aura([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "retribution aura", + /*P*/ {}, + /*A*/ { NextAction("devotion aura") }, + /*C*/ {} + ); + } + + static ActionNode* repentance_or_shield([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "repentance", + /*P*/ {}, + /*A*/ { NextAction("divine shield") }, + /*C*/ {} + ); + } +}; + +DpsPaladinStrategy::DpsPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) +{ + actionNodeFactories.Add(new DpsPaladinStrategyActionNodeFactory()); +} + +std::vector DpsPaladinStrategy::getDefaultActions() +{ + return { + NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), + NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f), + NextAction("crusader strike", ACTION_DEFAULT + 0.4f), + NextAction("divine storm", ACTION_DEFAULT + 0.3f), + NextAction("consecration", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void DpsPaladinStrategy::InitTriggers(std::vector& triggers) +{ + GenericPaladinStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "art of war", + { + NextAction("exorcism", ACTION_DEFAULT + 0.2f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "seal", + { + NextAction("seal of corruption", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("seal of wisdom", ACTION_HIGH + 5) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "avenging wrath", + { + NextAction("avenging wrath", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("divine storm", ACTION_HIGH + 4), + NextAction("consecration", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("reach melee", ACTION_HIGH + 1) + } + ) + ); +} diff --git a/src/strategy/paladin/DpsPaladinStrategy.h b/src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.h similarity index 92% rename from src/strategy/paladin/DpsPaladinStrategy.h rename to src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.h index 144ad3d58a..9611946a3b 100644 --- a/src/strategy/paladin/DpsPaladinStrategy.h +++ b/src/Ai/Class/Paladin/Strategy/DpsPaladinStrategy.h @@ -17,7 +17,7 @@ class DpsPaladinStrategy : public GenericPaladinStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "dps"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/paladin/GenericPaladinNonCombatStrategy.cpp b/src/Ai/Class/Paladin/Strategy/GenericPaladinNonCombatStrategy.cpp similarity index 60% rename from src/strategy/paladin/GenericPaladinNonCombatStrategy.cpp rename to src/Ai/Class/Paladin/Strategy/GenericPaladinNonCombatStrategy.cpp index a1630ea2fa..7f9919e06b 100644 --- a/src/strategy/paladin/GenericPaladinNonCombatStrategy.cpp +++ b/src/Ai/Class/Paladin/Strategy/GenericPaladinNonCombatStrategy.cpp @@ -18,15 +18,15 @@ void GenericPaladinNonCombatStrategy::InitTriggers(std::vector& tr { NonCombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("party member dead", NextAction::array(0, new NextAction("redemption", ACTION_CRITICAL_HEAL + 10), nullptr))); - triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, new NextAction("flash of light on party", 25.0f), nullptr))); - triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, new NextAction("flash of light on party", 26.0f), nullptr))); - triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new NextAction("holy light on party", 27.0f), nullptr))); - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("holy light on party", 28.0f), nullptr))); + triggers.push_back(new TriggerNode("party member dead", { NextAction("redemption", ACTION_CRITICAL_HEAL + 10) })); + triggers.push_back(new TriggerNode("party member almost full health", { NextAction("flash of light on party", 25.0f) })); + triggers.push_back(new TriggerNode("party member medium health", { NextAction("flash of light on party", 26.0f) })); + triggers.push_back(new TriggerNode("party member low health", { NextAction("holy light on party", 27.0f) })); + triggers.push_back(new TriggerNode("party member critical health", { NextAction("holy light on party", 28.0f) })); int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot()); if (specTab == 0 || specTab == 1) // Holy or Protection - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); + triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) })); if (specTab == 2) // Retribution - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply stone", 1.0f), nullptr))); + triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) })); } diff --git a/src/strategy/paladin/GenericPaladinNonCombatStrategy.h b/src/Ai/Class/Paladin/Strategy/GenericPaladinNonCombatStrategy.h similarity index 100% rename from src/strategy/paladin/GenericPaladinNonCombatStrategy.h rename to src/Ai/Class/Paladin/Strategy/GenericPaladinNonCombatStrategy.h diff --git a/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp new file mode 100644 index 0000000000..62d7dfb10b --- /dev/null +++ b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericPaladinStrategy.h" + +#include "GenericPaladinStrategyActionNodeFactory.h" +#include "Playerbots.h" + +GenericPaladinStrategy::GenericPaladinStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericPaladinStrategyActionNodeFactory()); +} + +void GenericPaladinStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("critical health", { NextAction("divine shield", + ACTION_HIGH + 5) })); + triggers.push_back( + new TriggerNode("hammer of justice interrupt", + { NextAction("hammer of justice", ACTION_INTERRUPT) })); + triggers.push_back(new TriggerNode( + "hammer of justice on enemy healer", + { NextAction("hammer of justice on enemy healer", ACTION_INTERRUPT) })); + triggers.push_back(new TriggerNode( + "hammer of justice on snare target", + { NextAction("hammer of justice on snare target", ACTION_INTERRUPT) })); + triggers.push_back(new TriggerNode( + "critical health", { NextAction("lay on hands", ACTION_EMERGENCY) })); + triggers.push_back( + new TriggerNode("party member critical health", + { NextAction("lay on hands on party", ACTION_EMERGENCY + 1) })); + triggers.push_back(new TriggerNode( + "protect party member", + { NextAction("blessing of protection on party", ACTION_EMERGENCY + 2) })); + triggers.push_back( + new TriggerNode("high mana", { NextAction("divine plea", ACTION_HIGH) })); +} + +void PaladinCureStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode( + "cleanse cure disease", { NextAction("cleanse disease", ACTION_DISPEL + 2) })); + triggers.push_back( + new TriggerNode("cleanse party member cure disease", + { NextAction("cleanse disease on party", ACTION_DISPEL + 1) })); + triggers.push_back(new TriggerNode( + "cleanse cure poison", { NextAction("cleanse poison", ACTION_DISPEL + 2) })); + triggers.push_back( + new TriggerNode("cleanse party member cure poison", + { NextAction("cleanse poison on party", ACTION_DISPEL + 1) })); + triggers.push_back(new TriggerNode( + "cleanse cure magic", { NextAction("cleanse magic", ACTION_DISPEL + 2) })); + triggers.push_back( + new TriggerNode("cleanse party member cure magic", + { NextAction("cleanse magic on party", ACTION_DISPEL + 1) })); +} + +void PaladinBoostStrategy::InitTriggers(std::vector& triggers) +{ + + // triggers.push_back(new TriggerNode("divine favor", { NextAction("divine favor", + // ACTION_HIGH + 1) })); +} + +void PaladinCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("turn undead", { NextAction("turn undead", ACTION_HIGH + 1) })); +} + +void PaladinHealerDpsStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("healer should attack", + { + NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), + NextAction("holy shock", ACTION_DEFAULT + 0.5f), + NextAction("shield of righteousness", ACTION_DEFAULT + 0.4f), + NextAction("judgement of light", ACTION_DEFAULT + 0.3f), + NextAction("consecration", ACTION_DEFAULT + 0.2f), + NextAction("exorcism", ACTION_DEFAULT+ 0.1f), + })); +} diff --git a/src/strategy/paladin/GenericPaladinStrategy.h b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.h similarity index 100% rename from src/strategy/paladin/GenericPaladinStrategy.h rename to src/Ai/Class/Paladin/Strategy/GenericPaladinStrategy.h diff --git a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategyActionNodeFactory.h similarity index 56% rename from src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h rename to src/Ai/Class/Paladin/Strategy/GenericPaladinStrategyActionNodeFactory.h index 93812ce6c4..f1d0d342e3 100644 --- a/src/strategy/paladin/GenericPaladinStrategyActionNodeFactory.h +++ b/src/Ai/Class/Paladin/Strategy/GenericPaladinStrategyActionNodeFactory.h @@ -52,206 +52,206 @@ class GenericPaladinStrategyActionNodeFactory : public NamedObjectFactory, released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "HealPaladinStrategy.h" + +#include "Playerbots.h" +#include "Strategy.h" + +class HealPaladinStrategyActionNodeFactory : public NamedObjectFactory +{ +}; + +HealPaladinStrategy::HealPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) +{ + actionNodeFactories.Add(new HealPaladinStrategyActionNodeFactory()); +} + +std::vector HealPaladinStrategy::getDefaultActions() +{ + return { NextAction("judgement of light", ACTION_DEFAULT) }; +} + +void HealPaladinStrategy::InitTriggers(std::vector& triggers) +{ + GenericPaladinStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "seal", + { + NextAction("seal of wisdom", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium mana", + { + NextAction("divine illumination", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("divine favor", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member to heal out of spell range", + { + NextAction("reach party member to heal", ACTION_EMERGENCY + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium group heal setting", + { + NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5), + NextAction("avenging wrath", ACTION_HIGH + 4), + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member critical health", + { + NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6), + NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5), + NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member low health", + { + NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member medium health", + { + NextAction("holy light on party", ACTION_LIGHT_HEAL + 9), + NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member almost full health", + { + NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3) + } + ) +); + + triggers.push_back( + new TriggerNode( + "beacon of light on main tank", + { + NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7) + } + ) +); + + triggers.push_back( + new TriggerNode( + "sacred shield on main tank", + { + NextAction("sacred shield on main tank", ACTION_CRITICAL_HEAL + 6) + } + ) +); +} diff --git a/src/strategy/paladin/HealPaladinStrategy.h b/src/Ai/Class/Paladin/Strategy/HealPaladinStrategy.h similarity index 92% rename from src/strategy/paladin/HealPaladinStrategy.h rename to src/Ai/Class/Paladin/Strategy/HealPaladinStrategy.h index eb13de15c7..f7f8022363 100644 --- a/src/strategy/paladin/HealPaladinStrategy.h +++ b/src/Ai/Class/Paladin/Strategy/HealPaladinStrategy.h @@ -17,7 +17,7 @@ class HealPaladinStrategy : public GenericPaladinStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "heal"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_HEAL | STRATEGY_TYPE_RANGED; } }; diff --git a/src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.cpp b/src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.cpp new file mode 100644 index 0000000000..b25fc36b35 --- /dev/null +++ b/src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.cpp @@ -0,0 +1,243 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "OffhealRetPaladinStrategy.h" + +#include "Playerbots.h" +#include "Strategy.h" + +class OffhealRetPaladinStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + OffhealRetPaladinStrategyActionNodeFactory() + { + creators["retribution aura"] = &retribution_aura; + creators["seal of corruption"] = &seal_of_corruption; + creators["seal of vengeance"] = &seal_of_vengeance; + creators["seal of command"] = &seal_of_command; + creators["blessing of might"] = &blessing_of_might; + creators["crusader strike"] = &crusader_strike; + creators["divine plea"] = &divine_plea; + } + +private: + static ActionNode* retribution_aura([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "retribution aura", + /*P*/ {}, + /*A*/ { NextAction("devotion aura") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of corruption", + /*P*/ {}, + /*A*/ { NextAction("seal of vengeance") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of vengeance", + /*P*/ {}, + /*A*/ { NextAction("seal of command") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of command", + /*P*/ {}, + /*A*/ { NextAction("seal of righteousness") }, + /*C*/ {} + ); + } + + static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "blessing of might", + /*P*/ {}, + /*A*/ { NextAction("blessing of kings") }, + /*C*/ {} + ); + } + + static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "crusader strike", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* divine_plea([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "divine plea", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +OffhealRetPaladinStrategy::OffhealRetPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) +{ + actionNodeFactories.Add(new OffhealRetPaladinStrategyActionNodeFactory()); +} + +std::vector OffhealRetPaladinStrategy::getDefaultActions() +{ + return { + NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), + NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f), + NextAction("crusader strike", ACTION_DEFAULT + 0.4f), + NextAction("divine storm", ACTION_DEFAULT + 0.3f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void OffhealRetPaladinStrategy::InitTriggers(std::vector& triggers) +{ + GenericPaladinStrategy::InitTriggers(triggers); + + // Damage Triggers + triggers.push_back( + new TriggerNode( + "seal", + { + NextAction("seal of corruption", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("seal of wisdom", ACTION_HIGH + 5), + NextAction("divine plea", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "art of war", + { + NextAction("exorcism", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "avenging wrath", + { + NextAction("avenging wrath", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("divine storm", ACTION_HIGH + 4), + NextAction("consecration", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("reach melee", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "retribution aura", + { + NextAction("retribution aura", ACTION_NORMAL) + } + ) + ); + triggers.push_back( + new TriggerNode( + "blessing of might", + { + NextAction("blessing of might", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("holy light", ACTION_CRITICAL_HEAL + 2) + } + ) + ); + + // Healing Triggers + triggers.push_back( + new TriggerNode( + "party member critical health", + { + NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6), + NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member low health", + { + NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member medium health", + { + NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member almost full health", + { + NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "party member to heal out of spell range", + { + NextAction("reach party member to heal", ACTION_EMERGENCY + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "beacon of light on main tank", + { + NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7) + } + ) + ); +} diff --git a/src/strategy/paladin/OffhealRetPaladinStrategy.h b/src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.h similarity index 93% rename from src/strategy/paladin/OffhealRetPaladinStrategy.h rename to src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.h index c634297aa6..3dfd24aa81 100644 --- a/src/strategy/paladin/OffhealRetPaladinStrategy.h +++ b/src/Ai/Class/Paladin/Strategy/OffhealRetPaladinStrategy.h @@ -17,7 +17,7 @@ class OffhealRetPaladinStrategy : public GenericPaladinStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "offheal"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_HEAL | STRATEGY_TYPE_MELEE; diff --git a/src/strategy/paladin/PaladinBuffStrategies.cpp b/src/Ai/Class/Paladin/Strategy/PaladinBuffStrategies.cpp similarity index 54% rename from src/strategy/paladin/PaladinBuffStrategies.cpp rename to src/Ai/Class/Paladin/Strategy/PaladinBuffStrategies.cpp index 439e3aaf17..884c2f2779 100644 --- a/src/strategy/paladin/PaladinBuffStrategies.cpp +++ b/src/Ai/Class/Paladin/Strategy/PaladinBuffStrategies.cpp @@ -10,78 +10,74 @@ void PaladinBuffManaStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("blessing of wisdom on party", - NextAction::array(0, new NextAction("blessing of wisdom on party", 11.0f), NULL))); + { NextAction("blessing of wisdom on party", 11.0f) })); triggers.push_back(new TriggerNode("blessing of kings on party", - NextAction::array(0, new NextAction("blessing of kings on party", 10.5f), NULL))); + { NextAction("blessing of kings on party", 10.5f) })); } void PaladinBuffHealthStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("blessing of sanctuary on party", - NextAction::array(0, new NextAction("blessing of sanctuary on party", 11.0f), nullptr))); - // triggers.push_back(new TriggerNode("blessing", NextAction::array(0, new NextAction("blessing of kings", - // ACTION_HIGH + 8), nullptr))); + { NextAction("blessing of sanctuary on party", 11.0f) })); } void PaladinBuffDpsStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("blessing of might on party", - NextAction::array(0, new NextAction("blessing of might on party", 11.0f), nullptr))); - // triggers.push_back(new TriggerNode("blessing", NextAction::array(0, new NextAction("blessing of might", - // ACTION_HIGH + 8), nullptr))); + { NextAction("blessing of might on party", 11.0f) })); } void PaladinShadowResistanceStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("shadow resistance aura", - NextAction::array(0, new NextAction("shadow resistance aura", ACTION_NORMAL), nullptr))); + { NextAction("shadow resistance aura", ACTION_NORMAL) })); } void PaladinFrostResistanceStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("frost resistance aura", - NextAction::array(0, new NextAction("frost resistance aura", ACTION_NORMAL), nullptr))); + { NextAction("frost resistance aura", ACTION_NORMAL) })); } void PaladinFireResistanceStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode( - "fire resistance aura", NextAction::array(0, new NextAction("fire resistance aura", ACTION_NORMAL), nullptr))); + "fire resistance aura", { NextAction("fire resistance aura", ACTION_NORMAL) })); } void PaladinBuffArmorStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("devotion aura", - NextAction::array(0, new NextAction("devotion aura", ACTION_NORMAL), nullptr))); + { NextAction("devotion aura", ACTION_NORMAL) })); } void PaladinBuffAoeStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode( - "retribution aura", NextAction::array(0, new NextAction("retribution aura", ACTION_NORMAL), nullptr))); + "retribution aura", { NextAction("retribution aura", ACTION_NORMAL) })); } void PaladinBuffCastStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode( - "concentration aura", NextAction::array(0, new NextAction("concentration aura", ACTION_NORMAL), nullptr))); + "concentration aura", { NextAction("concentration aura", ACTION_NORMAL) })); } void PaladinBuffSpeedStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode( - "crusader aura", NextAction::array(0, new NextAction("crusader aura", ACTION_NORMAL), nullptr))); + "crusader aura", { NextAction("crusader aura", ACTION_NORMAL) })); } void PaladinBuffThreatStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode( - "righteous fury", NextAction::array(0, new NextAction("righteous fury", ACTION_HIGH + 8), nullptr))); + "righteous fury", { NextAction("righteous fury", ACTION_HIGH + 8) })); } void PaladinBuffStatsStrategy::InitTriggers(std::vector& triggers) @@ -89,10 +85,10 @@ void PaladinBuffStatsStrategy::InitTriggers(std::vector& triggers) // First Sanctuary (prio > Kings) triggers.push_back( new TriggerNode("blessing of sanctuary on party", - NextAction::array(0, new NextAction("blessing of sanctuary on party", 12.0f), nullptr))); + { NextAction("blessing of sanctuary on party", 12.0f) })); // After Kings triggers.push_back( new TriggerNode("blessing of kings on party", - NextAction::array(0, new NextAction("blessing of kings on party", 11.0f), nullptr))); + { NextAction("blessing of kings on party", 11.0f) })); } diff --git a/src/strategy/paladin/PaladinBuffStrategies.h b/src/Ai/Class/Paladin/Strategy/PaladinBuffStrategies.h similarity index 100% rename from src/strategy/paladin/PaladinBuffStrategies.h rename to src/Ai/Class/Paladin/Strategy/PaladinBuffStrategies.h diff --git a/src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.cpp b/src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.cpp new file mode 100644 index 0000000000..b76116e043 --- /dev/null +++ b/src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.cpp @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "TankPaladinStrategy.h" + +#include "Playerbots.h" + +class TankPaladinStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + TankPaladinStrategyActionNodeFactory() + { + creators["seal of corruption"] = &seal_of_corruption; + creators["seal of vengeance"] = &seal_of_vengeance; + creators["seal of command"] = &seal_of_command; + creators["hand of reckoning"] = &hand_of_reckoning; + creators["taunt spell"] = &hand_of_reckoning; + } + +private: + static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of command", + /*P*/ {}, + /*A*/ { NextAction("seal of corruption") }, + /*C*/ {} + ); + } + static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of corruption", + /*P*/ {}, + /*A*/ { NextAction("seal of vengeance") }, + /*C*/ {} + ); + } + + static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "seal of vengeance", + /*P*/ {}, + /*A*/ { NextAction("seal of righteousness") }, + /*C*/ {} + ); + } + + static ActionNode* hand_of_reckoning([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "hand of reckoning", + /*P*/ {}, + /*A*/ { NextAction("righteous defense") }, + /*C*/ {} + ); + } +}; + +TankPaladinStrategy::TankPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) +{ + actionNodeFactories.Add(new TankPaladinStrategyActionNodeFactory()); +} + +std::vector TankPaladinStrategy::getDefaultActions() +{ + return { + NextAction("shield of righteousness", ACTION_DEFAULT + 0.6f), + NextAction("hammer of the righteous", ACTION_DEFAULT + 0.5f), + NextAction("judgement of wisdom", ACTION_DEFAULT + 0.4f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void TankPaladinStrategy::InitTriggers(std::vector& triggers) +{ + GenericPaladinStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "seal", + { + NextAction("seal of corruption", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("seal of wisdom", ACTION_HIGH + 9) + } + ) + ); + triggers.push_back(new TriggerNode( + "light aoe", + { + NextAction("avenger's shield", ACTION_HIGH + 5) + } + ) +); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("consecration", ACTION_HIGH + 7), + NextAction("avenger's shield", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lose aggro", + { + NextAction("hand of reckoning", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium health", + { NextAction("holy shield", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("holy shield", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("holy shield", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "avenging wrath", + { + NextAction("avenging wrath", ACTION_HIGH + 2) + } + ) +); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("hammer of wrath", ACTION_CRITICAL_HEAL) + } + ) + ); + triggers.push_back( + new TriggerNode( + "righteous fury", + { + NextAction("righteous fury", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium group heal setting", + { + NextAction("divine sacrifice", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enough mana", + { + NextAction("consecration", ACTION_HIGH + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "not facing target", + { + NextAction("set facing", ACTION_NORMAL + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("reach melee", ACTION_HIGH + 1) + } + ) + ); +} diff --git a/src/strategy/paladin/TankPaladinStrategy.h b/src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.h similarity index 92% rename from src/strategy/paladin/TankPaladinStrategy.h rename to src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.h index 5f7e109dc9..b4a0e0ca0f 100644 --- a/src/strategy/paladin/TankPaladinStrategy.h +++ b/src/Ai/Class/Paladin/Strategy/TankPaladinStrategy.h @@ -17,7 +17,7 @@ class TankPaladinStrategy : public GenericPaladinStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "tank"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/paladin/PaladinTriggers.cpp b/src/Ai/Class/Paladin/Trigger/PaladinTriggers.cpp similarity index 100% rename from src/strategy/paladin/PaladinTriggers.cpp rename to src/Ai/Class/Paladin/Trigger/PaladinTriggers.cpp diff --git a/src/strategy/paladin/PaladinTriggers.h b/src/Ai/Class/Paladin/Trigger/PaladinTriggers.h similarity index 100% rename from src/strategy/paladin/PaladinTriggers.h rename to src/Ai/Class/Paladin/Trigger/PaladinTriggers.h diff --git a/src/strategy/priest/PriestActions.cpp b/src/Ai/Class/Priest/Action/PriestActions.cpp similarity index 100% rename from src/strategy/priest/PriestActions.cpp rename to src/Ai/Class/Priest/Action/PriestActions.cpp diff --git a/src/strategy/priest/PriestActions.h b/src/Ai/Class/Priest/Action/PriestActions.h similarity index 100% rename from src/strategy/priest/PriestActions.h rename to src/Ai/Class/Priest/Action/PriestActions.h diff --git a/src/strategy/priest/PriestAiObjectContext.cpp b/src/Ai/Class/Priest/PriestAiObjectContext.cpp similarity index 100% rename from src/strategy/priest/PriestAiObjectContext.cpp rename to src/Ai/Class/Priest/PriestAiObjectContext.cpp diff --git a/src/strategy/priest/PriestAiObjectContext.h b/src/Ai/Class/Priest/PriestAiObjectContext.h similarity index 100% rename from src/strategy/priest/PriestAiObjectContext.h rename to src/Ai/Class/Priest/PriestAiObjectContext.h diff --git a/src/Ai/Class/Priest/Strategy/GenericPriestStrategy.cpp b/src/Ai/Class/Priest/Strategy/GenericPriestStrategy.cpp new file mode 100644 index 0000000000..60da134330 --- /dev/null +++ b/src/Ai/Class/Priest/Strategy/GenericPriestStrategy.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericPriestStrategy.h" + +#include "GenericPriestStrategyActionNodeFactory.h" +#include "HealPriestStrategy.h" +#include "Playerbots.h" + +GenericPriestStrategy::GenericPriestStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); +} + +void GenericPriestStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("medium threat", { NextAction("fade", 55.0f) })); + triggers.push_back(new TriggerNode("critical health", { NextAction("desperate prayer", + ACTION_HIGH + 5) })); + triggers.push_back(new TriggerNode( + "critical health", { NextAction("power word: shield", ACTION_NORMAL) })); + + triggers.push_back( + new TriggerNode("low health", { NextAction("power word: shield", ACTION_HIGH) })); + + triggers.push_back( + new TriggerNode("medium mana", + { + NextAction("shadowfiend", ACTION_HIGH + 2), + NextAction("inner focus", ACTION_HIGH + 1) })); + + triggers.push_back( + new TriggerNode("low mana", { NextAction("hymn of hope", ACTION_HIGH) })); + + triggers.push_back(new TriggerNode("enemy too close for spell", + { NextAction("flee", ACTION_MOVE + 9) })); + triggers.push_back(new TriggerNode("often", { NextAction("apply oil", 1.0f) })); + triggers.push_back(new TriggerNode("being attacked", + { NextAction("power word: shield", ACTION_HIGH + 1) })); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); +} + +PriestCureStrategy::PriestCureStrategy(PlayerbotAI* botAI) : Strategy(botAI) +{ + actionNodeFactories.Add(new CurePriestStrategyActionNodeFactory()); +} + +void PriestCureStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("dispel magic", { NextAction("dispel magic", 41.0f) })); + triggers.push_back(new TriggerNode("dispel magic on party", + { NextAction("dispel magic on party", 40.0f) })); + triggers.push_back( + new TriggerNode("cure disease", { NextAction("abolish disease", 31.0f) })); + triggers.push_back(new TriggerNode( + "party member cure disease", { NextAction("abolish disease on party", 30.0f) })); +} + +void PriestBoostStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("power infusion", { NextAction("power infusion", 41.0f) })); + triggers.push_back(new TriggerNode("boost", { NextAction("shadowfiend", 20.0f) })); +} + +void PriestCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("shackle undead", { NextAction("shackle undead", 31.0f) })); +} + +void PriestHealerDpsStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode("healer should attack", + { + NextAction("shadow word: pain", ACTION_DEFAULT + 0.5f), + NextAction("holy fire", ACTION_DEFAULT + 0.4f), + NextAction("smite", ACTION_DEFAULT + 0.3f), + NextAction("mind blast", ACTION_DEFAULT + 0.2f), + NextAction("shoot", ACTION_DEFAULT) })); + + triggers.push_back( + new TriggerNode("medium aoe and healer should attack", + { + NextAction("mind sear", ACTION_DEFAULT + 0.5f) })); +} diff --git a/src/strategy/priest/GenericPriestStrategy.h b/src/Ai/Class/Priest/Strategy/GenericPriestStrategy.h similarity index 100% rename from src/strategy/priest/GenericPriestStrategy.h rename to src/Ai/Class/Priest/Strategy/GenericPriestStrategy.h diff --git a/src/Ai/Class/Priest/Strategy/GenericPriestStrategyActionNodeFactory.h b/src/Ai/Class/Priest/Strategy/GenericPriestStrategyActionNodeFactory.h new file mode 100644 index 0000000000..ab6a0c2ba4 --- /dev/null +++ b/src/Ai/Class/Priest/Strategy/GenericPriestStrategyActionNodeFactory.h @@ -0,0 +1,257 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_GENERICPRIESTSTRATEGYACTIONNODEFACTORY_H +#define _PLAYERBOT_GENERICPRIESTSTRATEGYACTIONNODEFACTORY_H + +#include "Action.h" +#include "NamedObjectContext.h" + +class GenericPriestStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericPriestStrategyActionNodeFactory() + { + creators["inner fire"] = &inner_fire; + creators["holy nova"] = &holy_nova; + creators["power word: fortitude"] = &power_word_fortitude; + creators["power word: fortitude on party"] = &power_word_fortitude_on_party; + creators["divine spirit"] = &divine_spirit; + creators["divine spirit on party"] = &divine_spirit_on_party; + creators["power word: shield"] = &power_word_shield; + // creators["power word: shield on party"] = &power_word_shield_on_party; + creators["renew"] = &renew; + creators["renew on party"] = &renew_on_party; + creators["greater heal"] = &greater_heal; + creators["greater heal on party"] = &greater_heal_on_party; + creators["heal"] = &heal; + creators["heal on party"] = &heal_on_party; + creators["lesser heal"] = &lesser_heal; + creators["lesser heal on party"] = &lesser_heal_on_party; + creators["flash heal"] = &flash_heal; + creators["flash heal on party"] = &flash_heal_on_party; + creators["psychic scream"] = &psychic_scream; + // creators["fade"] = &fade; + creators["shadowfiend"] = &shadowfiend; + } + +private: + static ActionNode* inner_fire([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "inner fire", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* holy_nova([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "holy nova", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* power_word_fortitude([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "power word: fortitude", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* power_word_fortitude_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "power word: fortitude on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* divine_spirit([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "divine spirit", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* divine_spirit_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "divine spirit on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* power_word_shield([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "power word: shield", + /*P*/ { NextAction("remove shadowform") }, + // /*A*/ { NextAction("renew", 50.0f) }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* power_word_shield_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "power word: shield on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* renew([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "renew", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* renew_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "renew on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* greater_heal([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "greater heal", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("heal") }, + /*C*/ {} + ); + } + static ActionNode* greater_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "greater heal on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("heal on party") }, + /*C*/ {} + ); + } + static ActionNode* heal([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "heal", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("lesser heal") }, + /*C*/ {} + ); + } + static ActionNode* heal_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "heal on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("lesser heal on party") }, + /*C*/ {} + ); + } + static ActionNode* lesser_heal([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "lesser heal", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* lesser_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "lesser heal on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* flash_heal([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "flash heal", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("greater heal") }, + /*C*/ {} + ); + } + static ActionNode* flash_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "flash heal on party", + /*P*/ { NextAction("remove shadowform") }, + /*A*/ { NextAction("greater heal on party") }, + /*C*/ {} + ); + } + static ActionNode* psychic_scream([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "psychic scream", + /*P*/ {}, + /*A*/ { NextAction("fade") }, + /*C*/ {} + ); + } + + static ActionNode* shadowfiend([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "shadowfiend", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +class CurePriestStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + CurePriestStrategyActionNodeFactory() + { + creators["abolish disease"] = &abolish_disease; + creators["abolish disease on party"] = &abolish_disease_on_party; + } + +private: + + static ActionNode* abolish_disease([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "abolish disease", + /*P*/ {}, + /*A*/ { NextAction("cure disease") }, + /*C*/ {} + ); + } + + static ActionNode* abolish_disease_on_party([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "abolish disease on party", + /*P*/ {}, + /*A*/ { NextAction("cure disease on party") }, + /*C*/ {} + ); + } +}; + +#endif diff --git a/src/Ai/Class/Priest/Strategy/HealPriestStrategy.cpp b/src/Ai/Class/Priest/Strategy/HealPriestStrategy.cpp new file mode 100644 index 0000000000..35f764e4df --- /dev/null +++ b/src/Ai/Class/Priest/Strategy/HealPriestStrategy.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "HealPriestStrategy.h" + +#include "GenericPriestStrategyActionNodeFactory.h" +#include "Playerbots.h" + +HealPriestStrategy::HealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) +{ + actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); +} + +std::vector HealPriestStrategy::getDefaultActions() +{ + return { + NextAction("shoot", ACTION_DEFAULT) + }; +} + +void HealPriestStrategy::InitTriggers(std::vector& triggers) +{ + GenericPriestStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "group heal setting", + { + NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 8), + NextAction("power word: shield on not full", ACTION_MEDIUM_HEAL + 7) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium group heal setting", + { + NextAction("divine hymn", ACTION_CRITICAL_HEAL + 7), + NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 6), + NextAction("power word: shield on not full", ACTION_CRITICAL_HEAL + 5), + NextAction("prayer of healing on party", ACTION_CRITICAL_HEAL + 4) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member critical health", + { + NextAction("power word: shield on party", ACTION_CRITICAL_HEAL + 5), + NextAction("penance on party", ACTION_CRITICAL_HEAL + 4), + NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 3), + NextAction("flash heal on party", ACTION_CRITICAL_HEAL + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member low health", + { + NextAction("power word: shield on party", ACTION_MEDIUM_HEAL + 4), + NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 3), + NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), + NextAction("flash heal on party", ACTION_MEDIUM_HEAL + 0) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member medium health", + { + NextAction("power word: shield on party", ACTION_LIGHT_HEAL + 9), + NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 7), + NextAction("penance on party", ACTION_LIGHT_HEAL + 6), + NextAction("flash heal on party", ACTION_LIGHT_HEAL + 5) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member almost full health", + { + NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 2), + NextAction("renew on party", ACTION_LIGHT_HEAL + 1) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member to heal out of spell range", + { + NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 10) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "critical health", { + NextAction("pain suppression", ACTION_EMERGENCY + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "protect party member", + { + NextAction("pain suppression on party", ACTION_EMERGENCY) + } + ) + ); +} diff --git a/src/strategy/priest/HealPriestStrategy.h b/src/Ai/Class/Priest/Strategy/HealPriestStrategy.h similarity index 92% rename from src/strategy/priest/HealPriestStrategy.h rename to src/Ai/Class/Priest/Strategy/HealPriestStrategy.h index e6db66214d..49fd764e23 100644 --- a/src/strategy/priest/HealPriestStrategy.h +++ b/src/Ai/Class/Priest/Strategy/HealPriestStrategy.h @@ -16,7 +16,7 @@ class HealPriestStrategy : public GenericPriestStrategy HealPriestStrategy(PlayerbotAI* botAI); void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; std::string const getName() override { return "heal"; } uint32 GetType() const override { return STRATEGY_TYPE_HEAL | STRATEGY_TYPE_RANGED; } }; diff --git a/src/Ai/Class/Priest/Strategy/HolyPriestStrategy.cpp b/src/Ai/Class/Priest/Strategy/HolyPriestStrategy.cpp new file mode 100644 index 0000000000..399f21c615 --- /dev/null +++ b/src/Ai/Class/Priest/Strategy/HolyPriestStrategy.cpp @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "HolyPriestStrategy.h" + +#include "Playerbots.h" + +class HolyPriestStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + HolyPriestStrategyActionNodeFactory() { creators["smite"] = &smite; } + +private: + static ActionNode* smite([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "smite", + /*P*/ {}, + /*A*/ { NextAction("shoot") }, + /*C*/ {} + ); + } +}; + +HolyPriestStrategy::HolyPriestStrategy(PlayerbotAI* botAI) : HealPriestStrategy(botAI) +{ + actionNodeFactories.Add(new HolyPriestStrategyActionNodeFactory()); +} + +std::vector HolyPriestStrategy::getDefaultActions() +{ + return { + NextAction("smite", ACTION_DEFAULT + 0.2f), + NextAction("mana burn", ACTION_DEFAULT + 0.1f), + NextAction("starshards", ACTION_DEFAULT) + }; +} + +void HolyPriestStrategy::InitTriggers(std::vector& triggers) +{ + HealPriestStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "holy fire", + { + NextAction("holy fire", ACTION_NORMAL + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "shadowfiend", + { + NextAction("shadowfiend", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium mana", + { + NextAction("shadowfiend", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("mana burn", ACTION_HIGH) + } + ) + ); +} + +HolyHealPriestStrategy::HolyHealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) +{ + actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); +} + +std::vector HolyHealPriestStrategy::getDefaultActions() +{ + return { NextAction("shoot", ACTION_DEFAULT) }; +} + +void HolyHealPriestStrategy::InitTriggers(std::vector& triggers) +{ + GenericPriestStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "group heal setting", + { + NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 9), + NextAction("circle of healing on party", ACTION_MEDIUM_HEAL + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium group heal setting", + { + NextAction("divine hymn", ACTION_CRITICAL_HEAL + 7), + NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 6), + NextAction("circle of healing on party", ACTION_CRITICAL_HEAL + 5), + NextAction("prayer of healing on party", ACTION_CRITICAL_HEAL + 4) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member critical health", + { + NextAction("guardian spirit on party", ACTION_CRITICAL_HEAL + 6), + NextAction("power word: shield on party", ACTION_CRITICAL_HEAL + 5), + NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 3), + NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 2), + NextAction("flash heal on party", ACTION_CRITICAL_HEAL + 1), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member low health", + { + NextAction("circle of healing on party", ACTION_MEDIUM_HEAL + 4), + NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 3), + NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 2), + NextAction("flash heal on party", ACTION_MEDIUM_HEAL + 1) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member medium health", + { + NextAction("circle of healing on party", ACTION_LIGHT_HEAL + 7), + NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 6), + NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 5), + NextAction("flash heal on party", ACTION_LIGHT_HEAL + 4), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member almost full health", + { + NextAction("renew on party", ACTION_LIGHT_HEAL + 2), + NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 1), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "party member to heal out of spell range", + { + NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 10) + } + ) + ); +} diff --git a/src/strategy/priest/HolyPriestStrategy.h b/src/Ai/Class/Priest/Strategy/HolyPriestStrategy.h similarity index 90% rename from src/strategy/priest/HolyPriestStrategy.h rename to src/Ai/Class/Priest/Strategy/HolyPriestStrategy.h index 87b28a9848..5ae94c383b 100644 --- a/src/strategy/priest/HolyPriestStrategy.h +++ b/src/Ai/Class/Priest/Strategy/HolyPriestStrategy.h @@ -16,7 +16,7 @@ class HolyPriestStrategy : public HealPriestStrategy public: HolyPriestStrategy(PlayerbotAI* botAI); - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "holy dps"; } uint32 GetType() const override { return STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; } @@ -28,7 +28,7 @@ class HolyHealPriestStrategy : public GenericPriestStrategy HolyHealPriestStrategy(PlayerbotAI* botAI); void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; std::string const getName() override { return "holy heal"; } uint32 GetType() const override { return STRATEGY_TYPE_HEAL | STRATEGY_TYPE_RANGED; } }; diff --git a/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.cpp b/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.cpp new file mode 100644 index 0000000000..6447d45197 --- /dev/null +++ b/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "PriestNonCombatStrategy.h" + +#include "Playerbots.h" +#include "PriestNonCombatStrategyActionNodeFactory.h" + +PriestNonCombatStrategy::PriestNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) +{ + actionNodeFactories.Add(new PriestNonCombatStrategyActionNodeFactory()); +} + +void PriestNonCombatStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode("inner fire",{ NextAction("inner fire", 10.0f) })); + triggers.push_back(new TriggerNode( + "party member dead",{ NextAction("remove shadowform", ACTION_CRITICAL_HEAL + 11), + NextAction("resurrection", ACTION_CRITICAL_HEAL + 10) })); + triggers.push_back(new TriggerNode("often",{ NextAction("apply oil", 1.0f) })); + triggers.push_back( + new TriggerNode("party member critical health", + { NextAction("renew on party", ACTION_CRITICAL_HEAL + 3), + NextAction("penance on party", ACTION_CRITICAL_HEAL + 2), + NextAction("greater heal on party", ACTION_CRITICAL_HEAL + 1) })); + + triggers.push_back( + new TriggerNode("party member low health", + { NextAction("renew on party", ACTION_MEDIUM_HEAL + 3), + NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), + NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 1) })); + + triggers.push_back( + new TriggerNode("party member medium health", + { NextAction("renew on party", ACTION_LIGHT_HEAL + 9), + NextAction("penance on party", ACTION_LIGHT_HEAL + 8) })); + + triggers.push_back( + new TriggerNode("party member almost full health", + { NextAction("renew on party", ACTION_LIGHT_HEAL + 3) })); + + triggers.push_back( + new TriggerNode("group heal setting",{ NextAction("circle of healing on party", 27.0f) })); + triggers.push_back(new TriggerNode("new pet", + { NextAction("set pet stance", 10.0f) })); +} + +void PriestBuffStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode("prayer of fortitude on party", + { NextAction("prayer of fortitude on party", 12.0f) })); + triggers.push_back( + new TriggerNode("prayer of spirit on party", + { NextAction("prayer of spirit on party", 14.0f) })); + triggers.push_back( + new TriggerNode("power word: fortitude on party", + { NextAction("power word: fortitude on party", 11.0f) })); + triggers.push_back(new TriggerNode("divine spirit on party", + { NextAction("divine spirit on party", 13.0f) })); +} + +void PriestShadowResistanceStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + triggers.push_back(new TriggerNode("shadow protection", + { NextAction("shadow protection", 12.0f) })); + triggers.push_back( + new TriggerNode("shadow protection on party", + { NextAction("shadow protection on party", 11.0f) })); +} diff --git a/src/strategy/priest/PriestNonCombatStrategy.h b/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.h similarity index 100% rename from src/strategy/priest/PriestNonCombatStrategy.h rename to src/Ai/Class/Priest/Strategy/PriestNonCombatStrategy.h diff --git a/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h b/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategyActionNodeFactory.h similarity index 52% rename from src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h rename to src/Ai/Class/Priest/Strategy/PriestNonCombatStrategyActionNodeFactory.h index e12a1a67e5..c7d4aba82b 100644 --- a/src/strategy/priest/PriestNonCombatStrategyActionNodeFactory.h +++ b/src/Ai/Class/Priest/Strategy/PriestNonCombatStrategyActionNodeFactory.h @@ -38,115 +38,115 @@ class PriestNonCombatStrategyActionNodeFactory : public NamedObjectFactory, released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "ShadowPriestStrategy.h" + +#include "Playerbots.h" +#include "ShadowPriestStrategyActionNodeFactory.h" + +ShadowPriestStrategy::ShadowPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) +{ + actionNodeFactories.Add(new ShadowPriestStrategyActionNodeFactory()); +} + +std::vector ShadowPriestStrategy::getDefaultActions() +{ + return { + NextAction("mind blast", ACTION_DEFAULT + 0.3f), + NextAction("mind flay", ACTION_DEFAULT + 0.2f), + NextAction("shadow word: death", ACTION_DEFAULT + 0.1f), // cast during movement + NextAction("shoot", ACTION_DEFAULT) + }; +} + +void ShadowPriestStrategy::InitTriggers(std::vector& triggers) +{ + GenericPriestStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "shadowform", + { + NextAction("shadowform", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("dispersion", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("dispersion", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "vampiric embrace", + { + NextAction("vampiric embrace", 16.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "silence", + { + NextAction("silence", ACTION_INTERRUPT + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "silence on enemy healer", + { + NextAction("silence on enemy healer", ACTION_INTERRUPT) + } + ) + ); +} + +void ShadowPriestAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "shadow word: pain on attacker", + { + NextAction("shadow word: pain on attacker", ACTION_NORMAL + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "vampiric touch on attacker", + { + NextAction("vampiric touch on attacker", ACTION_NORMAL + 4) + } + ) + ); + triggers.push_back( + new TriggerNode( + "mind sear channel check", + { + NextAction("cancel channel", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("mind sear", ACTION_HIGH + 4) + } + ) + ); +} + +void ShadowPriestDebuffStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "vampiric touch", + { + NextAction("vampiric touch", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "devouring plague", + { + NextAction("devouring plague", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "shadow word: pain", + { + NextAction("shadow word: pain", ACTION_HIGH + 1) + } + ) + ); +} diff --git a/src/strategy/priest/ShadowPriestStrategy.h b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategy.h similarity index 95% rename from src/strategy/priest/ShadowPriestStrategy.h rename to src/Ai/Class/Priest/Strategy/ShadowPriestStrategy.h index a6d8000d72..6bf681b762 100644 --- a/src/strategy/priest/ShadowPriestStrategy.h +++ b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategy.h @@ -15,7 +15,7 @@ class ShadowPriestStrategy : public GenericPriestStrategy public: ShadowPriestStrategy(PlayerbotAI* botAI); - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "shadow"; } uint32 GetType() const override { return STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; } diff --git a/src/strategy/priest/ShadowPriestStrategyActionNodeFactory.h b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h similarity index 62% rename from src/strategy/priest/ShadowPriestStrategyActionNodeFactory.h rename to src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h index e3dd4efac4..4efcc6f6a3 100644 --- a/src/strategy/priest/ShadowPriestStrategyActionNodeFactory.h +++ b/src/Ai/Class/Priest/Strategy/ShadowPriestStrategyActionNodeFactory.h @@ -26,33 +26,33 @@ class ShadowPriestStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + AssassinationRogueStrategyActionNodeFactory() + { + creators["mutilate"] = &mutilate; + creators["envenom"] = &envenom; + creators["backstab"] = &backstab; + creators["rupture"] = &rupture; + } + +private: + static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mutilate", + /*P*/ {}, + /*A*/ { NextAction("backstab") }, + /*C*/ {} + ); + } + static ActionNode* envenom([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "envenom", + /*P*/ {}, + /*A*/ { NextAction("rupture") }, + /*C*/ {} + ); + } + static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "backstab", + /*P*/ {}, + /*A*/ { NextAction("sinister strike") }, + /*C*/ {} + ); + } + static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rupture", + /*P*/ {}, + /*A*/ { NextAction("eviscerate") }, + /*C*/ {} + ); + } +}; + +AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeCombatStrategy(ai) +{ + actionNodeFactories.Add(new AssassinationRogueStrategyActionNodeFactory()); +} + +std::vector AssassinationRogueStrategy::getDefaultActions() +{ + return { + NextAction("melee", ACTION_DEFAULT) + }; +} + +void AssassinationRogueStrategy::InitTriggers(std::vector& triggers) +{ + MeleeCombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "high energy available", + { + NextAction("garrote", ACTION_HIGH + 7), + NextAction("ambush", ACTION_HIGH + 6) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "high energy available", + { + NextAction("mutilate", ACTION_NORMAL + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "hunger for blood", + { + NextAction("hunger for blood", ACTION_HIGH + 6), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "slice and dice", + { + NextAction("slice and dice", ACTION_HIGH + 5), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "combo points 3 available", + { + NextAction("envenom", ACTION_HIGH + 5), + NextAction("eviscerate", ACTION_HIGH + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "target with combo points almost dead", + { + NextAction("envenom", ACTION_HIGH + 4), + NextAction("eviscerate", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "expose armor", + { + NextAction("expose armor", ACTION_HIGH + 3), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium threat", + { + NextAction("vanish", ACTION_HIGH), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("evasion", ACTION_HIGH + 9), + NextAction("feint", ACTION_HIGH + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("cloak of shadows", ACTION_HIGH + 7) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "kick", + { + NextAction("kick", ACTION_INTERRUPT + 2), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "kick on enemy healer", + { + NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("fan of knives", ACTION_NORMAL + 5), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "low tank threat", + { + NextAction("tricks of the trade on main tank", ACTION_HIGH + 7), + } + ) + ); + + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("stealth", ACTION_HIGH + 3), + NextAction("sprint", ACTION_HIGH + 2), + NextAction("reach melee", ACTION_HIGH + 1), + } + ) + ); +} diff --git a/src/strategy/rogue/AssassinationRogueStrategy.h b/src/Ai/Class/Rogue/Strategy/AssassinationRogueStrategy.h similarity index 88% rename from src/strategy/rogue/AssassinationRogueStrategy.h rename to src/Ai/Class/Rogue/Strategy/AssassinationRogueStrategy.h index ae36d27272..5692528a0e 100644 --- a/src/strategy/rogue/AssassinationRogueStrategy.h +++ b/src/Ai/Class/Rogue/Strategy/AssassinationRogueStrategy.h @@ -12,7 +12,7 @@ class AssassinationRogueStrategy : public MeleeCombatStrategy public: virtual void InitTriggers(std::vector& triggers) override; virtual std::string const getName() override { return "melee"; } - virtual NextAction** getDefaultActions() override; + virtual std::vector getDefaultActions() override; uint32 GetType() const override { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; } }; diff --git a/src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.cpp b/src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.cpp new file mode 100644 index 0000000000..22c6a6f836 --- /dev/null +++ b/src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.cpp @@ -0,0 +1,466 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "DpsRogueStrategy.h" + +#include "Playerbots.h" + +class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + DpsRogueStrategyActionNodeFactory() + { + creators["mutilate"] = &mutilate; + creators["sinister strike"] = &sinister_strike; + creators["kick"] = &kick; + creators["kidney shot"] = &kidney_shot; + creators["backstab"] = &backstab; + creators["melee"] = &melee; + creators["rupture"] = &rupture; + } + +private: + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "melee", + /*P*/ {}, + /*A*/ { + NextAction("mutilate") }, + /*C*/ {} + ); + } + static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mutilate", + /*P*/ {}, + /*A*/ { + NextAction("sinister strike") }, + /*C*/ {} + ); + } + static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "sinister strike", + /*P*/ {}, + /*A*/ { + NextAction("melee") }, + /*C*/ {} + ); + } + static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "kick", + /*P*/ {}, + /*A*/ { + NextAction("kidney shot") }, + /*C*/ {} + ); + } + static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "kidney shot", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "backstab", + /*P*/ {}, + /*A*/ { + NextAction("mutilate") }, + /*C*/ {} + ); + } + static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "rupture", + /*P*/ {}, + /*A*/ { + NextAction("eviscerate") }, + /*C*/ {} + ); + } +}; + +DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI) +{ + actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory()); +} + +std::vector DpsRogueStrategy::getDefaultActions() +{ + return { + NextAction("killing spree", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void DpsRogueStrategy::InitTriggers(std::vector& triggers) +{ + MeleeCombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "high energy available", + { + NextAction("garrote", ACTION_HIGH + 7), + NextAction("ambush", ACTION_HIGH + 6) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "high energy available", + { + NextAction("sinister strike", ACTION_NORMAL + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "slice and dice", + { + NextAction("slice and dice", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "combo points available", + { + NextAction("rupture", ACTION_HIGH + 1), + NextAction("eviscerate", ACTION_HIGH) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "target with combo points almost dead", + { + NextAction("eviscerate", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium threat", + { + NextAction("vanish", ACTION_HIGH) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("evasion", ACTION_HIGH + 9), + NextAction("feint", ACTION_HIGH + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("cloak of shadows", ACTION_HIGH + 7) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "kick", + { + NextAction("kick", ACTION_INTERRUPT + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "kick on enemy healer", + { + NextAction("kick on enemy healer", ACTION_INTERRUPT + 1) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "light aoe", + { + NextAction("blade flurry", ACTION_HIGH + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "blade flurry", + { + NextAction("blade flurry", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("stealth", ACTION_HIGH + 3), + NextAction("sprint", ACTION_HIGH + 2), + NextAction("reach melee", ACTION_HIGH + 1) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "expose armor", + { + NextAction("expose armor", ACTION_HIGH + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "low tank threat", + { + NextAction("tricks of the trade on main tank", ACTION_HIGH + 7) + } + ) + ); +} + +class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + StealthedRogueStrategyActionNodeFactory() + { + creators["ambush"] = &ambush; + creators["cheap shot"] = &cheap_shot; + creators["garrote"] = &garrote; + creators["sap"] = &sap; + creators["sinister strike"] = &sinister_strike; + } + +private: + static ActionNode* ambush([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "ambush", + /*P*/ {}, + /*A*/ { NextAction("garrote") }, + /*C*/ {} + ); + } + + static ActionNode* cheap_shot([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "cheap shot", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* garrote([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "garrote", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* sap([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "sap", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "sinister strike", + /*P*/ {}, + /*A*/ { NextAction("cheap shot") }, + /*C*/ {} + ); + } +}; + +StealthedRogueStrategy::StealthedRogueStrategy(PlayerbotAI* botAI) : Strategy(botAI) +{ + actionNodeFactories.Add(new StealthedRogueStrategyActionNodeFactory()); +} + +std::vector StealthedRogueStrategy::getDefaultActions() +{ + return { + NextAction("ambush", ACTION_NORMAL + 4), + NextAction("backstab", ACTION_NORMAL + 3), + NextAction("cheap shot", ACTION_NORMAL + 2), + NextAction("sinister strike", ACTION_NORMAL + 1), + NextAction("melee", ACTION_NORMAL) + }; +} + +void StealthedRogueStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "combo points available", + { + NextAction("eviscerate", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "kick", + { + NextAction("cheap shot", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "kick on enemy healer", + { + NextAction("cheap shot", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "behind target", + { + NextAction("ambush", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "not behind target", + { + NextAction("cheap shot", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy flagcarrier near", + { + NextAction("sprint", ACTION_EMERGENCY + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "unstealth", + { + NextAction("unstealth", ACTION_NORMAL) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "no stealth", + { + NextAction("check stealth", ACTION_EMERGENCY) + } + ) + ); + triggers.push_back( + new TriggerNode( + "sprint", + { + NextAction("sprint", ACTION_INTERRUPT) + } + ) + ); +} + +void StealthStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "stealth", + { + NextAction("stealth", ACTION_INTERRUPT) + } + ) + ); +} + +void RogueAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "light aoe", + { + NextAction("blade flurry", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("fan of knives", ACTION_NORMAL + 5) + } + ) + ); +} + +void RogueBoostStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "adrenaline rush", + { + NextAction("adrenaline rush", ACTION_HIGH + 2) + } + ) + ); +} + +void RogueCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "sap", + { + NextAction("stealth", ACTION_INTERRUPT), + NextAction("sap", ACTION_INTERRUPT) + } + ) + ); +} diff --git a/src/strategy/rogue/DpsRogueStrategy.h b/src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.h similarity index 94% rename from src/strategy/rogue/DpsRogueStrategy.h rename to src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.h index 8e9a79b245..ae418b6c98 100644 --- a/src/strategy/rogue/DpsRogueStrategy.h +++ b/src/Ai/Class/Rogue/Strategy/DpsRogueStrategy.h @@ -18,7 +18,7 @@ class DpsRogueStrategy : public MeleeCombatStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "dps"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return MeleeCombatStrategy::GetType() | STRATEGY_TYPE_DPS; } }; @@ -29,7 +29,7 @@ class StealthedRogueStrategy : public Strategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "stealthed"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; class StealthStrategy : public Strategy diff --git a/src/strategy/rogue/GenericRogueNonCombatStrategy.cpp b/src/Ai/Class/Rogue/Strategy/GenericRogueNonCombatStrategy.cpp similarity index 52% rename from src/strategy/rogue/GenericRogueNonCombatStrategy.cpp rename to src/Ai/Class/Rogue/Strategy/GenericRogueNonCombatStrategy.cpp index bfdcacd7e8..88838f2dd3 100644 --- a/src/strategy/rogue/GenericRogueNonCombatStrategy.cpp +++ b/src/Ai/Class/Rogue/Strategy/GenericRogueNonCombatStrategy.cpp @@ -19,9 +19,9 @@ class GenericRogueNonCombatStrategyActionNodeFactory : public NamedObjectFactory static ActionNode* use_deadly_poison_on_off_hand([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("use deadly poison on off hand", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("use instant poison on off hand"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("use instant poison on off hand") }, + /*C*/ {}); } }; @@ -35,24 +35,16 @@ void GenericRogueNonCombatStrategy::InitTriggers(std::vector& trig NonCombatStrategy::InitTriggers(triggers); triggers.push_back(new TriggerNode("player has flag", - NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr))); + { NextAction("sprint", ACTION_EMERGENCY + 1) })); triggers.push_back(new TriggerNode("enemy flagcarrier near", - NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 2), nullptr))); - // triggers.push_back(new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", 1.0f), - // nullptr))); triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply - // poison", 1.0f), nullptr))); - + { NextAction("sprint", ACTION_EMERGENCY + 2) })); triggers.push_back( new TriggerNode("main hand weapon no enchant", - NextAction::array(0, new NextAction("use instant poison on main hand", 20.0f), NULL))); + { NextAction("use instant poison on main hand", 20.0f) })); triggers.push_back( new TriggerNode("off hand weapon no enchant", - NextAction::array(0, new NextAction("use deadly poison on off hand", 19.0f), NULL))); - - // triggers.push_back(new TriggerNode( - // "off hand weapon no enchant", - // NextAction::array(0, new NextAction("use instant poison", 18.0f), NULL))); + { NextAction("use deadly poison on off hand", 19.0f) })); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("unstealth", 30.0f), NULL))); + triggers.push_back(new TriggerNode("often", { NextAction("unstealth", 30.0f) })); } diff --git a/src/strategy/rogue/GenericRogueNonCombatStrategy.h b/src/Ai/Class/Rogue/Strategy/GenericRogueNonCombatStrategy.h similarity index 100% rename from src/strategy/rogue/GenericRogueNonCombatStrategy.h rename to src/Ai/Class/Rogue/Strategy/GenericRogueNonCombatStrategy.h diff --git a/src/strategy/rogue/RogueTriggers.cpp b/src/Ai/Class/Rogue/Trigger/RogueTriggers.cpp similarity index 100% rename from src/strategy/rogue/RogueTriggers.cpp rename to src/Ai/Class/Rogue/Trigger/RogueTriggers.cpp diff --git a/src/strategy/rogue/RogueTriggers.h b/src/Ai/Class/Rogue/Trigger/RogueTriggers.h similarity index 100% rename from src/strategy/rogue/RogueTriggers.h rename to src/Ai/Class/Rogue/Trigger/RogueTriggers.h diff --git a/src/strategy/shaman/ShamanActions.cpp b/src/Ai/Class/Shaman/Action/ShamanActions.cpp similarity index 100% rename from src/strategy/shaman/ShamanActions.cpp rename to src/Ai/Class/Shaman/Action/ShamanActions.cpp diff --git a/src/strategy/shaman/ShamanActions.h b/src/Ai/Class/Shaman/Action/ShamanActions.h similarity index 100% rename from src/strategy/shaman/ShamanActions.h rename to src/Ai/Class/Shaman/Action/ShamanActions.h diff --git a/src/strategy/shaman/ShamanAiObjectContext.cpp b/src/Ai/Class/Shaman/ShamanAiObjectContext.cpp similarity index 100% rename from src/strategy/shaman/ShamanAiObjectContext.cpp rename to src/Ai/Class/Shaman/ShamanAiObjectContext.cpp diff --git a/src/strategy/shaman/ShamanAiObjectContext.h b/src/Ai/Class/Shaman/ShamanAiObjectContext.h similarity index 100% rename from src/strategy/shaman/ShamanAiObjectContext.h rename to src/Ai/Class/Shaman/ShamanAiObjectContext.h diff --git a/src/strategy/shaman/ElementalShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp similarity index 51% rename from src/strategy/shaman/ElementalShamanStrategy.cpp rename to src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp index 350b347219..c1295687cd 100644 --- a/src/strategy/shaman/ElementalShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.cpp @@ -25,15 +25,15 @@ class ElementalShamanStrategyActionNodeFactory : public NamedObjectFactory ElementalShamanStrategy::getDefaultActions() { - return NextAction::array(0, new NextAction("lava burst", 5.2f), - new NextAction("lightning bolt", 5.0f), - nullptr); + return { + NextAction("lava burst", 5.2f), + NextAction("lightning bolt", 5.0f) + }; } // ===== Trigger Initialization === @@ -56,20 +57,76 @@ void ElementalShamanStrategy::InitTriggers(std::vector& triggers) GenericShamanStrategy::InitTriggers(triggers); // Totem Triggers - triggers.push_back(new TriggerNode("call of the elements", NextAction::array(0, new NextAction("call of the elements", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("stoneclaw totem", 40.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "call of the elements", + { + NextAction("call of the elements", 60.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("stoneclaw totem", 40.0f) + } + ) + ); // Cooldown Trigger - triggers.push_back(new TriggerNode("elemental mastery", NextAction::array(0, new NextAction("elemental mastery", 29.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "elemental mastery", + { + NextAction("elemental mastery", 29.0f) + } + ) + ); // Damage Triggers - triggers.push_back(new TriggerNode("earth shock execute", NextAction::array(0, new NextAction("earth shock", 5.5f), nullptr))); - triggers.push_back(new TriggerNode("flame shock", NextAction::array(0, new NextAction("flame shock", 5.3f), nullptr))); + triggers.push_back( + new TriggerNode( + "earth shock execute", + { + NextAction("earth shock", 5.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "flame shock", + { + NextAction("flame shock", 5.3f) + } + ) + ); // Mana Triggers - triggers.push_back(new TriggerNode("water shield", NextAction::array(0, new NextAction("water shield", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("thunderstorm", 19.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "water shield", + { + NextAction("water shield", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high mana", + { + NextAction("thunderstorm", 19.0f) + } + ) + ); // Range Triggers - triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("thunderstorm", 19.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "enemy is close", + { + NextAction("thunderstorm", 19.0f) + } + ) + ); } diff --git a/src/strategy/shaman/ElementalShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.h similarity index 92% rename from src/strategy/shaman/ElementalShamanStrategy.h rename to src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.h index 44f883c765..3c58485630 100644 --- a/src/strategy/shaman/ElementalShamanStrategy.h +++ b/src/Ai/Class/Shaman/Strategy/ElementalShamanStrategy.h @@ -16,7 +16,7 @@ class ElementalShamanStrategy : public GenericShamanStrategy ElementalShamanStrategy(PlayerbotAI* botAI); void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; std::string const getName() override { return "ele"; } uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_RANGED; } }; diff --git a/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp new file mode 100644 index 0000000000..4b7fb7159e --- /dev/null +++ b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "EnhancementShamanStrategy.h" + +#include "Playerbots.h" + +// ===== Action Node Factory ===== +class EnhancementShamanStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + EnhancementShamanStrategyActionNodeFactory() + { + creators["stormstrike"] = &stormstrike; + creators["lava lash"] = &lava_lash; + creators["feral spirit"] = &feral_spirit; + creators["lightning bolt"] = &lightning_bolt; + creators["earth shock"] = &earth_shock; + creators["flame shock"] = &flame_shock; + creators["shamanistic rage"] = &shamanistic_rage; + creators["call of the elements"] = &call_of_the_elements; + creators["lightning shield"] = &lightning_shield; + } + +private: + static ActionNode* stormstrike(PlayerbotAI*) { return new ActionNode("stormstrike", {}, {}, {}); } + static ActionNode* lava_lash([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "lava lash", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + static ActionNode* feral_spirit(PlayerbotAI*) { return new ActionNode("feral spirit", {}, {}, {}); } + static ActionNode* lightning_bolt(PlayerbotAI*) { return new ActionNode("lightning bolt", {}, {}, {}); } + static ActionNode* earth_shock(PlayerbotAI*) { return new ActionNode("earth shock", {}, {}, {}); } + static ActionNode* flame_shock(PlayerbotAI*) { return new ActionNode("flame shock", {}, {}, {}); } + static ActionNode* shamanistic_rage(PlayerbotAI*) { return new ActionNode("shamanistic rage", {}, {}, {}); } + static ActionNode* call_of_the_elements(PlayerbotAI*) { return new ActionNode("call of the elements", {}, {}, {}); } + static ActionNode* lightning_shield(PlayerbotAI*) { return new ActionNode("lightning shield", {}, {}, {}); } +}; + +// ===== Single Target Strategy ===== +EnhancementShamanStrategy::EnhancementShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) +{ + actionNodeFactories.Add(new EnhancementShamanStrategyActionNodeFactory()); +} + +// ===== Default Actions ===== +std::vector EnhancementShamanStrategy::getDefaultActions() +{ + return { + NextAction("stormstrike", 5.5f), + NextAction("feral spirit", 5.4f), + NextAction("earth shock", 5.3f), + NextAction("lava lash", 5.2f), + NextAction("melee", 5.0f) + }; +} + +// ===== Trigger Initialization === +void EnhancementShamanStrategy::InitTriggers(std::vector& triggers) +{ + GenericShamanStrategy::InitTriggers(triggers); + + // Totem Trigger + triggers.push_back( + new TriggerNode( + "call of the elements and enemy within melee", + { + NextAction("call of the elements", 60.0f) + } + ) + ); + + // Spirit Walk Trigger + triggers.push_back( + new TriggerNode( + "spirit walk ready", + { + NextAction("spirit walk", 50.0f) + } + ) + ); + + // Damage Triggers + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("reach melee", 40.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "maelstrom weapon 5", + { + NextAction("lightning bolt", 20.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "maelstrom weapon 4", + { + NextAction("lightning bolt", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "flame shock", + { + NextAction("flame shock", 19.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lightning shield", + { + NextAction("lightning shield", 18.5f) + } + ) + ); + + // Health/Mana Triggers + triggers.push_back( + new TriggerNode( + "medium mana", + { + NextAction("shamanistic rage", 23.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("shamanistic rage", 23.0f) + } + ) + ); +} diff --git a/src/strategy/shaman/EnhancementShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.h similarity index 92% rename from src/strategy/shaman/EnhancementShamanStrategy.h rename to src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.h index 04e299074c..1ebfb86945 100644 --- a/src/strategy/shaman/EnhancementShamanStrategy.h +++ b/src/Ai/Class/Shaman/Strategy/EnhancementShamanStrategy.h @@ -16,7 +16,7 @@ class EnhancementShamanStrategy : public GenericShamanStrategy EnhancementShamanStrategy(PlayerbotAI* botAI); void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; std::string const getName() override { return "enh"; } uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/shaman/GenericShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/GenericShamanStrategy.cpp similarity index 52% rename from src/strategy/shaman/GenericShamanStrategy.cpp rename to src/Ai/Class/Shaman/Strategy/GenericShamanStrategy.cpp index 2df84edd57..fd47d023d4 100644 --- a/src/strategy/shaman/GenericShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/GenericShamanStrategy.cpp @@ -40,59 +40,59 @@ class GenericShamanStrategyActionNodeFactory : public NamedObjectFactory& triggers) { CombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("wind shear", NextAction::array(0, new NextAction("wind shear", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("wind shear on enemy healer", NextAction::array(0, new NextAction("wind shear on enemy healer", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("purge", NextAction::array(0, new NextAction("purge", ACTION_DISPEL), nullptr))); - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("mana potion", ACTION_DISPEL), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 65.0f), nullptr))); + triggers.push_back(new TriggerNode("wind shear", { NextAction("wind shear", 23.0f), })); + triggers.push_back(new TriggerNode("wind shear on enemy healer", { NextAction("wind shear on enemy healer", 23.0f), })); + triggers.push_back(new TriggerNode("purge", { NextAction("purge", ACTION_DISPEL), })); + triggers.push_back(new TriggerNode("medium mana", { NextAction("mana potion", ACTION_DISPEL), })); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 65.0f), })); } void ShamanCureStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("cure poison", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cure poison", NextAction::array(0, new NextAction("cure poison on party", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("cleanse spirit poison", NextAction::array(0, new NextAction("cleanse spirit", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cleanse spirit poison", NextAction::array(0, new NextAction("cleanse spirit poison on party", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("cure disease", NextAction::array(0, new NextAction("cure disease", 31.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cure disease", NextAction::array(0, new NextAction("cure disease on party", 30.0f), nullptr))); - triggers.push_back(new TriggerNode("cleanse spirit disease", NextAction::array(0, new NextAction("cleanse spirit", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cleanse spirit disease", NextAction::array(0, new NextAction("cleanse spirit disease on party", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("cleanse spirit curse", NextAction::array(0, new NextAction("cleanse spirit", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cleanse spirit curse", NextAction::array(0, new NextAction("cleanse spirit curse on party", 23.0f), nullptr))); + triggers.push_back(new TriggerNode("cure poison", { NextAction("cure poison", 21.0f), })); + triggers.push_back(new TriggerNode("party member cure poison", { NextAction("cure poison on party", 21.0f), })); + triggers.push_back(new TriggerNode("cleanse spirit poison", { NextAction("cleanse spirit", 24.0f), })); + triggers.push_back(new TriggerNode("party member cleanse spirit poison", { NextAction("cleanse spirit poison on party", 23.0f), })); + triggers.push_back(new TriggerNode("cure disease", { NextAction("cure disease", 31.0f), })); + triggers.push_back(new TriggerNode("party member cure disease", { NextAction("cure disease on party", 30.0f), })); + triggers.push_back(new TriggerNode("cleanse spirit disease", { NextAction("cleanse spirit", 24.0f), })); + triggers.push_back(new TriggerNode("party member cleanse spirit disease", { NextAction("cleanse spirit disease on party", 23.0f), })); + triggers.push_back(new TriggerNode("cleanse spirit curse", { NextAction("cleanse spirit", 24.0f), })); + triggers.push_back(new TriggerNode("party member cleanse spirit curse", { NextAction("cleanse spirit curse on party", 23.0f), })); } void ShamanBoostStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("heroism", NextAction::array(0, new NextAction("heroism", 30.0f), nullptr))); - triggers.push_back(new TriggerNode("bloodlust", NextAction::array(0, new NextAction("bloodlust", 30.0f), nullptr))); + triggers.push_back(new TriggerNode("heroism", { NextAction("heroism", 30.0f), })); + triggers.push_back(new TriggerNode("bloodlust", { NextAction("bloodlust", 30.0f), })); Player* bot = botAI->GetBot(); int tab = AiFactory::GetPlayerSpecTab(bot); if (tab == 0) // Elemental { - triggers.push_back(new TriggerNode("fire elemental totem", NextAction::array(0, new NextAction("fire elemental totem", 23.0f), nullptr))); + triggers.push_back(new TriggerNode("fire elemental totem", { NextAction("fire elemental totem", 23.0f), })); } else if (tab == 1) // Enhancement { - triggers.push_back(new TriggerNode("fire elemental totem", NextAction::array(0, new NextAction("fire elemental totem melee", 24.0f), nullptr))); + triggers.push_back(new TriggerNode("fire elemental totem", { NextAction("fire elemental totem melee", 24.0f), })); } } @@ -151,18 +151,18 @@ void ShamanAoeStrategy::InitTriggers(std::vector& triggers) if (tab == 0) // Elemental { - triggers.push_back(new TriggerNode("medium aoe",NextAction::array(0, new NextAction("fire nova", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("chain lightning no cd", NextAction::array(0, new NextAction("chain lightning", 5.6f), nullptr))); + triggers.push_back(new TriggerNode("medium aoe",{ NextAction("fire nova", 23.0f), })); + triggers.push_back(new TriggerNode("chain lightning no cd", { NextAction("chain lightning", 5.6f), })); } else if (tab == 1) // Enhancement { - triggers.push_back(new TriggerNode("medium aoe",NextAction::array(0, - new NextAction("magma totem", 24.0f), - new NextAction("fire nova", 23.0f), nullptr))); + triggers.push_back(new TriggerNode("medium aoe",{ + NextAction("magma totem", 24.0f), + NextAction("fire nova", 23.0f), })); - triggers.push_back(new TriggerNode("maelstrom weapon 5 and medium aoe", NextAction::array(0, new NextAction("chain lightning", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("maelstrom weapon 4 and medium aoe", NextAction::array(0, new NextAction("chain lightning", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("enemy within melee", NextAction::array(0, new NextAction("fire nova", 5.1f), nullptr))); + triggers.push_back(new TriggerNode("maelstrom weapon 5 and medium aoe", { NextAction("chain lightning", 22.0f), })); + triggers.push_back(new TriggerNode("maelstrom weapon 4 and medium aoe", { NextAction("chain lightning", 21.0f), })); + triggers.push_back(new TriggerNode("enemy within melee", { NextAction("fire nova", 5.1f), })); } else if (tab == 2) // Restoration { diff --git a/src/strategy/shaman/GenericShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/GenericShamanStrategy.h similarity index 100% rename from src/strategy/shaman/GenericShamanStrategy.h rename to src/Ai/Class/Shaman/Strategy/GenericShamanStrategy.h diff --git a/src/strategy/shaman/RestoShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp similarity index 53% rename from src/strategy/shaman/RestoShamanStrategy.cpp rename to src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp index ea7476b475..698531a858 100644 --- a/src/strategy/shaman/RestoShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.cpp @@ -36,26 +36,26 @@ class RestoShamanStrategyActionNodeFactory : public NamedObjectFactory& triggers) GenericShamanStrategy::InitTriggers(triggers); // Totem Triggers - triggers.push_back(new TriggerNode("call of the elements", NextAction::array(0, new NextAction("call of the elements", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("stoneclaw totem", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("mana tide totem", ACTION_HIGH + 5), NULL))); + triggers.push_back(new TriggerNode("call of the elements", { NextAction("call of the elements", 60.0f) })); + triggers.push_back(new TriggerNode("low health", { NextAction("stoneclaw totem", 40.0f) })); + triggers.push_back(new TriggerNode("medium mana", { NextAction("mana tide totem", ACTION_HIGH + 5) })); // Healing Triggers - triggers.push_back(new TriggerNode("group heal setting", NextAction::array(0, - new NextAction("riptide on party", 27.0f), - new NextAction("chain heal on party", 26.0f), NULL))); + triggers.push_back(new TriggerNode("group heal setting", { + NextAction("riptide on party", 27.0f), + NextAction("chain heal on party", 26.0f) })); - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, - new NextAction("riptide on party", 25.0f), - new NextAction("healing wave on party", 24.0f), - new NextAction("lesser healing wave on party", 23.0f), nullptr))); + triggers.push_back(new TriggerNode("party member critical health", { + NextAction("riptide on party", 25.0f), + NextAction("healing wave on party", 24.0f), + NextAction("lesser healing wave on party", 23.0f) })); - triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, - new NextAction("riptide on party", 19.0f), - new NextAction("healing wave on party", 18.0f), - new NextAction("lesser healing wave on party", 17.0f), nullptr))); + triggers.push_back(new TriggerNode("party member low health", { + NextAction("riptide on party", 19.0f), + NextAction("healing wave on party", 18.0f), + NextAction("lesser healing wave on party", 17.0f) })); - triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, - new NextAction("riptide on party", 16.0f), - new NextAction("healing wave on party", 15.0f), - new NextAction("lesser healing wave on party", 14.0f), nullptr))); + triggers.push_back(new TriggerNode("party member medium health", { + NextAction("riptide on party", 16.0f), + NextAction("healing wave on party", 15.0f), + NextAction("lesser healing wave on party", 14.0f) })); - triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, - new NextAction("riptide on party", 12.0f), - new NextAction("lesser healing wave on party", 11.0f), nullptr))); + triggers.push_back(new TriggerNode("party member almost full health", { + NextAction("riptide on party", 12.0f), + NextAction("lesser healing wave on party", 11.0f) })); - triggers.push_back(new TriggerNode("earth shield on main tank", NextAction::array(0, new NextAction("earth shield on main tank", ACTION_HIGH + 7), NULL))); + triggers.push_back(new TriggerNode("earth shield on main tank", { NextAction("earth shield on main tank", ACTION_HIGH + 7) })); // Dispel Triggers - triggers.push_back(new TriggerNode("party member cleanse spirit poison", NextAction::array(0, new NextAction("cleanse spirit poison on party", ACTION_DISPEL + 2), nullptr))); - triggers.push_back(new TriggerNode("party member cleanse spirit disease", NextAction::array(0, new NextAction("cleanse spirit disease on party", ACTION_DISPEL + 2), nullptr))); - triggers.push_back(new TriggerNode("party member cleanse spirit curse",NextAction::array(0, new NextAction("cleanse spirit curse on party", ACTION_DISPEL + 2), NULL))); + triggers.push_back(new TriggerNode("party member cleanse spirit poison", { NextAction("cleanse spirit poison on party", ACTION_DISPEL + 2) })); + triggers.push_back(new TriggerNode("party member cleanse spirit disease", { NextAction("cleanse spirit disease on party", ACTION_DISPEL + 2) })); + triggers.push_back(new TriggerNode("party member cleanse spirit curse",{ NextAction("cleanse spirit curse on party", ACTION_DISPEL + 2) })); // Range/Mana Triggers - triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr))); - triggers.push_back(new TriggerNode("party member to heal out of spell range", NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 1), nullptr))); - triggers.push_back(new TriggerNode("water shield", NextAction::array(0, new NextAction("water shield", 19.5f), nullptr))); + triggers.push_back(new TriggerNode("enemy too close for spell", { NextAction("flee", ACTION_MOVE + 9) })); + triggers.push_back(new TriggerNode("party member to heal out of spell range", { NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 1) })); + triggers.push_back(new TriggerNode("water shield", { NextAction("water shield", 19.5f) })); } void ShamanHealerDpsStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("healer should attack", - NextAction::array(0, new NextAction("flame shock", ACTION_DEFAULT + 0.2f), - new NextAction("lava burst", ACTION_DEFAULT + 0.1f), - new NextAction("lightning bolt", ACTION_DEFAULT), nullptr))); + { NextAction("flame shock", ACTION_DEFAULT + 0.2f), + NextAction("lava burst", ACTION_DEFAULT + 0.1f), + NextAction("lightning bolt", ACTION_DEFAULT) })); triggers.push_back( new TriggerNode("medium aoe and healer should attack", - NextAction::array(0, new NextAction("chain lightning", ACTION_DEFAULT + 0.3f), nullptr))); + { NextAction("chain lightning", ACTION_DEFAULT + 0.3f) })); } diff --git a/src/strategy/shaman/RestoShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.h similarity index 100% rename from src/strategy/shaman/RestoShamanStrategy.h rename to src/Ai/Class/Shaman/Strategy/RestoShamanStrategy.h diff --git a/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp b/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp new file mode 100644 index 0000000000..c72000539c --- /dev/null +++ b/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "ShamanNonCombatStrategy.h" +#include "AiFactory.h" +#include "Strategy.h" +#include "Playerbots.h" + +class ShamanNonCombatStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + ShamanNonCombatStrategyActionNodeFactory() + { + creators["flametongue weapon"] = &flametongue_weapon; + creators["frostbrand weapon"] = &frostbrand_weapon; + creators["windfury weapon"] = &windfury_weapon; + creators["earthliving weapon"] = &earthliving_weapon; + creators["wind shear"] = &wind_shear; + creators["purge"] = &purge; + } + +private: + static ActionNode* flametongue_weapon([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("flametongue weapon", + /*P*/ {}, + /*A*/ { NextAction("rockbiter weapon") }, + /*C*/ {}); + } + static ActionNode* frostbrand_weapon([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("frostbrand weapon", + /*P*/ {}, + /*A*/ { NextAction("flametongue weapon") }, + /*C*/ {}); + } + static ActionNode* windfury_weapon([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("windfury weapon", + /*P*/ {}, + /*A*/ { NextAction("flametongue weapon") }, + /*C*/ {}); + } + static ActionNode* earthliving_weapon([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode("earthliving weapon", + /*P*/ {}, + /*A*/ { NextAction("flametongue weapon") }, + /*C*/ {}); + } + static ActionNode* wind_shear(PlayerbotAI*) { return new ActionNode("wind shear", {}, {}, {}); } + static ActionNode* purge(PlayerbotAI*) { return new ActionNode("purge", {}, {}, {}); } +}; + +ShamanNonCombatStrategy::ShamanNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) +{ + actionNodeFactories.Add(new ShamanNonCombatStrategyActionNodeFactory()); +} + +void ShamanNonCombatStrategy::InitTriggers(std::vector& triggers) +{ + NonCombatStrategy::InitTriggers(triggers); + + // Totemic Recall + triggers.push_back(new TriggerNode("totemic recall", { NextAction("totemic recall", 60.0f), })); + + // Healing/Resurrect Triggers + triggers.push_back(new TriggerNode("party member dead", { NextAction("ancestral spirit", ACTION_CRITICAL_HEAL + 10), })); + triggers.push_back(new TriggerNode("party member critical health", { + NextAction("riptide on party", 31.0f), + NextAction("healing wave on party", 30.0f) })); + triggers.push_back(new TriggerNode("party member low health",{ + NextAction("riptide on party", 29.0f), + NextAction("healing wave on party", 28.0f) })); + triggers.push_back(new TriggerNode("party member medium health",{ + NextAction("riptide on party", 27.0f), + NextAction("healing wave on party", 26.0f) })); + triggers.push_back(new TriggerNode("party member almost full health",{ + NextAction("riptide on party", 25.0f), + NextAction("lesser healing wave on party", 24.0f) })); + triggers.push_back(new TriggerNode("group heal setting",{ NextAction("chain heal on party", 27.0f) })); + + // Cure Triggers + triggers.push_back(new TriggerNode("cure poison", { NextAction("cure poison", 21.0f), })); + triggers.push_back(new TriggerNode("party member cure poison", { NextAction("cure poison on party", 21.0f), })); + triggers.push_back(new TriggerNode("cure disease", { NextAction("cure disease", 31.0f), })); + triggers.push_back(new TriggerNode("party member cure disease", { NextAction("cure disease on party", 30.0f), })); + + // Out of Combat Buff Triggers + Player* bot = botAI->GetBot(); + int tab = AiFactory::GetPlayerSpecTab(bot); + + if (tab == 0) // Elemental + { + triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("flametongue weapon", 22.0f), })); + triggers.push_back(new TriggerNode("water shield", { NextAction("water shield", 21.0f), })); + } + else if (tab == 1) // Enhancement + { + triggers.push_back(new TriggerNode("main hand weapon no imbue", { NextAction("windfury weapon", 22.0f), })); + triggers.push_back(new TriggerNode("off hand weapon no imbue", { NextAction("flametongue weapon", 21.0f), })); + triggers.push_back(new TriggerNode("lightning shield", { NextAction("lightning shield", 20.0f), })); + } + else if (tab == 2) // Restoration + { + triggers.push_back(new TriggerNode("main hand weapon no imbue",{ NextAction("earthliving weapon", 22.0f), })); + triggers.push_back(new TriggerNode("water shield", { NextAction("water shield", 20.0f), })); + } + + // Buff Triggers while swimming + triggers.push_back(new TriggerNode("water breathing", { NextAction("water breathing", 12.0f), })); + triggers.push_back(new TriggerNode("water walking", { NextAction("water walking", 12.0f), })); + triggers.push_back(new TriggerNode("water breathing on party", { NextAction("water breathing on party", 11.0f), })); + triggers.push_back(new TriggerNode("water walking on party", { NextAction("water walking on party", 11.0f), })); + + // Pet Triggers + triggers.push_back(new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f), })); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 65.0f), })); +} + +void ShamanNonCombatStrategy::InitMultipliers(std::vector& multipliers) +{ + NonCombatStrategy::InitMultipliers(multipliers); +} diff --git a/src/strategy/shaman/ShamanNonCombatStrategy.h b/src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.h similarity index 100% rename from src/strategy/shaman/ShamanNonCombatStrategy.h rename to src/Ai/Class/Shaman/Strategy/ShamanNonCombatStrategy.h diff --git a/src/strategy/shaman/TotemsShamanStrategy.cpp b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp similarity index 60% rename from src/strategy/shaman/TotemsShamanStrategy.cpp rename to src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp index d9149b8c47..d00cc5e6cb 100644 --- a/src/strategy/shaman/TotemsShamanStrategy.cpp +++ b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.cpp @@ -15,32 +15,32 @@ StrengthOfEarthTotemStrategy::StrengthOfEarthTotemStrategy(PlayerbotAI* botAI) : void StrengthOfEarthTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set strength of earth totem", NextAction::array(0, new NextAction("set strength of earth totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no earth totem", NextAction::array(0, new NextAction("strength of earth totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set strength of earth totem", { NextAction("set strength of earth totem", 60.0f) })); + triggers.push_back(new TriggerNode("no earth totem", { NextAction("strength of earth totem", 55.0f) })); } StoneclawTotemStrategy::StoneclawTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void StoneclawTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set stoneskin totem", NextAction::array(0, new NextAction("set stoneskin totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no earth totem", NextAction::array(0, new NextAction("stoneskin totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set stoneskin totem", { NextAction("set stoneskin totem", 60.0f) })); + triggers.push_back(new TriggerNode("no earth totem", { NextAction("stoneskin totem", 55.0f) })); } EarthTotemStrategy::EarthTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void EarthTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set tremor totem", NextAction::array(0, new NextAction("set tremor totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no earth totem", NextAction::array(0, new NextAction("tremor totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set tremor totem", { NextAction("set tremor totem", 60.0f) })); + triggers.push_back(new TriggerNode("no earth totem", { NextAction("tremor totem", 55.0f) })); } EarthbindTotemStrategy::EarthbindTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void EarthbindTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set earthbind totem", NextAction::array(0, new NextAction("set earthbind totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no earth totem", NextAction::array(0, new NextAction("earthbind totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set earthbind totem", { NextAction("set earthbind totem", 60.0f) })); + triggers.push_back(new TriggerNode("no earth totem", { NextAction("earthbind totem", 55.0f) })); } // Fire Totems @@ -48,24 +48,24 @@ SearingTotemStrategy::SearingTotemStrategy(PlayerbotAI* botAI) : GenericShamanSt void SearingTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set searing totem", NextAction::array(0, new NextAction("set searing totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no fire totem", NextAction::array(0, new NextAction("searing totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set searing totem", { NextAction("set searing totem", 60.0f) })); + triggers.push_back(new TriggerNode("no fire totem", { NextAction("searing totem", 55.0f) })); } MagmaTotemStrategy::MagmaTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void MagmaTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set magma totem", NextAction::array(0, new NextAction("set magma totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no fire totem", NextAction::array(0, new NextAction("magma totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set magma totem", { NextAction("set magma totem", 60.0f) })); + triggers.push_back(new TriggerNode("no fire totem", { NextAction("magma totem", 55.0f) })); } FlametongueTotemStrategy::FlametongueTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void FlametongueTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set flametongue totem", NextAction::array(0, new NextAction("set flametongue totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no fire totem", NextAction::array(0, new NextAction("flametongue totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set flametongue totem", { NextAction("set flametongue totem", 60.0f) })); + triggers.push_back(new TriggerNode("no fire totem", { NextAction("flametongue totem", 55.0f) })); } TotemOfWrathStrategy::TotemOfWrathStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} @@ -76,21 +76,21 @@ void TotemOfWrathStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); if (bot->HasSpell(30706)) { - triggers.push_back(new TriggerNode("set totem of wrath", NextAction::array(0, new NextAction("set totem of wrath", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set totem of wrath", { NextAction("set totem of wrath", 60.0f) })); } else if (bot->HasSpell(8227)) { - triggers.push_back(new TriggerNode("set flametongue totem", NextAction::array(0, new NextAction("set flametongue totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set flametongue totem", { NextAction("set flametongue totem", 60.0f) })); } - triggers.push_back(new TriggerNode("no fire totem", NextAction::array(0, new NextAction("totem of wrath", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("no fire totem", { NextAction("totem of wrath", 55.0f) })); } FrostResistanceTotemStrategy::FrostResistanceTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void FrostResistanceTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set frost resistance totem", NextAction::array(0, new NextAction("set frost resistance totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no fire totem", NextAction::array(0, new NextAction("frost resistance totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set frost resistance totem", { NextAction("set frost resistance totem", 60.0f) })); + triggers.push_back(new TriggerNode("no fire totem", { NextAction("frost resistance totem", 55.0f) })); } // Water Totems @@ -98,16 +98,16 @@ HealingStreamTotemStrategy::HealingStreamTotemStrategy(PlayerbotAI* botAI) : Gen void HealingStreamTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set healing stream totem", NextAction::array(0, new NextAction("set healing stream totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no water totem", NextAction::array(0, new NextAction("healing stream totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set healing stream totem", { NextAction("set healing stream totem", 60.0f) })); + triggers.push_back(new TriggerNode("no water totem", { NextAction("healing stream totem", 55.0f) })); } ManaSpringTotemStrategy::ManaSpringTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void ManaSpringTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set mana spring totem", NextAction::array(0, new NextAction("set mana spring totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no water totem", NextAction::array(0, new NextAction("mana spring totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set mana spring totem", { NextAction("set mana spring totem", 60.0f) })); + triggers.push_back(new TriggerNode("no water totem", { NextAction("mana spring totem", 55.0f) })); } CleansingTotemStrategy::CleansingTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} @@ -118,21 +118,21 @@ void CleansingTotemStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); if (bot->HasSpell(8170)) { - triggers.push_back(new TriggerNode("set cleansing totem", NextAction::array(0, new NextAction("set cleansing totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set cleansing totem", { NextAction("set cleansing totem", 60.0f) })); } else if (bot->HasSpell(5675)) { - triggers.push_back(new TriggerNode("set mana spring totem", NextAction::array(0, new NextAction("set mana spring totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set mana spring totem", { NextAction("set mana spring totem", 60.0f) })); } - triggers.push_back(new TriggerNode("no water totem", NextAction::array(0, new NextAction("cleansing totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("no water totem", { NextAction("cleansing totem", 55.0f) })); } FireResistanceTotemStrategy::FireResistanceTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void FireResistanceTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set fire resistance totem", NextAction::array(0, new NextAction("set fire resistance totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no water totem", NextAction::array(0, new NextAction("fire resistance totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set fire resistance totem", { NextAction("set fire resistance totem", 60.0f) })); + triggers.push_back(new TriggerNode("no water totem", { NextAction("fire resistance totem", 55.0f) })); } // Air Totems @@ -144,14 +144,14 @@ void WrathOfAirTotemStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); if (bot->HasSpell(3738)) { - triggers.push_back(new TriggerNode("set wrath of air totem", NextAction::array(0, new NextAction("set wrath of air totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set wrath of air totem", { NextAction("set wrath of air totem", 60.0f) })); } else if (bot->HasSpell(8177)) { - triggers.push_back(new TriggerNode("set grounding totem", NextAction::array(0, new NextAction("set grounding totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set grounding totem", { NextAction("set grounding totem", 60.0f) })); } triggers.push_back( - new TriggerNode("no air totem", NextAction::array(0, new NextAction("wrath of air totem", 55.0f), nullptr))); + new TriggerNode("no air totem", { NextAction("wrath of air totem", 55.0f) })); } WindfuryTotemStrategy::WindfuryTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} @@ -162,27 +162,27 @@ void WindfuryTotemStrategy::InitTriggers(std::vector& triggers) Player* bot = botAI->GetBot(); if (bot->HasSpell(8512)) { - triggers.push_back(new TriggerNode("set windfury totem", NextAction::array(0, new NextAction("set windfury totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set windfury totem", { NextAction("set windfury totem", 60.0f) })); } else if (bot->HasSpell(8177)) { - triggers.push_back(new TriggerNode("set grounding totem", NextAction::array(0, new NextAction("set grounding totem", 60.0f), nullptr))); + triggers.push_back(new TriggerNode("set grounding totem", { NextAction("set grounding totem", 60.0f) })); } - triggers.push_back(new TriggerNode("no air totem", NextAction::array(0, new NextAction("windfury totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("no air totem", { NextAction("windfury totem", 55.0f) })); } NatureResistanceTotemStrategy::NatureResistanceTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void NatureResistanceTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set nature resistance totem", NextAction::array(0, new NextAction("set nature resistance totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no air totem", NextAction::array(0, new NextAction("nature resistance totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set nature resistance totem", { NextAction("set nature resistance totem", 60.0f) })); + triggers.push_back(new TriggerNode("no air totem", { NextAction("nature resistance totem", 55.0f) })); } GroundingTotemStrategy::GroundingTotemStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) {} void GroundingTotemStrategy::InitTriggers(std::vector& triggers) { GenericShamanStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("set grounding totem", NextAction::array(0, new NextAction("set grounding totem", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no air totem", NextAction::array(0, new NextAction("grounding totem", 55.0f), nullptr))); + triggers.push_back(new TriggerNode("set grounding totem", { NextAction("set grounding totem", 60.0f) })); + triggers.push_back(new TriggerNode("no air totem", { NextAction("grounding totem", 55.0f) })); } diff --git a/src/strategy/shaman/TotemsShamanStrategy.h b/src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h similarity index 100% rename from src/strategy/shaman/TotemsShamanStrategy.h rename to src/Ai/Class/Shaman/Strategy/TotemsShamanStrategy.h diff --git a/src/strategy/shaman/ShamanTriggers.cpp b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp similarity index 100% rename from src/strategy/shaman/ShamanTriggers.cpp rename to src/Ai/Class/Shaman/Trigger/ShamanTriggers.cpp diff --git a/src/strategy/shaman/ShamanTriggers.h b/src/Ai/Class/Shaman/Trigger/ShamanTriggers.h similarity index 100% rename from src/strategy/shaman/ShamanTriggers.h rename to src/Ai/Class/Shaman/Trigger/ShamanTriggers.h diff --git a/src/strategy/warlock/WarlockActions.cpp b/src/Ai/Class/Warlock/Action/WarlockActions.cpp similarity index 100% rename from src/strategy/warlock/WarlockActions.cpp rename to src/Ai/Class/Warlock/Action/WarlockActions.cpp diff --git a/src/strategy/warlock/WarlockActions.h b/src/Ai/Class/Warlock/Action/WarlockActions.h similarity index 100% rename from src/strategy/warlock/WarlockActions.h rename to src/Ai/Class/Warlock/Action/WarlockActions.h diff --git a/src/strategy/warlock/AfflictionWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.cpp similarity index 50% rename from src/strategy/warlock/AfflictionWarlockStrategy.cpp rename to src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.cpp index c35127f263..78da04d99e 100644 --- a/src/strategy/warlock/AfflictionWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.cpp @@ -27,18 +27,18 @@ class AfflictionWarlockStrategyActionNodeFactory : public NamedObjectFactory AfflictionWarlockStrategy::getDefaultActions() { - return NextAction::array( 0, - new NextAction("corruption", 5.5f), - new NextAction("unstable affliction", 5.4f), - new NextAction("haunt", 5.3f), - new NextAction("shadow bolt", 5.2f), - new NextAction("shoot", 5.0f), nullptr); + return { + NextAction("corruption", 5.5f), + NextAction("unstable affliction", 5.4f), + NextAction("haunt", 5.3f), + NextAction("shadow bolt", 5.2f), + NextAction("shoot", 5.0f) + }; } // ===== Trigger Initialization === @@ -64,19 +65,89 @@ void AfflictionWarlockStrategy::InitTriggers(std::vector& triggers GenericWarlockStrategy::InitTriggers(triggers); // Main DoT triggers for high uptime - triggers.push_back(new TriggerNode("corruption on attacker", NextAction::array(0, new NextAction("corruption on attacker", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("unstable affliction on attacker", NextAction::array(0, new NextAction("unstable affliction on attacker", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("corruption", NextAction::array(0, new NextAction("corruption", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("unstable affliction", NextAction::array(0, new NextAction("unstable affliction", 17.5f), nullptr))); - triggers.push_back(new TriggerNode("haunt", NextAction::array(0, new NextAction("haunt", 16.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "corruption on attacker", + { + NextAction("corruption on attacker", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "unstable affliction on attacker", + { + NextAction("unstable affliction on attacker", 19.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "corruption", + { + NextAction("corruption", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "unstable affliction", + { + NextAction("unstable affliction", 17.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "haunt", + { + NextAction("haunt", 16.5f) + } + ) + ); // Drain Soul as execute if target is low HP // Shadow Trance for free casts - triggers.push_back(new TriggerNode("shadow trance", NextAction::array(0, new NextAction("shadow bolt", 16.0f), nullptr))); - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("drain soul", 15.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "shadow trance", + { + NextAction("shadow bolt", 16.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("drain soul", 15.5f) + } + ) + ); // Life Tap glyph buff, and Life Tap as filler - triggers.push_back(new TriggerNode("life tap glyph buff", NextAction::array(0, new NextAction("life tap", 29.5f), nullptr))); - triggers.push_back(new TriggerNode("life tap", NextAction::array(0, new NextAction("life tap", 5.1f), nullptr))); + triggers.push_back( + new TriggerNode( + "life tap glyph buff", + { + NextAction("life tap", 29.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "life tap", + { + NextAction("life tap", 5.1f) + } + ) + ); - triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "enemy too close for spell", + { + NextAction("flee", 39.0f) + } + ) + ); } diff --git a/src/strategy/warlock/AfflictionWarlockStrategy.h b/src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.h similarity index 91% rename from src/strategy/warlock/AfflictionWarlockStrategy.h rename to src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.h index 1585c4484d..503715bd41 100644 --- a/src/strategy/warlock/AfflictionWarlockStrategy.h +++ b/src/Ai/Class/Warlock/Strategy/AfflictionWarlockStrategy.h @@ -18,7 +18,7 @@ class AfflictionWarlockStrategy : public GenericWarlockStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "affli"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/warlock/DemonologyWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.cpp similarity index 51% rename from src/strategy/warlock/DemonologyWarlockStrategy.cpp rename to src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.cpp index f41bf96f8c..6bb4e9de59 100644 --- a/src/strategy/warlock/DemonologyWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.cpp @@ -31,22 +31,22 @@ class DemonologyWarlockStrategyActionNodeFactory : public NamedObjectFactory DemonologyWarlockStrategy::getDefaultActions() { - return NextAction::array(0, - new NextAction("corruption", 5.5f), - new NextAction("immolate", 5.4f), - new NextAction("shadow bolt", 5.3f), - new NextAction("incinerate", 5.2f), - new NextAction("shoot", 5.0f), nullptr); + return { + NextAction("corruption", 5.5f), + NextAction("immolate", 5.4f), + NextAction("shadow bolt", 5.3f), + NextAction("incinerate", 5.2f), + NextAction("shoot", 5.0f) }; } // ===== Trigger Initialization === @@ -72,24 +72,101 @@ void DemonologyWarlockStrategy::InitTriggers(std::vector& triggers GenericWarlockStrategy::InitTriggers(triggers); // High priority cooldowns - triggers.push_back(new TriggerNode("metamorphosis", NextAction::array(0, new NextAction("metamorphosis", 28.5f), nullptr))); - triggers.push_back(new TriggerNode("demonic empowerment", NextAction::array(0, new NextAction("demonic empowerment", 28.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "metamorphosis", + { + NextAction("metamorphosis", 28.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "demonic empowerment", + { + NextAction("demonic empowerment", 28.0f) + } + ) + ); // Main DoT triggers for high uptime - triggers.push_back(new TriggerNode("corruption on attacker", NextAction::array(0, new NextAction("corruption on attacker", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("immolate on attacker", NextAction::array(0, new NextAction("immolate on attacker", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("corruption", NextAction::array(0, new NextAction("corruption", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("immolate", NextAction::array(0, new NextAction("immolate", 17.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "corruption on attacker", + { + NextAction("corruption on attacker", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "immolate on attacker", + { + NextAction("immolate on attacker", 19.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "corruption", + { + NextAction("corruption", 18.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "immolate", + { + NextAction("immolate", 17.5f) + } + ) + ); // Procs - triggers.push_back(new TriggerNode("decimation", NextAction::array(0, new NextAction("soul fire", 17.0f), nullptr))); - triggers.push_back(new TriggerNode("molten core", NextAction::array(0, new NextAction("incinerate", 16.5f), nullptr))); + triggers.push_back( + new TriggerNode( + "decimation", + { + NextAction("soul fire", 17.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "molten core", + { + NextAction("incinerate", 16.5f) + } + ) + ); // Life Tap glyph buff, and Life Tap as filler - triggers.push_back(new TriggerNode("life tap glyph buff", NextAction::array(0, new NextAction("life tap", 29.5f), nullptr))); - triggers.push_back(new TriggerNode("life tap", NextAction::array(0, new NextAction("life tap", 5.1f), nullptr))); + triggers.push_back( + new TriggerNode( + "life tap glyph buff", + { + NextAction("life tap", 29.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "life tap", + { + NextAction("life tap", 5.1f) + } + ) + ); - triggers.push_back(new TriggerNode("meta melee flee check", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "meta melee flee check", + { + NextAction("flee", 39.0f) + } + ) + ); } // Combat strategy to run to melee for Immolation Aura @@ -100,7 +177,13 @@ MetaMeleeAoeStrategy::MetaMeleeAoeStrategy(PlayerbotAI* botAI) : CombatStrategy( void MetaMeleeAoeStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("immolation aura active", NextAction::array(0, - new NextAction("reach melee", 25.5f), - new NextAction("demon charge", 25.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "immolation aura active", + { + NextAction("reach melee", 25.5f), + NextAction("demon charge", 25.0f) + } + ) + ); } diff --git a/src/strategy/warlock/DemonologyWarlockStrategy.h b/src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.h similarity index 94% rename from src/strategy/warlock/DemonologyWarlockStrategy.h rename to src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.h index df853c85ac..5a84175a57 100644 --- a/src/strategy/warlock/DemonologyWarlockStrategy.h +++ b/src/Ai/Class/Warlock/Strategy/DemonologyWarlockStrategy.h @@ -18,7 +18,7 @@ class DemonologyWarlockStrategy : public GenericWarlockStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "demo"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; class MetaMeleeAoeStrategy : public CombatStrategy diff --git a/src/strategy/warlock/DestructionWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.cpp similarity index 51% rename from src/strategy/warlock/DestructionWarlockStrategy.cpp rename to src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.cpp index dd0ce08630..af44de01c5 100644 --- a/src/strategy/warlock/DestructionWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.cpp @@ -29,20 +29,20 @@ class DestructionWarlockStrategyActionNodeFactory : public NamedObjectFactory DestructionWarlockStrategy::getDefaultActions() { - return NextAction::array( 0, - new NextAction("immolate", 5.9f), - new NextAction("conflagrate", 5.8f), - new NextAction("chaos bolt", 5.7f), - new NextAction("incinerate", 5.6f), - new NextAction("corruption", 5.3f), // Note: Corruption and Shadow Bolt won't be used after the character learns Incinerate at level 64 - new NextAction("shadow bolt", 5.2f), - new NextAction("shoot", 5.0f), nullptr); + return { + NextAction("immolate", 5.9f), + NextAction("conflagrate", 5.8f), + NextAction("chaos bolt", 5.7f), + NextAction("incinerate", 5.6f), + NextAction("corruption", 5.3f), // Note: Corruption and Shadow Bolt won't be used after the character learns Incinerate at level 64 + NextAction("shadow bolt", 5.2f), + NextAction("shoot", 5.0f) + }; } // ===== Trigger Initialization === @@ -70,20 +71,83 @@ void DestructionWarlockStrategy::InitTriggers(std::vector& trigger GenericWarlockStrategy::InitTriggers(triggers); // Main DoT triggers for high uptime + high priority cooldowns - triggers.push_back(new TriggerNode("immolate", NextAction::array(0, new NextAction("immolate", 20.0f), nullptr))); - triggers.push_back(new TriggerNode("conflagrate", NextAction::array(0, new NextAction("conflagrate", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("chaos bolt", NextAction::array(0, new NextAction("chaos bolt", 19.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "immolate", + { + NextAction("immolate", 20.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "conflagrate", + { + NextAction("conflagrate", 19.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "chaos bolt", + { + NextAction("chaos bolt", 19.0f) + } + ) + ); // Note: Corruption won't be used after the character learns Incinerate at level 64 - triggers.push_back(new TriggerNode("corruption on attacker", NextAction::array(0, new NextAction("corruption on attacker", 5.5f), nullptr))); - triggers.push_back(new TriggerNode("corruption", NextAction::array(0, new NextAction("corruption", 5.4f), nullptr))); + triggers.push_back( + new TriggerNode( + "corruption on attacker", + { + NextAction("corruption on attacker", 5.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "corruption", + { + NextAction("corruption", 5.4f) + } + ) + ); // Shadowburn as execute if target is low HP - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("shadowburn", 18.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("shadowburn", 18.0f) + } + ) + ); // Life Tap glyph buff, and Life Tap as filler - triggers.push_back(new TriggerNode("life tap glyph buff", NextAction::array(0, new NextAction("life tap", 29.5f), nullptr))); - triggers.push_back(new TriggerNode("life tap", NextAction::array(0, new NextAction("life tap", 5.1f), nullptr))); + triggers.push_back( + new TriggerNode( + "life tap glyph buff", + { + NextAction("life tap", 29.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "life tap", + { + NextAction("life tap", 5.1f) + } + ) + ); - triggers.push_back(new TriggerNode("enemy too close for spell", NextAction::array(0, new NextAction("flee", 39.0f), nullptr))); + triggers.push_back( + new TriggerNode( + "enemy too close for spell", + { + NextAction("flee", 39.0f) + } + ) + ); } diff --git a/src/strategy/warlock/DestructionWarlockStrategy.h b/src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.h similarity index 92% rename from src/strategy/warlock/DestructionWarlockStrategy.h rename to src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.h index 46759d74eb..68fe67bb32 100644 --- a/src/strategy/warlock/DestructionWarlockStrategy.h +++ b/src/Ai/Class/Warlock/Strategy/DestructionWarlockStrategy.h @@ -18,7 +18,7 @@ class DestructionWarlockStrategy : public GenericWarlockStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "destro"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/warlock/GenericWarlockNonCombatStrategy.cpp b/src/Ai/Class/Warlock/Strategy/GenericWarlockNonCombatStrategy.cpp similarity index 56% rename from src/strategy/warlock/GenericWarlockNonCombatStrategy.cpp rename to src/Ai/Class/Warlock/Strategy/GenericWarlockNonCombatStrategy.cpp index 72484e3776..a78ff0a988 100644 --- a/src/strategy/warlock/GenericWarlockNonCombatStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/GenericWarlockNonCombatStrategy.cpp @@ -28,45 +28,45 @@ class GenericWarlockNonCombatStrategyActionNodeFactory : public NamedObjectFacto static ActionNode* fel_armor([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("fel armor", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("demon armor"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("demon armor") }, + /*C*/ {}); } static ActionNode* demon_armor([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("demon armor", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("demon skin"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("demon skin") }, + /*C*/ {}); } static ActionNode* summon_voidwalker([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("summon voidwalker", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("summon imp"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("summon imp") }, + /*C*/ {}); } static ActionNode* summon_succubus([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("summon succubus", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("summon voidwalker"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("summon voidwalker") }, + /*C*/ {}); } static ActionNode* summon_felhunter([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("summon felhunter", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("summon succubus"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("summon succubus") }, + /*C*/ {}); } static ActionNode* summon_felguard([[maybe_unused]] PlayerbotAI* botAI) { return new ActionNode("summon felguard", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("summon felhunter"), nullptr), - /*C*/ nullptr); + /*P*/ {}, + /*A*/ { NextAction("summon felhunter") }, + /*C*/ {}); } }; @@ -78,16 +78,16 @@ GenericWarlockNonCombatStrategy::GenericWarlockNonCombatStrategy(PlayerbotAI* bo void GenericWarlockNonCombatStrategy::InitTriggers(std::vector& triggers) { NonCombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("fel domination", 30.0f), nullptr))); - triggers.push_back(new TriggerNode("no soul shard", NextAction::array(0, new NextAction("create soul shard", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("too many soul shards", NextAction::array(0, new NextAction("destroy soul shard", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("soul link", NextAction::array(0, new NextAction("soul link", 28.0f), nullptr))); - triggers.push_back(new TriggerNode("demon armor", NextAction::array(0, new NextAction("fel armor", 27.0f), nullptr))); - triggers.push_back(new TriggerNode("no healthstone", NextAction::array(0, new NextAction("create healthstone", 26.0f), nullptr))); - triggers.push_back(new TriggerNode("no soulstone", NextAction::array(0, new NextAction("create soulstone", 25.0f), nullptr))); - triggers.push_back(new TriggerNode("life tap", NextAction::array(0, new NextAction("life tap", 23.0f), nullptr))); + triggers.push_back(new TriggerNode("has pet", { NextAction("toggle pet spell", 60.0f) })); + triggers.push_back(new TriggerNode("new pet", { NextAction("set pet stance", 60.0f) })); + triggers.push_back(new TriggerNode("no pet", { NextAction("fel domination", 30.0f) })); + triggers.push_back(new TriggerNode("no soul shard", { NextAction("create soul shard", 60.0f) })); + triggers.push_back(new TriggerNode("too many soul shards", { NextAction("destroy soul shard", 60.0f) })); + triggers.push_back(new TriggerNode("soul link", { NextAction("soul link", 28.0f) })); + triggers.push_back(new TriggerNode("demon armor", { NextAction("fel armor", 27.0f) })); + triggers.push_back(new TriggerNode("no healthstone", { NextAction("create healthstone", 26.0f) })); + triggers.push_back(new TriggerNode("no soulstone", { NextAction("create soulstone", 25.0f) })); + triggers.push_back(new TriggerNode("life tap", { NextAction("life tap", 23.0f) })); } // Non-combat strategy for summoning a Imp @@ -98,8 +98,8 @@ SummonImpStrategy::SummonImpStrategy(PlayerbotAI* ai) : NonCombatStrategy(ai) {} void SummonImpStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon imp", 29.0f), NULL))); - triggers.push_back(new TriggerNode("wrong pet", NextAction::array(0, new NextAction("summon imp", 29.0f), NULL))); + triggers.push_back(new TriggerNode("no pet", { NextAction("summon imp", 29.0f) })); + triggers.push_back(new TriggerNode("wrong pet", { NextAction("summon imp", 29.0f) })); } // Non-combat strategy for summoning a Voidwalker @@ -110,8 +110,8 @@ SummonVoidwalkerStrategy::SummonVoidwalkerStrategy(PlayerbotAI* ai) : NonCombatS void SummonVoidwalkerStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon voidwalker", 29.0f), NULL))); - triggers.push_back(new TriggerNode("wrong pet", NextAction::array(0, new NextAction("summon voidwalker", 29.0f), NULL))); + triggers.push_back(new TriggerNode("no pet", { NextAction("summon voidwalker", 29.0f) })); + triggers.push_back(new TriggerNode("wrong pet", { NextAction("summon voidwalker", 29.0f) })); } // Non-combat strategy for summoning a Succubus @@ -122,8 +122,8 @@ SummonSuccubusStrategy::SummonSuccubusStrategy(PlayerbotAI* ai) : NonCombatStrat void SummonSuccubusStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon succubus", 29.0f), NULL))); - triggers.push_back(new TriggerNode("wrong pet", NextAction::array(0, new NextAction("summon succubus", 29.0f), NULL))); + triggers.push_back(new TriggerNode("no pet", { NextAction("summon succubus", 29.0f) })); + triggers.push_back(new TriggerNode("wrong pet", { NextAction("summon succubus", 29.0f) })); } // Non-combat strategy for summoning a Felhunter @@ -134,8 +134,8 @@ SummonFelhunterStrategy::SummonFelhunterStrategy(PlayerbotAI* ai) : NonCombatStr void SummonFelhunterStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felhunter", 29.0f), NULL))); - triggers.push_back(new TriggerNode("wrong pet", NextAction::array(0, new NextAction("summon felhunter", 29.0f), NULL))); + triggers.push_back(new TriggerNode("no pet", { NextAction("summon felhunter", 29.0f) })); + triggers.push_back(new TriggerNode("wrong pet", { NextAction("summon felhunter", 29.0f) })); } // Non-combat strategy for summoning a Felguard @@ -146,8 +146,8 @@ SummonFelguardStrategy::SummonFelguardStrategy(PlayerbotAI* ai) : NonCombatStrat void SummonFelguardStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon felguard", 29.0f), NULL))); - triggers.push_back(new TriggerNode("wrong pet", NextAction::array(0, new NextAction("summon felguard", 29.0f), NULL))); + triggers.push_back(new TriggerNode("no pet", { NextAction("summon felguard", 29.0f) })); + triggers.push_back(new TriggerNode("wrong pet", { NextAction("summon felguard", 29.0f) })); } // Non-combat strategy for selecting themselves to receive soulstone @@ -158,7 +158,7 @@ SoulstoneSelfStrategy::SoulstoneSelfStrategy(PlayerbotAI* ai) : NonCombatStrateg void SoulstoneSelfStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("soulstone", NextAction::array(0, new NextAction("soulstone self", 24.0f), NULL))); + triggers.push_back(new TriggerNode("soulstone", { NextAction("soulstone self", 24.0f) })); } // Non-combat strategy for selecting the master to receive soulstone @@ -169,7 +169,7 @@ SoulstoneMasterStrategy::SoulstoneMasterStrategy(PlayerbotAI* ai) : NonCombatStr void SoulstoneMasterStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("soulstone", NextAction::array(0, new NextAction("soulstone master", 24.0f), NULL))); + triggers.push_back(new TriggerNode("soulstone", { NextAction("soulstone master", 24.0f) })); } // Non-combat strategy for selecting tanks to receive soulstone @@ -180,7 +180,7 @@ SoulstoneTankStrategy::SoulstoneTankStrategy(PlayerbotAI* ai) : NonCombatStrateg void SoulstoneTankStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("soulstone", NextAction::array(0, new NextAction("soulstone tank", 24.0f), NULL))); + triggers.push_back(new TriggerNode("soulstone", { NextAction("soulstone tank", 24.0f) })); } // Non-combat strategy for selecting healers to receive soulstone @@ -191,7 +191,7 @@ SoulstoneHealerStrategy::SoulstoneHealerStrategy(PlayerbotAI* ai) : NonCombatStr void SoulstoneHealerStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("soulstone", NextAction::array(0, new NextAction("soulstone healer", 24.0f), NULL))); + triggers.push_back(new TriggerNode("soulstone", { NextAction("soulstone healer", 24.0f) })); } // Non-combat strategy for using Spellstone @@ -202,8 +202,8 @@ UseSpellstoneStrategy::UseSpellstoneStrategy(PlayerbotAI* ai) : NonCombatStrateg void UseSpellstoneStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no spellstone", NextAction::array(0, new NextAction("create spellstone", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("spellstone", NextAction::array(0, new NextAction("spellstone", 24.0f), nullptr))); + triggers.push_back(new TriggerNode("no spellstone", { NextAction("create spellstone", 24.0f) })); + triggers.push_back(new TriggerNode("spellstone", { NextAction("spellstone", 24.0f) })); } // Non-combat strategy for using Firestone @@ -214,6 +214,6 @@ UseFirestoneStrategy::UseFirestoneStrategy(PlayerbotAI* ai) : NonCombatStrategy( void UseFirestoneStrategy::InitTriggers(std::vector& triggers) { - triggers.push_back(new TriggerNode("no firestone", NextAction::array(0, new NextAction("create firestone", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("firestone", NextAction::array(0, new NextAction("firestone", 24.0f), nullptr))); + triggers.push_back(new TriggerNode("no firestone", { NextAction("create firestone", 24.0f) })); + triggers.push_back(new TriggerNode("firestone", { NextAction("firestone", 24.0f) })); } diff --git a/src/strategy/warlock/GenericWarlockNonCombatStrategy.h b/src/Ai/Class/Warlock/Strategy/GenericWarlockNonCombatStrategy.h similarity index 100% rename from src/strategy/warlock/GenericWarlockNonCombatStrategy.h rename to src/Ai/Class/Warlock/Strategy/GenericWarlockNonCombatStrategy.h diff --git a/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp new file mode 100644 index 0000000000..1759776580 --- /dev/null +++ b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.cpp @@ -0,0 +1,261 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericWarlockStrategy.h" +#include "Strategy.h" +#include "Playerbots.h" + +class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + GenericWarlockStrategyActionNodeFactory() + { + creators["banish on cc"] = &banish_on_cc; + creators["fear on cc"] = &fear_on_cc; + creators["spell lock"] = &spell_lock; + creators["devour magic purge"] = &devour_magic_purge; + creators["devour magic cleanse"] = &devour_magic_cleanse; + } + +private: + static ActionNode* banish_on_cc(PlayerbotAI*) { return new ActionNode("banish on cc", {}, {}, {}); } + static ActionNode* fear_on_cc(PlayerbotAI*) { return new ActionNode("fear on cc", {}, {}, {}); } + static ActionNode* spell_lock(PlayerbotAI*) { return new ActionNode("spell lock", {}, {}, {}); } + static ActionNode* devour_magic_purge(PlayerbotAI*) { return new ActionNode("devour magic purge", {}, {}, {}); } + static ActionNode* devour_magic_cleanse(PlayerbotAI*) { return new ActionNode("devour magic cleanse", {}, {}, {}); } +}; + +GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory()); +} + +std::vector GenericWarlockStrategy::getDefaultActions() +{ + return {}; +} + +void GenericWarlockStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "low mana", + { + NextAction("life tap", 95.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium threat", + { + NextAction("soulshatter", 55.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "spell lock", + { + NextAction("spell lock", 40.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "no soul shard", + { + NextAction("create soul shard", 60.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "too many soul shards", + { + NextAction("destroy soul shard", 60.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "devour magic purge", + { + NextAction("devour magic purge", 50.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "devour magic cleanse", + { + NextAction("devour magic cleanse", 50.0f) + } + ) + ); +} + +// ===== AoE Strategy, 3+ enemies ===== + +void AoEWarlockStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "medium aoe", + { + NextAction("immolation aura", 26.0f), + NextAction("shadowfury", 23.0f), + NextAction("shadowflame", 22.5f), + NextAction("seed of corruption on attacker", 22.0f), + NextAction("seed of corruption", 21.5f), + NextAction("rain of fire", 21.0f) + } + ) + ); + + triggers.push_back( + new TriggerNode("rain of fire channel check", + { + NextAction("cancel channel", 21.5f) + } + ) + ); +} + +void WarlockBoostStrategy::InitTriggers(std::vector& triggers) +{ + // Placeholder for future boost triggers +} + +void WarlockPetStrategy::InitTriggers(std::vector& triggers) +{ + // Placeholder for future pet triggers +} + +void WarlockCcStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "banish", + { + NextAction("banish on cc", 33.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "fear", + { + NextAction("fear on cc", 32.0f) + } + ) + ); +} + +// Combat strategy for using Curse of Agony +// Enabled by default for the Affliction spec +// To enable, type "co +curse of agony" +// To disable, type "co -curse of agony" +void WarlockCurseOfAgonyStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of agony on attacker", + { + NextAction("curse of agony on attacker", 18.5f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "curse of agony", + { + NextAction("curse of agony", 17.0f) + } + ) + ); +} + +// Combat strategy for using Curse of the Elements +// Enabled by default for the Destruction spec +// To enable, type "co +curse of elements" +// To disable, type "co -curse of elements" +void WarlockCurseOfTheElementsStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of the elements", + { + NextAction("curse of the elements", 29.0f) + } + ) + ); +} + +// Combat strategy for using Curse of Doom +// Disabled by default +// To enable, type "co +curse of doom" +// To disable, type "co -curse of doom" +void WarlockCurseOfDoomStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of doom", + { + NextAction("curse of doom", 29.0f) + } + ) + ); +} + +// Combat strategy for using Curse of Exhaustion +// Disabled by default +// To enable, type "co +curse of exhaustion" +// To disable, type "co -curse of exhaustion" +void WarlockCurseOfExhaustionStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of exhaustion", + { + NextAction("curse of exhaustion", 29.0f) + } + ) + ); +} + +// Combat strategy for using Curse of Tongues +// Disabled by default +// To enable, type "co +curse of tongues" +// To disable, type "co -curse of tongues" +void WarlockCurseOfTonguesStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of tongues", + { + NextAction("curse of tongues", 29.0f) + } + ) + ); +} + +// Combat strategy for using Curse of Weakness +// Disabled by default +// To enable, type "co +curse of weakness" +// To disable, type "co -curse of weakness" +void WarlockCurseOfWeaknessStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "curse of weakness", + { + NextAction("curse of weakness", 29.0f) + } + ) + ); +} diff --git a/src/strategy/warlock/GenericWarlockStrategy.h b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.h similarity index 98% rename from src/strategy/warlock/GenericWarlockStrategy.h rename to src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.h index 2fda9c03a3..a44a03de48 100644 --- a/src/strategy/warlock/GenericWarlockStrategy.h +++ b/src/Ai/Class/Warlock/Strategy/GenericWarlockStrategy.h @@ -17,7 +17,7 @@ class GenericWarlockStrategy : public CombatStrategy std::string const getName() override { return "warlock"; } void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return CombatStrategy::GetType() | STRATEGY_TYPE_RANGED | STRATEGY_TYPE_DPS; } }; diff --git a/src/strategy/warlock/TankWarlockStrategy.cpp b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp similarity index 82% rename from src/strategy/warlock/TankWarlockStrategy.cpp rename to src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp index 2328169aa4..c54fd59684 100644 --- a/src/strategy/warlock/TankWarlockStrategy.cpp +++ b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.cpp @@ -23,8 +23,8 @@ class TankWarlockStrategyActionNodeFactory : public NamedObjectFactory TankWarlockStrategy::getDefaultActions() { // Shadow Ward is the highest priority, Searing Pain next. - return NextAction::array(0, new NextAction("shadow ward", 27.5f), new NextAction("searing pain", 27.0f), nullptr); + return { + NextAction("shadow ward", 27.5f), + NextAction("searing pain", 27.0f) + }; } void TankWarlockStrategy::InitTriggers(std::vector& triggers) diff --git a/src/strategy/warlock/TankWarlockStrategy.h b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.h similarity index 91% rename from src/strategy/warlock/TankWarlockStrategy.h rename to src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.h index 240f9515db..f20ffe894a 100644 --- a/src/strategy/warlock/TankWarlockStrategy.h +++ b/src/Ai/Class/Warlock/Strategy/TankWarlockStrategy.h @@ -17,7 +17,7 @@ class TankWarlockStrategy : public GenericWarlockStrategy std::string const getName() override { return "tank"; } void InitTriggers(std::vector& triggers) override; - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; }; #endif diff --git a/src/strategy/warlock/WarlockTriggers.cpp b/src/Ai/Class/Warlock/Trigger/WarlockTriggers.cpp similarity index 100% rename from src/strategy/warlock/WarlockTriggers.cpp rename to src/Ai/Class/Warlock/Trigger/WarlockTriggers.cpp diff --git a/src/strategy/warlock/WarlockTriggers.h b/src/Ai/Class/Warlock/Trigger/WarlockTriggers.h similarity index 100% rename from src/strategy/warlock/WarlockTriggers.h rename to src/Ai/Class/Warlock/Trigger/WarlockTriggers.h diff --git a/src/strategy/warlock/WarlockAiObjectContext.cpp b/src/Ai/Class/Warlock/WarlockAiObjectContext.cpp similarity index 100% rename from src/strategy/warlock/WarlockAiObjectContext.cpp rename to src/Ai/Class/Warlock/WarlockAiObjectContext.cpp diff --git a/src/strategy/warlock/WarlockAiObjectContext.h b/src/Ai/Class/Warlock/WarlockAiObjectContext.h similarity index 100% rename from src/strategy/warlock/WarlockAiObjectContext.h rename to src/Ai/Class/Warlock/WarlockAiObjectContext.h diff --git a/src/strategy/warrior/WarriorActions.cpp b/src/Ai/Class/Warrior/Action/WarriorActions.cpp similarity index 100% rename from src/strategy/warrior/WarriorActions.cpp rename to src/Ai/Class/Warrior/Action/WarriorActions.cpp diff --git a/src/strategy/warrior/WarriorActions.h b/src/Ai/Class/Warrior/Action/WarriorActions.h similarity index 100% rename from src/strategy/warrior/WarriorActions.h rename to src/Ai/Class/Warrior/Action/WarriorActions.h diff --git a/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp new file mode 100644 index 0000000000..eba5677e7f --- /dev/null +++ b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "ArmsWarriorStrategy.h" + +#include "Playerbots.h" + +class ArmsWarriorStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + ArmsWarriorStrategyActionNodeFactory() + { + creators["charge"] = &charge; + creators["death wish"] = &death_wish; + creators["piercing howl"] = &piercing_howl; + creators["mocking blow"] = &mocking_blow; + creators["heroic strike"] = &heroic_strike; + creators["enraged regeneration"] = &enraged_regeneration; + creators["retaliation"] = &retaliation; + creators["shattering throw"] = &shattering_throw; + } + +private: + static ActionNode* charge(PlayerbotAI* botAI) + { + return new ActionNode( + "charge", + /*P*/ {}, + /*A*/ { NextAction("reach melee") }, + /*C*/ {} + ); + } + + static ActionNode* death_wish(PlayerbotAI* botAI) + { + return new ActionNode( + "death wish", + /*P*/ {}, + /*A*/ { NextAction("bloodrage") }, + /*C*/ {} + ); + } + + static ActionNode* piercing_howl(PlayerbotAI* botAI) + { + return new ActionNode( + "piercing howl", + /*P*/ {}, + /*A*/ { NextAction("mocking blow") }, + /*C*/ {} + ); + } + + static ActionNode* mocking_blow(PlayerbotAI* botAI) + { + return new ActionNode( + "mocking blow", + /*P*/ {}, + /*A*/ { NextAction("hamstring") }, + /*C*/ {} + ); + } + + static ActionNode* heroic_strike(PlayerbotAI* botAI) + { + return new ActionNode( + "heroic strike", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* enraged_regeneration(PlayerbotAI* botAI) + { + return new ActionNode( + "enraged regeneration", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* retaliation(PlayerbotAI* botAI) + { + return new ActionNode( + "retaliation", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* shattering_throw(PlayerbotAI* botAI) + { + return new ActionNode( + "shattering throw", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +ArmsWarriorStrategy::ArmsWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) +{ + actionNodeFactories.Add(new ArmsWarriorStrategyActionNodeFactory()); +} + +std::vector ArmsWarriorStrategy::getDefaultActions() +{ + return { + NextAction("bladestorm", ACTION_DEFAULT + 0.2f), + NextAction("mortal strike", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} +void ArmsWarriorStrategy::InitTriggers(std::vector& triggers) +{ + GenericWarriorStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("charge", ACTION_MOVE + 10) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "battle stance", + { + NextAction("battle stance", ACTION_HIGH + 10) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "battle shout", + { + NextAction("battle shout", ACTION_HIGH + 9) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "rend", + { + NextAction("rend", ACTION_HIGH + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "rend on attacker", + { + NextAction("rend on attacker", ACTION_HIGH + 8) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "mortal strike", + { + NextAction("mortal strike", ACTION_HIGH + 3) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "target critical health", + { + NextAction("execute", ACTION_HIGH + 5) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "sudden death", + { + NextAction("execute", ACTION_HIGH + 5) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "hamstring", + { + NextAction("piercing howl", ACTION_HIGH) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "overpower", + { + NextAction("overpower", ACTION_HIGH + 4) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "taste for blood", + { + NextAction("overpower", ACTION_HIGH + 4) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "victory rush", + { + NextAction("victory rush", ACTION_INTERRUPT) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "high rage available", + { + NextAction("heroic strike", ACTION_HIGH), + NextAction("slam", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bloodrage", + { + NextAction("bloodrage", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "death wish", + { + NextAction("death wish", ACTION_HIGH + 2) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("intimidating shout", ACTION_EMERGENCY) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "medium health", + { + NextAction("enraged regeneration", ACTION_EMERGENCY) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "almost full health", + { + NextAction("retaliation", ACTION_EMERGENCY + 1) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "shattering throw trigger", + { + NextAction("shattering throw", ACTION_INTERRUPT + 1) + } + ) + ); +} diff --git a/src/strategy/warrior/ArmsWarriorStrategy.h b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.h similarity index 92% rename from src/strategy/warrior/ArmsWarriorStrategy.h rename to src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.h index 682657befd..126d162100 100644 --- a/src/strategy/warrior/ArmsWarriorStrategy.h +++ b/src/Ai/Class/Warrior/Strategy/ArmsWarriorStrategy.h @@ -18,7 +18,7 @@ class ArmsWarriorStrategy : public GenericWarriorStrategy public: void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "arms"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp new file mode 100644 index 0000000000..6400ee4a8e --- /dev/null +++ b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.cpp @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "FuryWarriorStrategy.h" + +#include "Playerbots.h" + +class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + FuryWarriorStrategyActionNodeFactory() + { + creators["charge"] = &charge; + creators["intercept"] = &intercept; + creators["piercing howl"] = &piercing_howl; + creators["pummel"] = &pummel; + creators["enraged regeneration"] = &enraged_regeneration; + } + +private: + static ActionNode* charge(PlayerbotAI* botAI) + { + return new ActionNode( + "charge", + /*P*/ {}, + /*A*/ { NextAction("intercept" )}, + /*C*/ {} + ); + } + + static ActionNode* intercept(PlayerbotAI* botAI) + { + return new ActionNode( + "intercept", + /*P*/ {}, + /*A*/ { NextAction("reach melee" )}, + /*C*/ {} + ); + } + + static ActionNode* piercing_howl(PlayerbotAI* botAI) + { + return new ActionNode( + "piercing howl", + /*P*/ {}, + /*A*/ { NextAction("hamstring" )}, + /*C*/ {} + ); + } + + static ActionNode* pummel(PlayerbotAI* botAI) + { + return new ActionNode( + "pummel", + /*P*/ {}, + /*A*/ { NextAction("intercept" )}, + /*C*/ {} + ); + } + + static ActionNode* enraged_regeneration(PlayerbotAI* botAI) + { + return new ActionNode( + "enraged regeneration", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +FuryWarriorStrategy::FuryWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) +{ + actionNodeFactories.Add(new FuryWarriorStrategyActionNodeFactory()); +} + +std::vector FuryWarriorStrategy::getDefaultActions() +{ + return { + NextAction("bloodthirst", ACTION_DEFAULT + 0.5f), + NextAction("whirlwind", ACTION_DEFAULT + 0.4f), + NextAction("sunder armor", ACTION_DEFAULT + 0.3f), + NextAction("execute", ACTION_DEFAULT + 0.2f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void FuryWarriorStrategy::InitTriggers(std::vector& triggers) +{ + GenericWarriorStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("charge", ACTION_MOVE + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "berserker stance", { + NextAction("berserker stance", ACTION_HIGH + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "battle shout", + { + NextAction("battle shout", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "pummel on enemy healer", + { + NextAction("pummel on enemy healer", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "pummel", + { + NextAction("pummel", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "victory rush", + { + NextAction("victory rush", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bloodthirst", + { + NextAction("bloodthirst", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "whirlwind", + { + NextAction("whirlwind", ACTION_HIGH + 6) + } + ) + ); + triggers.push_back( + new TriggerNode( + "instant slam", + { + NextAction("slam", ACTION_HIGH + 5) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bloodrage", + { + NextAction("bloodrage", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium rage available", + { + NextAction("heroic strike", ACTION_DEFAULT + 0.1f) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "death wish", + { + NextAction("death wish", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "recklessness", + { + NextAction("recklessness", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("enraged regeneration", ACTION_EMERGENCY) + } + ) + ); +} diff --git a/src/strategy/warrior/FuryWarriorStrategy.h b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.h similarity index 92% rename from src/strategy/warrior/FuryWarriorStrategy.h rename to src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.h index 2791379ea8..79413960bb 100644 --- a/src/strategy/warrior/FuryWarriorStrategy.h +++ b/src/Ai/Class/Warrior/Strategy/FuryWarriorStrategy.h @@ -17,7 +17,7 @@ class FuryWarriorStrategy : public GenericWarriorStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "fury"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_COMBAT | STRATEGY_TYPE_DPS | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/warrior/GenericWarriorNonCombatStrategy.cpp b/src/Ai/Class/Warrior/Strategy/GenericWarriorNonCombatStrategy.cpp similarity index 62% rename from src/strategy/warrior/GenericWarriorNonCombatStrategy.cpp rename to src/Ai/Class/Warrior/Strategy/GenericWarriorNonCombatStrategy.cpp index a5525462d1..091aed2b84 100644 --- a/src/strategy/warrior/GenericWarriorNonCombatStrategy.cpp +++ b/src/Ai/Class/Warrior/Strategy/GenericWarriorNonCombatStrategy.cpp @@ -11,7 +11,5 @@ void GenericWarriorNonCombatStrategy::InitTriggers(std::vector& tr { NonCombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply stone", 1.0f), nullptr))); - // triggers.push_back(new TriggerNode("battle stance", NextAction::array(0, new NextAction("battle stance", 1.0f), - // nullptr))); + triggers.push_back(new TriggerNode("often", { NextAction("apply stone", 1.0f) })); } diff --git a/src/strategy/warrior/GenericWarriorNonCombatStrategy.h b/src/Ai/Class/Warrior/Strategy/GenericWarriorNonCombatStrategy.h similarity index 100% rename from src/strategy/warrior/GenericWarriorNonCombatStrategy.h rename to src/Ai/Class/Warrior/Strategy/GenericWarriorNonCombatStrategy.h diff --git a/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp new file mode 100644 index 0000000000..178984de9c --- /dev/null +++ b/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "GenericWarriorStrategy.h" + +#include "Playerbots.h" + +GenericWarriorStrategy::GenericWarriorStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + +} + +void GenericWarriorStrategy::InitTriggers(std::vector& triggers) +{ + CombatStrategy::InitTriggers(triggers); + triggers.push_back(new TriggerNode( + "enemy out of melee", { NextAction("reach melee", ACTION_HIGH + 1) })); +} + +class WarrirorAoeStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + WarrirorAoeStrategyActionNodeFactory() + { + + } + +private: + +}; + +WarrirorAoeStrategy::WarrirorAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) +{ + actionNodeFactories.Add(new WarrirorAoeStrategyActionNodeFactory()); +} + +void WarrirorAoeStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode( + "light aoe", { NextAction("sweeping strikes", ACTION_HIGH + 7), + NextAction("bladestorm", ACTION_HIGH + 6), + NextAction("thunder clap", ACTION_HIGH + 5), + NextAction("shockwave", ACTION_HIGH + 4), + NextAction("demoralizing shout without life time check", ACTION_HIGH + 1), + NextAction("cleave", ACTION_HIGH) })); + triggers.push_back( + new TriggerNode("shockwave on snare target", + { NextAction("shockwave on snare target", ACTION_HIGH + 5) })); + +} diff --git a/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h b/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h new file mode 100644 index 0000000000..5a336be203 --- /dev/null +++ b/src/Ai/Class/Warrior/Strategy/GenericWarriorStrategy.h @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_GENERICWARRIORSTRATEGY_H +#define _PLAYERBOT_GENERICWARRIORSTRATEGY_H + +#include "CombatStrategy.h" + +class PlayerbotAI; + +// Stance requirements +class WarriorStanceRequirementActionNodeFactory : public NamedObjectFactory +{ +public: + WarriorStanceRequirementActionNodeFactory() + { + // battle only + creators["charge"] = &charge; + creators["mocking blow"] = &mocking_blow; + creators["overpower"] = &overpower; + creators["retaliation"] = &retaliation; + creators["shattering throw"] = &shattering_throw; + + // temp + creators["mortal strike"] = &mortal_strike; + + // berserker only + creators["berserker rage"] = &berserker_rage; + creators["recklessness"] = &recklessness; + creators["whirlwind"] = &whirlwind; + creators["pummel"] = &pummel; + creators["intercept"] = &intercept; + + // defensive only + creators["taunt"] = &taunt; + creators["revenge"] = &revenge; + creators["shield block"] = &shield_block; + creators["disarm"] = &disarm; + creators["shield wall"] = &shield_wall; + creators["intervene"] = &intervene; + } + +private: + + static ActionNode* charge([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "charge", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* mocking_blow([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mocking blow", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* overpower([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "overpower", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* berserker_rage([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "berserker rage", + /*P*/ { NextAction("berserker stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* recklessness([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "recklessness", + /*P*/ { NextAction("berserker stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* whirlwind([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "whirlwind", + /*P*/ { NextAction("berserker stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* pummel([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "pummel", + /*P*/ { NextAction("berserker stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* intercept([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "intercept", + /*P*/ { NextAction("berserker stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* taunt([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "taunt", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* revenge([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "revenge", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* shield_block([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "shield block", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* disarm([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "disarm", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* shield_wall([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "shield wall", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* intervene([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "intervene", + /*P*/ { NextAction("defensive stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* mortal_strike([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mortal strike", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* retaliation([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "retaliation", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* shattering_throw([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "shattering throw", + /*P*/ { NextAction("battle stance") }, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +class GenericWarriorStrategy : public CombatStrategy +{ +public: + GenericWarriorStrategy(PlayerbotAI* botAI); + + void InitTriggers(std::vector& triggers) override; + std::string const getName() override { return "warrior"; } +}; + +class WarrirorAoeStrategy : public CombatStrategy +{ +public: + WarrirorAoeStrategy(PlayerbotAI* botAI); + + void InitTriggers(std::vector& triggers) override; + std::string const getName() override { return "aoe"; } +}; + +#endif diff --git a/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp new file mode 100644 index 0000000000..05f732c30c --- /dev/null +++ b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.cpp @@ -0,0 +1,369 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "TankWarriorStrategy.h" + +#include "Playerbots.h" + +class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory +{ +public: + TankWarriorStrategyActionNodeFactory() + { + creators["charge"] = &charge; + creators["sunder armor"] = &sunder_armor; + creators["commanding shout"] = &commanding_shout; + creators["devastate"] = &devastate; + creators["last stand"] = &last_stand; + creators["heroic throw on snare target"] = &heroic_throw_on_snare_target; + creators["heroic throw taunt"] = &heroic_throw_taunt; + creators["taunt"] = &taunt; + creators["taunt spell"] = &taunt; + creators["vigilance"] = &vigilance; + creators["enraged regeneration"] = &enraged_regeneration; + } + +private: + static ActionNode* heroic_throw_taunt(PlayerbotAI* botAI) + { + return new ActionNode( + "heroic throw", + /*P*/ {}, + /*A*/ { NextAction("shield slam") }, + /*C*/ {} + ); + } + + static ActionNode* heroic_throw_on_snare_target(PlayerbotAI* botAI) + { + return new ActionNode( + "heroic throw on snare target", + /*P*/ {}, + /*A*/ { NextAction("taunt on snare target") }, + /*C*/ {} + ); + } + + static ActionNode* last_stand(PlayerbotAI* botAI) + { + return new ActionNode( + "last stand", + /*P*/ {}, + /*A*/ { NextAction("intimidating shout") }, + /*C*/ {} + ); + } + + static ActionNode* devastate(PlayerbotAI* botAI) + { + return new ActionNode( + "devastate", + /*P*/ {}, + /*A*/ { NextAction("sunder armor") }, + /*C*/ {} + ); + } + + static ActionNode* commanding_shout(PlayerbotAI* botAI) + { + return new ActionNode( + "commanding shout", + /*P*/ {}, + /*A*/ { NextAction("battle shout") }, + /*C*/ {} + ); + } + + static ActionNode* sunder_armor(PlayerbotAI* botAI) + { + return new ActionNode( + "sunder armor", + /*P*/ {}, + /*A*/ { NextAction("melee") }, + /*C*/ {} + ); + } + + static ActionNode* charge(PlayerbotAI* botAI) + { + return new ActionNode( + "charge", + /*P*/ {}, + /*A*/ { NextAction("reach melee") }, + /*C*/ {} + ); + } + + static ActionNode* taunt(PlayerbotAI* botAI) + { + return new ActionNode( + "taunt", + /*P*/ {}, + /*A*/ { NextAction("heroic throw taunt") }, + /*C*/ {} + ); + } + + static ActionNode* vigilance(PlayerbotAI* botAI) + { + return new ActionNode( + "vigilance", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* enraged_regeneration(PlayerbotAI* botAI) + { + return new ActionNode( + "enraged regeneration", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +TankWarriorStrategy::TankWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) +{ + actionNodeFactories.Add(new TankWarriorStrategyActionNodeFactory()); +} + +std::vector TankWarriorStrategy::getDefaultActions() +{ + return { + NextAction("devastate", ACTION_DEFAULT + 0.3f), + NextAction("revenge", ACTION_DEFAULT + 0.2f), + NextAction("demoralizing shout", ACTION_DEFAULT + 0.1f), + NextAction("melee", ACTION_DEFAULT) + }; +} + +void TankWarriorStrategy::InitTriggers(std::vector& triggers) +{ + GenericWarriorStrategy::InitTriggers(triggers); + + triggers.push_back( + new TriggerNode( + "vigilance", + { + NextAction("vigilance", ACTION_HIGH + 7) + } + ) + ); + triggers.push_back( + new TriggerNode( + "enemy out of melee", + { + NextAction("heroic throw", ACTION_MOVE + 11), + NextAction("charge", ACTION_MOVE + 10) + } + ) + ); + + triggers.push_back( + new TriggerNode( + "thunder clap and rage", + { + NextAction("thunder clap", ACTION_MOVE + 11) + } + ) + ); + triggers.push_back( + new TriggerNode( + "defensive stance", + { + NextAction("defensive stance", ACTION_HIGH + 9) + } + ) + ); + triggers.push_back( + new TriggerNode( + "commanding shout", + { + NextAction("commanding shout", ACTION_HIGH + 8) + } + ) + ); + triggers.push_back( + new TriggerNode( + "bloodrage", + { + NextAction("bloodrage", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "sunder armor", + { + NextAction("devastate", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium rage available", + { + NextAction("shield slam", ACTION_HIGH + 2), + NextAction("devastate", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "shield block", + { + NextAction("shield block", ACTION_INTERRUPT + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "revenge", + { + NextAction("revenge", ACTION_HIGH + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "disarm", + { + NextAction("disarm", ACTION_HIGH + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "lose aggro", + { + NextAction("taunt", ACTION_INTERRUPT + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "taunt on snare target", + { + NextAction("heroic throw on snare target", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "low health", + { + NextAction("shield wall", ACTION_MEDIUM_HEAL) + } + ) + ); + triggers.push_back( + new TriggerNode( + "critical health", + { + NextAction("last stand", ACTION_EMERGENCY + 3), + NextAction("enraged regeneration", ACTION_EMERGENCY + 2) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high aoe", + { + NextAction("challenging shout", ACTION_HIGH + 3) + } + ) + ); + triggers.push_back( + new TriggerNode( + "concussion blow", + { + NextAction("concussion blow", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "shield bash", + { + NextAction("shield bash", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "shield bash on enemy healer", + { + NextAction("shield bash on enemy healer", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "spell reflection", + { + NextAction("spell reflection", ACTION_INTERRUPT + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "victory rush", + { + NextAction("victory rush", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "sword and board", + { + NextAction("shield slam", ACTION_INTERRUPT) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rend", + { + NextAction("rend", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "rend on attacker", + { + NextAction("rend on attacker", ACTION_NORMAL + 1) + } + ) + ); + triggers.push_back( + new TriggerNode( + "protect party member", + { + NextAction("intervene", ACTION_EMERGENCY) + } + ) + ); + triggers.push_back( + new TriggerNode( + "high rage available", + { + NextAction("heroic strike", ACTION_HIGH) + } + ) + ); + triggers.push_back( + new TriggerNode( + "medium rage available", + { + NextAction("thunder clap", ACTION_HIGH + 1) + } + ) + ); +} diff --git a/src/strategy/warrior/TankWarriorStrategy.h b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.h similarity index 92% rename from src/strategy/warrior/TankWarriorStrategy.h rename to src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.h index 54e111087c..b528242979 100644 --- a/src/strategy/warrior/TankWarriorStrategy.h +++ b/src/Ai/Class/Warrior/Strategy/TankWarriorStrategy.h @@ -18,7 +18,7 @@ class TankWarriorStrategy : public GenericWarriorStrategy void InitTriggers(std::vector& triggers) override; std::string const getName() override { return "tank"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; uint32 GetType() const override { return STRATEGY_TYPE_TANK | STRATEGY_TYPE_MELEE; } }; diff --git a/src/strategy/warrior/WarriorTriggers.cpp b/src/Ai/Class/Warrior/Trigger/WarriorTriggers.cpp similarity index 100% rename from src/strategy/warrior/WarriorTriggers.cpp rename to src/Ai/Class/Warrior/Trigger/WarriorTriggers.cpp diff --git a/src/strategy/warrior/WarriorTriggers.h b/src/Ai/Class/Warrior/Trigger/WarriorTriggers.h similarity index 100% rename from src/strategy/warrior/WarriorTriggers.h rename to src/Ai/Class/Warrior/Trigger/WarriorTriggers.h diff --git a/src/strategy/warrior/WarriorAiObjectContext.cpp b/src/Ai/Class/Warrior/WarriorAiObjectContext.cpp similarity index 100% rename from src/strategy/warrior/WarriorAiObjectContext.cpp rename to src/Ai/Class/Warrior/WarriorAiObjectContext.cpp diff --git a/src/strategy/warrior/WarriorAiObjectContext.h b/src/Ai/Class/Warrior/WarriorAiObjectContext.h similarity index 100% rename from src/strategy/warrior/WarriorAiObjectContext.h rename to src/Ai/Class/Warrior/WarriorAiObjectContext.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActions.cpp b/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActions.cpp rename to src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.cpp diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActions.h b/src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActions.h rename to src/Ai/Dungeon/AzjolNerub/Action/AzjolNerubActions.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActionContext.h b/src/Ai/Dungeon/AzjolNerub/AzjolNerubActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubActionContext.h rename to src/Ai/Dungeon/AzjolNerub/AzjolNerubActionContext.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggerContext.h b/src/Ai/Dungeon/AzjolNerub/AzjolNerubTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggerContext.h rename to src/Ai/Dungeon/AzjolNerub/AzjolNerubTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubMultipliers.cpp b/src/Ai/Dungeon/AzjolNerub/Multiplier/AzjolNerubMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubMultipliers.cpp rename to src/Ai/Dungeon/AzjolNerub/Multiplier/AzjolNerubMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubMultipliers.h b/src/Ai/Dungeon/AzjolNerub/Multiplier/AzjolNerubMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubMultipliers.h rename to src/Ai/Dungeon/AzjolNerub/Multiplier/AzjolNerubMultipliers.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubStrategy.cpp b/src/Ai/Dungeon/AzjolNerub/Strategy/AzjolNerubStrategy.cpp similarity index 75% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubStrategy.cpp rename to src/Ai/Dungeon/AzjolNerub/Strategy/AzjolNerubStrategy.cpp index 1a30e98ce8..dbbb8f5bf5 100644 --- a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubStrategy.cpp +++ b/src/Ai/Dungeon/AzjolNerub/Strategy/AzjolNerubStrategy.cpp @@ -7,9 +7,9 @@ void WotlkDungeonANStrategy::InitTriggers(std::vector &triggers) // TODO: Add CC trigger while web wraps are casting? // TODO: Bring healer closer than ranged dps to avoid fixates? triggers.push_back(new TriggerNode("krik'thir web wrap", - NextAction::array(0, new NextAction("attack web wrap", ACTION_RAID + 5), nullptr))); + { NextAction("attack web wrap", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("krik'thir watchers", - NextAction::array(0, new NextAction("krik'thir priority", ACTION_RAID + 4), nullptr))); + { NextAction("krik'thir priority", ACTION_RAID + 4) })); // Hadronox // The core AC triggers are very buggy with this boss, but default strat seems to play correctly @@ -19,9 +19,9 @@ void WotlkDungeonANStrategy::InitTriggers(std::vector &triggers) // and cast time is instant so no way to check currently casting location. // May need to hook boss AI.. might be able to just heal through it for now. // triggers.push_back(new TriggerNode("anub'arak impale", - // NextAction::array(0, new NextAction("TODO", ACTION_MOVE + 5), nullptr))); + // { NextAction("TODO", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("anub'arak pound", - NextAction::array(0, new NextAction("dodge pound", ACTION_MOVE + 5), nullptr))); + { NextAction("dodge pound", ACTION_MOVE + 5) })); } void WotlkDungeonANStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubStrategy.h b/src/Ai/Dungeon/AzjolNerub/Strategy/AzjolNerubStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubStrategy.h rename to src/Ai/Dungeon/AzjolNerub/Strategy/AzjolNerubStrategy.h diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggers.cpp b/src/Ai/Dungeon/AzjolNerub/Trigger/AzjolNerubTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggers.cpp rename to src/Ai/Dungeon/AzjolNerub/Trigger/AzjolNerubTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggers.h b/src/Ai/Dungeon/AzjolNerub/Trigger/AzjolNerubTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/azjolnerub/AzjolNerubTriggers.h rename to src/Ai/Dungeon/AzjolNerub/Trigger/AzjolNerubTriggers.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.cpp b/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.cpp rename to src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.cpp diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.h b/src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActions.h rename to src/Ai/Dungeon/CullingOfStratholme/Action/CullingOfStratholmeActions.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActionContext.h b/src/Ai/Dungeon/CullingOfStratholme/CullingOfStratholmeActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeActionContext.h rename to src/Ai/Dungeon/CullingOfStratholme/CullingOfStratholmeActionContext.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggerContext.h b/src/Ai/Dungeon/CullingOfStratholme/CullingOfStratholmeTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggerContext.h rename to src/Ai/Dungeon/CullingOfStratholme/CullingOfStratholmeTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.cpp b/src/Ai/Dungeon/CullingOfStratholme/Multiplier/CullingOfStratholmeMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.cpp rename to src/Ai/Dungeon/CullingOfStratholme/Multiplier/CullingOfStratholmeMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.h b/src/Ai/Dungeon/CullingOfStratholme/Multiplier/CullingOfStratholmeMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeMultipliers.h rename to src/Ai/Dungeon/CullingOfStratholme/Multiplier/CullingOfStratholmeMultipliers.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.cpp b/src/Ai/Dungeon/CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.cpp similarity index 79% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.cpp rename to src/Ai/Dungeon/CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.cpp index e9011ee7ff..90765bded4 100644 --- a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.cpp +++ b/src/Ai/Dungeon/CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.cpp @@ -8,12 +8,12 @@ void WotlkDungeonCoSStrategy::InitTriggers(std::vector &triggers) // Salramm the Fleshcrafter triggers.push_back(new TriggerNode("explode ghoul", - NextAction::array(0, new NextAction("explode ghoul spread", ACTION_MOVE + 5), nullptr))); + { NextAction("explode ghoul spread", ACTION_MOVE + 5) })); // Chrono-Lord Epoch // Not sure if this actually works, I think I've seen him charge melee characters..? triggers.push_back(new TriggerNode("epoch ranged", - NextAction::array(0, new NextAction("epoch stack", ACTION_MOVE + 5), nullptr))); + { NextAction("epoch stack", ACTION_MOVE + 5) })); // Mal'Ganis diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.h b/src/Ai/Dungeon/CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeStrategy.h rename to src/Ai/Dungeon/CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.h diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.cpp b/src/Ai/Dungeon/CullingOfStratholme/Trigger/CullingOfStratholmeTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.cpp rename to src/Ai/Dungeon/CullingOfStratholme/Trigger/CullingOfStratholmeTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.h b/src/Ai/Dungeon/CullingOfStratholme/Trigger/CullingOfStratholmeTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/cullingofstratholme/CullingOfStratholmeTriggers.h rename to src/Ai/Dungeon/CullingOfStratholme/Trigger/CullingOfStratholmeTriggers.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActions.cpp b/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActions.cpp rename to src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.cpp diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActions.h b/src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActions.h rename to src/Ai/Dungeon/DraktharonKeep/Action/DrakTharonKeepActions.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActionContext.h b/src/Ai/Dungeon/DraktharonKeep/DrakTharonKeepActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepActionContext.h rename to src/Ai/Dungeon/DraktharonKeep/DrakTharonKeepActionContext.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggerContext.h b/src/Ai/Dungeon/DraktharonKeep/DrakTharonKeepTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggerContext.h rename to src/Ai/Dungeon/DraktharonKeep/DrakTharonKeepTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepMultipliers.cpp b/src/Ai/Dungeon/DraktharonKeep/Multiplier/DrakTharonKeepMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepMultipliers.cpp rename to src/Ai/Dungeon/DraktharonKeep/Multiplier/DrakTharonKeepMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepMultipliers.h b/src/Ai/Dungeon/DraktharonKeep/Multiplier/DrakTharonKeepMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepMultipliers.h rename to src/Ai/Dungeon/DraktharonKeep/Multiplier/DrakTharonKeepMultipliers.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepStrategy.cpp b/src/Ai/Dungeon/DraktharonKeep/Strategy/DrakTharonKeepStrategy.cpp similarity index 59% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepStrategy.cpp rename to src/Ai/Dungeon/DraktharonKeep/Strategy/DrakTharonKeepStrategy.cpp index a32d523135..791a0ea71e 100644 --- a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepStrategy.cpp +++ b/src/Ai/Dungeon/DraktharonKeep/Strategy/DrakTharonKeepStrategy.cpp @@ -5,32 +5,32 @@ void WotlkDungeonDTKStrategy::InitTriggers(std::vector &triggers) { // Trollgore triggers.push_back(new TriggerNode("corpse explode", - NextAction::array(0, new NextAction("corpse explode spread", ACTION_MOVE + 5), nullptr))); + { NextAction("corpse explode spread", ACTION_MOVE + 5) })); // Novos the Summoner // TODO: Can be improved - it's a pretty easy fight but complex to program, revisit if needed triggers.push_back(new TriggerNode("arcane field", - NextAction::array(0, new NextAction("avoid arcane field", ACTION_MOVE + 5), nullptr))); + { NextAction("avoid arcane field", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("arcane field", - NextAction::array(0, new NextAction("novos positioning", ACTION_MOVE + 4), nullptr))); + { NextAction("novos positioning", ACTION_MOVE + 4) })); triggers.push_back(new TriggerNode("arcane field", - NextAction::array(0, new NextAction("novos target priority", ACTION_NORMAL + 1), nullptr))); + { NextAction("novos target priority", ACTION_NORMAL + 1) })); // King Dred // TODO: Fear ward / tremor totem, or general anti-fear strat development //The Prophet Tharon'ja triggers.push_back(new TriggerNode("gift of tharon'ja", - NextAction::array(0, new NextAction("touch of life", ACTION_NORMAL + 5), nullptr))); + { NextAction("touch of life", ACTION_NORMAL + 5) })); triggers.push_back(new TriggerNode("gift of tharon'ja", - NextAction::array(0, new NextAction("bone armor", ACTION_NORMAL + 4), nullptr))); + { NextAction("bone armor", ACTION_NORMAL + 4) })); // Run ranged chars (who would normally stand at range) into melee, to dps in skeleton form triggers.push_back(new TriggerNode("tharon'ja out of melee", - NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 3), nullptr))); + { NextAction("reach melee", ACTION_NORMAL + 3) })); triggers.push_back(new TriggerNode("gift of tharon'ja", - NextAction::array(0, new NextAction("taunt", ACTION_NORMAL + 2), nullptr))); + { NextAction("taunt", ACTION_NORMAL + 2) })); triggers.push_back(new TriggerNode("gift of tharon'ja", - NextAction::array(0, new NextAction("slaying strike", ACTION_NORMAL + 2), nullptr))); + { NextAction("slaying strike", ACTION_NORMAL + 2) })); } void WotlkDungeonDTKStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepStrategy.h b/src/Ai/Dungeon/DraktharonKeep/Strategy/DrakTharonKeepStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepStrategy.h rename to src/Ai/Dungeon/DraktharonKeep/Strategy/DrakTharonKeepStrategy.h diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggers.cpp b/src/Ai/Dungeon/DraktharonKeep/Trigger/DrakTharonKeepTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggers.cpp rename to src/Ai/Dungeon/DraktharonKeep/Trigger/DrakTharonKeepTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggers.h b/src/Ai/Dungeon/DraktharonKeep/Trigger/DrakTharonKeepTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/draktharonkeep/DrakTharonKeepTriggers.h rename to src/Ai/Dungeon/DraktharonKeep/Trigger/DrakTharonKeepTriggers.h diff --git a/src/strategy/dungeons/DungeonStrategyContext.h b/src/Ai/Dungeon/DungeonStrategyContext.h similarity index 83% rename from src/strategy/dungeons/DungeonStrategyContext.h rename to src/Ai/Dungeon/DungeonStrategyContext.h index cc606afef8..3311aeee24 100644 --- a/src/strategy/dungeons/DungeonStrategyContext.h +++ b/src/Ai/Dungeon/DungeonStrategyContext.h @@ -2,21 +2,21 @@ #define _PLAYERBOT_DUNGEONSTRATEGYCONTEXT_H #include "Strategy.h" -#include "wotlk/utgardekeep/UtgardeKeepStrategy.h" -#include "wotlk/nexus/NexusStrategy.h" -#include "wotlk/azjolnerub/AzjolNerubStrategy.h" -#include "wotlk/oldkingdom/OldKingdomStrategy.h" -#include "wotlk/draktharonkeep/DrakTharonKeepStrategy.h" -#include "wotlk/violethold/VioletHoldStrategy.h" -#include "wotlk/gundrak/GundrakStrategy.h" -#include "wotlk/hallsofstone/HallsOfStoneStrategy.h" -#include "wotlk/hallsoflightning/HallsOfLightningStrategy.h" -#include "wotlk/oculus/OculusStrategy.h" -#include "wotlk/utgardepinnacle/UtgardePinnacleStrategy.h" -#include "wotlk/cullingofstratholme/CullingOfStratholmeStrategy.h" -#include "wotlk/forgeofsouls/ForgeOfSoulsStrategy.h" -#include "wotlk/pitofsaron/PitOfSaronStrategy.h" -#include "wotlk/trialofthechampion/TrialOfTheChampionStrategy.h" +#include "UtgardeKeep/Strategy/UtgardeKeepStrategy.h" +#include "Nexus/Strategy/NexusStrategy.h" +#include "AzjolNerub/Strategy/AzjolNerubStrategy.h" +#include "OldKingdom/Strategy/OldKingdomStrategy.h" +#include "DraktharonKeep/Strategy/DrakTharonKeepStrategy.h" +#include "VioletHold/Strategy/VioletHoldStrategy.h" +#include "Gundrak/Strategy/GundrakStrategy.h" +#include "HallsOfStone/Strategy/HallsOfStoneStrategy.h" +#include "HallsOfLightning/Strategy/HallsOfLightningStrategy.h" +#include "Oculus/Strategy/OculusStrategy.h" +#include "UtgardePinnacle/Strategy/UtgardePinnacleStrategy.h" +#include "CullingOfStratholme/Strategy/CullingOfStratholmeStrategy.h" +#include "ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.h" +#include "PitOfSaron/Strategy/PitOfSaronStrategy.h" +#include "TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.h" /* Full list/TODO: diff --git a/src/strategy/dungeons/DungeonStrategyUtils.h b/src/Ai/Dungeon/DungeonStrategyUtils.h similarity index 100% rename from src/strategy/dungeons/DungeonStrategyUtils.h rename to src/Ai/Dungeon/DungeonStrategyUtils.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp b/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.cpp rename to src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.cpp diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h b/src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActions.h rename to src/Ai/Dungeon/ForgeOfSouls/Action/ForgeOfSoulsActions.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActionContext.h b/src/Ai/Dungeon/ForgeOfSouls/ForgeOfSoulsActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsActionContext.h rename to src/Ai/Dungeon/ForgeOfSouls/ForgeOfSoulsActionContext.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggerContext.h b/src/Ai/Dungeon/ForgeOfSouls/ForgeOfSoulsTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggerContext.h rename to src/Ai/Dungeon/ForgeOfSouls/ForgeOfSoulsTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp b/src/Ai/Dungeon/ForgeOfSouls/Multiplier/ForgeOfSoulsMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.cpp rename to src/Ai/Dungeon/ForgeOfSouls/Multiplier/ForgeOfSoulsMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.h b/src/Ai/Dungeon/ForgeOfSouls/Multiplier/ForgeOfSoulsMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsMultipliers.h rename to src/Ai/Dungeon/ForgeOfSouls/Multiplier/ForgeOfSoulsMultipliers.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp b/src/Ai/Dungeon/ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.cpp similarity index 54% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp rename to src/Ai/Dungeon/ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.cpp index b70b518ee5..9ff3219829 100644 --- a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.cpp +++ b/src/Ai/Dungeon/ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.cpp @@ -4,17 +4,16 @@ void WotlkDungeonFoSStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("move from bronjahm", - NextAction::array(0, new NextAction("move from bronjahm", ACTION_MOVE + 5), nullptr))); + { NextAction("move from bronjahm", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("switch to soul fragment", - NextAction::array(0, new NextAction("attack corrupted soul fragment", ACTION_RAID + 2), nullptr))); + { NextAction("attack corrupted soul fragment", ACTION_RAID + 2) })); triggers.push_back(new TriggerNode("bronjahm position", - NextAction::array(0, new NextAction("bronjahm group position", ACTION_RAID + 1), nullptr))); + { NextAction("bronjahm group position", ACTION_RAID + 1) })); triggers.push_back(new TriggerNode("devourer of souls", - NextAction::array(0, new NextAction("devourer of souls", ACTION_RAID + 1), nullptr))); + { NextAction("devourer of souls", ACTION_RAID + 1) })); } void WotlkDungeonFoSStrategy::InitMultipliers(std::vector& multipliers) { multipliers.push_back(new BronjahmMultiplier(botAI)); - //multipliers.push_back(new AttackFragmentMultiplier(botAI)); } diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.h b/src/Ai/Dungeon/ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsStrategy.h rename to src/Ai/Dungeon/ForgeOfSouls/Strategy/ForgeOfSoulsStrategy.h diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp b/src/Ai/Dungeon/ForgeOfSouls/Trigger/ForgeOfSoulsTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.cpp rename to src/Ai/Dungeon/ForgeOfSouls/Trigger/ForgeOfSoulsTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.h b/src/Ai/Dungeon/ForgeOfSouls/Trigger/ForgeOfSoulsTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/forgeofsouls/ForgeOfSoulsTriggers.h rename to src/Ai/Dungeon/ForgeOfSouls/Trigger/ForgeOfSoulsTriggers.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakActions.cpp b/src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakActions.cpp rename to src/Ai/Dungeon/Gundrak/Action/GundrakActions.cpp diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakActions.h b/src/Ai/Dungeon/Gundrak/Action/GundrakActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakActions.h rename to src/Ai/Dungeon/Gundrak/Action/GundrakActions.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakActionContext.h b/src/Ai/Dungeon/Gundrak/GundrakActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakActionContext.h rename to src/Ai/Dungeon/Gundrak/GundrakActionContext.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakTriggerContext.h b/src/Ai/Dungeon/Gundrak/GundrakTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakTriggerContext.h rename to src/Ai/Dungeon/Gundrak/GundrakTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakMultipliers.cpp b/src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakMultipliers.cpp rename to src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakMultipliers.h b/src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakMultipliers.h rename to src/Ai/Dungeon/Gundrak/Multiplier/GundrakMultipliers.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakStrategy.cpp b/src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.cpp similarity index 74% rename from src/strategy/dungeons/wotlk/gundrak/GundrakStrategy.cpp rename to src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.cpp index 8c5612dc65..c8244e2ca9 100644 --- a/src/strategy/dungeons/wotlk/gundrak/GundrakStrategy.cpp +++ b/src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.cpp @@ -11,13 +11,13 @@ void WotlkDungeonGDStrategy::InitTriggers(std::vector &triggers) // TODO: Might need to add target priority for heroic on the snakes or to burn down boss. // Will re-test in heroic, decent dps groups should be able to blast him down with no funky strats. triggers.push_back(new TriggerNode("poison nova", - NextAction::array(0, new NextAction("avoid poison nova", ACTION_RAID + 5), nullptr))); + { NextAction("avoid poison nova", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("snake wrap", - NextAction::array(0, new NextAction("attack snake wrap", ACTION_RAID + 4), nullptr))); + { NextAction("attack snake wrap", ACTION_RAID + 4) })); // Gal'darah triggers.push_back(new TriggerNode("whirling slash", - NextAction::array(0, new NextAction("avoid whirling slash", ACTION_RAID + 5), nullptr))); + { NextAction("avoid whirling slash", ACTION_RAID + 5) })); // Eck the Ferocious (Heroic only) } diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakStrategy.h b/src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakStrategy.h rename to src/Ai/Dungeon/Gundrak/Strategy/GundrakStrategy.h diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakTriggers.cpp b/src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakTriggers.cpp rename to src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/gundrak/GundrakTriggers.h b/src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/gundrak/GundrakTriggers.h rename to src/Ai/Dungeon/Gundrak/Trigger/GundrakTriggers.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp b/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.cpp rename to src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.cpp diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.h b/src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActions.h rename to src/Ai/Dungeon/HallsOfLightning/Action/HallsOfLightningActions.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActionContext.h b/src/Ai/Dungeon/HallsOfLightning/HallsOfLightningActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningActionContext.h rename to src/Ai/Dungeon/HallsOfLightning/HallsOfLightningActionContext.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggerContext.h b/src/Ai/Dungeon/HallsOfLightning/HallsOfLightningTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggerContext.h rename to src/Ai/Dungeon/HallsOfLightning/HallsOfLightningTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp b/src/Ai/Dungeon/HallsOfLightning/Multiplier/HallsOfLightningMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.cpp rename to src/Ai/Dungeon/HallsOfLightning/Multiplier/HallsOfLightningMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.h b/src/Ai/Dungeon/HallsOfLightning/Multiplier/HallsOfLightningMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningMultipliers.h rename to src/Ai/Dungeon/HallsOfLightning/Multiplier/HallsOfLightningMultipliers.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningStrategy.cpp b/src/Ai/Dungeon/HallsOfLightning/Strategy/HallsOfLightningStrategy.cpp similarity index 57% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningStrategy.cpp rename to src/Ai/Dungeon/HallsOfLightning/Strategy/HallsOfLightningStrategy.cpp index 42d30d96d9..1266fb0b9c 100644 --- a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningStrategy.cpp +++ b/src/Ai/Dungeon/HallsOfLightning/Strategy/HallsOfLightningStrategy.cpp @@ -5,30 +5,30 @@ void WotlkDungeonHoLStrategy::InitTriggers(std::vector &triggers) { // General Bjarngrim triggers.push_back(new TriggerNode("stormforged lieutenant", - NextAction::array(0, new NextAction("bjarngrim target", ACTION_RAID + 5), nullptr))); + { NextAction("bjarngrim target", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("whirlwind", - NextAction::array(0, new NextAction("avoid whirlwind", ACTION_RAID + 4), nullptr))); + { NextAction("avoid whirlwind", ACTION_RAID + 4) })); // Volkhan triggers.push_back(new TriggerNode("volkhan", - NextAction::array(0, new NextAction("volkhan target", ACTION_RAID + 5), nullptr))); + { NextAction("volkhan target", ACTION_RAID + 5) })); // Ionar triggers.push_back(new TriggerNode("ionar disperse", - NextAction::array(0, new NextAction("disperse position", ACTION_MOVE + 5), nullptr))); + { NextAction("disperse position", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("ionar tank aggro", - NextAction::array(0, new NextAction("ionar tank position", ACTION_MOVE + 4), nullptr))); + { NextAction("ionar tank position", ACTION_MOVE + 4) })); triggers.push_back(new TriggerNode("static overload", - NextAction::array(0, new NextAction("static overload spread", ACTION_MOVE + 3), nullptr))); + { NextAction("static overload spread", ACTION_MOVE + 3) })); // TODO: Targeted player can dodge the ball, but a single player soaking it isn't too bad to heal triggers.push_back(new TriggerNode("ball lightning", - NextAction::array(0, new NextAction("ball lightning spread", ACTION_MOVE + 2), nullptr))); + { NextAction("ball lightning spread", ACTION_MOVE + 2) })); // Loken triggers.push_back(new TriggerNode("lightning nova", - NextAction::array(0, new NextAction("avoid lightning nova", ACTION_MOVE + 5), nullptr))); + { NextAction("avoid lightning nova", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("loken ranged", - NextAction::array(0, new NextAction("loken stack", ACTION_MOVE + 4), nullptr))); + { NextAction("loken stack", ACTION_MOVE + 4) })); } void WotlkDungeonHoLStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningStrategy.h b/src/Ai/Dungeon/HallsOfLightning/Strategy/HallsOfLightningStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningStrategy.h rename to src/Ai/Dungeon/HallsOfLightning/Strategy/HallsOfLightningStrategy.h diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggers.cpp b/src/Ai/Dungeon/HallsOfLightning/Trigger/HallsOfLightningTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggers.cpp rename to src/Ai/Dungeon/HallsOfLightning/Trigger/HallsOfLightningTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggers.h b/src/Ai/Dungeon/HallsOfLightning/Trigger/HallsOfLightningTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsoflightning/HallsOfLightningTriggers.h rename to src/Ai/Dungeon/HallsOfLightning/Trigger/HallsOfLightningTriggers.h diff --git a/src/strategy/dungeons/wotlk/hallsofreflection/TODO b/src/Ai/Dungeon/HallsOfReflection/TODO similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofreflection/TODO rename to src/Ai/Dungeon/HallsOfReflection/TODO diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActions.cpp b/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActions.cpp rename to src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.cpp diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActions.h b/src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActions.h rename to src/Ai/Dungeon/HallsOfStone/Action/HallsOfStoneActions.h diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActionContext.h b/src/Ai/Dungeon/HallsOfStone/HallsOfStoneActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneActionContext.h rename to src/Ai/Dungeon/HallsOfStone/HallsOfStoneActionContext.h diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggerContext.h b/src/Ai/Dungeon/HallsOfStone/HallsOfStoneTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggerContext.h rename to src/Ai/Dungeon/HallsOfStone/HallsOfStoneTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneMultipliers.cpp b/src/Ai/Dungeon/HallsOfStone/Multiplier/HallsOfStoneMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneMultipliers.cpp rename to src/Ai/Dungeon/HallsOfStone/Multiplier/HallsOfStoneMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneMultipliers.h b/src/Ai/Dungeon/HallsOfStone/Multiplier/HallsOfStoneMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneMultipliers.h rename to src/Ai/Dungeon/HallsOfStone/Multiplier/HallsOfStoneMultipliers.h diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneStrategy.cpp b/src/Ai/Dungeon/HallsOfStone/Strategy/HallsOfStoneStrategy.cpp similarity index 84% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneStrategy.cpp rename to src/Ai/Dungeon/HallsOfStone/Strategy/HallsOfStoneStrategy.cpp index b13d4d6353..47006a9e44 100644 --- a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneStrategy.cpp +++ b/src/Ai/Dungeon/HallsOfStone/Strategy/HallsOfStoneStrategy.cpp @@ -9,7 +9,7 @@ void WotlkDungeonHoSStrategy::InitTriggers(std::vector &triggers) // Krystallus // TODO: I think bots need to dismiss pets on this, or they nuke players they are standing close to triggers.push_back(new TriggerNode("ground slam", - NextAction::array(0, new NextAction("shatter spread", ACTION_RAID + 5), nullptr))); + { NextAction("shatter spread", ACTION_RAID + 5) })); // Tribunal of Ages // Seems fine, maybe add focus targeting strat if needed on heroic. @@ -19,7 +19,7 @@ void WotlkDungeonHoSStrategy::InitTriggers(std::vector &triggers) // Sjonnir The Ironshaper // Possibly tank in place in the middle of the room, assign a dps to adds? triggers.push_back(new TriggerNode("lightning ring", - NextAction::array(0, new NextAction("avoid lightning ring", ACTION_RAID + 5), nullptr))); + { NextAction("avoid lightning ring", ACTION_RAID + 5) })); } void WotlkDungeonHoSStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneStrategy.h b/src/Ai/Dungeon/HallsOfStone/Strategy/HallsOfStoneStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneStrategy.h rename to src/Ai/Dungeon/HallsOfStone/Strategy/HallsOfStoneStrategy.h diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggers.cpp b/src/Ai/Dungeon/HallsOfStone/Trigger/HallsOfStoneTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggers.cpp rename to src/Ai/Dungeon/HallsOfStone/Trigger/HallsOfStoneTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggers.h b/src/Ai/Dungeon/HallsOfStone/Trigger/HallsOfStoneTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/hallsofstone/HallsOfStoneTriggers.h rename to src/Ai/Dungeon/HallsOfStone/Trigger/HallsOfStoneTriggers.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusActions.cpp b/src/Ai/Dungeon/Nexus/Action/NexusActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusActions.cpp rename to src/Ai/Dungeon/Nexus/Action/NexusActions.cpp diff --git a/src/strategy/dungeons/wotlk/nexus/NexusActions.h b/src/Ai/Dungeon/Nexus/Action/NexusActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusActions.h rename to src/Ai/Dungeon/Nexus/Action/NexusActions.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusMultipliers.cpp b/src/Ai/Dungeon/Nexus/Multiplier/NexusMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusMultipliers.cpp rename to src/Ai/Dungeon/Nexus/Multiplier/NexusMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/nexus/NexusMultipliers.h b/src/Ai/Dungeon/Nexus/Multiplier/NexusMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusMultipliers.h rename to src/Ai/Dungeon/Nexus/Multiplier/NexusMultipliers.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusActionContext.h b/src/Ai/Dungeon/Nexus/NexusActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusActionContext.h rename to src/Ai/Dungeon/Nexus/NexusActionContext.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusTriggerContext.h b/src/Ai/Dungeon/Nexus/NexusTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusTriggerContext.h rename to src/Ai/Dungeon/Nexus/NexusTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusStrategy.cpp b/src/Ai/Dungeon/Nexus/Strategy/NexusStrategy.cpp similarity index 73% rename from src/strategy/dungeons/wotlk/nexus/NexusStrategy.cpp rename to src/Ai/Dungeon/Nexus/Strategy/NexusStrategy.cpp index 22a85f5027..e633ba9822 100644 --- a/src/strategy/dungeons/wotlk/nexus/NexusStrategy.cpp +++ b/src/Ai/Dungeon/Nexus/Strategy/NexusStrategy.cpp @@ -7,39 +7,39 @@ void WotlkDungeonNexStrategy::InitTriggers(std::vector &triggers) // or // Alliance Commander (Horde N)/Commander Stoutbeard (Horde H) triggers.push_back(new TriggerNode("faction commander whirlwind", - NextAction::array(0, new NextAction("move from whirlwind", ACTION_MOVE + 5), nullptr))); + { NextAction("move from whirlwind", ACTION_MOVE + 5) })); // TODO: Handle fear? (tremor totems, fear ward etc.) // Grand Magus Telestra triggers.push_back(new TriggerNode("telestra firebomb", - NextAction::array(0, new NextAction("firebomb spread", ACTION_MOVE + 5), nullptr))); + { NextAction("firebomb spread", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("telestra split phase", - NextAction::array(0, new NextAction("telestra split target", ACTION_RAID + 1), nullptr))); + { NextAction("telestra split target", ACTION_RAID + 1) })); // TODO: Add priority interrupt on the frost split's Blizzard casts // Anomalus triggers.push_back(new TriggerNode("chaotic rift", - NextAction::array(0, new NextAction("chaotic rift target", ACTION_RAID + 1), nullptr))); + { NextAction("chaotic rift target", ACTION_RAID + 1) })); // Ormorok the Tree-Shaper // Tank trigger to stack inside boss. Can also add return action to prevent boss repositioning // if it becomes too much of a problem. He usually dies before he's up against a wall though triggers.push_back(new TriggerNode("ormorok spikes", - NextAction::array(0, new NextAction("dodge spikes", ACTION_MOVE + 5), nullptr))); + { NextAction("dodge spikes", ACTION_MOVE + 5) })); // Non-tank trigger to stack. Avoiding the spikes at range is.. harder than it seems. // TODO: This turns hunters into melee marshmallows, have not come up with a better solution yet triggers.push_back(new TriggerNode("ormorok stack", - NextAction::array(0, new NextAction("dodge spikes", ACTION_MOVE + 5), nullptr))); + { NextAction("dodge spikes", ACTION_MOVE + 5) })); // TODO: Add handling for spell reflect... best to spam low level/weak spells but don't want // to hardcode spells per class, might be difficult to dynamically generate this. // Will revisit if I find my altbots killing themselves in heroic, just heal through it for now // Keristrasza triggers.push_back(new TriggerNode("intense cold", - NextAction::array(0, new NextAction("intense cold jump", ACTION_MOVE + 5), nullptr))); + { NextAction("intense cold jump", ACTION_MOVE + 5) })); // Flank dragon positioning triggers.push_back(new TriggerNode("keristrasza positioning", - NextAction::array(0, new NextAction("rear flank", ACTION_MOVE + 4), nullptr))); + { NextAction("rear flank", ACTION_MOVE + 4) })); // TODO: Add frost resist aura for paladins? } diff --git a/src/strategy/dungeons/wotlk/nexus/NexusStrategy.h b/src/Ai/Dungeon/Nexus/Strategy/NexusStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusStrategy.h rename to src/Ai/Dungeon/Nexus/Strategy/NexusStrategy.h diff --git a/src/strategy/dungeons/wotlk/nexus/NexusTriggers.cpp b/src/Ai/Dungeon/Nexus/Trigger/NexusTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusTriggers.cpp rename to src/Ai/Dungeon/Nexus/Trigger/NexusTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/nexus/NexusTriggers.h b/src/Ai/Dungeon/Nexus/Trigger/NexusTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/nexus/NexusTriggers.h rename to src/Ai/Dungeon/Nexus/Trigger/NexusTriggers.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusActions.cpp b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp similarity index 95% rename from src/strategy/dungeons/wotlk/oculus/OculusActions.cpp rename to src/Ai/Dungeon/Oculus/Action/OculusActions.cpp index f1aa4d2917..414acc4bc9 100644 --- a/src/strategy/dungeons/wotlk/oculus/OculusActions.cpp +++ b/src/Ai/Dungeon/Oculus/Action/OculusActions.cpp @@ -62,17 +62,25 @@ bool MountDrakeAction::Execute(Event event) break; } - GuidVector members = AI_VALUE(GuidVector, "group members"); - for (auto& member : members) + std::vector players = botAI->GetPlayersInGroup(); + for (Player* player : players) { - Player* player = botAI->GetPlayer(member); - if (!player->GetSession()->IsBot()) { continue; } + if (!player || !player->IsInWorld() || player->IsDuringRemoveFromWorld()) + continue; + + WorldSession* session = player->GetSession(); + if (!session || !session->IsBot()) + continue; + + int slot = botAI->GetGroupSlotIndex(player); + if (slot < 0) + continue; - for (int i = 0; i < composition.size(); i++) + for (uint8 i = 0; i < composition.size(); ++i) { if (composition[i] > 0) { - drakeAssignments[botAI->GetGroupSlotIndex(player)] = DRAKE_ITEMS[i]; + drakeAssignments[slot] = DRAKE_ITEMS[i]; composition[i]--; break; } diff --git a/src/strategy/dungeons/wotlk/oculus/OculusActions.h b/src/Ai/Dungeon/Oculus/Action/OculusActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusActions.h rename to src/Ai/Dungeon/Oculus/Action/OculusActions.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusMultipliers.cpp b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusMultipliers.cpp rename to src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/oculus/OculusMultipliers.h b/src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusMultipliers.h rename to src/Ai/Dungeon/Oculus/Multiplier/OculusMultipliers.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusActionContext.h b/src/Ai/Dungeon/Oculus/OculusActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusActionContext.h rename to src/Ai/Dungeon/Oculus/OculusActionContext.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusTriggerContext.h b/src/Ai/Dungeon/Oculus/OculusTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusTriggerContext.h rename to src/Ai/Dungeon/Oculus/OculusTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusStrategy.cpp b/src/Ai/Dungeon/Oculus/Strategy/OculusStrategy.cpp similarity index 60% rename from src/strategy/dungeons/wotlk/oculus/OculusStrategy.cpp rename to src/Ai/Dungeon/Oculus/Strategy/OculusStrategy.cpp index 3e98dfa6a4..4c558469ee 100644 --- a/src/strategy/dungeons/wotlk/oculus/OculusStrategy.cpp +++ b/src/Ai/Dungeon/Oculus/Strategy/OculusStrategy.cpp @@ -6,28 +6,28 @@ void WotlkDungeonOccStrategy::InitTriggers(std::vector &triggers) // Drakos the Interrogator // TODO: May need work, TBA. triggers.push_back(new TriggerNode("unstable sphere", - NextAction::array(0, new NextAction("avoid unstable sphere", ACTION_MOVE + 5), nullptr))); + { NextAction("avoid unstable sphere", ACTION_MOVE + 5) })); // DRAKES triggers.push_back(new TriggerNode("drake mount", - NextAction::array(0, new NextAction("mount drake", ACTION_RAID + 5), nullptr))); + { NextAction("mount drake", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("drake dismount", - NextAction::array(0, new NextAction("dismount drake", ACTION_RAID + 5), nullptr))); + { NextAction("dismount drake", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("group flying", - NextAction::array(0, new NextAction("occ fly drake", ACTION_NORMAL + 1), nullptr))); + { NextAction("occ fly drake", ACTION_NORMAL + 1) })); triggers.push_back(new TriggerNode("drake combat", - NextAction::array(0, new NextAction("occ drake attack", ACTION_NORMAL + 5), nullptr))); + { NextAction("occ drake attack", ACTION_NORMAL + 5) })); // Varos Cloudstrider // Seems to be no way to identify the marked cores, may need to hook boss AI.. // triggers.push_back(new TriggerNode("varos cloudstrider", - // NextAction::array(0, new NextAction("avoid energize cores", ACTION_RAID + 5), nullptr))); + // { NextAction("avoid energize cores", ACTION_RAID + 5) })); // Mage-Lord Urom triggers.push_back(new TriggerNode("arcane explosion", - NextAction::array(0, new NextAction("avoid arcane explosion", ACTION_MOVE + 5), nullptr))); + { NextAction("avoid arcane explosion", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("time bomb", - NextAction::array(0, new NextAction("time bomb spread", ACTION_MOVE + 4), nullptr))); + { NextAction("time bomb spread", ACTION_MOVE + 4) })); // Ley-Guardian Eregos } diff --git a/src/strategy/dungeons/wotlk/oculus/OculusStrategy.h b/src/Ai/Dungeon/Oculus/Strategy/OculusStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusStrategy.h rename to src/Ai/Dungeon/Oculus/Strategy/OculusStrategy.h diff --git a/src/strategy/dungeons/wotlk/oculus/OculusTriggers.cpp b/src/Ai/Dungeon/Oculus/Trigger/OculusTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusTriggers.cpp rename to src/Ai/Dungeon/Oculus/Trigger/OculusTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/oculus/OculusTriggers.h b/src/Ai/Dungeon/Oculus/Trigger/OculusTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/oculus/OculusTriggers.h rename to src/Ai/Dungeon/Oculus/Trigger/OculusTriggers.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActions.cpp b/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActions.cpp rename to src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.cpp diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActions.h b/src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActions.h rename to src/Ai/Dungeon/OldKingdom/Action/OldKingdomActions.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomMultipliers.cpp b/src/Ai/Dungeon/OldKingdom/Multiplier/OldKingdomMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomMultipliers.cpp rename to src/Ai/Dungeon/OldKingdom/Multiplier/OldKingdomMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomMultipliers.h b/src/Ai/Dungeon/OldKingdom/Multiplier/OldKingdomMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomMultipliers.h rename to src/Ai/Dungeon/OldKingdom/Multiplier/OldKingdomMultipliers.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActionContext.h b/src/Ai/Dungeon/OldKingdom/OldKingdomActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomActionContext.h rename to src/Ai/Dungeon/OldKingdom/OldKingdomActionContext.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggerContext.h b/src/Ai/Dungeon/OldKingdom/OldKingdomTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggerContext.h rename to src/Ai/Dungeon/OldKingdom/OldKingdomTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomStrategy.cpp b/src/Ai/Dungeon/OldKingdom/Strategy/OldKingdomStrategy.cpp similarity index 80% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomStrategy.cpp rename to src/Ai/Dungeon/OldKingdom/Strategy/OldKingdomStrategy.cpp index 50a38412f7..484ea6ac48 100644 --- a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomStrategy.cpp +++ b/src/Ai/Dungeon/OldKingdom/Strategy/OldKingdomStrategy.cpp @@ -5,7 +5,7 @@ void WotlkDungeonOKStrategy::InitTriggers(std::vector &triggers) { // Elder Nadox triggers.push_back(new TriggerNode("nadox guardian", - NextAction::array(0, new NextAction("attack nadox guardian", ACTION_RAID + 5), nullptr))); + { NextAction("attack nadox guardian", ACTION_RAID + 5) })); // Prince Taldaram // Flame Orb spawns in melee, doesn't have a clear direction until it starts moving. @@ -14,13 +14,13 @@ void WotlkDungeonOKStrategy::InitTriggers(std::vector &triggers) // Jedoga Shadowseeker triggers.push_back(new TriggerNode("jedoga volunteer", - NextAction::array(0, new NextAction("attack jedoga volunteer", ACTION_RAID + 5), nullptr))); + { NextAction("attack jedoga volunteer", ACTION_RAID + 5) })); // Herald Volazj // Trash mobs before him have a big telegraphed shadow crash spell, // this can be avoided and is intended to be dodged triggers.push_back(new TriggerNode("shadow crash", - NextAction::array(0, new NextAction("avoid shadow crash", ACTION_MOVE + 5), nullptr))); + { NextAction("avoid shadow crash", ACTION_MOVE + 5) })); // Volazj is not implemented properly in AC, insanity phase does nothing. // Amanitar (Heroic Only) diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomStrategy.h b/src/Ai/Dungeon/OldKingdom/Strategy/OldKingdomStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomStrategy.h rename to src/Ai/Dungeon/OldKingdom/Strategy/OldKingdomStrategy.h diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggers.cpp b/src/Ai/Dungeon/OldKingdom/Trigger/OldKingdomTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggers.cpp rename to src/Ai/Dungeon/OldKingdom/Trigger/OldKingdomTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggers.h b/src/Ai/Dungeon/OldKingdom/Trigger/OldKingdomTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/oldkingdom/OldKingdomTriggers.h rename to src/Ai/Dungeon/OldKingdom/Trigger/OldKingdomTriggers.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActions.cpp b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActions.cpp rename to src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.cpp diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActions.h b/src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActions.h rename to src/Ai/Dungeon/PitOfSaron/Action/PitOfSaronActions.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronMultipliers.cpp b/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronMultipliers.cpp rename to src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronMultipliers.h b/src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronMultipliers.h rename to src/Ai/Dungeon/PitOfSaron/Multiplier/PitOfSaronMultipliers.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActionContext.h b/src/Ai/Dungeon/PitOfSaron/PitOfSaronActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronActionContext.h rename to src/Ai/Dungeon/PitOfSaron/PitOfSaronActionContext.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggerContext.h b/src/Ai/Dungeon/PitOfSaron/PitOfSaronTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggerContext.h rename to src/Ai/Dungeon/PitOfSaron/PitOfSaronTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronStrategy.cpp b/src/Ai/Dungeon/PitOfSaron/Strategy/PitOfSaronStrategy.cpp similarity index 62% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronStrategy.cpp rename to src/Ai/Dungeon/PitOfSaron/Strategy/PitOfSaronStrategy.cpp index 2539457bf0..641af0a6d4 100644 --- a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronStrategy.cpp +++ b/src/Ai/Dungeon/PitOfSaron/Strategy/PitOfSaronStrategy.cpp @@ -4,14 +4,13 @@ void WotlkDungeonPoSStrategy::InitTriggers(std::vector& triggers) { triggers.push_back(new TriggerNode("ick and krick", - NextAction::array(0, new NextAction("ick and krick", ACTION_RAID + 5), nullptr))); + { NextAction("ick and krick", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("tyrannus", - NextAction::array(0, new NextAction("tyrannus", ACTION_RAID + 5), nullptr))); + { NextAction("tyrannus", ACTION_RAID + 5) })); } void WotlkDungeonPoSStrategy::InitMultipliers(std::vector& multipliers) { multipliers.push_back(new IckAndKrickMultiplier(botAI)); - //multipliers.push_back(new AttackFragmentMultiplier(botAI)); } diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronStrategy.h b/src/Ai/Dungeon/PitOfSaron/Strategy/PitOfSaronStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronStrategy.h rename to src/Ai/Dungeon/PitOfSaron/Strategy/PitOfSaronStrategy.h diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggers.cpp b/src/Ai/Dungeon/PitOfSaron/Trigger/PitOfSaronTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggers.cpp rename to src/Ai/Dungeon/PitOfSaron/Trigger/PitOfSaronTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggers.h b/src/Ai/Dungeon/PitOfSaron/Trigger/PitOfSaronTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/pitofsaron/PitOfSaronTriggers.h rename to src/Ai/Dungeon/PitOfSaron/Trigger/PitOfSaronTriggers.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActions.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp similarity index 99% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActions.cpp rename to src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp index 5dd1ef8bcc..92b687b292 100644 --- a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActions.cpp +++ b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.cpp @@ -1,7 +1,7 @@ #include "Playerbots.h" #include "TrialOfTheChampionActions.h" #include "TrialOfTheChampionStrategy.h" -#include "strategy/values/NearestNpcsValue.h" +#include "NearestNpcsValue.h" #include "ObjectAccessor.h" #include "Timer.h" #include "Vehicle.h" diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActions.h b/src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActions.h rename to src/Ai/Dungeon/TrialOfTheChampion/Action/TrialOfTheChampionActions.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionMultipliers.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Multiplier/TrialOfTheChampionMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionMultipliers.cpp rename to src/Ai/Dungeon/TrialOfTheChampion/Multiplier/TrialOfTheChampionMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionMultipliers.h b/src/Ai/Dungeon/TrialOfTheChampion/Multiplier/TrialOfTheChampionMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionMultipliers.h rename to src/Ai/Dungeon/TrialOfTheChampion/Multiplier/TrialOfTheChampionMultipliers.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionStrategy.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp similarity index 51% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionStrategy.cpp rename to src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp index e1f97000c6..bbccca71f3 100644 --- a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionStrategy.cpp +++ b/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.cpp @@ -4,19 +4,18 @@ void WotlkDungeonToCStrategy::InitTriggers(std::vector &triggers) { triggers.push_back(new TriggerNode("toc lance", - NextAction::array(0, new NextAction("toc lance", ACTION_RAID + 5), nullptr))); + { NextAction("toc lance", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("toc ue lance", - NextAction::array(0, new NextAction("toc ue lance", ACTION_RAID + 2), nullptr))); + { NextAction("toc ue lance", ACTION_RAID + 2) })); triggers.push_back(new TriggerNode("toc mount near", - NextAction::array(0, new NextAction("toc mount", ACTION_RAID + 4), nullptr))); + { NextAction("toc mount", ACTION_RAID + 4) })); triggers.push_back(new TriggerNode("toc mounted", - NextAction::array(0, new NextAction("toc mounted", ACTION_RAID + 6), nullptr))); + { NextAction("toc mounted", ACTION_RAID + 6) })); triggers.push_back(new TriggerNode("toc eadric", - NextAction::array(0, new NextAction("toc eadric", ACTION_RAID + 3), nullptr))); + { NextAction("toc eadric", ACTION_RAID + 3) })); } void WotlkDungeonToCStrategy::InitMultipliers(std::vector &multipliers) { - //multipliers.push_back(new toc...); if needed in the future } diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionStrategy.h b/src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionStrategy.h rename to src/Ai/Dungeon/TrialOfTheChampion/Strategy/TrialOfTheChampionStrategy.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActionContext.h b/src/Ai/Dungeon/TrialOfTheChampion/TrialOfTheChampionActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionActionContext.h rename to src/Ai/Dungeon/TrialOfTheChampion/TrialOfTheChampionActionContext.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggerContext.h b/src/Ai/Dungeon/TrialOfTheChampion/TrialOfTheChampionTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggerContext.h rename to src/Ai/Dungeon/TrialOfTheChampion/TrialOfTheChampionTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggers.cpp b/src/Ai/Dungeon/TrialOfTheChampion/Trigger/TrialOfTheChampionTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggers.cpp rename to src/Ai/Dungeon/TrialOfTheChampion/Trigger/TrialOfTheChampionTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggers.h b/src/Ai/Dungeon/TrialOfTheChampion/Trigger/TrialOfTheChampionTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/trialofthechampion/TrialOfTheChampionTriggers.h rename to src/Ai/Dungeon/TrialOfTheChampion/Trigger/TrialOfTheChampionTriggers.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp b/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.cpp rename to src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.cpp diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.h b/src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActions.h rename to src/Ai/Dungeon/UtgardeKeep/Action/UtgardeKeepActions.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp b/src/Ai/Dungeon/UtgardeKeep/Multiplier/UtgardeKeepMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.cpp rename to src/Ai/Dungeon/UtgardeKeep/Multiplier/UtgardeKeepMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.h b/src/Ai/Dungeon/UtgardeKeep/Multiplier/UtgardeKeepMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepMultipliers.h rename to src/Ai/Dungeon/UtgardeKeep/Multiplier/UtgardeKeepMultipliers.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepStrategy.cpp b/src/Ai/Dungeon/UtgardeKeep/Strategy/UtgardeKeepStrategy.cpp similarity index 69% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepStrategy.cpp rename to src/Ai/Dungeon/UtgardeKeep/Strategy/UtgardeKeepStrategy.cpp index ee7d102a9b..562cb8ec5f 100644 --- a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepStrategy.cpp +++ b/src/Ai/Dungeon/UtgardeKeep/Strategy/UtgardeKeepStrategy.cpp @@ -5,32 +5,32 @@ void WotlkDungeonUKStrategy::InitTriggers(std::vector &triggers) { // Prince Keleseth triggers.push_back(new TriggerNode("keleseth frost tomb", - NextAction::array(0, new NextAction("attack frost tomb", ACTION_RAID + 1), nullptr))); + { NextAction("attack frost tomb", ACTION_RAID + 1) })); // Skarvald the Constructor & Dalronn the Controller triggers.push_back(new TriggerNode("dalronn priority", - NextAction::array(0, new NextAction("attack dalronn", ACTION_RAID + 1), nullptr))); + { NextAction("attack dalronn", ACTION_RAID + 1) })); // Ingvar the Plunderer // Doesn't work yet, this action doesn't get processed until the existing cast finishes // triggers.push_back(new TriggerNode("ingvar staggering roar", - // NextAction::array(0, new NextAction("ingvar stop casting", ACTION_RAID + 1), nullptr))); + // { NextAction("ingvar stop casting", ACTION_RAID + 1) })); // No easy way to check LoS here, the pillars do not seem to count as gameobjects. // Not implemented for now, unsure if this is needed as a good group can probably burst through the boss // and just eat the debuff. // triggers.push_back(new TriggerNode("ingvar dreadful roar", - // NextAction::array(0, new NextAction("ingvar hide los", ACTION_RAID + 1), nullptr))); + // { NextAction("ingvar hide los", ACTION_RAID + 1) })); triggers.push_back(new TriggerNode("ingvar smash tank", - NextAction::array(0, new NextAction("ingvar dodge smash", ACTION_MOVE + 5), nullptr))); + { NextAction("ingvar dodge smash", ACTION_MOVE + 5) })); triggers.push_back(new TriggerNode("ingvar smash tank return", - NextAction::array(0, new NextAction("ingvar smash return", ACTION_MOVE + 5), nullptr))); + { NextAction("ingvar smash return", ACTION_MOVE + 5) })); // Buggy... if not behind target, ai can get stuck running towards and away from target. // I think for ranged chars, a custom action should be added that doesn't attempt to run into melee. // This is a bandaid for now, needs to be improved. triggers.push_back(new TriggerNode("not behind ingvar", - NextAction::array(0, new NextAction("set behind", ACTION_MOVE + 1), nullptr))); + { NextAction("set behind", ACTION_MOVE + 1) })); } diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepStrategy.h b/src/Ai/Dungeon/UtgardeKeep/Strategy/UtgardeKeepStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepStrategy.h rename to src/Ai/Dungeon/UtgardeKeep/Strategy/UtgardeKeepStrategy.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggers.cpp b/src/Ai/Dungeon/UtgardeKeep/Trigger/UtgardeKeepTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggers.cpp rename to src/Ai/Dungeon/UtgardeKeep/Trigger/UtgardeKeepTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggers.h b/src/Ai/Dungeon/UtgardeKeep/Trigger/UtgardeKeepTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggers.h rename to src/Ai/Dungeon/UtgardeKeep/Trigger/UtgardeKeepTriggers.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActionContext.h b/src/Ai/Dungeon/UtgardeKeep/UtgardeKeepActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepActionContext.h rename to src/Ai/Dungeon/UtgardeKeep/UtgardeKeepActionContext.h diff --git a/src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggerContext.h b/src/Ai/Dungeon/UtgardeKeep/UtgardeKeepTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardekeep/UtgardeKeepTriggerContext.h rename to src/Ai/Dungeon/UtgardeKeep/UtgardeKeepTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActions.cpp b/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActions.cpp rename to src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.cpp diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActions.h b/src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActions.h rename to src/Ai/Dungeon/UtgardePinnacle/Action/UtgardePinnacleActions.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleMultipliers.cpp b/src/Ai/Dungeon/UtgardePinnacle/Multiplier/UtgardePinnacleMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleMultipliers.cpp rename to src/Ai/Dungeon/UtgardePinnacle/Multiplier/UtgardePinnacleMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleMultipliers.h b/src/Ai/Dungeon/UtgardePinnacle/Multiplier/UtgardePinnacleMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleMultipliers.h rename to src/Ai/Dungeon/UtgardePinnacle/Multiplier/UtgardePinnacleMultipliers.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleStrategy.cpp b/src/Ai/Dungeon/UtgardePinnacle/Strategy/UtgardePinnacleStrategy.cpp similarity index 73% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleStrategy.cpp rename to src/Ai/Dungeon/UtgardePinnacle/Strategy/UtgardePinnacleStrategy.cpp index bcc4399cda..fe104f34fb 100644 --- a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleStrategy.cpp +++ b/src/Ai/Dungeon/UtgardePinnacle/Strategy/UtgardePinnacleStrategy.cpp @@ -10,14 +10,14 @@ void WotlkDungeonUPStrategy::InitTriggers(std::vector &triggers) // Skadi the Ruthless // TODO: Harpoons launchable via GameObject. For now players should do them triggers.push_back(new TriggerNode("freezing cloud", - NextAction::array(0, new NextAction("avoid freezing cloud", ACTION_RAID + 5), nullptr))); + { NextAction("avoid freezing cloud", ACTION_RAID + 5) })); triggers.push_back(new TriggerNode("skadi whirlwind", - NextAction::array(0, new NextAction("avoid skadi whirlwind", ACTION_RAID + 4), nullptr))); + { NextAction("avoid skadi whirlwind", ACTION_RAID + 4) })); // King Ymiron // May need to avoid orb.. unclear if the generic avoid AoE does this well triggers.push_back(new TriggerNode("ymiron bane", - NextAction::array(0, new NextAction("stop attack", ACTION_RAID + 5), nullptr))); + { NextAction("stop attack", ACTION_RAID + 5) })); } void WotlkDungeonUPStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleStrategy.h b/src/Ai/Dungeon/UtgardePinnacle/Strategy/UtgardePinnacleStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleStrategy.h rename to src/Ai/Dungeon/UtgardePinnacle/Strategy/UtgardePinnacleStrategy.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggers.cpp b/src/Ai/Dungeon/UtgardePinnacle/Trigger/UtgardePinnacleTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggers.cpp rename to src/Ai/Dungeon/UtgardePinnacle/Trigger/UtgardePinnacleTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggers.h b/src/Ai/Dungeon/UtgardePinnacle/Trigger/UtgardePinnacleTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggers.h rename to src/Ai/Dungeon/UtgardePinnacle/Trigger/UtgardePinnacleTriggers.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActionContext.h b/src/Ai/Dungeon/UtgardePinnacle/UtgardePinnacleActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleActionContext.h rename to src/Ai/Dungeon/UtgardePinnacle/UtgardePinnacleActionContext.h diff --git a/src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggerContext.h b/src/Ai/Dungeon/UtgardePinnacle/UtgardePinnacleTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/utgardepinnacle/UtgardePinnacleTriggerContext.h rename to src/Ai/Dungeon/UtgardePinnacle/UtgardePinnacleTriggerContext.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldActions.cpp b/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldActions.cpp rename to src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.cpp diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldActions.h b/src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldActions.h rename to src/Ai/Dungeon/VioletHold/Action/VioletHoldActions.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldMultipliers.cpp b/src/Ai/Dungeon/VioletHold/Multiplier/VioletHoldMultipliers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldMultipliers.cpp rename to src/Ai/Dungeon/VioletHold/Multiplier/VioletHoldMultipliers.cpp diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldMultipliers.h b/src/Ai/Dungeon/VioletHold/Multiplier/VioletHoldMultipliers.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldMultipliers.h rename to src/Ai/Dungeon/VioletHold/Multiplier/VioletHoldMultipliers.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldStrategy.cpp b/src/Ai/Dungeon/VioletHold/Strategy/VioletHoldStrategy.cpp similarity index 71% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldStrategy.cpp rename to src/Ai/Dungeon/VioletHold/Strategy/VioletHoldStrategy.cpp index 5b610300f3..ffc00e3063 100644 --- a/src/strategy/dungeons/wotlk/violethold/VioletHoldStrategy.cpp +++ b/src/Ai/Dungeon/VioletHold/Strategy/VioletHoldStrategy.cpp @@ -6,14 +6,14 @@ void WotlkDungeonVHStrategy::InitTriggers(std::vector &triggers) // Erekem // This boss has many purgable buffs, purging/dispels could be merged into generic strats though triggers.push_back(new TriggerNode("erekem target", - NextAction::array(0, new NextAction("attack erekem", ACTION_RAID + 1), nullptr))); + { NextAction("attack erekem", ACTION_RAID + 1) })); // Moragg // TODO: This guy has Optic Link which may require moving, add if needed // Ichoron triggers.push_back(new TriggerNode("ichoron target", - NextAction::array(0, new NextAction("attack ichor globule", ACTION_RAID + 1), nullptr))); + { NextAction("attack ichor globule", ACTION_RAID + 1) })); // Xevozz // TODO: Revisit in heroics, waypoints back and forth on stairs. Need to test with double beacon spawn @@ -23,13 +23,13 @@ void WotlkDungeonVHStrategy::InitTriggers(std::vector &triggers) // Zuramat the Obliterator triggers.push_back(new TriggerNode("shroud of darkness", - NextAction::array(0, new NextAction("stop attack", ACTION_HIGH + 5), nullptr))); + { NextAction("stop attack", ACTION_HIGH + 5) })); triggers.push_back(new TriggerNode("void shift", - NextAction::array(0, new NextAction("attack void sentry", ACTION_RAID + 1), nullptr))); + { NextAction("attack void sentry", ACTION_RAID + 1) })); // Cyanigosa triggers.push_back(new TriggerNode("cyanigosa positioning", - NextAction::array(0, new NextAction("rear flank", ACTION_MOVE + 5), nullptr))); + { NextAction("rear flank", ACTION_MOVE + 5) })); } void WotlkDungeonVHStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldStrategy.h b/src/Ai/Dungeon/VioletHold/Strategy/VioletHoldStrategy.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldStrategy.h rename to src/Ai/Dungeon/VioletHold/Strategy/VioletHoldStrategy.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldTriggers.cpp b/src/Ai/Dungeon/VioletHold/Trigger/VioletHoldTriggers.cpp similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldTriggers.cpp rename to src/Ai/Dungeon/VioletHold/Trigger/VioletHoldTriggers.cpp diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldTriggers.h b/src/Ai/Dungeon/VioletHold/Trigger/VioletHoldTriggers.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldTriggers.h rename to src/Ai/Dungeon/VioletHold/Trigger/VioletHoldTriggers.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldActionContext.h b/src/Ai/Dungeon/VioletHold/VioletHoldActionContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldActionContext.h rename to src/Ai/Dungeon/VioletHold/VioletHoldActionContext.h diff --git a/src/strategy/dungeons/wotlk/violethold/VioletHoldTriggerContext.h b/src/Ai/Dungeon/VioletHold/VioletHoldTriggerContext.h similarity index 100% rename from src/strategy/dungeons/wotlk/violethold/VioletHoldTriggerContext.h rename to src/Ai/Dungeon/VioletHold/VioletHoldTriggerContext.h diff --git a/src/Ai/Dungeon/WotlkDungeonActionContext.h b/src/Ai/Dungeon/WotlkDungeonActionContext.h new file mode 100644 index 0000000000..c7202de61e --- /dev/null +++ b/src/Ai/Dungeon/WotlkDungeonActionContext.h @@ -0,0 +1,21 @@ +#ifndef _PLAYERBOT_WOTLKDUNGEONACTIONCONTEXT_H +#define _PLAYERBOT_WOTLKDUNGEONACTIONCONTEXT_H + +#include "UtgardeKeep/UtgardeKeepActionContext.h" +#include "Nexus/NexusActionContext.h" +#include "AzjolNerub/AzjolNerubActionContext.h" +#include "OldKingdom/OldKingdomActionContext.h" +#include "DraktharonKeep/DrakTharonKeepActionContext.h" +#include "VioletHold/VioletHoldActionContext.h" +#include "Gundrak/GundrakActionContext.h" +#include "HallsOfStone/HallsOfStoneActionContext.h" +#include "HallsOfLightning/HallsOfLightningActionContext.h" +#include "Oculus/OculusActionContext.h" +#include "UtgardePinnacle/UtgardePinnacleActionContext.h" +#include "CullingOfStratholme/CullingOfStratholmeActionContext.h" +#include "ForgeOfSouls/ForgeOfSoulsActionContext.h" +#include "PitOfSaron/PitOfSaronActionContext.h" +#include "TrialOfTheChampion/TrialOfTheChampionActionContext.h" +// #include "HallsOfReflection/HallsOfReflectionActionContext.h" + +#endif diff --git a/src/Ai/Dungeon/WotlkDungeonTriggerContext.h b/src/Ai/Dungeon/WotlkDungeonTriggerContext.h new file mode 100644 index 0000000000..630aecbd98 --- /dev/null +++ b/src/Ai/Dungeon/WotlkDungeonTriggerContext.h @@ -0,0 +1,21 @@ +#ifndef _PLAYERBOT_WOTLKDUNGEONTRIGGERCONTEXT_H +#define _PLAYERBOT_WOTLKDUNGEONTRIGGERCONTEXT_H + +#include "UtgardeKeep/UtgardeKeepTriggerContext.h" +#include "Nexus/NexusTriggerContext.h" +#include "AzjolNerub/AzjolNerubTriggerContext.h" +#include "OldKingdom/OldKingdomTriggerContext.h" +#include "DraktharonKeep/DrakTharonKeepTriggerContext.h" +#include "VioletHold/VioletHoldTriggerContext.h" +#include "Gundrak/GundrakTriggerContext.h" +#include "HallsOfStone/HallsOfStoneTriggerContext.h" +#include "HallsOfLightning/HallsOfLightningTriggerContext.h" +#include "Oculus/OculusTriggerContext.h" +#include "UtgardePinnacle/UtgardePinnacleTriggerContext.h" +#include "CullingOfStratholme/CullingOfStratholmeTriggerContext.h" +#include "ForgeOfSouls/ForgeOfSoulsTriggerContext.h" +#include "PitOfSaron/PitOfSaronTriggerContext.h" +#include "TrialOfTheChampion/TrialOfTheChampionTriggerContext.h" +// #include "HallsOfReflection/HallsOfReflectionTriggerContext.h" + +#endif diff --git a/src/strategy/raids/aq20/RaidAq20Actions.cpp b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Actions.cpp rename to src/Ai/Raid/Aq20/Action/RaidAq20Actions.cpp diff --git a/src/strategy/raids/aq20/RaidAq20Actions.h b/src/Ai/Raid/Aq20/Action/RaidAq20Actions.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Actions.h rename to src/Ai/Raid/Aq20/Action/RaidAq20Actions.h diff --git a/src/strategy/raids/aq20/RaidAq20ActionContext.h b/src/Ai/Raid/Aq20/RaidAq20ActionContext.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20ActionContext.h rename to src/Ai/Raid/Aq20/RaidAq20ActionContext.h diff --git a/src/strategy/raids/aq20/RaidAq20TriggerContext.h b/src/Ai/Raid/Aq20/RaidAq20TriggerContext.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20TriggerContext.h rename to src/Ai/Raid/Aq20/RaidAq20TriggerContext.h diff --git a/src/strategy/raids/aq20/RaidAq20Strategy.cpp b/src/Ai/Raid/Aq20/Strategy/RaidAq20Strategy.cpp similarity index 68% rename from src/strategy/raids/aq20/RaidAq20Strategy.cpp rename to src/Ai/Raid/Aq20/Strategy/RaidAq20Strategy.cpp index 2b8cbe8cf2..93e0462caf 100644 --- a/src/strategy/raids/aq20/RaidAq20Strategy.cpp +++ b/src/Ai/Raid/Aq20/Strategy/RaidAq20Strategy.cpp @@ -6,6 +6,6 @@ void RaidAq20Strategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("aq20 move to crystal", - NextAction::array(0, new NextAction("aq20 use crystal", ACTION_RAID), nullptr))); + { NextAction("aq20 use crystal", ACTION_RAID) })); } diff --git a/src/strategy/raids/aq20/RaidAq20Strategy.h b/src/Ai/Raid/Aq20/Strategy/RaidAq20Strategy.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Strategy.h rename to src/Ai/Raid/Aq20/Strategy/RaidAq20Strategy.h diff --git a/src/strategy/raids/aq20/RaidAq20Triggers.cpp b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Triggers.cpp rename to src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.cpp diff --git a/src/strategy/raids/aq20/RaidAq20Triggers.h b/src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Triggers.h rename to src/Ai/Raid/Aq20/Trigger/RaidAq20Triggers.h diff --git a/src/strategy/raids/aq20/RaidAq20Utils.cpp b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Utils.cpp rename to src/Ai/Raid/Aq20/Util/RaidAq20Utils.cpp diff --git a/src/strategy/raids/aq20/RaidAq20Utils.h b/src/Ai/Raid/Aq20/Util/RaidAq20Utils.h similarity index 100% rename from src/strategy/raids/aq20/RaidAq20Utils.h rename to src/Ai/Raid/Aq20/Util/RaidAq20Utils.h diff --git a/src/strategy/raids/blackwinglair/RaidBwlActions.cpp b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlActions.cpp rename to src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.cpp diff --git a/src/strategy/raids/blackwinglair/RaidBwlActions.h b/src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlActions.h rename to src/Ai/Raid/BlackwingLair/Action/RaidBwlActions.h diff --git a/src/strategy/raids/blackwinglair/RaidBwlActionContext.h b/src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlActionContext.h rename to src/Ai/Raid/BlackwingLair/RaidBwlActionContext.h diff --git a/src/strategy/raids/blackwinglair/RaidBwlTriggerContext.h b/src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlTriggerContext.h rename to src/Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h diff --git a/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp b/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp new file mode 100644 index 0000000000..c65a80ecba --- /dev/null +++ b/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.cpp @@ -0,0 +1,15 @@ +#include "RaidBwlStrategy.h" + +#include "Strategy.h" + +void RaidBwlStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("often", + { NextAction("bwl check onyxia scale cloak", ACTION_RAID) })); + + triggers.push_back(new TriggerNode("bwl suppression device", + { NextAction("bwl turn off suppression device", ACTION_RAID) })); + + triggers.push_back(new TriggerNode("bwl affliction bronze", + { NextAction("bwl use hourglass sand", ACTION_RAID) })); +} diff --git a/src/strategy/raids/blackwinglair/RaidBwlStrategy.h b/src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.h similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlStrategy.h rename to src/Ai/Raid/BlackwingLair/Strategy/RaidBwlStrategy.h diff --git a/src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp rename to src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.cpp diff --git a/src/strategy/raids/blackwinglair/RaidBwlTriggers.h b/src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h similarity index 100% rename from src/strategy/raids/blackwinglair/RaidBwlTriggers.h rename to src/Ai/Raid/BlackwingLair/Trigger/RaidBwlTriggers.h diff --git a/src/strategy/raids/eyeofeternity/RaidEoEActions.cpp b/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEActions.cpp rename to src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.cpp diff --git a/src/strategy/raids/eyeofeternity/RaidEoEActions.h b/src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEActions.h rename to src/Ai/Raid/EyeOfEternity/Action/RaidEoEActions.h diff --git a/src/strategy/raids/eyeofeternity/RaidEoEMultipliers.cpp b/src/Ai/Raid/EyeOfEternity/Multiplier/RaidEoEMultipliers.cpp similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEMultipliers.cpp rename to src/Ai/Raid/EyeOfEternity/Multiplier/RaidEoEMultipliers.cpp diff --git a/src/strategy/raids/eyeofeternity/RaidEoEMultipliers.h b/src/Ai/Raid/EyeOfEternity/Multiplier/RaidEoEMultipliers.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEMultipliers.h rename to src/Ai/Raid/EyeOfEternity/Multiplier/RaidEoEMultipliers.h diff --git a/src/strategy/raids/eyeofeternity/RaidEoEActionContext.h b/src/Ai/Raid/EyeOfEternity/RaidEoEActionContext.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEActionContext.h rename to src/Ai/Raid/EyeOfEternity/RaidEoEActionContext.h diff --git a/src/strategy/raids/eyeofeternity/RaidEoETriggerContext.h b/src/Ai/Raid/EyeOfEternity/RaidEoETriggerContext.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoETriggerContext.h rename to src/Ai/Raid/EyeOfEternity/RaidEoETriggerContext.h diff --git a/src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.cpp b/src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.cpp new file mode 100644 index 0000000000..3c0ff7ffd8 --- /dev/null +++ b/src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.cpp @@ -0,0 +1,21 @@ +#include "RaidEoEStrategy.h" +#include "RaidEoEMultipliers.h" +#include "Strategy.h" + +void RaidEoEStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("malygos", + { NextAction("malygos position", ACTION_MOVE) })); + triggers.push_back(new TriggerNode("malygos", + { NextAction("malygos target", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("group flying", + { NextAction("eoe fly drake", ACTION_NORMAL + 1) })); + triggers.push_back(new TriggerNode("drake combat", + { NextAction("eoe drake attack", ACTION_NORMAL + 5) })); +} + +void RaidEoEStrategy::InitMultipliers(std::vector &multipliers) +{ + multipliers.push_back(new MalygosMultiplier(botAI)); +} diff --git a/src/strategy/raids/eyeofeternity/RaidEoEStrategy.h b/src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoEStrategy.h rename to src/Ai/Raid/EyeOfEternity/Strategy/RaidEoEStrategy.h diff --git a/src/strategy/raids/eyeofeternity/RaidEoETriggers.cpp b/src/Ai/Raid/EyeOfEternity/Trigger/RaidEoETriggers.cpp similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoETriggers.cpp rename to src/Ai/Raid/EyeOfEternity/Trigger/RaidEoETriggers.cpp diff --git a/src/strategy/raids/eyeofeternity/RaidEoETriggers.h b/src/Ai/Raid/EyeOfEternity/Trigger/RaidEoETriggers.h similarity index 100% rename from src/strategy/raids/eyeofeternity/RaidEoETriggers.h rename to src/Ai/Raid/EyeOfEternity/Trigger/RaidEoETriggers.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairActions.cpp b/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairActions.cpp rename to src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.cpp diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairActions.h b/src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairActions.h rename to src/Ai/Raid/GruulsLair/Action/RaidGruulsLairActions.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairMultipliers.cpp b/src/Ai/Raid/GruulsLair/Multiplier/RaidGruulsLairMultipliers.cpp similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairMultipliers.cpp rename to src/Ai/Raid/GruulsLair/Multiplier/RaidGruulsLairMultipliers.cpp diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairMultipliers.h b/src/Ai/Raid/GruulsLair/Multiplier/RaidGruulsLairMultipliers.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairMultipliers.h rename to src/Ai/Raid/GruulsLair/Multiplier/RaidGruulsLairMultipliers.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairActionContext.h b/src/Ai/Raid/GruulsLair/RaidGruulsLairActionContext.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairActionContext.h rename to src/Ai/Raid/GruulsLair/RaidGruulsLairActionContext.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairTriggerContext.h b/src/Ai/Raid/GruulsLair/RaidGruulsLairTriggerContext.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairTriggerContext.h rename to src/Ai/Raid/GruulsLair/RaidGruulsLairTriggerContext.h diff --git a/src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.cpp b/src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.cpp new file mode 100644 index 0000000000..9ec264ea00 --- /dev/null +++ b/src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.cpp @@ -0,0 +1,56 @@ +#include "RaidGruulsLairStrategy.h" +#include "RaidGruulsLairMultipliers.h" + +void RaidGruulsLairStrategy::InitTriggers(std::vector& triggers) +{ + // High King Maulgar + triggers.push_back(new TriggerNode("high king maulgar is main tank", { + NextAction("high king maulgar main tank attack maulgar", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar is first assist tank", { + NextAction("high king maulgar first assist tank attack olm", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar is second assist tank", { + NextAction("high king maulgar second assist tank attack blindeye", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar is mage tank", { + NextAction("high king maulgar mage tank attack krosh", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar is moonkin tank", { + NextAction("high king maulgar moonkin tank attack kiggler", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar determining kill order", { + NextAction("high king maulgar assign dps priority", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar healer in danger", { + NextAction("high king maulgar healer find safe position", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("high king maulgar boss channeling whirlwind", { + NextAction("high king maulgar run away from whirlwind", ACTION_EMERGENCY + 6) })); + + triggers.push_back(new TriggerNode("high king maulgar wild felstalker spawned", { + NextAction("high king maulgar banish felstalker", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("high king maulgar pulling olm and blindeye", { + NextAction("high king maulgar misdirect olm and blindeye", ACTION_RAID + 2) })); + + // Gruul the Dragonkiller + triggers.push_back(new TriggerNode("gruul the dragonkiller boss engaged by main tank", { + NextAction("gruul the dragonkiller main tank position boss", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("gruul the dragonkiller boss engaged by range", { + NextAction("gruul the dragonkiller spread ranged", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("gruul the dragonkiller incoming shatter", { + NextAction("gruul the dragonkiller shatter spread", ACTION_EMERGENCY + 6) })); +} + +void RaidGruulsLairStrategy::InitMultipliers(std::vector& multipliers) +{ + multipliers.push_back(new HighKingMaulgarDisableTankAssistMultiplier(botAI)); + multipliers.push_back(new HighKingMaulgarAvoidWhirlwindMultiplier(botAI)); + multipliers.push_back(new HighKingMaulgarDisableArcaneShotOnKroshMultiplier(botAI)); + multipliers.push_back(new HighKingMaulgarDisableMageTankAOEMultiplier(botAI)); + multipliers.push_back(new GruulTheDragonkillerMainTankMovementMultiplier(botAI)); + multipliers.push_back(new GruulTheDragonkillerGroundSlamMultiplier(botAI)); +} diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairStrategy.h b/src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairStrategy.h rename to src/Ai/Raid/GruulsLair/Strategy/RaidGruulsLairStrategy.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairTriggers.cpp b/src/Ai/Raid/GruulsLair/Trigger/RaidGruulsLairTriggers.cpp similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairTriggers.cpp rename to src/Ai/Raid/GruulsLair/Trigger/RaidGruulsLairTriggers.cpp diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairTriggers.h b/src/Ai/Raid/GruulsLair/Trigger/RaidGruulsLairTriggers.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairTriggers.h rename to src/Ai/Raid/GruulsLair/Trigger/RaidGruulsLairTriggers.h diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairHelpers.cpp b/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairHelpers.cpp rename to src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.cpp diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairHelpers.h b/src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.h similarity index 100% rename from src/strategy/raids/gruulslair/RaidGruulsLairHelpers.h rename to src/Ai/Raid/GruulsLair/Util/RaidGruulsLairHelpers.h diff --git a/src/strategy/raids/icecrown/RaidIccActions.cpp b/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp similarity index 99% rename from src/strategy/raids/icecrown/RaidIccActions.cpp rename to src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp index 4f763ecb95..14c8ada9ac 100644 --- a/src/strategy/raids/icecrown/RaidIccActions.cpp +++ b/src/Ai/Raid/Icecrown/Action/RaidIccActions.cpp @@ -1,5 +1,5 @@ #include "RaidIccActions.h" -#include "strategy/values/NearestNpcsValue.h" +#include "NearestNpcsValue.h" #include "ObjectAccessor.h" #include "RaidIccStrategy.h" #include "Playerbots.h" diff --git a/src/strategy/raids/icecrown/RaidIccActions.h b/src/Ai/Raid/Icecrown/Action/RaidIccActions.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccActions.h rename to src/Ai/Raid/Icecrown/Action/RaidIccActions.h diff --git a/src/strategy/raids/icecrown/RaidIccMultipliers.cpp b/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp similarity index 100% rename from src/strategy/raids/icecrown/RaidIccMultipliers.cpp rename to src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.cpp diff --git a/src/strategy/raids/icecrown/RaidIccMultipliers.h b/src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccMultipliers.h rename to src/Ai/Raid/Icecrown/Multiplier/RaidIccMultipliers.h diff --git a/src/strategy/raids/icecrown/RaidIccActionContext.h b/src/Ai/Raid/Icecrown/RaidIccActionContext.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccActionContext.h rename to src/Ai/Raid/Icecrown/RaidIccActionContext.h diff --git a/src/strategy/raids/icecrown/RaidIccScripts.h b/src/Ai/Raid/Icecrown/RaidIccScripts.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccScripts.h rename to src/Ai/Raid/Icecrown/RaidIccScripts.h diff --git a/src/strategy/raids/icecrown/RaidIccTriggerContext.h b/src/Ai/Raid/Icecrown/RaidIccTriggerContext.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccTriggerContext.h rename to src/Ai/Raid/Icecrown/RaidIccTriggerContext.h diff --git a/src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.cpp b/src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.cpp new file mode 100644 index 0000000000..e0dbe82306 --- /dev/null +++ b/src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.cpp @@ -0,0 +1,186 @@ +#include "RaidIccStrategy.h" + +#include "RaidIccMultipliers.h" + +void RaidIccStrategy::InitTriggers(std::vector& triggers) +{ + //Lord Marrogwar + triggers.push_back(new TriggerNode("icc lm", + { NextAction("icc lm tank position", ACTION_RAID + 5), + NextAction("icc spike", ACTION_RAID + 3) })); + + //Lady Deathwhisper + triggers.push_back(new TriggerNode("icc dark reckoning", + { NextAction("icc dark reckoning", ACTION_MOVE + 5) })); + + triggers.push_back(new TriggerNode("icc lady deathwhisper", + { NextAction("icc ranged position lady deathwhisper", ACTION_MOVE + 2), + NextAction("icc adds lady deathwhisper", ACTION_RAID + 3), + NextAction("icc shade lady deathwhisper", ACTION_RAID + 4) })); + + //Gunship Battle + triggers.push_back(new TriggerNode("icc rotting frost giant tank position", + { NextAction("icc rotting frost giant tank position", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc gunship cannon near", + { NextAction("icc gunship enter cannon", ACTION_RAID + 6) })); + + triggers.push_back( new TriggerNode("icc in cannon", + { NextAction("icc cannon fire", ACTION_RAID+5) })); + + triggers.push_back(new TriggerNode("icc gunship teleport ally", + { NextAction("icc gunship teleport ally", ACTION_RAID + 4) })); + + triggers.push_back(new TriggerNode("icc gunship teleport horde", + { NextAction("icc gunship teleport horde", ACTION_RAID + 4) })); + + //DBS + triggers.push_back(new TriggerNode("icc dbs", + { NextAction("icc dbs tank position", ACTION_RAID + 3), + NextAction("icc adds dbs", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc dbs main tank rune of blood", + { NextAction("taunt spell", ACTION_EMERGENCY + 4) })); + + //DOGS + triggers.push_back(new TriggerNode("icc stinky precious main tank mortal wound", + { NextAction("taunt spell", ACTION_EMERGENCY + 4) })); + + //FESTERGUT + triggers.push_back(new TriggerNode("icc festergut group position", + { NextAction("icc festergut group position", ACTION_MOVE + 4) })); + + triggers.push_back(new TriggerNode("icc festergut main tank gastric bloat", + { NextAction("taunt spell", ACTION_EMERGENCY + 6) })); + + triggers.push_back(new TriggerNode("icc festergut spore", + { NextAction("icc festergut spore", ACTION_MOVE + 5) })); + + //ROTFACE + triggers.push_back(new TriggerNode("icc rotface tank position", + { NextAction("icc rotface tank position", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc rotface group position", + { NextAction("icc rotface group position", ACTION_RAID + 6) })); + + triggers.push_back(new TriggerNode("icc rotface move away from explosion", + { NextAction("icc rotface move away from explosion", ACTION_RAID +7) })); + + //PP + triggers.push_back(new TriggerNode("icc putricide volatile ooze", + { NextAction("icc putricide volatile ooze", ACTION_RAID + 4) })); + + triggers.push_back(new TriggerNode("icc putricide gas cloud", + { NextAction("icc putricide gas cloud", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc putricide growing ooze puddle", + { NextAction("icc putricide growing ooze puddle", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode("icc putricide main tank mutated plague", + { NextAction("taunt spell", ACTION_RAID + 10) })); + + triggers.push_back(new TriggerNode("icc putricide malleable goo", + { NextAction("icc putricide avoid malleable goo", ACTION_RAID + 2) })); + + //BPC + triggers.push_back(new TriggerNode("icc bpc keleseth tank", + { NextAction("icc bpc keleseth tank", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("icc bpc main tank", + { NextAction("icc bpc main tank", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode("icc bpc empowered vortex", + { NextAction("icc bpc empowered vortex", ACTION_RAID + 4) })); + + triggers.push_back(new TriggerNode("icc bpc kinetic bomb", + { NextAction("icc bpc kinetic bomb", ACTION_RAID + 6) })); + + triggers.push_back(new TriggerNode("icc bpc ball of flame", + { NextAction("icc bpc ball of flame", ACTION_RAID + 7) })); + + //BQL + triggers.push_back(new TriggerNode("icc bql group position", + { NextAction("icc bql group position", ACTION_RAID) })); + + triggers.push_back(new TriggerNode("icc bql pact of darkfallen", + { NextAction("icc bql pact of darkfallen", ACTION_RAID +1) })); + + triggers.push_back(new TriggerNode("icc bql vampiric bite", + { NextAction("icc bql vampiric bite", ACTION_EMERGENCY + 5) })); + + //Sister Svalna + triggers.push_back(new TriggerNode("icc valkyre spear", + { NextAction("icc valkyre spear", ACTION_EMERGENCY + 5) })); + + triggers.push_back(new TriggerNode("icc sister svalna", + { NextAction("icc sister svalna", ACTION_RAID + 5) })); + + //VDW + triggers.push_back(new TriggerNode("icc valithria group", + { NextAction("icc valithria group", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("icc valithria portal", + { NextAction("icc valithria portal", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc valithria heal", + { NextAction("icc valithria heal", ACTION_RAID+2) })); + + triggers.push_back(new TriggerNode("icc valithria dream cloud", + { NextAction("icc valithria dream cloud", ACTION_RAID + 4) })); + + //SINDRAGOSA + triggers.push_back(new TriggerNode("icc sindragosa group position", + { NextAction("icc sindragosa group position", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("icc sindragosa frost beacon", + { NextAction("icc sindragosa frost beacon", ACTION_RAID + 5) })); + + triggers.push_back(new TriggerNode("icc sindragosa blistering cold", + { NextAction("icc sindragosa blistering cold", ACTION_EMERGENCY + 4) })); + + triggers.push_back(new TriggerNode("icc sindragosa unchained magic", + { NextAction("icc sindragosa unchained magic", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("icc sindragosa chilled to the bone", + { NextAction("icc sindragosa chilled to the bone", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("icc sindragosa mystic buffet", + { NextAction("icc sindragosa mystic buffet", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode("icc sindragosa main tank mystic buffet", + { NextAction("taunt spell", ACTION_EMERGENCY + 3) })); + + triggers.push_back(new TriggerNode("icc sindragosa frost bomb", + { NextAction("icc sindragosa frost bomb", ACTION_RAID + 7) })); + + triggers.push_back(new TriggerNode("icc sindragosa tank swap position", + { NextAction("icc sindragosa tank swap position", ACTION_EMERGENCY + 2) })); + + //LICH KING + triggers.push_back(new TriggerNode("icc lich king shadow trap", + { NextAction("icc lich king shadow trap", ACTION_RAID + 6) })); + + triggers.push_back(new TriggerNode("icc lich king necrotic plague", + { NextAction("icc lich king necrotic plague", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode("icc lich king winter", + { NextAction("icc lich king winter", ACTION_RAID +5) })); + + triggers.push_back(new TriggerNode("icc lich king adds", + { NextAction("icc lich king adds", ACTION_RAID +2) })); +} + +void RaidIccStrategy::InitMultipliers(std::vector& multipliers) +{ + multipliers.push_back(new IccLadyDeathwhisperMultiplier(botAI)); + multipliers.push_back(new IccAddsDbsMultiplier(botAI)); + multipliers.push_back(new IccDogsMultiplier(botAI)); + multipliers.push_back(new IccFestergutMultiplier(botAI)); + multipliers.push_back(new IccRotfaceMultiplier(botAI)); + multipliers.push_back(new IccAddsPutricideMultiplier(botAI)); + multipliers.push_back(new IccBpcAssistMultiplier(botAI)); + multipliers.push_back(new IccBqlMultiplier(botAI)); + multipliers.push_back(new IccValithriaDreamCloudMultiplier(botAI)); + multipliers.push_back(new IccSindragosaMultiplier(botAI)); + multipliers.push_back(new IccLichKingAddsMultiplier(botAI)); +} diff --git a/src/strategy/raids/icecrown/RaidIccStrategy.h b/src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccStrategy.h rename to src/Ai/Raid/Icecrown/Strategy/RaidIccStrategy.h diff --git a/src/strategy/raids/icecrown/RaidIccTriggers.cpp b/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp similarity index 99% rename from src/strategy/raids/icecrown/RaidIccTriggers.cpp rename to src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp index 44a2008b1b..b9ebb8ca8d 100644 --- a/src/strategy/raids/icecrown/RaidIccTriggers.cpp +++ b/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.cpp @@ -1,6 +1,6 @@ #include "RaidIccTriggers.h" #include "RaidIccActions.h" -#include "strategy/values/NearestNpcsValue.h" +#include "NearestNpcsValue.h" #include "PlayerbotAIConfig.h" #include "ObjectAccessor.h" #include "GenericTriggers.h" @@ -99,7 +99,10 @@ bool IccGunshipCannonNearTrigger::IsActive() bool IccGunshipTeleportAllyTrigger::IsActive() { Unit* boss = bot->FindNearestCreature(NPC_HIGH_OVERLORD_SAURFANG, 100.0f); - if (!boss) + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; + + if (!boss->IsAlive()) return false; if (!boss->IsHostileTo(bot)) @@ -111,7 +114,10 @@ bool IccGunshipTeleportAllyTrigger::IsActive() bool IccGunshipTeleportHordeTrigger::IsActive() { Unit* boss = bot->FindNearestCreature(NPC_MURADIN_BRONZEBEARD, 100.0f); - if (!boss) + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; + + if (!boss->IsAlive()) return false; if (!boss->IsHostileTo(bot)) diff --git a/src/strategy/raids/icecrown/RaidIccTriggers.h b/src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.h similarity index 100% rename from src/strategy/raids/icecrown/RaidIccTriggers.h rename to src/Ai/Raid/Icecrown/Trigger/RaidIccTriggers.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanActions.cpp b/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanActions.cpp rename to src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.cpp diff --git a/src/strategy/raids/karazhan/RaidKarazhanActions.h b/src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanActions.h rename to src/Ai/Raid/Karazhan/Action/RaidKarazhanActions.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanMultipliers.cpp b/src/Ai/Raid/Karazhan/Multiplier/RaidKarazhanMultipliers.cpp similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanMultipliers.cpp rename to src/Ai/Raid/Karazhan/Multiplier/RaidKarazhanMultipliers.cpp diff --git a/src/strategy/raids/karazhan/RaidKarazhanMultipliers.h b/src/Ai/Raid/Karazhan/Multiplier/RaidKarazhanMultipliers.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanMultipliers.h rename to src/Ai/Raid/Karazhan/Multiplier/RaidKarazhanMultipliers.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanActionContext.h b/src/Ai/Raid/Karazhan/RaidKarazhanActionContext.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanActionContext.h rename to src/Ai/Raid/Karazhan/RaidKarazhanActionContext.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanTriggerContext.h b/src/Ai/Raid/Karazhan/RaidKarazhanTriggerContext.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanTriggerContext.h rename to src/Ai/Raid/Karazhan/RaidKarazhanTriggerContext.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanStrategy.cpp b/src/Ai/Raid/Karazhan/Strategy/RaidKarazhanStrategy.cpp similarity index 55% rename from src/strategy/raids/karazhan/RaidKarazhanStrategy.cpp rename to src/Ai/Raid/Karazhan/Strategy/RaidKarazhanStrategy.cpp index 041651afd4..04578f0839 100644 --- a/src/strategy/raids/karazhan/RaidKarazhanStrategy.cpp +++ b/src/Ai/Raid/Karazhan/Strategy/RaidKarazhanStrategy.cpp @@ -5,139 +5,139 @@ void RaidKarazhanStrategy::InitTriggers(std::vector& triggers) { // Trash triggers.push_back(new TriggerNode("mana warp is about to explode", - NextAction::array(0, new NextAction("mana warp stun creature before warp breach", ACTION_EMERGENCY + 6), nullptr) + { NextAction("mana warp stun creature before warp breach", ACTION_EMERGENCY + 6) } )); // Attumen the Huntsman triggers.push_back(new TriggerNode("attumen the huntsman need target priority", - NextAction::array(0, new NextAction("attumen the huntsman mark target", ACTION_RAID + 1), nullptr) + { NextAction("attumen the huntsman mark target", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("attumen the huntsman attumen spawned", - NextAction::array(0, new NextAction("attumen the huntsman split bosses", ACTION_RAID + 2), nullptr) + { NextAction("attumen the huntsman split bosses", ACTION_RAID + 2) } )); triggers.push_back(new TriggerNode("attumen the huntsman attumen is mounted", - NextAction::array(0, new NextAction("attumen the huntsman stack behind", ACTION_RAID + 1), nullptr) + { NextAction("attumen the huntsman stack behind", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("attumen the huntsman boss wipes aggro when mounting", - NextAction::array(0, new NextAction("attumen the huntsman manage dps timer", ACTION_RAID + 2), nullptr) + { NextAction("attumen the huntsman manage dps timer", ACTION_RAID + 2) } )); // Moroes triggers.push_back(new TriggerNode("moroes boss engaged by main tank", - NextAction::array(0, new NextAction("moroes main tank attack boss", ACTION_RAID + 1), nullptr) + { NextAction("moroes main tank attack boss", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("moroes need target priority", - NextAction::array(0, new NextAction("moroes mark target", ACTION_RAID + 1), nullptr) + { NextAction("moroes mark target", ACTION_RAID + 1) } )); // Maiden of Virtue triggers.push_back(new TriggerNode("maiden of virtue healers are stunned by repentance", - NextAction::array(0, new NextAction("maiden of virtue move boss to healer", ACTION_RAID + 1), nullptr) + { NextAction("maiden of virtue move boss to healer", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("maiden of virtue holy wrath deals chain damage", - NextAction::array(0, new NextAction("maiden of virtue position ranged", ACTION_RAID + 1), nullptr) + { NextAction("maiden of virtue position ranged", ACTION_RAID + 1) } )); // The Big Bad Wolf triggers.push_back(new TriggerNode("big bad wolf boss is chasing little red riding hood", - NextAction::array(0, new NextAction("big bad wolf run away from boss", ACTION_EMERGENCY + 6), nullptr) + { NextAction("big bad wolf run away from boss", ACTION_EMERGENCY + 6) } )); triggers.push_back(new TriggerNode("big bad wolf boss engaged by tank", - NextAction::array(0, new NextAction("big bad wolf position boss", ACTION_RAID + 1), nullptr) + { NextAction("big bad wolf position boss", ACTION_RAID + 1) } )); // Romulo and Julianne triggers.push_back(new TriggerNode("romulo and julianne both bosses revived", - NextAction::array(0, new NextAction("romulo and julianne mark target", ACTION_RAID + 1), nullptr) + { NextAction("romulo and julianne mark target", ACTION_RAID + 1) } )); // The Wizard of Oz triggers.push_back(new TriggerNode("wizard of oz need target priority", - NextAction::array(0, new NextAction("wizard of oz mark target", ACTION_RAID + 1), nullptr) + { NextAction("wizard of oz mark target", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("wizard of oz strawman is vulnerable to fire", - NextAction::array(0, new NextAction("wizard of oz scorch strawman", ACTION_RAID + 2), nullptr) + { NextAction("wizard of oz scorch strawman", ACTION_RAID + 2) } )); // The Curator triggers.push_back(new TriggerNode("the curator astral flare spawned", - NextAction::array(0, new NextAction("the curator mark astral flare", ACTION_RAID + 1), nullptr) + { NextAction("the curator mark astral flare", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("the curator boss engaged by tanks", - NextAction::array(0, new NextAction("the curator position boss", ACTION_RAID + 2), nullptr) + { NextAction("the curator position boss", ACTION_RAID + 2) } )); triggers.push_back(new TriggerNode("the curator astral flares cast arcing sear", - NextAction::array(0, new NextAction("the curator spread ranged", ACTION_RAID + 2), nullptr) + { NextAction("the curator spread ranged", ACTION_RAID + 2) } )); // Terestian Illhoof triggers.push_back(new TriggerNode("terestian illhoof need target priority", - NextAction::array(0, new NextAction("terestian illhoof mark target", ACTION_RAID + 1), nullptr) + { NextAction("terestian illhoof mark target", ACTION_RAID + 1) } )); // Shade of Aran triggers.push_back(new TriggerNode("shade of aran arcane explosion is casting", - NextAction::array(0, new NextAction("shade of aran run away from arcane explosion", ACTION_EMERGENCY + 6), nullptr) + { NextAction("shade of aran run away from arcane explosion", ACTION_EMERGENCY + 6) } )); triggers.push_back(new TriggerNode("shade of aran flame wreath is active", - NextAction::array(0, new NextAction("shade of aran stop moving during flame wreath", ACTION_EMERGENCY + 7), nullptr) + { NextAction("shade of aran stop moving during flame wreath", ACTION_EMERGENCY + 7) } )); triggers.push_back(new TriggerNode("shade of aran conjured elementals summoned", - NextAction::array(0, new NextAction("shade of aran mark conjured elemental", ACTION_RAID + 1), nullptr) + { NextAction("shade of aran mark conjured elemental", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("shade of aran boss uses counterspell and blizzard", - NextAction::array(0, new NextAction("shade of aran ranged maintain distance", ACTION_RAID + 2), nullptr) + { NextAction("shade of aran ranged maintain distance", ACTION_RAID + 2) } )); // Netherspite triggers.push_back(new TriggerNode("netherspite red beam is active", - NextAction::array(0, new NextAction("netherspite block red beam", ACTION_EMERGENCY + 8), nullptr) + { NextAction("netherspite block red beam", ACTION_EMERGENCY + 8) } )); triggers.push_back(new TriggerNode("netherspite blue beam is active", - NextAction::array(0, new NextAction("netherspite block blue beam", ACTION_EMERGENCY + 8), nullptr) + { NextAction("netherspite block blue beam", ACTION_EMERGENCY + 8) } )); triggers.push_back(new TriggerNode("netherspite green beam is active", - NextAction::array(0, new NextAction("netherspite block green beam", ACTION_EMERGENCY + 8), nullptr) + { NextAction("netherspite block green beam", ACTION_EMERGENCY + 8) } )); triggers.push_back(new TriggerNode("netherspite bot is not beam blocker", - NextAction::array(0, new NextAction("netherspite avoid beam and void zone", ACTION_EMERGENCY + 7), nullptr) + { NextAction("netherspite avoid beam and void zone", ACTION_EMERGENCY + 7) } )); triggers.push_back(new TriggerNode("netherspite boss is banished", - NextAction::array(0, new NextAction("netherspite banish phase avoid void zone", ACTION_RAID + 1), nullptr) + { NextAction("netherspite banish phase avoid void zone", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("netherspite need to manage timers and trackers", - NextAction::array(0, new NextAction("netherspite manage timers and trackers", ACTION_EMERGENCY + 10), nullptr) + { NextAction("netherspite manage timers and trackers", ACTION_EMERGENCY + 10) } )); // Prince Malchezaar triggers.push_back(new TriggerNode("prince malchezaar bot is enfeebled", - NextAction::array(0, new NextAction("prince malchezaar enfeebled avoid hazard", ACTION_EMERGENCY + 6), nullptr) + { NextAction("prince malchezaar enfeebled avoid hazard", ACTION_EMERGENCY + 6) } )); triggers.push_back(new TriggerNode("prince malchezaar infernals are spawned", - NextAction::array(0, new NextAction("prince malchezaar non tank avoid infernal", ACTION_EMERGENCY + 1), nullptr) + { NextAction("prince malchezaar non tank avoid infernal", ACTION_EMERGENCY + 1) } )); triggers.push_back(new TriggerNode("prince malchezaar boss engaged by main tank", - NextAction::array(0, new NextAction("prince malchezaar main tank movement", ACTION_EMERGENCY + 6), nullptr) + { NextAction("prince malchezaar main tank movement", ACTION_EMERGENCY + 6) } )); // Nightbane triggers.push_back(new TriggerNode("nightbane boss engaged by main tank", - NextAction::array(0, new NextAction("nightbane ground phase position boss", ACTION_RAID + 1), nullptr) + { NextAction("nightbane ground phase position boss", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("nightbane ranged bots are in charred earth", - NextAction::array(0, new NextAction("nightbane ground phase rotate ranged positions", ACTION_EMERGENCY + 1), nullptr) + { NextAction("nightbane ground phase rotate ranged positions", ACTION_EMERGENCY + 1) } )); triggers.push_back(new TriggerNode("nightbane main tank is susceptible to fear", - NextAction::array(0, new NextAction("nightbane cast fear ward on main tank", ACTION_RAID + 2), nullptr) + { NextAction("nightbane cast fear ward on main tank", ACTION_RAID + 2) } )); triggers.push_back(new TriggerNode("nightbane pets ignore collision to chase flying boss", - NextAction::array(0, new NextAction("nightbane control pet aggression", ACTION_RAID + 2), nullptr) + { NextAction("nightbane control pet aggression", ACTION_RAID + 2) } )); triggers.push_back(new TriggerNode("nightbane boss is flying", - NextAction::array(0, new NextAction("nightbane flight phase movement", ACTION_RAID + 1), nullptr) + { NextAction("nightbane flight phase movement", ACTION_RAID + 1) } )); triggers.push_back(new TriggerNode("nightbane need to manage timers and trackers", - NextAction::array(0, new NextAction("nightbane manage timers and trackers", ACTION_EMERGENCY + 10), nullptr) + { NextAction("nightbane manage timers and trackers", ACTION_EMERGENCY + 10) } )); } diff --git a/src/strategy/raids/karazhan/RaidKarazhanStrategy.h b/src/Ai/Raid/Karazhan/Strategy/RaidKarazhanStrategy.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanStrategy.h rename to src/Ai/Raid/Karazhan/Strategy/RaidKarazhanStrategy.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanTriggers.cpp b/src/Ai/Raid/Karazhan/Trigger/RaidKarazhanTriggers.cpp similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanTriggers.cpp rename to src/Ai/Raid/Karazhan/Trigger/RaidKarazhanTriggers.cpp diff --git a/src/strategy/raids/karazhan/RaidKarazhanTriggers.h b/src/Ai/Raid/Karazhan/Trigger/RaidKarazhanTriggers.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanTriggers.h rename to src/Ai/Raid/Karazhan/Trigger/RaidKarazhanTriggers.h diff --git a/src/strategy/raids/karazhan/RaidKarazhanHelpers.cpp b/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanHelpers.cpp rename to src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.cpp diff --git a/src/strategy/raids/karazhan/RaidKarazhanHelpers.h b/src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.h similarity index 100% rename from src/strategy/raids/karazhan/RaidKarazhanHelpers.h rename to src/Ai/Raid/Karazhan/Util/RaidKarazhanHelpers.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonActions.cpp b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonActions.cpp rename to src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.cpp diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonActions.h b/src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonActions.h rename to src/Ai/Raid/Magtheridon/Action/RaidMagtheridonActions.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonMultipliers.cpp b/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonMultipliers.cpp rename to src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.cpp diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonMultipliers.h b/src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonMultipliers.h rename to src/Ai/Raid/Magtheridon/Multiplier/RaidMagtheridonMultipliers.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonActionContext.h b/src/Ai/Raid/Magtheridon/RaidMagtheridonActionContext.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonActionContext.h rename to src/Ai/Raid/Magtheridon/RaidMagtheridonActionContext.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonTriggerContext.h b/src/Ai/Raid/Magtheridon/RaidMagtheridonTriggerContext.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonTriggerContext.h rename to src/Ai/Raid/Magtheridon/RaidMagtheridonTriggerContext.h diff --git a/src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.cpp b/src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.cpp new file mode 100644 index 0000000000..73d240825f --- /dev/null +++ b/src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.cpp @@ -0,0 +1,42 @@ +#include "RaidMagtheridonStrategy.h" +#include "RaidMagtheridonMultipliers.h" + +void RaidMagtheridonStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back(new TriggerNode("magtheridon incoming blast nova", { + NextAction("magtheridon use manticron cube", ACTION_EMERGENCY + 10) })); + + triggers.push_back(new TriggerNode("magtheridon need to manage timers and assignments", { + NextAction("magtheridon manage timers and assignments", ACTION_EMERGENCY + 1) })); + + triggers.push_back(new TriggerNode("magtheridon burning abyssal spawned", { + NextAction("magtheridon warlock cc burning abyssal", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode("magtheridon boss engaged by ranged", { + NextAction("magtheridon spread ranged", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("magtheridon pulling west and east channelers", { + NextAction("magtheridon misdirect hellfire channelers", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("magtheridon boss engaged by main tank", { + NextAction("magtheridon main tank position boss", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode("magtheridon first three channelers engaged by main tank", { + NextAction("magtheridon main tank attack first three channelers", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("magtheridon nw channeler engaged by first assist tank", { + NextAction("magtheridon first assist tank attack nw channeler", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("magtheridon ne channeler engaged by second assist tank", { + NextAction("magtheridon second assist tank attack ne channeler", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode("magtheridon determining kill order", { + NextAction("magtheridon assign dps priority", ACTION_RAID + 1) })); +} + +void RaidMagtheridonStrategy::InitMultipliers(std::vector& multipliers) +{ + multipliers.push_back(new MagtheridonUseManticronCubeMultiplier(botAI)); + multipliers.push_back(new MagtheridonWaitToAttackMultiplier(botAI)); + multipliers.push_back(new MagtheridonDisableOffTankAssistMultiplier(botAI)); +} diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonStrategy.h b/src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonStrategy.h rename to src/Ai/Raid/Magtheridon/Strategy/RaidMagtheridonStrategy.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonTriggers.cpp b/src/Ai/Raid/Magtheridon/Trigger/RaidMagtheridonTriggers.cpp similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonTriggers.cpp rename to src/Ai/Raid/Magtheridon/Trigger/RaidMagtheridonTriggers.cpp diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonTriggers.h b/src/Ai/Raid/Magtheridon/Trigger/RaidMagtheridonTriggers.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonTriggers.h rename to src/Ai/Raid/Magtheridon/Trigger/RaidMagtheridonTriggers.h diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonHelpers.cpp b/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonHelpers.cpp rename to src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.cpp diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonHelpers.h b/src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.h similarity index 100% rename from src/strategy/raids/magtheridon/RaidMagtheridonHelpers.h rename to src/Ai/Raid/Magtheridon/Util/RaidMagtheridonHelpers.h diff --git a/src/strategy/raids/moltencore/RaidMcActions.cpp b/src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp similarity index 100% rename from src/strategy/raids/moltencore/RaidMcActions.cpp rename to src/Ai/Raid/MoltenCore/Action/RaidMcActions.cpp diff --git a/src/strategy/raids/moltencore/RaidMcActions.h b/src/Ai/Raid/MoltenCore/Action/RaidMcActions.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcActions.h rename to src/Ai/Raid/MoltenCore/Action/RaidMcActions.h diff --git a/src/strategy/raids/moltencore/RaidMcMultipliers.cpp b/src/Ai/Raid/MoltenCore/Multiplier/RaidMcMultipliers.cpp similarity index 100% rename from src/strategy/raids/moltencore/RaidMcMultipliers.cpp rename to src/Ai/Raid/MoltenCore/Multiplier/RaidMcMultipliers.cpp diff --git a/src/strategy/raids/moltencore/RaidMcMultipliers.h b/src/Ai/Raid/MoltenCore/Multiplier/RaidMcMultipliers.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcMultipliers.h rename to src/Ai/Raid/MoltenCore/Multiplier/RaidMcMultipliers.h diff --git a/src/strategy/raids/moltencore/RaidMcActionContext.h b/src/Ai/Raid/MoltenCore/RaidMcActionContext.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcActionContext.h rename to src/Ai/Raid/MoltenCore/RaidMcActionContext.h diff --git a/src/strategy/raids/moltencore/RaidMcHelpers.h b/src/Ai/Raid/MoltenCore/RaidMcHelpers.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcHelpers.h rename to src/Ai/Raid/MoltenCore/RaidMcHelpers.h diff --git a/src/strategy/raids/moltencore/RaidMcTriggerContext.h b/src/Ai/Raid/MoltenCore/RaidMcTriggerContext.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcTriggerContext.h rename to src/Ai/Raid/MoltenCore/RaidMcTriggerContext.h diff --git a/src/strategy/raids/moltencore/RaidMcStrategy.cpp b/src/Ai/Raid/MoltenCore/Strategy/RaidMcStrategy.cpp similarity index 53% rename from src/strategy/raids/moltencore/RaidMcStrategy.cpp rename to src/Ai/Raid/MoltenCore/Strategy/RaidMcStrategy.cpp index c6a5042eb5..3eddb76a79 100644 --- a/src/strategy/raids/moltencore/RaidMcStrategy.cpp +++ b/src/Ai/Raid/MoltenCore/Strategy/RaidMcStrategy.cpp @@ -8,69 +8,69 @@ void RaidMcStrategy::InitTriggers(std::vector& triggers) // Lucifron triggers.push_back( new TriggerNode("mc lucifron shadow resistance", - NextAction::array(0, new NextAction("mc lucifron shadow resistance", ACTION_RAID), nullptr))); + { NextAction("mc lucifron shadow resistance", ACTION_RAID) })); // Magmadar // TODO: Fear ward / tremor totem, or general anti-fear strat development. Same as King Dred (Drak'Tharon) and faction commander (Nexus). triggers.push_back( new TriggerNode("mc magmadar fire resistance", - NextAction::array(0, new NextAction("mc magmadar fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc magmadar fire resistance", ACTION_RAID) })); // Gehennas triggers.push_back( new TriggerNode("mc gehennas shadow resistance", - NextAction::array(0, new NextAction("mc gehennas shadow resistance", ACTION_RAID), nullptr))); + { NextAction("mc gehennas shadow resistance", ACTION_RAID) })); // Garr triggers.push_back( new TriggerNode("mc garr fire resistance", - NextAction::array(0, new NextAction("mc garr fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc garr fire resistance", ACTION_RAID) })); // Baron Geddon triggers.push_back( new TriggerNode("mc baron geddon fire resistance", - NextAction::array(0, new NextAction("mc baron geddon fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc baron geddon fire resistance", ACTION_RAID) })); triggers.push_back( new TriggerNode("mc living bomb debuff", - NextAction::array(0, new NextAction("mc move from group", ACTION_RAID), nullptr))); + { NextAction("mc move from group", ACTION_RAID) })); triggers.push_back( new TriggerNode("mc baron geddon inferno", - NextAction::array(0, new NextAction("mc move from baron geddon", ACTION_RAID), nullptr))); + { NextAction("mc move from baron geddon", ACTION_RAID) })); // Shazzrah triggers.push_back( new TriggerNode("mc shazzrah ranged", - NextAction::array(0, new NextAction("mc shazzrah move away", ACTION_RAID), nullptr))); + { NextAction("mc shazzrah move away", ACTION_RAID) })); // Sulfuron Harbinger // Alternatively, shadow resistance is also possible. triggers.push_back( new TriggerNode("mc sulfuron harbinger fire resistance", - NextAction::array(0, new NextAction("mc sulfuron harbinger fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc sulfuron harbinger fire resistance", ACTION_RAID) })); // Golemagg the Incinerator triggers.push_back( new TriggerNode("mc golemagg fire resistance", - NextAction::array(0, new NextAction("mc golemagg fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc golemagg fire resistance", ACTION_RAID) })); triggers.push_back( new TriggerNode("mc golemagg mark boss", - NextAction::array(0, new NextAction("mc golemagg mark boss", ACTION_RAID), nullptr))); + { NextAction("mc golemagg mark boss", ACTION_RAID) })); triggers.push_back( new TriggerNode("mc golemagg is main tank", - NextAction::array(0, new NextAction("mc golemagg main tank attack golemagg", ACTION_RAID), nullptr))); + { NextAction("mc golemagg main tank attack golemagg", ACTION_RAID) })); triggers.push_back( new TriggerNode("mc golemagg is assist tank", - NextAction::array(0, new NextAction("mc golemagg assist tank attack core rager", ACTION_RAID), nullptr))); + { NextAction("mc golemagg assist tank attack core rager", ACTION_RAID) })); // Majordomo Executus triggers.push_back( new TriggerNode("mc majordomo shadow resistance", - NextAction::array(0, new NextAction("mc majordomo shadow resistance", ACTION_RAID), nullptr))); + { NextAction("mc majordomo shadow resistance", ACTION_RAID) })); // Ragnaros triggers.push_back( new TriggerNode("mc ragnaros fire resistance", - NextAction::array(0, new NextAction("mc ragnaros fire resistance", ACTION_RAID), nullptr))); + { NextAction("mc ragnaros fire resistance", ACTION_RAID) })); } void RaidMcStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/strategy/raids/moltencore/RaidMcStrategy.h b/src/Ai/Raid/MoltenCore/Strategy/RaidMcStrategy.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcStrategy.h rename to src/Ai/Raid/MoltenCore/Strategy/RaidMcStrategy.h diff --git a/src/strategy/raids/moltencore/RaidMcTriggers.cpp b/src/Ai/Raid/MoltenCore/Trigger/RaidMcTriggers.cpp similarity index 100% rename from src/strategy/raids/moltencore/RaidMcTriggers.cpp rename to src/Ai/Raid/MoltenCore/Trigger/RaidMcTriggers.cpp diff --git a/src/strategy/raids/moltencore/RaidMcTriggers.h b/src/Ai/Raid/MoltenCore/Trigger/RaidMcTriggers.h similarity index 100% rename from src/strategy/raids/moltencore/RaidMcTriggers.h rename to src/Ai/Raid/MoltenCore/Trigger/RaidMcTriggers.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsActions.cpp b/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsActions.cpp rename to src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.cpp diff --git a/src/strategy/raids/obsidiansanctum/RaidOsActions.h b/src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsActions.h rename to src/Ai/Raid/ObsidianSanctum/Action/RaidOsActions.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsMultipliers.cpp b/src/Ai/Raid/ObsidianSanctum/Multiplier/RaidOsMultipliers.cpp similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsMultipliers.cpp rename to src/Ai/Raid/ObsidianSanctum/Multiplier/RaidOsMultipliers.cpp diff --git a/src/strategy/raids/obsidiansanctum/RaidOsMultipliers.h b/src/Ai/Raid/ObsidianSanctum/Multiplier/RaidOsMultipliers.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsMultipliers.h rename to src/Ai/Raid/ObsidianSanctum/Multiplier/RaidOsMultipliers.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsActionContext.h b/src/Ai/Raid/ObsidianSanctum/RaidOsActionContext.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsActionContext.h rename to src/Ai/Raid/ObsidianSanctum/RaidOsActionContext.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsTriggerContext.h b/src/Ai/Raid/ObsidianSanctum/RaidOsTriggerContext.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsTriggerContext.h rename to src/Ai/Raid/ObsidianSanctum/RaidOsTriggerContext.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsStrategy.cpp b/src/Ai/Raid/ObsidianSanctum/Strategy/RaidOsStrategy.cpp similarity index 51% rename from src/strategy/raids/obsidiansanctum/RaidOsStrategy.cpp rename to src/Ai/Raid/ObsidianSanctum/Strategy/RaidOsStrategy.cpp index 244fdb1115..4468de991f 100644 --- a/src/strategy/raids/obsidiansanctum/RaidOsStrategy.cpp +++ b/src/Ai/Raid/ObsidianSanctum/Strategy/RaidOsStrategy.cpp @@ -6,24 +6,24 @@ void RaidOsStrategy::InitTriggers(std::vector& triggers) { triggers.push_back( new TriggerNode("sartharion tank", - NextAction::array(0, new NextAction("sartharion tank position", ACTION_MOVE), nullptr))); + { NextAction("sartharion tank position", ACTION_MOVE) })); triggers.push_back( new TriggerNode("twilight fissure", - NextAction::array(0, new NextAction("avoid twilight fissure", ACTION_RAID + 2), nullptr))); + { NextAction("avoid twilight fissure", ACTION_RAID + 2) })); triggers.push_back( new TriggerNode("flame tsunami", - NextAction::array(0, new NextAction("avoid flame tsunami", ACTION_RAID + 1), nullptr))); + { NextAction("avoid flame tsunami", ACTION_RAID + 1) })); triggers.push_back( new TriggerNode("sartharion dps", - NextAction::array(0, new NextAction("sartharion attack priority", ACTION_RAID), nullptr))); + { NextAction("sartharion attack priority", ACTION_RAID) })); // Flank dragon positioning triggers.push_back(new TriggerNode("sartharion melee positioning", - NextAction::array(0, new NextAction("rear flank", ACTION_MOVE + 4), nullptr))); + { NextAction("rear flank", ACTION_MOVE + 4) })); triggers.push_back(new TriggerNode("twilight portal enter", - NextAction::array(0, new NextAction("enter twilight portal", ACTION_RAID + 1), nullptr))); + { NextAction("enter twilight portal", ACTION_RAID + 1) })); triggers.push_back(new TriggerNode("twilight portal exit", - NextAction::array(0, new NextAction("exit twilight portal", ACTION_RAID + 1), nullptr))); + { NextAction("exit twilight portal", ACTION_RAID + 1) })); } void RaidOsStrategy::InitMultipliers(std::vector &multipliers) diff --git a/src/strategy/raids/obsidiansanctum/RaidOsStrategy.h b/src/Ai/Raid/ObsidianSanctum/Strategy/RaidOsStrategy.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsStrategy.h rename to src/Ai/Raid/ObsidianSanctum/Strategy/RaidOsStrategy.h diff --git a/src/strategy/raids/obsidiansanctum/RaidOsTriggers.cpp b/src/Ai/Raid/ObsidianSanctum/Trigger/RaidOsTriggers.cpp similarity index 92% rename from src/strategy/raids/obsidiansanctum/RaidOsTriggers.cpp rename to src/Ai/Raid/ObsidianSanctum/Trigger/RaidOsTriggers.cpp index 2c3758856d..710e3cac10 100644 --- a/src/strategy/raids/obsidiansanctum/RaidOsTriggers.cpp +++ b/src/Ai/Raid/ObsidianSanctum/Trigger/RaidOsTriggers.cpp @@ -78,19 +78,19 @@ bool SartharionMeleePositioningTrigger::IsActive() bool TwilightPortalEnterTrigger::IsActive() { - if (botAI->IsMainTank(bot) || botAI->IsHealAssistantOfIndex(bot, 0)) { return false; } + if (botAI->IsMainTank(bot) || botAI->IsAssistHealOfIndex(bot, 0)) { return false; } // In 25-man, take two healers in. Otherwise just take one // if (bot->GetRaidDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) // { - // if (botAI->IsHealAssistantOfIndex(bot, 0) || botAI->IsHealAssistantOfIndex(bot, 1)) + // if (botAI->IsAssistHealOfIndex(bot, 0) || botAI->IsAssistHealOfIndex(bot, 1)) // { // return false; // } // } // else // { - // if (botAI->IsHealAssistantOfIndex(bot, 0)) + // if (botAI->IsAssistHealOfIndex(bot, 0)) // { // return false; // } diff --git a/src/strategy/raids/obsidiansanctum/RaidOsTriggers.h b/src/Ai/Raid/ObsidianSanctum/Trigger/RaidOsTriggers.h similarity index 100% rename from src/strategy/raids/obsidiansanctum/RaidOsTriggers.h rename to src/Ai/Raid/ObsidianSanctum/Trigger/RaidOsTriggers.h diff --git a/src/strategy/raids/onyxia/RaidOnyxiaActions.cpp b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp similarity index 87% rename from src/strategy/raids/onyxia/RaidOnyxiaActions.cpp rename to src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp index c0cd4bebab..9fa4612bf6 100644 --- a/src/strategy/raids/onyxia/RaidOnyxiaActions.cpp +++ b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.cpp @@ -45,8 +45,19 @@ bool RaidOnyxiaSpreadOutAction::Execute(Event event) if (!boss) return false; - Player* target = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_targets.GetUnitTarget()->ToPlayer(); - if (target != bot) + // Trigger may fire on one tick, but the action can execute on a later tick. + // By that time the cast may have finished, so current spell can be null. + Spell* currentSpell = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL); + if (!currentSpell || !currentSpell->m_spellInfo) + return false; + + // Fireball + if (currentSpell->m_spellInfo->Id != 18392) + return false; + + Unit* unitTarget = currentSpell->m_targets.GetUnitTarget(); + Player* target = unitTarget ? unitTarget->ToPlayer() : nullptr; + if (!target || target != bot) return false; // bot->Yell("Spreading out — I'm the Fireball target!", LANG_UNIVERSAL); @@ -60,7 +71,7 @@ bool RaidOnyxiaMoveToSafeZoneAction::Execute(Event event) return false; Spell* currentSpell = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (!currentSpell) + if (!currentSpell || !currentSpell->m_spellInfo) return false; uint32 spellId = currentSpell->m_spellInfo->Id; diff --git a/src/strategy/raids/onyxia/RaidOnyxiaActions.h b/src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h similarity index 100% rename from src/strategy/raids/onyxia/RaidOnyxiaActions.h rename to src/Ai/Raid/Onyxia/Action/RaidOnyxiaActions.h diff --git a/src/strategy/raids/onyxia/RaidOnyxiaActionContext.h b/src/Ai/Raid/Onyxia/RaidOnyxiaActionContext.h similarity index 100% rename from src/strategy/raids/onyxia/RaidOnyxiaActionContext.h rename to src/Ai/Raid/Onyxia/RaidOnyxiaActionContext.h diff --git a/src/strategy/raids/onyxia/RaidOnyxiaTriggerContext.h b/src/Ai/Raid/Onyxia/RaidOnyxiaTriggerContext.h similarity index 100% rename from src/strategy/raids/onyxia/RaidOnyxiaTriggerContext.h rename to src/Ai/Raid/Onyxia/RaidOnyxiaTriggerContext.h diff --git a/src/strategy/raids/onyxia/RaidOnyxiaStrategy.cpp b/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp similarity index 51% rename from src/strategy/raids/onyxia/RaidOnyxiaStrategy.cpp rename to src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp index 2e4d50d4ae..b1217f59eb 100644 --- a/src/strategy/raids/onyxia/RaidOnyxiaStrategy.cpp +++ b/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.cpp @@ -5,23 +5,23 @@ void RaidOnyxiaStrategy::InitTriggers(std::vector& triggers) // ----------- Phase 1 (100% - 65%) ----------- triggers.push_back(new TriggerNode( - "ony near tail", NextAction::array(0, new NextAction("ony move to side", ACTION_RAID + 2), nullptr))); + "ony near tail", { NextAction("ony move to side", ACTION_RAID + 2) })); triggers.push_back(new TriggerNode( - "ony avoid eggs", NextAction::array(0, new NextAction("ony avoid eggs move", ACTION_EMERGENCY + 5), nullptr))); + "ony avoid eggs", { NextAction("ony avoid eggs move", ACTION_EMERGENCY + 5) })); // ----------- Phase 2 (65% - 40%) ----------- triggers.push_back( new TriggerNode("ony deep breath warning", - NextAction::array(0, new NextAction("ony move to safe zone", ACTION_EMERGENCY + 5), nullptr))); + { NextAction("ony move to safe zone", ACTION_EMERGENCY + 5) })); triggers.push_back( new TriggerNode("ony fireball splash incoming", - NextAction::array(0, new NextAction("ony spread out", ACTION_EMERGENCY + 2), nullptr))); + { NextAction("ony spread out", ACTION_EMERGENCY + 2) })); triggers.push_back(new TriggerNode( - "ony whelps spawn", NextAction::array(0, new NextAction("ony kill whelps", ACTION_RAID + 1), nullptr))); + "ony whelps spawn", { NextAction("ony kill whelps", ACTION_RAID + 1) })); } void RaidOnyxiaStrategy::InitMultipliers(std::vector& multipliers) diff --git a/src/strategy/raids/onyxia/RaidOnyxiaStrategy.h b/src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.h similarity index 100% rename from src/strategy/raids/onyxia/RaidOnyxiaStrategy.h rename to src/Ai/Raid/Onyxia/Strategy/RaidOnyxiaStrategy.h diff --git a/src/strategy/raids/onyxia/RaidOnyxiaTriggers.cpp b/src/Ai/Raid/Onyxia/Trigger/RaidOnyxiaTriggers.cpp similarity index 92% rename from src/strategy/raids/onyxia/RaidOnyxiaTriggers.cpp rename to src/Ai/Raid/Onyxia/Trigger/RaidOnyxiaTriggers.cpp index f74f34e358..56486ebf96 100644 --- a/src/strategy/raids/onyxia/RaidOnyxiaTriggers.cpp +++ b/src/Ai/Raid/Onyxia/Trigger/RaidOnyxiaTriggers.cpp @@ -4,7 +4,7 @@ #include "ObjectAccessor.h" #include "PlayerbotAI.h" #include "Playerbots.h" -#include "strategy/values/NearestNpcsValue.h" +#include "NearestNpcsValue.h" OnyxiaDeepBreathTrigger::OnyxiaDeepBreathTrigger(PlayerbotAI* botAI) : Trigger(botAI, "ony deep breath warning") {} @@ -17,7 +17,7 @@ bool OnyxiaDeepBreathTrigger::IsActive() // Check if Onyxia is casting Spell* currentSpell = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (!currentSpell) + if (!currentSpell || !currentSpell->m_spellInfo) return false; uint32 spellId = currentSpell->m_spellInfo->Id; @@ -65,7 +65,7 @@ bool RaidOnyxiaFireballSplashTrigger::IsActive() // Check if Onyxia is casting Fireball Spell* currentSpell = boss->GetCurrentSpell(CURRENT_GENERIC_SPELL); - if (!currentSpell || currentSpell->m_spellInfo->Id != 18392) // 18392 is the classic Fireball ID + if (!currentSpell || !currentSpell->m_spellInfo || currentSpell->m_spellInfo->Id != 18392) // 18392 is the classic Fireball ID // 18392 is the classic Fireball ID return false; GuidVector nearbyUnits = AI_VALUE(GuidVector, "nearest friendly players"); diff --git a/src/strategy/raids/onyxia/RaidOnyxiaTriggers.h b/src/Ai/Raid/Onyxia/Trigger/RaidOnyxiaTriggers.h similarity index 100% rename from src/strategy/raids/onyxia/RaidOnyxiaTriggers.h rename to src/Ai/Raid/Onyxia/Trigger/RaidOnyxiaTriggers.h diff --git a/src/strategy/raids/RaidStrategyContext.h b/src/Ai/Raid/RaidStrategyContext.h similarity index 100% rename from src/strategy/raids/RaidStrategyContext.h rename to src/Ai/Raid/RaidStrategyContext.h diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.cpp b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarActions.cpp rename to src/Ai/Raid/Ulduar/Action/RaidUlduarActions.cpp diff --git a/src/strategy/raids/ulduar/RaidUlduarActions.h b/src/Ai/Raid/Ulduar/Action/RaidUlduarActions.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarActions.h rename to src/Ai/Raid/Ulduar/Action/RaidUlduarActions.h diff --git a/src/strategy/raids/ulduar/RaidUlduarMultipliers.cpp b/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarMultipliers.cpp rename to src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.cpp diff --git a/src/strategy/raids/ulduar/RaidUlduarMultipliers.h b/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.h similarity index 86% rename from src/strategy/raids/ulduar/RaidUlduarMultipliers.h rename to src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.h index aef41be5d9..736d9483b2 100644 --- a/src/strategy/raids/ulduar/RaidUlduarMultipliers.h +++ b/src/Ai/Raid/Ulduar/Multiplier/RaidUlduarMultipliers.h @@ -3,7 +3,7 @@ #define _PLAYERRBOT_RAIDULDUARMULTIPLIERS_H_ #include "Multiplier.h" -#include "raids/ulduar/RaidUlduarBossHelper.h" +#include "Ai/Raid/Ulduar/RaidUlduarBossHelper.h" class FlameLeviathanMultiplier : public Multiplier { diff --git a/src/strategy/raids/ulduar/RaidUlduarActionContext.h b/src/Ai/Raid/Ulduar/RaidUlduarActionContext.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarActionContext.h rename to src/Ai/Raid/Ulduar/RaidUlduarActionContext.h diff --git a/src/strategy/raids/ulduar/RaidUlduarBossHelper.cpp b/src/Ai/Raid/Ulduar/RaidUlduarBossHelper.cpp similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarBossHelper.cpp rename to src/Ai/Raid/Ulduar/RaidUlduarBossHelper.cpp diff --git a/src/strategy/raids/ulduar/RaidUlduarBossHelper.h b/src/Ai/Raid/Ulduar/RaidUlduarBossHelper.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarBossHelper.h rename to src/Ai/Raid/Ulduar/RaidUlduarBossHelper.h diff --git a/src/strategy/raids/ulduar/RaidUlduarScripts.h b/src/Ai/Raid/Ulduar/RaidUlduarScripts.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarScripts.h rename to src/Ai/Raid/Ulduar/RaidUlduarScripts.h diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggerContext.h b/src/Ai/Raid/Ulduar/RaidUlduarTriggerContext.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarTriggerContext.h rename to src/Ai/Raid/Ulduar/RaidUlduarTriggerContext.h diff --git a/src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.cpp b/src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.cpp new file mode 100644 index 0000000000..3b9a426cc6 --- /dev/null +++ b/src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.cpp @@ -0,0 +1,323 @@ +#include "RaidUlduarStrategy.h" + +#include "RaidUlduarMultipliers.h" + +void RaidUlduarStrategy::InitTriggers(std::vector& triggers) +{ + // + // Flame Leviathan + // + triggers.push_back(new TriggerNode( + "flame leviathan vehicle near", + { NextAction("flame leviathan enter vehicle", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode( + "flame leviathan on vehicle", + { NextAction("flame leviathan vehicle", ACTION_RAID + 1) })); + + // + // Razorscale + // + triggers.push_back(new TriggerNode( + "razorscale avoid devouring flames", + { NextAction("razorscale avoid devouring flames", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "razorscale avoid sentinel", + { NextAction("razorscale avoid sentinel", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode( + "razorscale flying alone", + { NextAction("razorscale ignore flying alone", ACTION_MOVE + 5) })); + + triggers.push_back(new TriggerNode( + "razorscale avoid whirlwind", + { NextAction("razorscale avoid whirlwind", ACTION_RAID + 3) })); + + triggers.push_back(new TriggerNode( + "razorscale grounded", + { NextAction("razorscale grounded", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "razorscale harpoon trigger", + { NextAction("razorscale harpoon action", ACTION_MOVE) })); + + triggers.push_back(new TriggerNode( + "razorscale fuse armor trigger", + { NextAction("razorscale fuse armor action", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode( + "razorscale fire resistance trigger", + { NextAction("razorscale fire resistance action", ACTION_RAID) })); + + // + // Ignis + // + triggers.push_back(new TriggerNode( + "ignis fire resistance trigger", + { NextAction("ignis fire resistance action", ACTION_RAID) })); + + // + // Iron Assembly + // + triggers.push_back(new TriggerNode( + "iron assembly lightning tendrils trigger", + { NextAction("iron assembly lightning tendrils action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "iron assembly overload trigger", + { NextAction("iron assembly overload action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "iron assembly rune of power trigger", + { NextAction("iron assembly rune of power action", ACTION_RAID) })); + + // + // Kologarn + // + triggers.push_back(new TriggerNode( + "kologarn fall from floor trigger", + { NextAction("kologarn fall from floor action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "kologarn rti target trigger", + { NextAction("kologarn rti target action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "kologarn eyebeam trigger", + { NextAction("kologarn eyebeam action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "kologarn attack dps target trigger", + { NextAction("attack rti target", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "kologarn mark dps target trigger", + { NextAction("kologarn mark dps target action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "kologarn nature resistance trigger", + { NextAction("kologarn nature resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "kologarn rubble slowdown trigger", + { NextAction("kologarn rubble slowdown action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "kologarn crunch armor trigger", + { NextAction("kologarn crunch armor action", ACTION_RAID) })); + + // + // Auriaya + // + triggers.push_back(new TriggerNode( + "auriaya fall from floor trigger", + { NextAction("auriaya fall from floor action", ACTION_RAID) })); + + // + // Hodir + // + triggers.push_back(new TriggerNode( + "hodir near snowpacked icicle", + { NextAction("hodir move snowpacked icicle", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "hodir biting cold", + { NextAction("hodir biting cold jump", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "hodir frost resistance trigger", + { NextAction("hodir frost resistance action", ACTION_RAID) })); + + // + // Freya + // + triggers.push_back(new TriggerNode( + "freya near nature bomb", + { NextAction("freya move away nature bomb", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "freya nature resistance trigger", + { NextAction("freya nature resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "freya fire resistance trigger", + { NextAction("freya fire resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "freya mark dps target trigger", + { NextAction("freya mark dps target action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "freya move to healing spore trigger", + { NextAction("freya move to healing spore action", ACTION_RAID) })); + + // + // Thorim + // + triggers.push_back(new TriggerNode( + "thorim nature resistance trigger", + { NextAction("thorim nature resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim frost resistance trigger", + { NextAction("thorim frost resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim unbalancing strike trigger", + { NextAction("thorim unbalancing strike action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim mark dps target trigger", + { NextAction("thorim mark dps target action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim gauntlet positioning trigger", + { NextAction("thorim gauntlet positioning action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim arena positioning trigger", + { NextAction("thorim arena positioning action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "thorim fall from floor trigger", + { NextAction("thorim fall from floor action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "thorim phase 2 positioning trigger", + { NextAction("thorim phase 2 positioning action", ACTION_RAID) })); + + // + // Mimiron + // + triggers.push_back(new TriggerNode( + "mimiron p3wx2 laser barrage trigger", + { NextAction("mimiron p3wx2 laser barrage action", ACTION_RAID + 2) })); + + triggers.push_back(new TriggerNode( + "mimiron shock blast trigger", + { NextAction("mimiron shock blast action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "mimiron fire resistance trigger", + { NextAction("mimiron fire resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron phase 1 positioning trigger", + { NextAction("mimiron phase 1 positioning action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron rapid burst trigger", + { NextAction("mimiron rapid burst action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron aerial command unit trigger", + { NextAction("mimiron aerial command unit action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron rocket strike trigger", + { NextAction("mimiron rocket strike action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron phase 4 mark dps trigger", + { NextAction("mimiron phase 4 mark dps action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "mimiron cheat trigger", + { NextAction("mimiron cheat action", ACTION_RAID) })); + + // + // General Vezax + // + triggers.push_back(new TriggerNode( + "vezax cheat trigger", + { NextAction("vezax cheat action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "vezax shadow crash trigger", + { NextAction("vezax shadow crash action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "vezax mark of the faceless trigger", + { NextAction("vezax mark of the faceless action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "vezax shadow resistance trigger", + { NextAction("vezax shadow resistance action", ACTION_RAID) })); + + // + // Yogg-Saron + // + triggers.push_back(new TriggerNode( + "sara shadow resistance trigger", + { NextAction("sara shadow resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron shadow resistance trigger", + { NextAction("yogg-saron shadow resistance action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron ominous cloud cheat trigger", + { NextAction("yogg-saron ominous cloud cheat action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron guardian positioning trigger", + { NextAction("yogg-saron guardian positioning action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron sanity trigger", + { NextAction("yogg-saron sanity action", ACTION_RAID + 1) })); + + triggers.push_back(new TriggerNode( + "yogg-saron death orb trigger", + { NextAction("yogg-saron death orb action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron malady of the mind trigger", + { NextAction("yogg-saron malady of the mind action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron mark target trigger", + { NextAction("yogg-saron mark target action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron brain link trigger", + { NextAction("yogg-saron brain link action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron move to enter portal trigger", + { NextAction("yogg-saron move to enter portal action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron use portal trigger", + { NextAction("yogg-saron use portal action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron fall from floor trigger", + { NextAction("yogg-saron fall from floor action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron boss room movement cheat trigger", + { NextAction("yogg-saron boss room movement cheat action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron illusion room trigger", + { NextAction("yogg-saron illusion room action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron move to exit portal trigger", + { NextAction("yogg-saron move to exit portal action", ACTION_RAID) })); + + triggers.push_back(new TriggerNode( + "yogg-saron lunatic gaze trigger", + { NextAction("yogg-saron lunatic gaze action", ACTION_EMERGENCY) })); + + triggers.push_back(new TriggerNode( + "yogg-saron phase 3 positioning trigger", + { NextAction("yogg-saron phase 3 positioning action", ACTION_RAID) })); +} + +void RaidUlduarStrategy::InitMultipliers(std::vector& multipliers) +{ + multipliers.push_back(new FlameLeviathanMultiplier(botAI)); +} diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.h b/src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarStrategy.h rename to src/Ai/Raid/Ulduar/Strategy/RaidUlduarStrategy.h diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp similarity index 98% rename from src/strategy/raids/ulduar/RaidUlduarTriggers.cpp rename to src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp index 89ad7ac5fb..f883917ed0 100644 --- a/src/strategy/raids/ulduar/RaidUlduarTriggers.cpp +++ b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.cpp @@ -765,9 +765,13 @@ bool FreyaMoveToHealingSporeTrigger::IsActive() bool ThorimUnbalancingStrikeTrigger::IsActive() { Unit* boss = AI_VALUE2(Unit*, "find target", "thorim"); + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; - // Check boss and it is alive - if (!boss || !boss->IsAlive() || !boss->IsHostileTo(bot)) + if (!boss->IsAlive()) + return false; + + if (!boss->IsHostileTo(bot)) return false; return bot->HasAura(SPELL_UNBALANCING_STRIKE); @@ -804,8 +808,13 @@ bool ThorimMarkDpsTargetTrigger::IsActive() Unit* boss = AI_VALUE2(Unit*, "find target", "thorim"); - // Check boss and it is alive - if (!boss || !boss->IsAlive() || !boss->IsHostileTo(bot)) + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; + + if (!boss->IsAlive()) + return false; + + if (!boss->IsHostileTo(bot)) return false; if (boss->GetPositionZ() < ULDUAR_THORIM_AXIS_Z_FLOOR_THRESHOLD && (!currentSkullUnit || !currentSkullUnit->IsAlive())) @@ -982,9 +991,13 @@ bool ThorimGauntletPositioningTrigger::IsActive() bool ThorimArenaPositioningTrigger::IsActive() { Unit* boss = AI_VALUE2(Unit*, "find target", "thorim"); + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; - // Check boss and it is alive - if (!boss || !boss->IsAlive() || !boss->IsHostileTo(bot)) + if (!boss->IsAlive()) + return false; + + if (!boss->IsHostileTo(bot)) return false; if (boss->GetPositionZ() < ULDUAR_THORIM_AXIS_Z_FLOOR_THRESHOLD) @@ -1080,9 +1093,13 @@ bool ThorimPhase2PositioningTrigger::IsActive() return false; Unit* boss = AI_VALUE2(Unit*, "find target", "thorim"); + if (!boss || !boss->IsInWorld() || boss->IsDuringRemoveFromWorld()) + return false; - // Check boss and it is alive - if (!boss || !boss->IsAlive() || !boss->IsHostileTo(bot)) + if (!boss->IsAlive()) + return false; + + if (!boss->IsHostileTo(bot)) return false; if (boss->GetPositionZ() > ULDUAR_THORIM_AXIS_Z_FLOOR_THRESHOLD) diff --git a/src/strategy/raids/ulduar/RaidUlduarTriggers.h b/src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.h similarity index 100% rename from src/strategy/raids/ulduar/RaidUlduarTriggers.h rename to src/Ai/Raid/Ulduar/Trigger/RaidUlduarTriggers.h diff --git a/src/strategy/raids/vaultofarchavon/RaidVoAActions.cpp b/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoAActions.cpp rename to src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.cpp diff --git a/src/strategy/raids/vaultofarchavon/RaidVoAActions.h b/src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.h similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoAActions.h rename to src/Ai/Raid/VaultOfArchavon/Action/RaidVoAActions.h diff --git a/src/strategy/raids/vaultofarchavon/RaidVoAActionContext.h b/src/Ai/Raid/VaultOfArchavon/RaidVoAActionContext.h similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoAActionContext.h rename to src/Ai/Raid/VaultOfArchavon/RaidVoAActionContext.h diff --git a/src/strategy/raids/vaultofarchavon/RaidVoATriggerContext.h b/src/Ai/Raid/VaultOfArchavon/RaidVoATriggerContext.h similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoATriggerContext.h rename to src/Ai/Raid/VaultOfArchavon/RaidVoATriggerContext.h diff --git a/src/strategy/raids/vaultofarchavon/RaidVoAStrategy.cpp b/src/Ai/Raid/VaultOfArchavon/Strategy/RaidVoAStrategy.cpp similarity index 55% rename from src/strategy/raids/vaultofarchavon/RaidVoAStrategy.cpp rename to src/Ai/Raid/VaultOfArchavon/Strategy/RaidVoAStrategy.cpp index 505cac1bfa..db81477a80 100644 --- a/src/strategy/raids/vaultofarchavon/RaidVoAStrategy.cpp +++ b/src/Ai/Raid/VaultOfArchavon/Strategy/RaidVoAStrategy.cpp @@ -11,23 +11,23 @@ void RaidVoAStrategy::InitTriggers(std::vector& triggers) // triggers.push_back(new TriggerNode( "emalon lighting nova trigger", - NextAction::array(0, new NextAction("emalon lighting nova action", ACTION_RAID + 1), nullptr))); + { NextAction("emalon lighting nova action", ACTION_RAID + 1) })); triggers.push_back(new TriggerNode( "emalon mark boss trigger", - NextAction::array(0, new NextAction("emalon mark boss action", ACTION_RAID), nullptr))); + { NextAction("emalon mark boss action", ACTION_RAID) })); triggers.push_back(new TriggerNode( "emalon overcharge trigger", - NextAction::array(0, new NextAction("emalon overcharge action", ACTION_RAID), nullptr))); + { NextAction("emalon overcharge action", ACTION_RAID) })); triggers.push_back(new TriggerNode( "emalon fall from floor trigger", - NextAction::array(0, new NextAction("emalon fall from floor action", ACTION_RAID), nullptr))); + { NextAction("emalon fall from floor action", ACTION_RAID) })); triggers.push_back(new TriggerNode( "emalon nature resistance trigger", - NextAction::array(0, new NextAction("emalon nature resistance action", ACTION_RAID), nullptr))); + { NextAction("emalon nature resistance action", ACTION_RAID) })); // // Koralon the Flame Watcher @@ -35,5 +35,5 @@ void RaidVoAStrategy::InitTriggers(std::vector& triggers) triggers.push_back(new TriggerNode( "koralon fire resistance trigger", - NextAction::array(0, new NextAction("koralon fire resistance action", ACTION_RAID), nullptr))); + { NextAction("koralon fire resistance action", ACTION_RAID) })); } diff --git a/src/strategy/raids/vaultofarchavon/RaidVoAStrategy.h b/src/Ai/Raid/VaultOfArchavon/Strategy/RaidVoAStrategy.h similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoAStrategy.h rename to src/Ai/Raid/VaultOfArchavon/Strategy/RaidVoAStrategy.h diff --git a/src/strategy/raids/vaultofarchavon/RaidVoATriggers.cpp b/src/Ai/Raid/VaultOfArchavon/Trigger/RaidVoATriggers.cpp similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoATriggers.cpp rename to src/Ai/Raid/VaultOfArchavon/Trigger/RaidVoATriggers.cpp diff --git a/src/strategy/raids/vaultofarchavon/RaidVoATriggers.h b/src/Ai/Raid/VaultOfArchavon/Trigger/RaidVoATriggers.h similarity index 100% rename from src/strategy/raids/vaultofarchavon/RaidVoATriggers.h rename to src/Ai/Raid/VaultOfArchavon/Trigger/RaidVoATriggers.h diff --git a/src/strategy/rpg/NewRpgAction.cpp b/src/Ai/World/Rpg/Action/NewRpgAction.cpp similarity index 100% rename from src/strategy/rpg/NewRpgAction.cpp rename to src/Ai/World/Rpg/Action/NewRpgAction.cpp diff --git a/src/strategy/rpg/NewRpgAction.h b/src/Ai/World/Rpg/Action/NewRpgAction.h similarity index 100% rename from src/strategy/rpg/NewRpgAction.h rename to src/Ai/World/Rpg/Action/NewRpgAction.h diff --git a/src/strategy/rpg/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp similarity index 97% rename from src/strategy/rpg/NewRpgBaseAction.cpp rename to src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index acd3407827..4898d7e36c 100644 --- a/src/strategy/rpg/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -3,6 +3,7 @@ #include "BroadcastHelper.h" #include "ChatHelper.h" #include "Creature.h" +#include "FlightMasterCache.h" #include "G3D/Vector2.h" #include "GameObject.h" #include "GossipDef.h" @@ -269,7 +270,7 @@ bool NewRpgBaseAction::CanInteractWithQuestGiver(Object* questGiver) if (!guid) return false; - if (!bot->IsInWorld()) + if (!bot->IsInWorld() || bot->IsDuringRemoveFromWorld()) return false; if (bot->IsInFlight()) @@ -302,12 +303,14 @@ bool NewRpgBaseAction::CanInteractWithQuestGiver(Object* questGiver) if (creature->GetReactionTo(bot) <= REP_UNFRIENDLY) return false; + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(creature->GetEntry()); + // pussywizard: many npcs have missing conditions for class training and rogue trainer can for eg. train // dual wield to a shaman :/ too many to change in sql and watch in the future pussywizard: this function is // not used when talking, but when already taking action (buy spell, reset talents, show spell list) if (npcflagmask & (UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS) && - creature->GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS && - !bot->IsClass((Classes)creature->GetCreatureTemplate()->trainer_class, CLASS_CONTEXT_CLASS_TRAINER)) + trainer->GetTrainerType() == Trainer::Type::Class && + !trainer->IsTrainerValidForPlayer(bot)) return false; return true; @@ -966,22 +969,7 @@ WorldPosition NewRpgBaseAction::SelectRandomCampPos(Player* bot) bool NewRpgBaseAction::SelectRandomFlightTaxiNode(ObjectGuid& flightMaster, uint32& fromNode, uint32& toNode) { - const std::vector& flightMasters = IsAlliance(bot->getRace()) - ? sRandomPlayerbotMgr->allianceFlightMasterCache - : sRandomPlayerbotMgr->hordeFlightMasterCache; - Creature* nearestFlightMaster = nullptr; - for (const uint32& guid : flightMasters) - { - Creature* flightMaster = ObjectAccessor::GetSpawnedCreatureByDBGUID(bot->GetMapId(), guid); - if (!flightMaster) - continue; - - if (bot->GetMapId() != flightMaster->GetMapId()) - continue; - - if (!nearestFlightMaster || bot->GetDistance(nearestFlightMaster) > bot->GetDistance(flightMaster)) - nearestFlightMaster = flightMaster; - } + Creature* nearestFlightMaster = sFlightMasterCache->GetNearestFlightMaster(bot); if (!nearestFlightMaster || bot->GetDistance(nearestFlightMaster) > 500.0f) return false; diff --git a/src/strategy/rpg/NewRpgBaseAction.h b/src/Ai/World/Rpg/Action/NewRpgBaseAction.h similarity index 100% rename from src/strategy/rpg/NewRpgBaseAction.h rename to src/Ai/World/Rpg/Action/NewRpgBaseAction.h diff --git a/src/strategy/rpg/NewRpgInfo.cpp b/src/Ai/World/Rpg/NewRpgInfo.cpp similarity index 100% rename from src/strategy/rpg/NewRpgInfo.cpp rename to src/Ai/World/Rpg/NewRpgInfo.cpp diff --git a/src/strategy/rpg/NewRpgInfo.h b/src/Ai/World/Rpg/NewRpgInfo.h similarity index 100% rename from src/strategy/rpg/NewRpgInfo.h rename to src/Ai/World/Rpg/NewRpgInfo.h diff --git a/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp new file mode 100644 index 0000000000..030ad6b4fc --- /dev/null +++ b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "NewRpgStrategy.h" + +#include "Playerbots.h" + +NewRpgStrategy::NewRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} + +std::vector NewRpgStrategy::getDefaultActions() +{ + // the releavance should be greater than grind + return { + NextAction("new rpg status update", 11.0f) + }; +} + +void NewRpgStrategy::InitTriggers(std::vector& triggers) +{ + triggers.push_back( + new TriggerNode( + "go grind status", + { + NextAction("new rpg go grind", 3.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "go camp status", + { + NextAction("new rpg go camp", 3.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "wander random status", + { + NextAction("new rpg wander random", 3.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "wander npc status", + { + NextAction("new rpg wander npc", 3.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "do quest status", + { + NextAction("new rpg do quest", 3.0f) + } + ) + ); + triggers.push_back( + new TriggerNode( + "travel flight status", + { + NextAction("new rpg travel flight", 3.0f) + } + ) + ); +} + +void NewRpgStrategy::InitMultipliers(std::vector& multipliers) +{ + +} diff --git a/src/strategy/rpg/NewRpgStrategy.h b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.h similarity index 92% rename from src/strategy/rpg/NewRpgStrategy.h rename to src/Ai/World/Rpg/Strategy/NewRpgStrategy.h index b1b1e1568a..47b2a550d4 100644 --- a/src/strategy/rpg/NewRpgStrategy.h +++ b/src/Ai/World/Rpg/Strategy/NewRpgStrategy.h @@ -18,7 +18,7 @@ class NewRpgStrategy : public Strategy NewRpgStrategy(PlayerbotAI* botAI); std::string const getName() override { return "new rpg"; } - NextAction** getDefaultActions() override; + std::vector getDefaultActions() override; void InitTriggers(std::vector& triggers) override; void InitMultipliers(std::vector& multipliers) override; }; diff --git a/src/strategy/rpg/NewRpgTrigger.cpp b/src/Ai/World/Rpg/Trigger/NewRpgTrigger.cpp similarity index 100% rename from src/strategy/rpg/NewRpgTrigger.cpp rename to src/Ai/World/Rpg/Trigger/NewRpgTrigger.cpp diff --git a/src/strategy/rpg/NewRpgTriggers.h b/src/Ai/World/Rpg/Trigger/NewRpgTriggers.h similarity index 100% rename from src/strategy/rpg/NewRpgTriggers.h rename to src/Ai/World/Rpg/Trigger/NewRpgTriggers.h diff --git a/src/ChatFilter.cpp b/src/Bot/Cmd/ChatFilter.cpp similarity index 100% rename from src/ChatFilter.cpp rename to src/Bot/Cmd/ChatFilter.cpp diff --git a/src/ChatFilter.h b/src/Bot/Cmd/ChatFilter.h similarity index 100% rename from src/ChatFilter.h rename to src/Bot/Cmd/ChatFilter.h diff --git a/src/ChatHelper.cpp b/src/Bot/Cmd/ChatHelper.cpp similarity index 100% rename from src/ChatHelper.cpp rename to src/Bot/Cmd/ChatHelper.cpp diff --git a/src/ChatHelper.h b/src/Bot/Cmd/ChatHelper.h similarity index 100% rename from src/ChatHelper.h rename to src/Bot/Cmd/ChatHelper.h diff --git a/src/PlayerbotCommandServer.cpp b/src/Bot/Cmd/PlayerbotCommandServer.cpp similarity index 100% rename from src/PlayerbotCommandServer.cpp rename to src/Bot/Cmd/PlayerbotCommandServer.cpp diff --git a/src/PlayerbotCommandServer.h b/src/Bot/Cmd/PlayerbotCommandServer.h similarity index 100% rename from src/PlayerbotCommandServer.h rename to src/Bot/Cmd/PlayerbotCommandServer.h diff --git a/src/PerformanceMonitor.cpp b/src/Bot/Debug/PerfMonitor.cpp similarity index 96% rename from src/PerformanceMonitor.cpp rename to src/Bot/Debug/PerfMonitor.cpp index 99b0989a47..c6d134edb9 100644 --- a/src/PerformanceMonitor.cpp +++ b/src/Bot/Debug/PerfMonitor.cpp @@ -3,11 +3,11 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Playerbots.h" -PerformanceMonitorOperation* PerformanceMonitor::start(PerformanceMetric metric, std::string const name, +PerfMonitorOperation* PerfMonitor::start(PerformanceMetric metric, std::string const name, PerformanceStack* stack) { if (!sPlayerbotAIConfig->perfMonEnabled) @@ -45,10 +45,10 @@ PerformanceMonitorOperation* PerformanceMonitor::start(PerformanceMetric metric, data[metric][stackName] = pd; } - return new PerformanceMonitorOperation(pd, name, stack); + return new PerfMonitorOperation(pd, name, stack); } -void PerformanceMonitor::PrintStats(bool perTick, bool fullStack) +void PerfMonitor::PrintStats(bool perTick, bool fullStack) { if (data.empty()) return; @@ -247,7 +247,7 @@ void PerformanceMonitor::PrintStats(bool perTick, bool fullStack) } } -void PerformanceMonitor::Reset() +void PerfMonitor::Reset() { for (std::map>::iterator i = data.begin(); i != data.end(); ++i) @@ -265,7 +265,7 @@ void PerformanceMonitor::Reset() } } -PerformanceMonitorOperation::PerformanceMonitorOperation(PerformanceData* data, std::string const name, +PerfMonitorOperation::PerfMonitorOperation(PerformanceData* data, std::string const name, PerformanceStack* stack) : data(data), name(name), stack(stack) { @@ -273,7 +273,7 @@ PerformanceMonitorOperation::PerformanceMonitorOperation(PerformanceData* data, .time_since_epoch(); } -void PerformanceMonitorOperation::finish() +void PerfMonitorOperation::finish() { std::chrono::microseconds finished = (std::chrono::time_point_cast(std::chrono::high_resolution_clock::now())) diff --git a/src/PerformanceMonitor.h b/src/Bot/Debug/PerfMonitor.h similarity index 72% rename from src/PerformanceMonitor.h rename to src/Bot/Debug/PerfMonitor.h index 290cec557c..0d3eb8aad1 100644 --- a/src/PerformanceMonitor.h +++ b/src/Bot/Debug/PerfMonitor.h @@ -34,10 +34,10 @@ enum PerformanceMetric PERF_MON_TOTAL }; -class PerformanceMonitorOperation +class PerfMonitorOperation { public: - PerformanceMonitorOperation(PerformanceData* data, std::string const name, PerformanceStack* stack); + PerfMonitorOperation(PerformanceData* data, std::string const name, PerformanceStack* stack); void finish(); private: @@ -47,19 +47,19 @@ class PerformanceMonitorOperation std::chrono::microseconds started; }; -class PerformanceMonitor +class PerfMonitor { public: - PerformanceMonitor(){}; - virtual ~PerformanceMonitor(){}; - static PerformanceMonitor* instance() + PerfMonitor(){}; + virtual ~PerfMonitor(){}; + static PerfMonitor* instance() { - static PerformanceMonitor instance; + static PerfMonitor instance; return &instance; } public: - PerformanceMonitorOperation* start(PerformanceMetric metric, std::string const name, + PerfMonitorOperation* start(PerformanceMetric metric, std::string const name, PerformanceStack* stack = nullptr); void PrintStats(bool perTick = false, bool fullStack = false); void Reset(); @@ -69,6 +69,6 @@ class PerformanceMonitor std::mutex lock; }; -#define sPerformanceMonitor PerformanceMonitor::instance() +#define sPerfMonitor PerfMonitor::instance() #endif diff --git a/src/Bot/Engine/Action/Action.cpp b/src/Bot/Engine/Action/Action.cpp new file mode 100644 index 0000000000..464f9dcfd2 --- /dev/null +++ b/src/Bot/Engine/Action/Action.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "Action.h" + +#include "Playerbots.h" +#include "Timer.h" + +Value* Action::GetTargetValue() { return context->GetValue(GetTargetName()); } + +Unit* Action::GetTarget() { return GetTargetValue()->Get(); } + +ActionBasket::ActionBasket(ActionNode* action, float relevance, bool skipPrerequisites, Event event) + : action(action), relevance(relevance), skipPrerequisites(skipPrerequisites), event(event), created(getMSTime()) +{ +} + +bool ActionBasket::isExpired(uint32_t msecs) { return getMSTime() - created >= msecs; } diff --git a/src/strategy/Action.h b/src/Bot/Engine/Action/Action.h similarity index 60% rename from src/strategy/Action.h rename to src/Bot/Engine/Action/Action.h index 5087a42b1c..2395c5ea87 100644 --- a/src/strategy/Action.h +++ b/src/Bot/Engine/Action/Action.h @@ -3,8 +3,7 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#ifndef _PLAYERBOT_ACTION_H -#define _PLAYERBOT_ACTION_H +#pragma once #include "AiObject.h" #include "Common.h" @@ -24,15 +23,26 @@ class NextAction std::string const getName() { return name; } float getRelevance() { return relevance; } - static uint32 size(NextAction** actions); - static NextAction** clone(NextAction** actions); - static NextAction** merge(NextAction** what, NextAction** with); - static NextAction** array(uint32 nil, ...); - static void destroy(NextAction** actions); + static std::vector merge(std::vector const& what, std::vector const& with) + { + std::vector result = {}; + + for (NextAction const& action : what) + { + result.push_back(action); + } + + for (NextAction const& action : with) + { + result.push_back(action); + } + + return result; + }; private: float relevance; - std::string const name; + std::string name; }; class Action : public AiNamedObject @@ -52,9 +62,9 @@ class Action : public AiNamedObject virtual bool Execute([[maybe_unused]] Event event) { return true; } virtual bool isPossible() { return true; } virtual bool isUseful() { return true; } - virtual NextAction** getPrerequisites() { return nullptr; } - virtual NextAction** getAlternatives() { return nullptr; } - virtual NextAction** getContinuers() { return nullptr; } + virtual std::vector getPrerequisites() { return {}; } + virtual std::vector getAlternatives() { return {}; } + virtual std::vector getContinuers() { return {}; } virtual ActionThreatType getThreatType() { return ActionThreatType::None; } void Update() {} void Reset() {} @@ -73,39 +83,44 @@ class Action : public AiNamedObject class ActionNode { public: - ActionNode(std::string const name, NextAction** prerequisites = nullptr, NextAction** alternatives = nullptr, - NextAction** continuers = nullptr) - : name(name), action(nullptr), continuers(continuers), alternatives(alternatives), prerequisites(prerequisites) - { - } // reorder arguments - whipowill - - virtual ~ActionNode() - { - NextAction::destroy(prerequisites); - NextAction::destroy(alternatives); - NextAction::destroy(continuers); - } + ActionNode( + std::string name, + std::vector prerequisites = {}, + std::vector alternatives = {}, + std::vector continuers = {} + ) : + name(std::move(name)), + action(nullptr), + continuers(continuers), + alternatives(alternatives), + prerequisites(prerequisites) + {} + + virtual ~ActionNode() = default; Action* getAction() { return action; } void setAction(Action* action) { this->action = action; } - std::string const getName() { return name; } + const std::string getName() { return name; } - NextAction** getContinuers() { return NextAction::merge(NextAction::clone(continuers), action->getContinuers()); } - NextAction** getAlternatives() + std::vector getContinuers() { - return NextAction::merge(NextAction::clone(alternatives), action->getAlternatives()); + return NextAction::merge(this->continuers, action->getContinuers()); } - NextAction** getPrerequisites() + std::vector getAlternatives() { - return NextAction::merge(NextAction::clone(prerequisites), action->getPrerequisites()); + return NextAction::merge(this->alternatives, action->getAlternatives()); + } + std::vector getPrerequisites() + { + return NextAction::merge(this->prerequisites, action->getPrerequisites()); } private: - std::string const name; + const std::string name; Action* action; - NextAction** continuers; - NextAction** alternatives; - NextAction** prerequisites; + std::vector continuers; + std::vector alternatives; + std::vector prerequisites; }; class ActionBasket @@ -121,14 +136,12 @@ class ActionBasket bool isSkipPrerequisites() { return skipPrerequisites; } void AmendRelevance(float k) { relevance *= k; } void setRelevance(float relevance) { this->relevance = relevance; } - bool isExpired(uint32 msecs); + bool isExpired(uint32_t msecs); private: ActionNode* action; float relevance; bool skipPrerequisites; Event event; - uint32 created; + uint32_t created; }; - -#endif diff --git a/src/strategy/AiObject.cpp b/src/Bot/Engine/AiObject.cpp similarity index 100% rename from src/strategy/AiObject.cpp rename to src/Bot/Engine/AiObject.cpp diff --git a/src/strategy/AiObject.h b/src/Bot/Engine/AiObject.h similarity index 85% rename from src/strategy/AiObject.h rename to src/Bot/Engine/AiObject.h index 4312313f5b..c161d4edba 100644 --- a/src/strategy/AiObject.h +++ b/src/Bot/Engine/AiObject.h @@ -42,9 +42,6 @@ class AiNamedObject : public AiObject // TRIGGERS // -#define NEXT_TRIGGERS(name, relevance) \ - virtual NextAction* getNextAction() { return new NextAction(name, relevance); } - #define BEGIN_TRIGGER(clazz, super) \ class clazz : public super \ { \ @@ -78,14 +75,6 @@ class AiNamedObject : public AiObject clazz(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, spell) {} \ } -#define BUFF_PARTY_TRIGGER_A(clazz, spell) \ - class clazz : public BuffOnPartyTrigger \ - { \ - public: \ - clazz(PlayerbotAI* botAI) : BuffOnPartyTrigger(botAI, spell) {} \ - bool IsActive() override; \ - } - #define DEBUFF_TRIGGER(clazz, spell) \ class clazz : public DebuffTrigger \ { \ @@ -296,14 +285,6 @@ class AiNamedObject : public AiObject clazz(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, spell) {} \ } -#define HEAL_ACTION_U(clazz, spell, useful) \ - class clazz : public CastHealingSpellAction \ - { \ - public: \ - clazz(PlayerbotAI* botAI) : CastHealingSpellAction(botAI, spell) {} \ - bool isUseful() override { return useful; } \ - } - #define HEAL_PARTY_ACTION(clazz, spell, estAmount, manaEfficiency) \ class clazz : public HealPartyMemberAction \ { \ @@ -404,14 +385,6 @@ class AiNamedObject : public AiObject clazz(PlayerbotAI* botAI) : CastReachTargetSpellAction(botAI, spell, range) {} \ } -#define REACH_ACTION_U(clazz, spell, range, useful) \ - class clazz : public CastReachTargetSpellAction \ - { \ - public: \ - clazz(PlayerbotAI* botAI) : CastReachTargetSpellAction(botAI, spell, range) {} \ - bool isUseful() override { return useful; } \ - } - #define ENEMY_HEALER_ACTION(clazz, spell) \ class clazz : public CastSpellOnEnemyHealerAction \ { \ @@ -440,10 +413,6 @@ class AiNamedObject : public AiObject clazz(PlayerbotAI* botAI) : CastProtectSpellAction(botAI, spell) {} \ } -#define END_RANGED_SPELL_ACTION() \ - } \ - ; - #define BEGIN_SPELL_ACTION(clazz, name) \ class clazz : public CastSpellAction \ { \ @@ -472,42 +441,4 @@ class AiNamedObject : public AiObject public: \ clazz(PlayerbotAI* botAI) : CastMeleeSpellAction(botAI, name) {} -#define END_RANGED_SPELL_ACTION() \ - } \ - ; - -#define BEGIN_BUFF_ON_PARTY_ACTION(clazz, name) \ - class clazz : public BuffOnPartyAction \ - { \ - public: \ - clazz(PlayerbotAI* botAI) : BuffOnPartyAction(botAI, name) {} - -// -// Action node -// - -// node_name , action, prerequisite -#define ACTION_NODE_P(name, spell, pre) \ - static ActionNode* name([[maybe_unused]] PlayerbotAI* botAI) \ - { \ - return new ActionNode(spell, /*P*/ NextAction::array(0, new NextAction(pre), nullptr), /*A*/ nullptr, \ - /*C*/ nullptr); \ - } - -// node_name , action, alternative -#define ACTION_NODE_A(name, spell, alt) \ - static ActionNode* name([[maybe_unused]] PlayerbotAI* botAI) \ - { \ - return new ActionNode(spell, /*P*/ nullptr, /*A*/ NextAction::array(0, new NextAction(alt), nullptr), \ - /*C*/ nullptr); \ - } - -// node_name , action, continuer -#define ACTION_NODE_C(name, spell, con) \ - static ActionNode* name([[maybe_unused]] PlayerbotAI* botAI) \ - { \ - return new ActionNode(spell, /*P*/ nullptr, /*A*/ nullptr, \ - /*C*/ NextAction::array(0, new NextAction(con), nullptr)); \ - } - #endif diff --git a/src/strategy/AiObjectContext.cpp b/src/Bot/Engine/AiObjectContext.cpp similarity index 87% rename from src/strategy/AiObjectContext.cpp rename to src/Bot/Engine/AiObjectContext.cpp index aa6a67cd35..b6d5f7de0d 100644 --- a/src/strategy/AiObjectContext.cpp +++ b/src/Bot/Engine/AiObjectContext.cpp @@ -27,32 +27,32 @@ #include "WarriorAiObjectContext.h" #include "WorldPacketActionContext.h" #include "WorldPacketTriggerContext.h" -#include "dungeons/DungeonStrategyContext.h" -#include "dungeons/wotlk/WotlkDungeonActionContext.h" -#include "dungeons/wotlk/WotlkDungeonTriggerContext.h" -#include "raids/RaidStrategyContext.h" -#include "raids/aq20/RaidAq20ActionContext.h" -#include "raids/aq20/RaidAq20TriggerContext.h" -#include "raids/moltencore/RaidMcActionContext.h" -#include "raids/moltencore/RaidMcTriggerContext.h" -#include "raids/blackwinglair/RaidBwlActionContext.h" -#include "raids/blackwinglair/RaidBwlTriggerContext.h" -#include "raids/karazhan/RaidKarazhanActionContext.h" -#include "raids/karazhan/RaidKarazhanTriggerContext.h" -#include "raids/magtheridon/RaidMagtheridonActionContext.h" -#include "raids/magtheridon/RaidMagtheridonTriggerContext.h" -#include "raids/gruulslair/RaidGruulsLairActionContext.h" -#include "raids/gruulslair/RaidGruulsLairTriggerContext.h" -#include "raids/eyeofeternity/RaidEoEActionContext.h" -#include "raids/eyeofeternity/RaidEoETriggerContext.h" -#include "raids/vaultofarchavon/RaidVoAActionContext.h" -#include "raids/vaultofarchavon/RaidVoATriggerContext.h" -#include "raids/obsidiansanctum/RaidOsActionContext.h" -#include "raids/obsidiansanctum/RaidOsTriggerContext.h" -#include "raids/onyxia/RaidOnyxiaActionContext.h" -#include "raids/onyxia/RaidOnyxiaTriggerContext.h" -#include "raids/icecrown/RaidIccActionContext.h" -#include "raids/icecrown/RaidIccTriggerContext.h" +#include "Ai/Dungeon/DungeonStrategyContext.h" +#include "Ai/Dungeon/WotlkDungeonActionContext.h" +#include "Ai/Dungeon/WotlkDungeonTriggerContext.h" +#include "Ai/Raid/RaidStrategyContext.h" +#include "Ai/Raid/Aq20/RaidAq20ActionContext.h" +#include "Ai/Raid/Aq20/RaidAq20TriggerContext.h" +#include "Ai/Raid/MoltenCore/RaidMcActionContext.h" +#include "Ai/Raid/MoltenCore/RaidMcTriggerContext.h" +#include "Ai/Raid/BlackwingLair/RaidBwlActionContext.h" +#include "Ai/Raid/BlackwingLair/RaidBwlTriggerContext.h" +#include "Ai/Raid/Karazhan/RaidKarazhanActionContext.h" +#include "Ai/Raid/Karazhan/RaidKarazhanTriggerContext.h" +#include "Ai/Raid/Magtheridon/RaidMagtheridonActionContext.h" +#include "Ai/Raid/Magtheridon/RaidMagtheridonTriggerContext.h" +#include "Ai/Raid/GruulsLair/RaidGruulsLairActionContext.h" +#include "Ai/Raid/GruulsLair/RaidGruulsLairTriggerContext.h" +#include "Ai/Raid/EyeOfEternity/RaidEoEActionContext.h" +#include "Ai/Raid/EyeOfEternity/RaidEoETriggerContext.h" +#include "Ai/Raid/VaultOfArchavon/RaidVoAActionContext.h" +#include "Ai/Raid/VaultOfArchavon/RaidVoATriggerContext.h" +#include "Ai/Raid/ObsidianSanctum/RaidOsActionContext.h" +#include "Ai/Raid/ObsidianSanctum/RaidOsTriggerContext.h" +#include "Ai/Raid/Onyxia/RaidOnyxiaActionContext.h" +#include "Ai/Raid/Onyxia/RaidOnyxiaTriggerContext.h" +#include "Ai/Raid/Icecrown/RaidIccActionContext.h" +#include "Ai/Raid/Icecrown/RaidIccTriggerContext.h" SharedNamedObjectContextList AiObjectContext::sharedStrategyContexts; SharedNamedObjectContextList AiObjectContext::sharedActionContexts; diff --git a/src/strategy/AiObjectContext.h b/src/Bot/Engine/AiObjectContext.h similarity index 100% rename from src/strategy/AiObjectContext.h rename to src/Bot/Engine/AiObjectContext.h diff --git a/src/strategy/Engine.cpp b/src/Bot/Engine/Engine.cpp similarity index 90% rename from src/strategy/Engine.cpp rename to src/Bot/Engine/Engine.cpp index 2e36e05715..6ed61a1a4b 100644 --- a/src/strategy/Engine.cpp +++ b/src/Bot/Engine/Engine.cpp @@ -7,7 +7,7 @@ #include "Action.h" #include "Event.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Playerbots.h" #include "Queue.h" #include "Strategy.h" @@ -204,7 +204,7 @@ bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal) } } - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_ACTION, action->getName(), &aiObjectContext->performanceStack); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_ACTION, action->getName(), &aiObjectContext->performanceStack); actionExecuted = ListenAndExecute(action, event); if (pmo) pmo->finish(); @@ -258,48 +258,45 @@ ActionNode* Engine::CreateActionNode(std::string const name) return node; return new ActionNode(name, - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); + /*P*/ {}, + /*A*/ {}, + /*C*/ {}); } -bool Engine::MultiplyAndPush(NextAction** actions, float forceRelevance, bool skipPrerequisites, Event event, - char const* pushType) +bool Engine::MultiplyAndPush( + std::vector actions, + float forceRelevance, + bool skipPrerequisites, + Event event, + char const* pushType +) { bool pushed = false; - if (actions) + + for (NextAction nextAction : actions) { - for (uint32 j = 0; actions[j]; j++) - { - if (NextAction* nextAction = actions[j]) - { - ActionNode* action = CreateActionNode(nextAction->getName()); - InitializeAction(action); + ActionNode* action = this->CreateActionNode(nextAction.getName()); - float k = nextAction->getRelevance(); - if (forceRelevance > 0.0f) - { - k = forceRelevance; - } + this->InitializeAction(action); - if (k > 0) - { - LogAction("PUSH:%s - %f (%s)", action->getName().c_str(), k, pushType); - queue.Push(new ActionBasket(action, k, skipPrerequisites, event)); - pushed = true; - } - else - { - delete action; - } + float k = nextAction.getRelevance(); - delete nextAction; - } - else - break; + if (forceRelevance > 0.0f) + { + k = forceRelevance; } - delete[] actions; + if (k > 0) + { + this->LogAction("PUSH:%s - %f (%s)", action->getName().c_str(), k, pushType); + queue.Push(new ActionBasket(action, k, skipPrerequisites, event)); + pushed = true; + + continue; + } + + delete action; + } return pushed; @@ -459,8 +456,8 @@ void Engine::ProcessTriggers(bool minimal) if (minimal && node->getFirstRelevance() < 100) continue; - PerformanceMonitorOperation* pmo = - sPerformanceMonitor->start(PERF_MON_TRIGGER, trigger->getName(), &aiObjectContext->performanceStack); + PerfMonitorOperation* pmo = + sPerfMonitor->start(PERF_MON_TRIGGER, trigger->getName(), &aiObjectContext->performanceStack); Event event = trigger->Check(); if (pmo) pmo->finish(); @@ -530,10 +527,10 @@ std::vector Engine::GetStrategies() void Engine::PushAgain(ActionNode* actionNode, float relevance, Event event) { - NextAction** nextAction = new NextAction*[2]; - nextAction[0] = new NextAction(actionNode->getName(), relevance); - nextAction[1] = nullptr; + std::vector nextAction = { NextAction(actionNode->getName(), relevance) }; + MultiplyAndPush(nextAction, relevance, true, event, "again"); + delete actionNode; } @@ -563,6 +560,13 @@ bool Engine::ListenAndExecute(Action* action, Event event) { bool actionExecuted = false; + if (action == nullptr) + { + LOG_ERROR("playerbots", "Action is nullptr"); + + return actionExecuted; + } + if (actionExecutionListeners.Before(action, event)) { actionExecuted = actionExecutionListeners.AllowExecution(action, event) ? action->Execute(event) : true; @@ -602,7 +606,7 @@ void Engine::LogAction(char const* format, ...) va_list ap; va_start(ap, format); - vsprintf(buf, format, ap); + vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); lastAction += "|"; diff --git a/src/strategy/Engine.h b/src/Bot/Engine/Engine.h similarity index 97% rename from src/strategy/Engine.h rename to src/Bot/Engine/Engine.h index 6b98e04f42..8a7c34189d 100644 --- a/src/strategy/Engine.h +++ b/src/Bot/Engine/Engine.h @@ -90,7 +90,7 @@ class Engine : public PlayerbotAIAware bool testMode; private: - bool MultiplyAndPush(NextAction** actions, float forceRelevance, bool skipPrerequisites, Event event, + bool MultiplyAndPush(std::vector actions, float forceRelevance, bool skipPrerequisites, Event event, const char* pushType); void Reset(); void ProcessTriggers(bool minimal); diff --git a/src/strategy/ExternalEventHelper.cpp b/src/Bot/Engine/ExternalEventHelper.cpp similarity index 100% rename from src/strategy/ExternalEventHelper.cpp rename to src/Bot/Engine/ExternalEventHelper.cpp diff --git a/src/strategy/ExternalEventHelper.h b/src/Bot/Engine/ExternalEventHelper.h similarity index 100% rename from src/strategy/ExternalEventHelper.h rename to src/Bot/Engine/ExternalEventHelper.h diff --git a/src/strategy/Multiplier.h b/src/Bot/Engine/Multiplier.h similarity index 100% rename from src/strategy/Multiplier.h rename to src/Bot/Engine/Multiplier.h diff --git a/src/strategy/NamedObjectContext.cpp b/src/Bot/Engine/NamedObjectContext.cpp similarity index 100% rename from src/strategy/NamedObjectContext.cpp rename to src/Bot/Engine/NamedObjectContext.cpp diff --git a/src/strategy/NamedObjectContext.h b/src/Bot/Engine/NamedObjectContext.h similarity index 100% rename from src/strategy/NamedObjectContext.h rename to src/Bot/Engine/NamedObjectContext.h diff --git a/src/strategy/PassiveMultiplier.cpp b/src/Bot/Engine/PassiveMultiplier.cpp similarity index 100% rename from src/strategy/PassiveMultiplier.cpp rename to src/Bot/Engine/PassiveMultiplier.cpp diff --git a/src/strategy/PassiveMultiplier.h b/src/Bot/Engine/PassiveMultiplier.h similarity index 100% rename from src/strategy/PassiveMultiplier.h rename to src/Bot/Engine/PassiveMultiplier.h diff --git a/src/PlayerbotAIAware.h b/src/Bot/Engine/PlayerbotAIAware.h similarity index 100% rename from src/PlayerbotAIAware.h rename to src/Bot/Engine/PlayerbotAIAware.h diff --git a/src/PlayerbotAIBase.cpp b/src/Bot/Engine/PlayerbotAIBase.cpp similarity index 94% rename from src/PlayerbotAIBase.cpp rename to src/Bot/Engine/PlayerbotAIBase.cpp index 992e83491a..c034979340 100644 --- a/src/PlayerbotAIBase.cpp +++ b/src/Bot/Engine/PlayerbotAIBase.cpp @@ -14,7 +14,7 @@ void PlayerbotAIBase::UpdateAI(uint32 elapsed, bool minimal) if (totalPmo) totalPmo->finish(); - totalPmo = sPerformanceMonitor->start(PERF_MON_TOTAL, "PlayerbotAIBase::FullTick"); + totalPmo = sPerfMonitor->start(PERF_MON_TOTAL, "PlayerbotAIBase::FullTick"); if (nextAICheckDelay > elapsed) nextAICheckDelay -= elapsed; diff --git a/src/PlayerbotAIBase.h b/src/Bot/Engine/PlayerbotAIBase.h similarity index 93% rename from src/PlayerbotAIBase.h rename to src/Bot/Engine/PlayerbotAIBase.h index 2b1f6d3f83..03c762a58f 100644 --- a/src/PlayerbotAIBase.h +++ b/src/Bot/Engine/PlayerbotAIBase.h @@ -25,7 +25,7 @@ class PlayerbotAIBase protected: uint32 nextAICheckDelay; - class PerformanceMonitorOperation* totalPmo = nullptr; + class PerfMonitorOperation* totalPmo = nullptr; private: bool _isBotAI; diff --git a/src/strategy/CustomStrategy.cpp b/src/Bot/Engine/Strategy/CustomStrategy.cpp similarity index 80% rename from src/strategy/CustomStrategy.cpp rename to src/Bot/Engine/Strategy/CustomStrategy.cpp index a056aed5e1..d4dd3e514e 100644 --- a/src/strategy/CustomStrategy.cpp +++ b/src/Bot/Engine/Strategy/CustomStrategy.cpp @@ -6,36 +6,40 @@ #include "CustomStrategy.h" #include +#include #include "Playerbots.h" std::map CustomStrategy::actionLinesCache; -NextAction* toNextAction(std::string const action) +NextAction toNextAction(std::string const action) { std::vector tokens = split(action, '!'); - if (tokens.size() == 2 && !tokens[0].empty()) - return new NextAction(tokens[0], atof(tokens[1].c_str())); - else if (tokens.size() == 1 && !tokens[0].empty()) - return new NextAction(tokens[0], ACTION_NORMAL); + + if (tokens[0].empty()) + throw std::invalid_argument("Invalid action"); + + if (tokens.size() == 2) + return NextAction(tokens[0], atof(tokens[1].c_str())); + + if (tokens.size() == 1) + return NextAction(tokens[0], ACTION_NORMAL); LOG_ERROR("playerbots", "Invalid action {}", action.c_str()); - return nullptr; + + throw std::invalid_argument("Invalid action"); } -NextAction** toNextActionArray(std::string const actions) +std::vector toNextActionArray(const std::string actions) { - std::vector tokens = split(actions, ','); - NextAction** res = new NextAction*[tokens.size() + 1]; + const std::vector tokens = split(actions, ','); + std::vector res = {}; - uint32 index = 0; - for (std::vector::iterator i = tokens.begin(); i != tokens.end(); ++i) + for (const std::string token : tokens) { - if (NextAction* na = toNextAction(*i)) - res[index++] = na; + res.push_back(toNextAction(token)); } - res[index++] = nullptr; return res; } diff --git a/src/strategy/CustomStrategy.h b/src/Bot/Engine/Strategy/CustomStrategy.h similarity index 100% rename from src/strategy/CustomStrategy.h rename to src/Bot/Engine/Strategy/CustomStrategy.h diff --git a/src/Bot/Engine/Strategy/Strategy.cpp b/src/Bot/Engine/Strategy/Strategy.cpp new file mode 100644 index 0000000000..d6193e11e4 --- /dev/null +++ b/src/Bot/Engine/Strategy/Strategy.cpp @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "Strategy.h" + +#include "Playerbots.h" + +class ActionNodeFactoryInternal : public NamedObjectFactory +{ +public: + ActionNodeFactoryInternal() + { + creators["melee"] = &melee; + creators["healthstone"] = &healthstone; + creators["be near"] = &follow_master_random; + creators["attack anything"] = &attack_anything; + creators["move random"] = &move_random; + creators["move to loot"] = &move_to_loot; + creators["food"] = &food; + creators["drink"] = &drink; + creators["mana potion"] = &mana_potion; + creators["healing potion"] = &healing_potion; + creators["flee"] = &flee; + } + +private: + static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "melee", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* healthstone([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "healthstone", + /*P*/ {}, + /*A*/ { NextAction("healing potion") }, + /*C*/ {} + ); + } + + static ActionNode* follow_master_random([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "be near", + /*P*/ {}, + /*A*/ { NextAction("follow") }, + /*C*/ {} + ); + } + + static ActionNode* attack_anything([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "attack anything", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* move_random([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "move random", + /*P*/ {}, + /*A*/ { NextAction("stay line") }, + /*C*/ {} + ); + } + + static ActionNode* move_to_loot([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "move to loot", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* food([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "food", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* drink([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "drink", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* mana_potion([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "mana potion", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } + + static ActionNode* healing_potion([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "healing potion", + /*P*/ {}, + /*A*/ { NextAction("food") }, + /*C*/ {} + ); + } + + static ActionNode* flee([[maybe_unused]] PlayerbotAI* botAI) + { + return new ActionNode( + "flee", + /*P*/ {}, + /*A*/ {}, + /*C*/ {} + ); + } +}; + +Strategy::Strategy(PlayerbotAI* botAI) : PlayerbotAIAware(botAI) +{ + actionNodeFactories.Add(new ActionNodeFactoryInternal()); +} + +ActionNode* Strategy::GetAction(std::string const name) { return actionNodeFactories.GetContextObject(name, botAI); } diff --git a/src/strategy/Strategy.h b/src/Bot/Engine/Strategy/Strategy.h similarity index 96% rename from src/strategy/Strategy.h rename to src/Bot/Engine/Strategy/Strategy.h index 333906fe73..8f57bc0784 100644 --- a/src/strategy/Strategy.h +++ b/src/Bot/Engine/Strategy/Strategy.h @@ -60,7 +60,7 @@ class Strategy : public PlayerbotAIAware Strategy(PlayerbotAI* botAI); virtual ~Strategy() {} - virtual NextAction** getDefaultActions() { return nullptr; } + virtual std::vector getDefaultActions() { return {}; } virtual void InitTriggers([[maybe_unused]] std::vector& triggers) {} virtual void InitMultipliers([[maybe_unused]] std::vector& multipliers) {} virtual std::string const getName() = 0; diff --git a/src/strategy/Trigger.cpp b/src/Bot/Engine/Trigger/Trigger.cpp similarity index 100% rename from src/strategy/Trigger.cpp rename to src/Bot/Engine/Trigger/Trigger.cpp diff --git a/src/strategy/Trigger.h b/src/Bot/Engine/Trigger/Trigger.h similarity index 51% rename from src/strategy/Trigger.h rename to src/Bot/Engine/Trigger/Trigger.h index 8b391730ee..d32845dc52 100644 --- a/src/strategy/Trigger.h +++ b/src/Bot/Engine/Trigger/Trigger.h @@ -3,8 +3,7 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#ifndef _PLAYERBOT_TRIGGER_H -#define _PLAYERBOT_TRIGGER_H +#pragma once #include "Action.h" #include "Common.h" @@ -15,7 +14,11 @@ class Unit; class Trigger : public AiNamedObject { public: - Trigger(PlayerbotAI* botAI, std::string const name = "trigger", int32 checkInterval = 1); + Trigger( + PlayerbotAI* botAI, + const std::string name = "trigger", + int32_t checkInterval = 1 + ); virtual ~Trigger() {} @@ -23,7 +26,7 @@ class Trigger : public AiNamedObject virtual void ExternalEvent([[maybe_unused]] std::string const param, [[maybe_unused]] Player* owner = nullptr) {} virtual void ExternalEvent([[maybe_unused]] WorldPacket& packet, [[maybe_unused]] Player* owner = nullptr) {} virtual bool IsActive() { return false; } - virtual NextAction** getHandlers() { return nullptr; } + virtual std::vector getHandlers() { return {}; } void Update() {} virtual void Reset() {} virtual Unit* GetTarget(); @@ -33,32 +36,49 @@ class Trigger : public AiNamedObject bool needCheck(uint32 now); protected: - int32 checkInterval; - uint32 lastCheckTime; + int32_t checkInterval; + uint32_t lastCheckTime; }; class TriggerNode { public: - TriggerNode(std::string const name, NextAction** handlers = nullptr) - : trigger(nullptr), handlers(handlers), name(name) - { - } // reorder args - whipowill - - virtual ~TriggerNode() { NextAction::destroy(handlers); } + TriggerNode( + const std::string& name, + std::vector handlers = {} + ) : + trigger(nullptr), + handlers(std::move(handlers)), + name(name) + {} Trigger* getTrigger() { return trigger; } void setTrigger(Trigger* trigger) { this->trigger = trigger; } - std::string const getName() { return name; } + const std::string getName() { return name; } + + std::vector getHandlers() + { + std::vector result = this->handlers; - NextAction** getHandlers() { return NextAction::merge(NextAction::clone(handlers), trigger->getHandlers()); } + if (trigger != nullptr) + { + std::vector extra = trigger->getHandlers(); + result.insert(result.end(), extra.begin(), extra.end()); + } - float getFirstRelevance() { return handlers[0] ? handlers[0]->getRelevance() : -1; } + return result; + } + + float getFirstRelevance() + { + if (this->handlers.size() > 0) + return this->handlers[0].getRelevance(); + + return -1; + } private: Trigger* trigger; - NextAction** handlers; - std::string const name; + std::vector handlers; + const std::string name; }; - -#endif diff --git a/src/strategy/Value.cpp b/src/Bot/Engine/Value/Value.cpp similarity index 95% rename from src/strategy/Value.cpp rename to src/Bot/Engine/Value/Value.cpp index ac10774c65..c559e03816 100644 --- a/src/strategy/Value.cpp +++ b/src/Bot/Engine/Value/Value.cpp @@ -5,7 +5,7 @@ #include "Value.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Playerbots.h" #include "Timer.h" @@ -123,7 +123,7 @@ Unit* UnitCalculatedValue::Get() { if (checkInterval < 2) { - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start( + PerfMonitorOperation* pmo = sPerfMonitor->start( PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); value = Calculate(); if (pmo) @@ -135,7 +135,7 @@ Unit* UnitCalculatedValue::Get() if (!lastCheckTime || now - lastCheckTime >= checkInterval) { lastCheckTime = now; - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start( + PerfMonitorOperation* pmo = sPerfMonitor->start( PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); value = Calculate(); if (pmo) diff --git a/src/strategy/Value.h b/src/Bot/Engine/Value/Value.h similarity index 95% rename from src/strategy/Value.h rename to src/Bot/Engine/Value/Value.h index 8c370226f2..b37e162050 100644 --- a/src/strategy/Value.h +++ b/src/Bot/Engine/Value/Value.h @@ -10,7 +10,7 @@ #include "AiObject.h" #include "ObjectGuid.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Timer.h" #include "Unit.h" @@ -72,7 +72,7 @@ class CalculatedValue : public UntypedValue, public Value { if (checkInterval < 2) { - // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), + // PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_VALUE, this->getName(), // this->context ? &this->context->performanceStack : nullptr); value = Calculate(); // if (pmo) @@ -84,7 +84,7 @@ class CalculatedValue : public UntypedValue, public Value if (!lastCheckTime || now - lastCheckTime >= checkInterval) { lastCheckTime = now; - // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), + // PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_VALUE, this->getName(), // this->context ? &this->context->performanceStack : nullptr); value = Calculate(); // if (pmo) @@ -105,7 +105,7 @@ class CalculatedValue : public UntypedValue, public Value { if (checkInterval < 2) { - // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), + // PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_VALUE, this->getName(), // this->context ? &this->context->performanceStack : nullptr); value = Calculate(); // if (pmo) @@ -117,7 +117,7 @@ class CalculatedValue : public UntypedValue, public Value if (!lastCheckTime || now - lastCheckTime >= checkInterval) { lastCheckTime = now; - // PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_VALUE, this->getName(), + // PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_VALUE, this->getName(), // this->context ? &this->context->performanceStack : nullptr); value = Calculate(); // if (pmo) @@ -154,7 +154,7 @@ class SingleCalculatedValue : public CalculatedValue { this->lastCheckTime = now; - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start( + PerfMonitorOperation* pmo = sPerfMonitor->start( PERF_MON_VALUE, this->getName(), this->context ? &this->context->performanceStack : nullptr); this->value = this->Calculate(); if (pmo) diff --git a/src/strategy/Event.cpp b/src/Bot/Engine/WorldPacket/Event.cpp similarity index 100% rename from src/strategy/Event.cpp rename to src/Bot/Engine/WorldPacket/Event.cpp diff --git a/src/strategy/Event.h b/src/Bot/Engine/WorldPacket/Event.h similarity index 100% rename from src/strategy/Event.h rename to src/Bot/Engine/WorldPacket/Event.h diff --git a/src/AiFactory.cpp b/src/Bot/Factory/AiFactory.cpp similarity index 100% rename from src/AiFactory.cpp rename to src/Bot/Factory/AiFactory.cpp diff --git a/src/AiFactory.h b/src/Bot/Factory/AiFactory.h similarity index 100% rename from src/AiFactory.h rename to src/Bot/Factory/AiFactory.h diff --git a/src/factory/PlayerbotFactory.cpp b/src/Bot/Factory/PlayerbotFactory.cpp similarity index 97% rename from src/factory/PlayerbotFactory.cpp rename to src/Bot/Factory/PlayerbotFactory.cpp index ef320eba40..67f5909c11 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/Bot/Factory/PlayerbotFactory.cpp @@ -24,12 +24,12 @@ #include "LootMgr.h" #include "MapMgr.h" #include "ObjectMgr.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "PetDefines.h" #include "Player.h" #include "PlayerbotAI.h" #include "PlayerbotAIConfig.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "PlayerbotGuildMgr.h" #include "Playerbots.h" #include "QuestDef.h" @@ -122,7 +122,11 @@ void PlayerbotFactory::Init() uint32 maxStoreSize = sSpellMgr->GetSpellInfoStoreSize(); for (uint32 id = 1; id < maxStoreSize; ++id) { - if (id == 47181 || id == 50358 || id == 47242 || id == 52639 || id == 47147 || id == 7218) // Test Enchant + if (id == 7218 || id == 19927 || id == 44119 || id == 47147 || id == 47181 || + id == 47242 || id == 50358 || id == 52639) // Test Enchants + continue; + + if (id == 35791 || id == 39405) // Grandfathered TBC Enchants continue; if (id == 15463 || id == 15490) // Legendary Arcane Amalgamation @@ -236,7 +240,7 @@ void PlayerbotFactory::Randomize(bool incremental) // LOG_DEBUG("playerbots", "Preparing to {} randomize...", (incremental ? "incremental" : "full")); Prepare(); LOG_DEBUG("playerbots", "Resetting player..."); - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reset"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reset"); if (!sPlayerbotAIConfig->equipmentPersistence || level < sPlayerbotAIConfig->equipmentPersistenceLevel) { bot->resetTalents(true); @@ -262,7 +266,7 @@ void PlayerbotFactory::Randomize(bool incremental) if (pmo) pmo->finish(); - // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Immersive"); + // pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Immersive"); // LOG_INFO("playerbots", "Initializing immersive..."); // InitImmersive(); // if (pmo) @@ -270,7 +274,7 @@ void PlayerbotFactory::Randomize(bool incremental) if (sPlayerbotAIConfig->randomBotPreQuests) { - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Quests"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Quests"); InitInstanceQuests(); InitAttunementQuests(); if (pmo) @@ -278,27 +282,27 @@ void PlayerbotFactory::Randomize(bool incremental) } else { - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Quests"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Quests"); InitAttunementQuests(); if (pmo) pmo->finish(); } - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells1"); - LOG_DEBUG("playerbots", "Initializing spells (step 1)..."); + LOG_DEBUG("playerbots", "Initializing skills (step 1)..."); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills1"); bot->LearnDefaultSkills(); - InitClassSpells(); - InitAvailableSpells(); + InitSkills(); if (pmo) pmo->finish(); - LOG_DEBUG("playerbots", "Initializing skills (step 1)..."); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills1"); - InitSkills(); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells1"); + LOG_DEBUG("playerbots", "Initializing spells (step 1)..."); + InitClassSpells(); + InitAvailableSpells(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Talents"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Talents"); LOG_DEBUG("playerbots", "Initializing talents..."); if (!incremental || !sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel) @@ -308,45 +312,45 @@ void PlayerbotFactory::Randomize(bool incremental) sRandomPlayerbotMgr->SetValue(bot->GetGUID().GetCounter(), "specNo", 0); if (botAI) { - sPlayerbotDbStore->Reset(botAI); + sPlayerbotRepository->Reset(botAI); // botAI->DoSpecificAction("auto talents"); botAI->ResetStrategies(false); // fix wrong stored strategy } if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells2"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells2"); LOG_DEBUG("playerbots", "Initializing spells (step 2)..."); InitAvailableSpells(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reputation"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reputation"); LOG_DEBUG("playerbots", "Initializing reputation..."); InitReputation(); if (pmo) pmo->finish(); LOG_DEBUG("playerbots", "Initializing special spells..."); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells3"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Spells3"); InitSpecialSpells(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Mounts"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Mounts"); LOG_DEBUG("playerbots", "Initializing mounts..."); InitMounts(); // bot->SaveToDB(false, false); if (pmo) pmo->finish(); - // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills2"); + // pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Skills2"); // LOG_INFO("playerbots", "Initializing skills (step 2)..."); // UpdateTradeSkills(); // if (pmo) // pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip"); LOG_DEBUG("playerbots", "Initializing equipmemt..."); if (!incremental || !sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel) @@ -360,51 +364,51 @@ void PlayerbotFactory::Randomize(bool incremental) // if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) // { - // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Enchant"); + // pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Enchant"); // LOG_INFO("playerbots", "Initializing enchant templates..."); // LoadEnchantContainer(); // if (pmo) // pmo->finish(); // } - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Bags"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Bags"); LOG_DEBUG("playerbots", "Initializing bags..."); InitBags(); // bot->SaveToDB(false, false); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Ammo"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Ammo"); LOG_DEBUG("playerbots", "Initializing ammo..."); InitAmmo(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Food"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Food"); LOG_DEBUG("playerbots", "Initializing food..."); InitFood(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Potions"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Potions"); LOG_DEBUG("playerbots", "Initializing potions..."); InitPotions(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reagents"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reagents"); LOG_DEBUG("playerbots", "Initializing reagents..."); InitReagents(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Keys"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Keys"); LOG_DEBUG("playerbots", "Initializing keys..."); InitKeyring(); if (pmo) pmo->finish(); - // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EqSets"); + // pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EqSets"); // LOG_DEBUG("playerbots", "Initializing second equipment set..."); // InitSecondEquipmentSet(); // if (pmo) @@ -415,20 +419,20 @@ void PlayerbotFactory::Randomize(bool incremental) ApplyEnchantAndGemsNew(); } // { - // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EnchantTemplate"); + // pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_EnchantTemplate"); // LOG_INFO("playerbots", "Initializing enchant templates..."); // ApplyEnchantTemplate(); // if (pmo) // pmo->finish(); // } - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Inventory"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Inventory"); LOG_DEBUG("playerbots", "Initializing inventory..."); // InitInventory(); if (pmo) pmo->finish(); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Consumable"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Consumable"); LOG_DEBUG("playerbots", "Initializing consumables..."); InitConsumables(); if (pmo) @@ -438,7 +442,7 @@ void PlayerbotFactory::Randomize(bool incremental) InitGlyphs(); // bot->SaveToDB(false, false); - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Guilds"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Guilds"); // bot->SaveToDB(false, false); if (sPlayerbotAIConfig->randomBotGuildCount > 0) { @@ -451,7 +455,7 @@ void PlayerbotFactory::Randomize(bool incremental) if (bot->GetLevel() >= 70) { - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Arenas"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Arenas"); // LOG_INFO("playerbots", "Initializing arena teams..."); InitArenaTeam(); if (pmo) @@ -466,7 +470,7 @@ void PlayerbotFactory::Randomize(bool incremental) } if (bot->GetLevel() >= 10) { - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Pet"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Pet"); LOG_DEBUG("playerbots", "Initializing pet..."); InitPet(); // bot->SaveToDB(false, false); @@ -475,7 +479,7 @@ void PlayerbotFactory::Randomize(bool incremental) pmo->finish(); } - pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Save"); + pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Save"); LOG_DEBUG("playerbots", "Saving to DB..."); bot->SetMoney(urand(level * 100000, level * 5 * 100000)); bot->SetHealth(bot->GetMaxHealth()); @@ -502,9 +506,9 @@ void PlayerbotFactory::Refresh() InitPotions(); InitPet(); InitPetTalents(); + InitSkills(); InitClassSpells(); InitAvailableSpells(); - InitSkills(); InitReputation(); InitSpecialSpells(); InitMounts(); @@ -1103,8 +1107,6 @@ void PlayerbotFactory::ResetQuests() } } -void PlayerbotFactory::InitSpells() { InitAvailableSpells(); } - void PlayerbotFactory::InitTalentsTree(bool increment /*false*/, bool use_template /*true*/, bool reset /*false*/) { uint32 specTab; @@ -2526,66 +2528,41 @@ void PlayerbotFactory::InitAvailableSpells() for (CreatureTemplateContainer::const_iterator i = creatureTemplateContainer->begin(); i != creatureTemplateContainer->end(); ++i) { - CreatureTemplate const& co = i->second; - if (co.trainer_type != TRAINER_TYPE_TRADESKILLS && co.trainer_type != TRAINER_TYPE_CLASS) + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(i->first); + + if (!trainer) continue; - if (co.trainer_type == TRAINER_TYPE_CLASS && co.trainer_class != bot->getClass()) + if (trainer->GetTrainerType() != Trainer::Type::Tradeskill && + trainer->GetTrainerType() != Trainer::Type::Class) continue; - uint32 trainerId = co.Entry; - trainerIdCache[bot->getClass()].push_back(trainerId); + if (trainer->GetTrainerType() == Trainer::Type::Class && + !trainer->IsTrainerValidForPlayer(bot)) + continue; + + trainerIdCache[bot->getClass()].push_back(i->first); } } for (uint32 trainerId : trainerIdCache[bot->getClass()]) { - TrainerSpellData const* trainer_spells = sObjectMgr->GetNpcTrainerSpells(trainerId); - if (!trainer_spells) - trainer_spells = sObjectMgr->GetNpcTrainerSpells(trainerId); - - if (!trainer_spells) - continue; + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(trainerId); - for (TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); - itr != trainer_spells->spellList.end(); ++itr) + for (auto& spell : trainer->GetSpells()) { - TrainerSpell const* tSpell = &itr->second; - - if (!tSpell) - continue; - - if (tSpell->learnedSpell[0] && !bot->IsSpellFitByClassAndRace(tSpell->learnedSpell[0])) - continue; + // simplified version of Trainer::TeachSpell method - TrainerSpellState state = bot->GetTrainerSpellState(tSpell); - if (state != TRAINER_SPELL_GREEN) + Trainer::Spell const* trainerSpell = trainer->GetSpell(spell.SpellId); + if (!trainerSpell) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(tSpell->spell); - bool learn = true; - for (uint8 j = 0; j < 3; ++j) - { - if (!tSpell->learnedSpell[j] && !bot->IsSpellFitByClassAndRace(tSpell->learnedSpell[j])) - continue; - - if (spellInfo->Effects[j].Effect == SPELL_EFFECT_PROFICIENCY || - (spellInfo->Effects[j].Effect == SPELL_EFFECT_SKILL_STEP && - spellInfo->Effects[j].MiscValue != SKILL_RIDING) || - spellInfo->Effects[j].Effect == SPELL_EFFECT_DUAL_WIELD) - { - learn = false; - break; - } - } - if (!learn) - { + if (!trainer->CanTeachSpell(bot, trainerSpell)) continue; - } - if (tSpell->IsCastable()) - bot->CastSpell(bot, tSpell->spell, true); + if (trainerSpell->IsCastable()) + bot->CastSpell(bot, trainerSpell->SpellId, true); else - bot->learnSpell(tSpell->learnedSpell[0], false); + bot->learnSpell(trainerSpell->SpellId, false); } } } diff --git a/src/factory/PlayerbotFactory.h b/src/Bot/Factory/PlayerbotFactory.h similarity index 99% rename from src/factory/PlayerbotFactory.h rename to src/Bot/Factory/PlayerbotFactory.h index 109d710957..d943463eaa 100644 --- a/src/factory/PlayerbotFactory.h +++ b/src/Bot/Factory/PlayerbotFactory.h @@ -95,7 +95,6 @@ class PlayerbotFactory void InitTradeSkills(); void UpdateTradeSkills(); void SetRandomSkill(uint16 id); - void InitSpells(); void ClearSpells(); void ClearSkills(); void InitTalents(uint32 specNo); diff --git a/src/RandomPlayerbotFactory.cpp b/src/Bot/Factory/RandomPlayerbotFactory.cpp similarity index 100% rename from src/RandomPlayerbotFactory.cpp rename to src/Bot/Factory/RandomPlayerbotFactory.cpp diff --git a/src/RandomPlayerbotFactory.h b/src/Bot/Factory/RandomPlayerbotFactory.h similarity index 100% rename from src/RandomPlayerbotFactory.h rename to src/Bot/Factory/RandomPlayerbotFactory.h diff --git a/src/PlayerbotAI.cpp b/src/Bot/PlayerbotAI.cpp similarity index 96% rename from src/PlayerbotAI.cpp rename to src/Bot/PlayerbotAI.cpp index d10f950ce4..39db7c5948 100644 --- a/src/PlayerbotAI.cpp +++ b/src/Bot/PlayerbotAI.cpp @@ -38,10 +38,10 @@ #include "NewRpgStrategy.h" #include "ObjectGuid.h" #include "ObjectMgr.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Player.h" #include "PlayerbotAIConfig.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "PlayerbotMgr.h" #include "PlayerbotGuildMgr.h" #include "Playerbots.h" @@ -89,8 +89,10 @@ void PacketHandlingHelper::Handle(ExternalEventHelper& helper) { while (!queue.empty()) { - helper.HandlePacket(handlers, queue.top()); - queue.pop(); + WorldPacket packet = queue.top(); + queue.pop(); // remove first so handling can't modify the queue while we're using it + + helper.HandlePacket(handlers, packet); } } @@ -437,12 +439,19 @@ void PlayerbotAI::UpdateAIGroupMaster() void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal) { - if (bot->IsBeingTeleported() || !bot->IsInWorld()) + + if (!bot || !bot->GetSession()) + return; + + if (!bot->IsInWorld() || bot->IsBeingTeleported() || bot->IsDuringRemoveFromWorld()) return; + if (!bot->GetMap()) + return; // instances are created and destroyed on demand + std::string const mapString = WorldPosition(bot).isOverworld() ? std::to_string(bot->GetMapId()) : "I"; - PerformanceMonitorOperation* pmo = - sPerformanceMonitor->start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); + PerfMonitorOperation* pmo = + sPerfMonitor->start(PERF_MON_TOTAL, "PlayerbotAI::UpdateAIInternal " + mapString); ExternalEventHelper helper(aiObjectContext); // chat replies @@ -516,23 +525,37 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal void PlayerbotAI::HandleCommands() { ExternalEventHelper helper(aiObjectContext); + for (auto it = chatCommands.begin(); it != chatCommands.end();) { time_t& checkTime = it->GetTime(); - if (checkTime && time(0) < checkTime) + if (checkTime && time(nullptr) < checkTime) { ++it; continue; } - const std::string& command = it->GetCommand(); Player* owner = it->GetOwner(); + if (!owner) + { + it = chatCommands.erase(it); + continue; + } + + const std::string& command = it->GetCommand(); + if (command.empty()) + { + it = chatCommands.erase(it); + continue; + } + if (!helper.ParseChatCommand(command, owner) && it->GetType() == CHAT_MSG_WHISPER) { // ostringstream out; out << "Unknown command " << command; // TellPlayer(out); // helper.ParseChatCommand("help"); } + it = chatCommands.erase(it); } } @@ -540,6 +563,9 @@ void PlayerbotAI::HandleCommands() std::map chatMap; void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fromPlayer, const uint32 lang) { + if (!bot) + return; + std::string filtered = text; if (!IsAllowedCommand(filtered) && !GetSecurity()->CheckLevelFor(PlayerbotSecurityLevel::PLAYERBOT_SECURITY_INVITE, @@ -711,65 +737,82 @@ void PlayerbotAI::HandleCommand(uint32 type, const std::string& text, Player& fr void PlayerbotAI::HandleTeleportAck() { - if (IsRealPlayer()) + if (!bot || !bot->GetSession()) return; - // Clearing motion generators and stopping movement which prevents - // conflicts between teleport and any active motion (walk, run, swim, flight, etc.) - bot->GetMotionMaster()->Clear(true); - bot->StopMoving(); - - // Near teleport (within map/instance) - if (bot->IsBeingTeleportedNear()) - { - // Previous versions manually added the bot to the map if it was not in the world. - // not needed: HandleMoveTeleportAckOpcode() safely attaches the player to the map - // and clears IsBeingTeleportedNear(). - - Player* plMover = bot->m_mover->ToPlayer(); - if (!plMover) - return; - - // Send the near teleport ACK packet - WorldPacket p(MSG_MOVE_TELEPORT_ACK, 20); - p << plMover->GetPackGUID(); - p << uint32(0); - p << uint32(0); - bot->GetSession()->HandleMoveTeleportAck(p); - - // Simulate teleport latency and prevent AI from running too early (used cmangos delays) - SetNextCheckDelay(urand(1000, 2000)); - } + // only for bots + if (IsRealPlayer()) + return; - // Far teleport (worldport / different map) + /* + * FAR TELEPORT (worldport / map change) + * Player may NOT be in world or grid here. + * Handle this FIRST. + */ if (bot->IsBeingTeleportedFar()) { - // Handle far teleport ACK: - // Moves the bot to the new map, clears IsBeingTeleportedFar(), updates session/map references bot->GetSession()->HandleMoveWorldportAck(); - // Ensure bot now has a valid map. If this fails, there is a core/session bug? + // after worldport ACK the player should be in a valid map if (!bot->GetMap()) { LOG_ERROR("playerbot", "Bot {} has no map after worldport ACK", bot->GetGUID().ToString()); + return; } - // Instance strategies after teleport + // apply instance-related strategies after map attach if (sPlayerbotAIConfig->applyInstanceStrategies) ApplyInstanceStrategies(bot->GetMapId(), true); - // healer DPS strategies if restrictions are enabled if (sPlayerbotAIConfig->restrictHealerDPS) EvaluateHealerDpsStrategy(); - // Reset AI state to to before teleport conditions + // reset AI state after teleport Reset(true); - // Slightly longer delay to simulate far teleport latency (used cmangos delays) + // clear movement only AFTER teleport is finalized and bot is in world + if (bot->IsInWorld() && bot->GetMotionMaster()) + { + bot->GetMotionMaster()->Clear(true); + bot->StopMoving(); + } + + // simulate far teleport latency (cmangos-style) SetNextCheckDelay(urand(2000, 5000)); + return; } - SetNextCheckDelay(sPlayerbotAIConfig->globalCoolDown); + /* + * NEAR TELEPORT (same map / instance) + * Player MUST be in world (and in grid). + */ + if (bot->IsBeingTeleportedNear()) + { + if (!bot->IsInWorld()) + return; + + Player* plMover = bot->m_mover ? bot->m_mover->ToPlayer() : nullptr; + if (!plMover) + return; + + WorldPacket p(MSG_MOVE_TELEPORT_ACK, 20); + p << plMover->GetPackGUID(); + p << uint32(0); // flags + p << uint32(0); // time + + bot->GetSession()->HandleMoveTeleportAck(p); + + // clear movement after successful relocation + if (bot->GetMotionMaster()) + { + bot->GetMotionMaster()->Clear(true); + bot->StopMoving(); + } + + // simulate near teleport latency + SetNextCheckDelay(urand(1000, 2000)); + return; + } } void PlayerbotAI::Reset(bool full) @@ -1286,7 +1329,12 @@ void PlayerbotAI::SpellInterrupted(uint32 spellid) Spell* spell = bot->GetCurrentSpell((CurrentSpellTypes)type); if (!spell) continue; - if (spell->GetSpellInfo()->Id == spellid) + + SpellInfo const* spellInfo = spell->GetSpellInfo(); + if (!spellInfo) + continue; + + if (spellInfo->Id == spellid) bot->InterruptSpell((CurrentSpellTypes)type); } // LastSpellCast& lastSpell = aiObjectContext->GetValue("last spell cast")->Get(); @@ -1387,8 +1435,8 @@ void PlayerbotAI::DoNextAction(bool min) return; } - // Change engine if just ressed - if (currentEngine == engines[BOT_STATE_DEAD] && isBotAlive) + // Change engine if just ressed (no movement update when rooted) + if (currentEngine == engines[BOT_STATE_DEAD] && isBotAlive && !bot->IsRooted()) { bot->SendMovementFlagUpdate(); @@ -1692,7 +1740,7 @@ void PlayerbotAI::ResetStrategies(bool load) engines[i]->Init(); // if (load) - // sPlayerbotDbStore->Load(this); + // sPlayerbotRepository->Load(this); } bool PlayerbotAI::IsRanged(Player* player, bool bySpec) @@ -1728,6 +1776,7 @@ bool PlayerbotAI::IsRanged(Player* player, bool bySpec) } break; } + return true; } @@ -1747,35 +1796,46 @@ bool PlayerbotAI::IsCombo(Player* player) bool PlayerbotAI::IsRangedDps(Player* player, bool bySpec) { return IsRanged(player, bySpec) && IsDps(player, bySpec); } -bool PlayerbotAI::IsHealAssistantOfIndex(Player* player, int index) +bool PlayerbotAI::IsAssistHealOfIndex(Player* player, int index, bool ignoreDeadPlayers) { Group* group = player->GetGroup(); if (!group) - { return false; - } int counter = 0; + // First, assistants for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { Player* member = ref->GetSource(); - if (!member) - { continue; - } - if (IsHeal(member)) // Check if the member is a healer - { - bool isAssistant = group->IsAssistant(member->GetGUID()); + if (ignoreDeadPlayers && !member->IsAlive()) + continue; - // Check if the index matches for both assistant and non-assistant healers - if ((isAssistant && index == counter) || (!isAssistant && index == counter)) - { + if (group->IsAssistant(member->GetGUID()) && IsHeal(member)) + { + if (index == counter) return player == member; - } + counter++; + } + } + + // If not enough assistants, get non-assistants + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (!member) + continue; + + if (ignoreDeadPlayers && !member->IsAlive()) + continue; + if (!group->IsAssistant(member->GetGUID()) && IsHeal(member)) + { + if (index == counter) + return player == member; counter++; } } @@ -1783,35 +1843,46 @@ bool PlayerbotAI::IsHealAssistantOfIndex(Player* player, int index) return false; } -bool PlayerbotAI::IsRangedDpsAssistantOfIndex(Player* player, int index) +bool PlayerbotAI::IsAssistRangedDpsOfIndex(Player* player, int index, bool ignoreDeadPlayers) { Group* group = player->GetGroup(); if (!group) - { return false; - } int counter = 0; + // First, assistants for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { Player* member = ref->GetSource(); - if (!member) - { continue; - } - if (IsRangedDps(member)) // Check if the member is a ranged DPS - { - bool isAssistant = group->IsAssistant(member->GetGUID()); + if (ignoreDeadPlayers && !member->IsAlive()) + continue; - // Check the index for both assistant and non-assistant ranges - if ((isAssistant && index == counter) || (!isAssistant && index == counter)) - { + if (group->IsAssistant(member->GetGUID()) && IsRangedDps(member)) + { + if (index == counter) return player == member; - } + counter++; + } + } + + // If not enough assistants, get non-assistants + for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) + { + Player* member = ref->GetSource(); + if (!member) + continue; + + if (ignoreDeadPlayers && !member->IsAlive()) + continue; + if (!group->IsAssistant(member->GetGUID()) && IsRangedDps(member)) + { + if (index == counter) + return player == member; counter++; } } @@ -1821,10 +1892,9 @@ bool PlayerbotAI::IsRangedDpsAssistantOfIndex(Player* player, int index) bool PlayerbotAI::HasAggro(Unit* unit) { - if (!unit) - { + if (!IsValidUnit(unit)) return false; - } + bool isMT = IsMainTank(bot); Unit* victim = unit->GetVictim(); if (victim && (victim->GetGUID() == bot->GetGUID() || (!isMT && victim->ToPlayer() && IsTank(victim->ToPlayer())))) @@ -2199,10 +2269,15 @@ bool PlayerbotAI::IsMainTank(Player* player) bool PlayerbotAI::IsBotMainTank(Player* player) { - if (!player->GetSession()->IsBot() || !IsTank(player)) - { + if (!player || !player->IsInWorld() || player->IsDuringRemoveFromWorld()) + return false; + + WorldSession* session = player->GetSession(); + if (!session || !session->IsBot()) + return false; + + if (!IsTank(player)) return false; - } if (IsMainTank(player)) { @@ -2282,18 +2357,16 @@ bool PlayerbotAI::IsAssistTankOfIndex(Player* player, int index, bool ignoreDead { Group* group = player->GetGroup(); if (!group) - { return false; - } + int counter = 0; + + // First, assistants for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { Player* member = ref->GetSource(); - if (!member) - { continue; - } if (ignoreDeadPlayers && !member->IsAlive()) continue; @@ -2301,21 +2374,17 @@ bool PlayerbotAI::IsAssistTankOfIndex(Player* player, int index, bool ignoreDead if (group->IsAssistant(member->GetGUID()) && IsAssistTank(member)) { if (index == counter) - { return player == member; - } counter++; } } - // not enough + + // If not enough assistants, get non-assistants for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next()) { Player* member = ref->GetSource(); - if (!member) - { continue; - } if (ignoreDeadPlayers && !member->IsAlive()) continue; @@ -2323,9 +2392,7 @@ bool PlayerbotAI::IsAssistTankOfIndex(Player* player, int index, bool ignoreDead if (!group->IsAssistant(member->GetGUID()) && IsAssistTank(member)) { if (index == counter) - { return player == member; - } counter++; } } @@ -2822,6 +2889,9 @@ bool PlayerbotAI::TellMaster(std::string const text, PlayerbotSecurityLevel secu bool IsRealAura(Player* bot, AuraEffect const* aurEff, Unit const* unit) { + if (!unit || !unit->IsInWorld() || unit->IsDuringRemoveFromWorld()) + return false; + if (!aurEff) return false; @@ -2829,6 +2899,8 @@ bool IsRealAura(Player* bot, AuraEffect const* aurEff, Unit const* unit) return true; SpellInfo const* spellInfo = aurEff->GetSpellInfo(); + if (!spellInfo) + return false; uint32 stacks = aurEff->GetBase()->GetStackAmount(); if (stacks >= spellInfo->StackAmount) @@ -2844,7 +2916,7 @@ bool IsRealAura(Player* bot, AuraEffect const* aurEff, Unit const* unit) bool PlayerbotAI::HasAura(std::string const name, Unit* unit, bool maxStack, bool checkIsOwner, int maxAuraAmount, bool checkDuration) { - if (!unit) + if (!IsValidUnit(unit)) return false; std::wstring wnamepart; @@ -2940,7 +3012,7 @@ bool PlayerbotAI::HasAura(uint32 spellId, Unit const* unit) Aura* PlayerbotAI::GetAura(std::string const name, Unit* unit, bool checkIsOwner, bool checkDuration, int checkStack) { - if (!unit) + if (!IsValidUnit(unit)) return nullptr; std::wstring wnamepart; @@ -2958,6 +3030,9 @@ Aura* PlayerbotAI::GetAura(std::string const name, Unit* unit, bool checkIsOwner for (AuraEffect const* aurEff : auras) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); + if (!spellInfo) + continue; + std::string const& auraName = spellInfo->SpellName[0]; // Directly skip if name mismatch (both length and content) @@ -3038,6 +3113,9 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell, if (!target) target = bot; + if (!IsValidUnit(target)) + return false; + if (Pet* pet = bot->GetPet()) if (pet->HasSpell(spellid)) return true; @@ -3299,6 +3377,9 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, float x, float y, float z, bool c bool PlayerbotAI::CastSpell(std::string const name, Unit* target, Item* itemTarget) { + if (!IsValidUnit(target)) + return false; + bool result = CastSpell(aiObjectContext->GetValue("spell id", name)->Get(), target, itemTarget); if (result) { @@ -3311,15 +3392,19 @@ bool PlayerbotAI::CastSpell(std::string const name, Unit* target, Item* itemTarg bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget) { if (!spellId) - { return false; - } if (!target) target = bot; - Pet* pet = bot->GetPet(); + if (!IsValidUnit(target)) + return false; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo) + return false; + + Pet* pet = bot->GetPet(); if (pet && pet->HasSpell(spellId)) { // List of spell IDs for which we do NOT want to toggle auto-cast or send message @@ -3722,6 +3807,9 @@ bool PlayerbotAI::CanCastVehicleSpell(uint32 spellId, Unit* target) if (!spellId) return false; + if (!IsValidUnit(target)) + return false; + Vehicle* vehicle = bot->GetVehicle(); if (!vehicle) return false; @@ -3732,12 +3820,12 @@ bool PlayerbotAI::CanCastVehicleSpell(uint32 spellId, Unit* target) return false; Unit* vehicleBase = vehicle->GetBase(); - Unit* spellTarget = target; + if (!spellTarget) spellTarget = vehicleBase; - if (!spellTarget) + if (!IsValidUnit(spellTarget)) return false; if (vehicleBase->HasSpellCooldown(spellId)) @@ -3804,6 +3892,9 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) if (!spellId) return false; + if (!IsValidUnit(target)) + return false; + Vehicle* vehicle = bot->GetVehicle(); if (!vehicle) return false; @@ -3814,12 +3905,12 @@ bool PlayerbotAI::CastVehicleSpell(uint32 spellId, Unit* target) return false; Unit* vehicleBase = vehicle->GetBase(); - Unit* spellTarget = target; + if (!spellTarget) spellTarget = vehicleBase; - if (!spellTarget) + if (!IsValidUnit(spellTarget)) return false; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); @@ -3972,9 +4063,13 @@ bool PlayerbotAI::IsInVehicle(bool canControl, bool canCast, bool canAttack, boo void PlayerbotAI::WaitForSpellCast(Spell* spell) { + if (!spell) + return; + SpellInfo const* spellInfo = spell->GetSpellInfo(); uint32 castTime = spell->GetCastTime(); - if (spellInfo->IsChanneled()) + + if (spellInfo && spellInfo->IsChanneled()) { int32 duration = spellInfo->GetDuration(); bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration); @@ -4022,6 +4117,9 @@ void PlayerbotAI::RemoveAura(std::string const name) bool PlayerbotAI::IsInterruptableSpellCasting(Unit* target, std::string const spell) { + if (!IsValidUnit(target)) + return false; + uint32 spellid = aiObjectContext->GetValue("spell id", spell)->Get(); if (!spellid || !target->IsNonMeleeSpellCast(true)) return false; @@ -4050,17 +4148,25 @@ bool PlayerbotAI::IsInterruptableSpellCasting(Unit* target, std::string const sp bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType) { - if (!target->IsInWorld()) - { + if (!IsValidUnit(target) || !target->IsAlive()) return false; - } + + if (!IsValidPlayer(bot)) + return false; + bool isFriend = bot->IsFriendlyTo(target); + Unit::VisibleAuraMap const* visibleAuras = target->GetVisibleAuras(); + if (!visibleAuras) + return false; + for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr) { - Aura* aura = itr->second->GetBase(); + if (!itr->second) + continue; - if (aura->IsPassive()) + Aura* aura = itr->second->GetBase(); + if (!aura || aura->IsPassive() || aura->IsRemoved()) continue; if (sPlayerbotAIConfig->dispelAuraDuration && aura->GetDuration() && @@ -4068,6 +4174,8 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType) continue; SpellInfo const* spellInfo = aura->GetSpellInfo(); + if (!spellInfo) + continue; bool isPositiveSpell = spellInfo->IsPositive(); if (isPositiveSpell && isFriend) @@ -4079,6 +4187,7 @@ bool PlayerbotAI::HasAuraToDispel(Unit* target, uint32 dispelType) if (canDispel(spellInfo, dispelType)) return true; } + return false; } @@ -5709,7 +5818,7 @@ void PlayerbotAI::ImbueItem(Item* item) { ImbueItem(item, TARGET_FLAG_NONE, Obje // item on unit void PlayerbotAI::ImbueItem(Item* item, Unit* target) { - if (!target) + if (!IsValidUnit(target)) return; ImbueItem(item, TARGET_FLAG_UNIT, target->GetGUID()); @@ -5851,16 +5960,38 @@ int32 PlayerbotAI::GetNearGroupMemberCount(float dis) bool PlayerbotAI::CanMove() { - // do not allow if not vehicle driver - if (IsInVehicle() && !IsInVehicle(true)) + // Most common checks: confused, stunned, fleeing, jumping, charging. All these + // states are set when handling certain aura effects. We don't check against + // UNIT_STATE_ROOT here, because this state is used by vehicles. + if (bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) + return false; + + // Death state (w/o spirit release) and Spirit of Redemption aura (priest) + if ((bot->isDead() && !bot->HasPlayerFlag(PLAYER_FLAGS_GHOST)) || bot->HasSpiritOfRedemptionAura()) + return false; + + // Common CC effects, ordered by frequency: rooted > charmed > frozen > polymorphed. + // NOTE: Can't find proper way to check if bot is rooted or charmed w/o additional + // vehicle check -- when a passenger is added, they become rooted and charmed. + if (!bot->GetVehicle() && (bot->IsRooted() || bot->IsCharmed())) + return false; + if (bot->isFrozen() || bot->IsPolymorphed()) + return false; + + // Check for the MM controlled slot types: feared, confused, fleeing, etc. + if (bot->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_CONTROLLED) != NULL_MOTION_TYPE) return false; - if (bot->isFrozen() || bot->IsPolymorphed() || (bot->isDead() && !bot->HasPlayerFlag(PLAYER_FLAGS_GHOST)) || - bot->IsBeingTeleported() || bot->HasRootAura() || bot->HasSpiritOfRedemptionAura() || bot->HasConfuseAura() || - bot->IsCharmed() || bot->HasStunAura() || bot->IsInFlight() || bot->HasUnitState(UNIT_STATE_LOST_CONTROL)) + // Traveling state: taxi flight and being teleported (relatively rare) + if (bot->IsInFlight() || bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE || + bot->IsBeingTeleported()) return false; - return bot->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE; + // Vehicle state: is in the vehicle and can control it (rare, content-specific) + if ((bot->GetVehicle() && !IsInVehicle(true))) + return false; + + return true; } bool PlayerbotAI::IsInRealGuild() diff --git a/src/PlayerbotAI.h b/src/Bot/PlayerbotAI.h similarity index 97% rename from src/PlayerbotAI.h rename to src/Bot/PlayerbotAI.h index c8f5f23038..b2df4352cc 100644 --- a/src/PlayerbotAI.h +++ b/src/Bot/PlayerbotAI.h @@ -429,8 +429,8 @@ class PlayerbotAI : public PlayerbotAIBase static uint32 GetGroupTankNum(Player* player); static bool IsAssistTank(Player* player); static bool IsAssistTankOfIndex(Player* player, int index, bool ignoreDeadPlayers = false); - static bool IsHealAssistantOfIndex(Player* player, int index); - static bool IsRangedDpsAssistantOfIndex(Player* player, int index); + static bool IsAssistHealOfIndex(Player* player, int index, bool ignoreDeadPlayers = false); + static bool IsAssistRangedDpsOfIndex(Player* player, int index, bool ignoreDeadPlayers = false); bool HasAggro(Unit* unit); static int32 GetAssistTankIndex(Player* player); int32 GetGroupSlotIndex(Player* player); @@ -616,7 +616,15 @@ class PlayerbotAI : public PlayerbotAIBase void HandleCommands(); void HandleCommand(uint32 type, const std::string& text, Player& fromPlayer, const uint32 lang = LANG_UNIVERSAL); bool _isBotInitializing = false; - + inline bool IsValidUnit(const Unit* unit) const + { + return unit && unit->IsInWorld() && !unit->IsDuringRemoveFromWorld(); + } + inline bool IsValidPlayer(const Player* player) const + { + return player && player->GetSession() && player->IsInWorld() && !player->IsDuringRemoveFromWorld() && + !player->IsBeingTeleported(); + } protected: Player* bot; Player* master; diff --git a/src/PlayerbotMgr.cpp b/src/Bot/PlayerbotMgr.cpp similarity index 99% rename from src/PlayerbotMgr.cpp rename to src/Bot/PlayerbotMgr.cpp index ae3d4e1b2e..e01afb0f7c 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/Bot/PlayerbotMgr.cpp @@ -26,7 +26,7 @@ #include "ObjectGuid.h" #include "ObjectMgr.h" #include "PlayerbotAIConfig.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "PlayerbotFactory.h" #include "PlayerbotOperations.h" #include "PlayerbotSecurity.h" @@ -442,7 +442,7 @@ void PlayerbotHolder::DisablePlayerBot(ObjectGuid guid) Group* group = bot->GetGroup(); if (group && !bot->InBattleground() && !bot->InBattlegroundQueue() && botAI->HasActivePlayerMaster()) { - sPlayerbotDbStore->Save(botAI); + sPlayerbotRepository->Save(botAI); } LOG_DEBUG("playerbots", "Bot {} logged out", bot->GetName().c_str()); @@ -554,7 +554,7 @@ void PlayerbotHolder::OnBotLogin(Player* const bot) { botAI->ResetStrategies(!sRandomPlayerbotMgr->IsRandomBot(bot)); } - sPlayerbotDbStore->Load(botAI); + sPlayerbotRepository->Load(botAI); if (master && !master->HasUnitState(UNIT_STATE_IN_FLIGHT)) { diff --git a/src/PlayerbotMgr.h b/src/Bot/PlayerbotMgr.h similarity index 100% rename from src/PlayerbotMgr.h rename to src/Bot/PlayerbotMgr.h diff --git a/src/RandomPlayerbotMgr.cpp b/src/Bot/RandomPlayerbotMgr.cpp similarity index 99% rename from src/RandomPlayerbotMgr.cpp rename to src/Bot/RandomPlayerbotMgr.cpp index a2fe72f614..4d589ef1b4 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/Bot/RandomPlayerbotMgr.cpp @@ -26,6 +26,7 @@ #include "DatabaseEnv.h" #include "Define.h" #include "FleeManager.h" +#include "FlightMasterCache.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "GuildMgr.h" @@ -35,7 +36,7 @@ #include "NewRpgInfo.h" #include "NewRpgStrategy.h" #include "ObjectGuid.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "Player.h" #include "PlayerbotAI.h" #include "PlayerbotAIConfig.h" @@ -358,7 +359,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) if (totalPmo) totalPmo->finish(); - totalPmo = sPerformanceMonitor->start(PERF_MON_TOTAL, "RandomPlayerbotMgr::FullTick"); + totalPmo = sPerfMonitor->start(PERF_MON_TOTAL, "RandomPlayerbotMgr::FullTick"); if (!sPlayerbotAIConfig->randomBotAutologin || !sPlayerbotAIConfig->enabled) return; @@ -401,7 +402,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) uint32 updateIntervalTurboBoost = _isBotInitializing ? 1 : sPlayerbotAIConfig->randomBotUpdateInterval; SetNextCheckDelay(updateIntervalTurboBoost * (onlineBotFocus + 25) * 10); - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start( + PerfMonitorOperation* pmo = sPerfMonitor->start( PERF_MON_TOTAL, onlineBotCount < maxAllowedBotCount ? "RandomPlayerbotMgr::Login" : "RandomPlayerbotMgr::UpdateAIInternal"); @@ -1654,6 +1655,10 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector& if (bot->IsBeingTeleported() || !bot->IsInWorld()) return; + // no teleport / movement update when rooted. + if (bot->IsRooted()) + return; + // ignore when in queue for battle grounds. if (bot->InBattlegroundQueue()) return; @@ -1703,7 +1708,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector& return; } - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "RandomTeleportByLocations"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "RandomTeleportByLocations"); std::shuffle(std::begin(tlocs), std::end(tlocs), RandomEngine::Instance()); for (uint32 i = 0; i < tlocs.size(); i++) @@ -1998,14 +2003,12 @@ void RandomPlayerbotMgr::PrepareTeleportCache() bool forAlliance = !(entry->hostileMask & 2); if (tNpcflag & UNIT_NPC_FLAG_FLIGHTMASTER) { + WorldPosition pos(mapId, x, y, z, orient); if (forHorde) - { - hordeFlightMasterCache.push_back(guid); - } + sFlightMasterCache->AddHordeFlightMaster(guid, pos); + if (forAlliance) - { - allianceFlightMasterCache.push_back(guid); - } + sFlightMasterCache->AddAllianceFlightMaster(guid, pos); } const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(PHASEMASK_NORMAL, x, y, z)); uint32 zoneId = area->zone ? area->zone : area->ID; @@ -2296,7 +2299,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot) if (bot->InBattleground()) return; - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "RandomTeleport"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "RandomTeleport"); std::vector locs; std::list targets; @@ -2358,7 +2361,7 @@ void RandomPlayerbotMgr::IncreaseLevel(Player* bot) if (maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "IncreaseLevel"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "IncreaseLevel"); uint32 lastLevel = GetValue(bot, "level"); uint8 level = bot->GetLevel() + 1; if (level > maxLevel) @@ -2397,7 +2400,7 @@ void RandomPlayerbotMgr::RandomizeFirst(Player* bot) minLevel = std::max(minLevel, sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL)); } - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "RandomizeFirst"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "RandomizeFirst"); uint32 level; @@ -2476,7 +2479,7 @@ void RandomPlayerbotMgr::RandomizeMin(Player* bot) if (!botAI) return; - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "RandomizeMin"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "RandomizeMin"); uint32 level = sPlayerbotAIConfig->randomBotMinLevel; SetValue(bot, "level", level); PlayerbotFactory factory(bot, level); @@ -2565,7 +2568,7 @@ void RandomPlayerbotMgr::Refresh(Player* bot) LOG_DEBUG("playerbots", "Refreshing bot {} <{}>", bot->GetGUID().ToString().c_str(), bot->GetName().c_str()); - PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "Refresh"); + PerfMonitorOperation* pmo = sPerfMonitor->start(PERF_MON_RNDBOT, "Refresh"); botAI->Reset(); @@ -3210,6 +3213,12 @@ void RandomPlayerbotMgr::PrintStats() lvlPerRace[bot->getRace()] += bot->GetLevel(); PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot); + if (!botAI) + { + LOG_ERROR("playerbots", "Player/Bot {} is registered in sRandomPlayerbotMgr playerBots and has no bot AI!", bot->GetName().c_str()); + continue; + } + if (botAI->AllowActivity()) ++active; diff --git a/src/RandomPlayerbotMgr.h b/src/Bot/RandomPlayerbotMgr.h similarity index 98% rename from src/RandomPlayerbotMgr.h rename to src/Bot/RandomPlayerbotMgr.h index d65a59c910..26d09d454e 100644 --- a/src/RandomPlayerbotMgr.h +++ b/src/Bot/RandomPlayerbotMgr.h @@ -43,7 +43,7 @@ struct BattlegroundInfo }; class ChatHandler; -class PerformanceMonitorOperation; +class PerfMonitorOperation; class WorldLocation; struct CachedEvent @@ -171,8 +171,7 @@ class RandomPlayerbotMgr : public PlayerbotHolder std::map> locsPerLevelCache; std::map> allianceStarterPerLevelCache; std::map> hordeStarterPerLevelCache; - std::vector allianceFlightMasterCache; - std::vector hordeFlightMasterCache; + struct LevelBracket { uint32 low; uint32 high; diff --git a/src/Db/FlightMasterCache.cpp b/src/Db/FlightMasterCache.cpp new file mode 100644 index 0000000000..c708e09cb8 --- /dev/null +++ b/src/Db/FlightMasterCache.cpp @@ -0,0 +1,39 @@ +#include "FlightMasterCache.h" + +void FlightMasterCache::AddHordeFlightMaster(uint32 entry, WorldPosition pos) +{ + hordeFlightMasterCache[entry] = pos; +} + +void FlightMasterCache::AddAllianceFlightMaster(uint32 entry, WorldPosition pos) +{ + allianceFlightMasterCache[entry] = pos; +} + +Creature* FlightMasterCache::GetNearestFlightMaster(Player* bot) +{ + std::map& flightMasterCache = + (bot->GetTeamId() == ALLIANCE) ? allianceFlightMasterCache : hordeFlightMasterCache; + + Creature* nearestFlightMaster = nullptr; + float nearestDistance = std::numeric_limits::max(); + + for (auto const& [entry, pos] : flightMasterCache) + { + if (pos.GetMapId() == bot->GetMapId()) + { + float distance = bot->GetExactDist2dSq(pos); + if (distance < nearestDistance) + { + Creature* flightMaster = ObjectAccessor::GetSpawnedCreatureByDBGUID(bot->GetMapId(), entry); + if (flightMaster) + { + nearestDistance = distance; + nearestFlightMaster = flightMaster; + } + } + } + } + + return nearestFlightMaster; +} diff --git a/src/Db/FlightMasterCache.h b/src/Db/FlightMasterCache.h new file mode 100644 index 0000000000..519d6fc7c8 --- /dev/null +++ b/src/Db/FlightMasterCache.h @@ -0,0 +1,27 @@ +#ifndef _PLAYERBOT_FLIGHTMASTER_H +#define _PLAYERBOT_FLIGHTMASTER_H + +#include "Creature.h" +#include "Player.h" +#include "TravelMgr.h" + +class FlightMasterCache +{ +public: + static FlightMasterCache* Instance() + { + static FlightMasterCache instance; + return &instance; + } + + Creature* GetNearestFlightMaster(Player* bot); + void AddHordeFlightMaster(uint32 entry, WorldPosition pos); + void AddAllianceFlightMaster(uint32 entry, WorldPosition pos); + +private: + std::map allianceFlightMasterCache; + std::map hordeFlightMasterCache; +}; + +#define sFlightMasterCache FlightMasterCache::Instance() +#endif diff --git a/src/PlayerbotDungeonSuggestionMgr.cpp b/src/Db/PlayerbotDungeonRepository.cpp similarity index 88% rename from src/PlayerbotDungeonSuggestionMgr.cpp rename to src/Db/PlayerbotDungeonRepository.cpp index 3df2d0d7ea..3ee40e5616 100644 --- a/src/PlayerbotDungeonSuggestionMgr.cpp +++ b/src/Db/PlayerbotDungeonRepository.cpp @@ -3,16 +3,16 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#include "PlayerbotDungeonSuggestionMgr.h" +#include "PlayerbotDungeonRepository.h" #include "Playerbots.h" -std::vector const PlayerbotDungeonSuggestionMgr::GetDungeonSuggestions() +std::vector const PlayerbotDungeonRepository::GetDungeonSuggestions() { return m_dungeonSuggestions; } -void PlayerbotDungeonSuggestionMgr::LoadDungeonSuggestions() +void PlayerbotDungeonRepository::LoadDungeonSuggestions() { LOG_INFO("server.loading", "Loading playerbots dungeon suggestions..."); uint32 oldMSTime = getMSTime(); diff --git a/src/PlayerbotDungeonSuggestionMgr.h b/src/Db/PlayerbotDungeonRepository.h similarity index 63% rename from src/PlayerbotDungeonSuggestionMgr.h rename to src/Db/PlayerbotDungeonRepository.h index 74354613d1..8c709152a8 100644 --- a/src/PlayerbotDungeonSuggestionMgr.h +++ b/src/Db/PlayerbotDungeonRepository.h @@ -3,8 +3,8 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#ifndef _PLAYERBOT_PLAYERBOTDUNGEONSUGGESTIONMGR_H -#define _PLAYERBOT_PLAYERBOTDUNGEONSUGGESTIONMGR_H +#ifndef _PLAYERBOT_PLAYERBOTDUNGEONREPOSITORY_H +#define _PLAYERBOT_PLAYERBOTDUNGEONREPOSITORY_H #include #include @@ -22,14 +22,14 @@ struct DungeonSuggestion std::string strategy; }; -class PlayerbotDungeonSuggestionMgr +class PlayerbotDungeonRepository { public: - PlayerbotDungeonSuggestionMgr(){}; - ~PlayerbotDungeonSuggestionMgr(){}; - static PlayerbotDungeonSuggestionMgr* instance() + PlayerbotDungeonRepository(){}; + ~PlayerbotDungeonRepository(){}; + static PlayerbotDungeonRepository* instance() { - static PlayerbotDungeonSuggestionMgr instance; + static PlayerbotDungeonRepository instance; return &instance; } @@ -40,6 +40,6 @@ class PlayerbotDungeonSuggestionMgr std::vector m_dungeonSuggestions; }; -#define sPlayerbotDungeonSuggestionMgr PlayerbotDungeonSuggestionMgr::instance() +#define sPlayerbotDungeonRepository PlayerbotDungeonRepository::instance() #endif diff --git a/src/PlayerbotDbStore.cpp b/src/Db/PlayerbotRepository.cpp similarity index 88% rename from src/PlayerbotDbStore.cpp rename to src/Db/PlayerbotRepository.cpp index a841e02b39..886cebb833 100644 --- a/src/PlayerbotDbStore.cpp +++ b/src/Db/PlayerbotRepository.cpp @@ -3,13 +3,13 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include #include "Playerbots.h" -void PlayerbotDbStore::Load(PlayerbotAI* botAI) +void PlayerbotRepository::Load(PlayerbotAI* botAI) { ObjectGuid::LowType guid = botAI->GetBot()->GetGUID().GetCounter(); @@ -46,7 +46,7 @@ void PlayerbotDbStore::Load(PlayerbotAI* botAI) } } -void PlayerbotDbStore::Save(PlayerbotAI* botAI) +void PlayerbotRepository::Save(PlayerbotAI* botAI) { ObjectGuid::LowType guid = botAI->GetBot()->GetGUID().GetCounter(); @@ -68,7 +68,7 @@ void PlayerbotDbStore::Save(PlayerbotAI* botAI) SaveValue(guid, "dead", FormatStrategies("dead", botAI->GetStrategies(BOT_STATE_DEAD))); } -std::string const PlayerbotDbStore::FormatStrategies(std::string const type, std::vector strategies) +std::string const PlayerbotRepository::FormatStrategies(std::string const type, std::vector strategies) { std::ostringstream out; for (std::vector::iterator i = strategies.begin(); i != strategies.end(); ++i) @@ -78,7 +78,7 @@ std::string const PlayerbotDbStore::FormatStrategies(std::string const type, std return res.substr(0, res.size() - 1); } -void PlayerbotDbStore::Reset(PlayerbotAI* botAI) +void PlayerbotRepository::Reset(PlayerbotAI* botAI) { ObjectGuid::LowType guid = botAI->GetBot()->GetGUID().GetCounter(); @@ -87,7 +87,7 @@ void PlayerbotDbStore::Reset(PlayerbotAI* botAI) PlayerbotsDatabase.Execute(stmt); } -void PlayerbotDbStore::SaveValue(uint32 guid, std::string const key, std::string const value) +void PlayerbotRepository::SaveValue(uint32 guid, std::string const key, std::string const value) { PlayerbotsDatabasePreparedStatement* stmt = PlayerbotsDatabase.GetPreparedStatement(PLAYERBOTS_INS_DB_STORE); stmt->SetData(0, guid); diff --git a/src/PlayerbotDbStore.h b/src/Db/PlayerbotRepository.h similarity index 66% rename from src/PlayerbotDbStore.h rename to src/Db/PlayerbotRepository.h index 713d7f659c..90dbce54af 100644 --- a/src/PlayerbotDbStore.h +++ b/src/Db/PlayerbotRepository.h @@ -3,8 +3,8 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#ifndef _PLAYERBOT_PLAYERBOTDBSTORE_H -#define _PLAYERBOT_PLAYERBOTDBSTORE_H +#ifndef _PLAYERBOT_PLAYERBOTREPOSITORY_H +#define _PLAYERBOT_PLAYERBOTREPOSITORY_H #include @@ -12,14 +12,14 @@ class PlayerbotAI; -class PlayerbotDbStore +class PlayerbotRepository { public: - PlayerbotDbStore() {} - virtual ~PlayerbotDbStore() {} - static PlayerbotDbStore* instance() + PlayerbotRepository() {} + virtual ~PlayerbotRepository() {} + static PlayerbotRepository* instance() { - static PlayerbotDbStore instance; + static PlayerbotRepository instance; return &instance; } @@ -32,6 +32,6 @@ class PlayerbotDbStore std::string const FormatStrategies(std::string const type, std::vector strategies); }; -#define sPlayerbotDbStore PlayerbotDbStore::instance() +#define sPlayerbotRepository PlayerbotRepository::instance() #endif diff --git a/src/database/PlayerbotSpellCache.cpp b/src/Db/PlayerbotSpellRepository.cpp similarity index 76% rename from src/database/PlayerbotSpellCache.cpp rename to src/Db/PlayerbotSpellRepository.cpp index 02efcbd9bb..6642eeeea2 100644 --- a/src/database/PlayerbotSpellCache.cpp +++ b/src/Db/PlayerbotSpellRepository.cpp @@ -1,9 +1,10 @@ -#include "PlayerbotSpellCache.h" +#include "PlayerbotSpellRepository.h" -void PlayerbotSpellCache::Initialize() +// caches the result set +void PlayerbotSpellRepository::Initialize() { - LOG_INFO("playerbots", - "Playerbots: ListSpellsAction caches initialized"); + LOG_INFO("playerbots", "Playerbots: ListSpellsAction caches initialized"); + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { if (SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j)) @@ -31,7 +32,7 @@ void PlayerbotSpellCache::Initialize() skillSpells.size(), vendorItems.size()); } -SkillLineAbilityEntry const* PlayerbotSpellCache::GetSkillLine(uint32 spellId) const +SkillLineAbilityEntry const* PlayerbotSpellRepository::GetSkillLine(uint32 spellId) const { auto itr = skillSpells.find(spellId); if (itr != skillSpells.end()) @@ -39,7 +40,7 @@ SkillLineAbilityEntry const* PlayerbotSpellCache::GetSkillLine(uint32 spellId) c return nullptr; } -bool PlayerbotSpellCache::IsItemBuyable(uint32 itemId) const +bool PlayerbotSpellRepository::IsItemBuyable(uint32 itemId) const { return vendorItems.find(itemId) != vendorItems.end(); } diff --git a/src/database/PlayerbotSpellCache.h b/src/Db/PlayerbotSpellRepository.h similarity index 63% rename from src/database/PlayerbotSpellCache.h rename to src/Db/PlayerbotSpellRepository.h index 1550276809..55046e5956 100644 --- a/src/database/PlayerbotSpellCache.h +++ b/src/Db/PlayerbotSpellRepository.h @@ -3,17 +3,17 @@ * and/or modify it under version 3 of the License, or (at your option), any later version. */ -#ifndef _PLAYERBOT_PLAYERBOTSPELLCACHE_H -#define _PLAYERBOT_PLAYERBOTSPELLCACHE_H +#ifndef _PLAYERBOT_PLAYERBOTSPELLREPOSITORY_H +#define _PLAYERBOT_PLAYERBOTSPELLREPOSITORY_H #include "Playerbots.h" -class PlayerbotSpellCache +class PlayerbotSpellRepository { public: - static PlayerbotSpellCache* Instance() + static PlayerbotSpellRepository* Instance() { - static PlayerbotSpellCache instance; + static PlayerbotSpellRepository instance; return &instance; } @@ -23,12 +23,12 @@ class PlayerbotSpellCache bool IsItemBuyable(uint32 itemId) const; private: - PlayerbotSpellCache() = default; + PlayerbotSpellRepository() = default; std::map skillSpells; std::set vendorItems; }; -#define sPlayerbotSpellCache PlayerbotSpellCache::Instance() +#define sPlayerbotSpellRepository PlayerbotSpellRepository::Instance() #endif diff --git a/src/Helpers.cpp b/src/Helpers.cpp deleted file mode 100644 index 84d34c12fa..0000000000 --- a/src/Helpers.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "Helpers.h" - -char* strstri(char const* haystack, char const* needle) -{ - if (!*needle) - { - return (char*)haystack; - } - - for (; *haystack; ++haystack) - { - if (tolower(*haystack) == tolower(*needle)) - { - char const *h = haystack, *n = needle; - for (; *h && *n; ++h, ++n) - { - if (tolower(*h) != tolower(*n)) - { - break; - } - } - - if (!*n) - { - return (char*)haystack; - } - } - } - - return 0; -} - -std::string& ltrim(std::string& s) -{ - s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) { return !std::isspace(c); })); - return s; -} - -std::string& rtrim(std::string& s) -{ - s.erase(std::find_if(s.rbegin(), s.rend(), [](int c) { return !std::isspace(c); }).base(), s.end()); - return s; -} - -std::string& trim(std::string& s) { return ltrim(rtrim(s)); } diff --git a/src/Helpers.h b/src/Helpers.h deleted file mode 100644 index 6a648ad197..0000000000 --- a/src/Helpers.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_HELPERS_H -#define _PLAYERBOT_HELPERS_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "Common.h" - -void split(std::vector& dest, std::string const str, char const* delim) -{ - char* pTempStr = strdup(str.c_str()); - char* pWord = strtok(pTempStr, delim); - - while (pWord != nullptr) - { - dest.push_back(pWord); - pWord = strtok(nullptr, delim); - } - - free(pTempStr); -} - -std::vector& split(std::string const s, char delim, std::vector& elems) -{ - std::stringstream ss(s); - std::string item; - - while (getline(ss, item, delim)) - { - elems.push_back(item); - } - - return elems; -} - -std::vector split(std::string const s, char delim) -{ - std::vector elems; - return split(s, delim, elems); -} - -#endif diff --git a/src/LazyCalculatedValue.h b/src/LazyCalculatedValue.h deleted file mode 100644 index 84497b8a8c..0000000000 --- a/src/LazyCalculatedValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_LAZYCALCULATEDVALUE_H -#define _PLAYERBOT_LAZYCALCULATEDVALUE_H - -template -class LazyCalculatedValue -{ -public: - typedef TValue (TOwner::*Calculator)(); - -public: - LazyCalculatedValue(TOwner* owner, Calculator calculator) : calculator(calculator), owner(owner) { Reset(); } - -public: - TValue GetValue() - { - if (!calculated) - { - value = (owner->*calculator)(); - calculated = true; - } - - return value; - } - - void Reset() { calculated = false; } - -protected: - Calculator calculator; - TOwner* owner; - bool calculated; - TValue value; -}; - -#endif diff --git a/src/GuildTaskMgr.cpp b/src/Mgr/Guild/GuildTaskMgr.cpp similarity index 100% rename from src/GuildTaskMgr.cpp rename to src/Mgr/Guild/GuildTaskMgr.cpp diff --git a/src/GuildTaskMgr.h b/src/Mgr/Guild/GuildTaskMgr.h similarity index 100% rename from src/GuildTaskMgr.h rename to src/Mgr/Guild/GuildTaskMgr.h diff --git a/src/PlayerbotGuildMgr.cpp b/src/Mgr/Guild/PlayerbotGuildMgr.cpp similarity index 99% rename from src/PlayerbotGuildMgr.cpp rename to src/Mgr/Guild/PlayerbotGuildMgr.cpp index 98d71dab7a..c1f7aa5b2d 100644 --- a/src/PlayerbotGuildMgr.cpp +++ b/src/Mgr/Guild/PlayerbotGuildMgr.cpp @@ -95,7 +95,7 @@ std::string PlayerbotGuildMgr::AssignToGuild(Player* player) for (auto& keyValue : _guildCache) { GuildCache& cached = keyValue.second; - if (cached.status == 1 && cached.faction == playerFaction) + if (!cached.hasRealPlayer && cached.status == 1 && cached.faction == playerFaction) partiallyfilledguilds.push_back(&cached); } diff --git a/src/PlayerbotGuildMgr.h b/src/Mgr/Guild/PlayerbotGuildMgr.h similarity index 100% rename from src/PlayerbotGuildMgr.h rename to src/Mgr/Guild/PlayerbotGuildMgr.h diff --git a/src/strategy/ItemVisitors.cpp b/src/Mgr/Item/ItemVisitors.cpp similarity index 100% rename from src/strategy/ItemVisitors.cpp rename to src/Mgr/Item/ItemVisitors.cpp diff --git a/src/strategy/ItemVisitors.h b/src/Mgr/Item/ItemVisitors.h similarity index 100% rename from src/strategy/ItemVisitors.h rename to src/Mgr/Item/ItemVisitors.h diff --git a/src/LootObjectStack.cpp b/src/Mgr/Item/LootObjectStack.cpp similarity index 100% rename from src/LootObjectStack.cpp rename to src/Mgr/Item/LootObjectStack.cpp diff --git a/src/LootObjectStack.h b/src/Mgr/Item/LootObjectStack.h similarity index 100% rename from src/LootObjectStack.h rename to src/Mgr/Item/LootObjectStack.h diff --git a/src/RandomItemMgr.cpp b/src/Mgr/Item/RandomItemMgr.cpp similarity index 99% rename from src/RandomItemMgr.cpp rename to src/Mgr/Item/RandomItemMgr.cpp index a6e143ae14..87b8379355 100644 --- a/src/RandomItemMgr.cpp +++ b/src/Mgr/Item/RandomItemMgr.cpp @@ -2834,22 +2834,20 @@ inline bool ContainsInternal(ItemTemplate const* proto, uint32 skillId) CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates(); for (CreatureTemplateContainer::const_iterator itr = creatures->begin(); itr != creatures->end(); ++itr) { - if (itr->second.trainer_type != TRAINER_TYPE_TRADESKILLS) + Trainer::Trainer* trainer = sObjectMgr->GetTrainer(itr->first); + + if (!trainer) continue; - uint32 trainerId = itr->second.Entry; - TrainerSpellData const* trainer_spells = sObjectMgr->GetNpcTrainerSpells(trainerId); - if (!trainer_spells) + if (trainer->GetTrainerType() != Trainer::Type::Tradeskill) continue; - for (TrainerSpellMap::const_iterator iter = trainer_spells->spellList.begin(); - iter != trainer_spells->spellList.end(); ++iter) + for (auto& spell : trainer->GetSpells()) { - TrainerSpell const* tSpell = &iter->second; - if (!tSpell || tSpell->reqSkill != skillId) + if (spell.ReqSkillLine != skillId) continue; - if (IsCraftedBy(proto, tSpell->spell)) + if (IsCraftedBy(proto, spell.SpellId)) return true; } } diff --git a/src/RandomItemMgr.h b/src/Mgr/Item/RandomItemMgr.h similarity index 100% rename from src/RandomItemMgr.h rename to src/Mgr/Item/RandomItemMgr.h diff --git a/src/factory/StatsCollector.cpp b/src/Mgr/Item/StatsCollector.cpp similarity index 100% rename from src/factory/StatsCollector.cpp rename to src/Mgr/Item/StatsCollector.cpp diff --git a/src/factory/StatsCollector.h b/src/Mgr/Item/StatsCollector.h similarity index 100% rename from src/factory/StatsCollector.h rename to src/Mgr/Item/StatsCollector.h diff --git a/src/factory/StatsWeightCalculator.cpp b/src/Mgr/Item/StatsWeightCalculator.cpp similarity index 100% rename from src/factory/StatsWeightCalculator.cpp rename to src/Mgr/Item/StatsWeightCalculator.cpp diff --git a/src/factory/StatsWeightCalculator.h b/src/Mgr/Item/StatsWeightCalculator.h similarity index 100% rename from src/factory/StatsWeightCalculator.h rename to src/Mgr/Item/StatsWeightCalculator.h diff --git a/src/FleeManager.cpp b/src/Mgr/Move/FleeManager.cpp similarity index 100% rename from src/FleeManager.cpp rename to src/Mgr/Move/FleeManager.cpp diff --git a/src/FleeManager.h b/src/Mgr/Move/FleeManager.h similarity index 100% rename from src/FleeManager.h rename to src/Mgr/Move/FleeManager.h diff --git a/src/PlayerbotSecurity.cpp b/src/Mgr/Security/PlayerbotSecurity.cpp similarity index 100% rename from src/PlayerbotSecurity.cpp rename to src/Mgr/Security/PlayerbotSecurity.cpp diff --git a/src/PlayerbotSecurity.h b/src/Mgr/Security/PlayerbotSecurity.h similarity index 100% rename from src/PlayerbotSecurity.h rename to src/Mgr/Security/PlayerbotSecurity.h diff --git a/src/Talentspec.cpp b/src/Mgr/Talent/Talentspec.cpp similarity index 100% rename from src/Talentspec.cpp rename to src/Mgr/Talent/Talentspec.cpp diff --git a/src/Talentspec.h b/src/Mgr/Talent/Talentspec.h similarity index 100% rename from src/Talentspec.h rename to src/Mgr/Talent/Talentspec.h diff --git a/src/PlayerbotTextMgr.cpp b/src/Mgr/Text/PlayerbotTextMgr.cpp similarity index 100% rename from src/PlayerbotTextMgr.cpp rename to src/Mgr/Text/PlayerbotTextMgr.cpp diff --git a/src/PlayerbotTextMgr.h b/src/Mgr/Text/PlayerbotTextMgr.h similarity index 100% rename from src/PlayerbotTextMgr.h rename to src/Mgr/Text/PlayerbotTextMgr.h diff --git a/src/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp similarity index 99% rename from src/TravelMgr.cpp rename to src/Mgr/Travel/TravelMgr.cpp index 043e5ab50d..ab70576502 100644 --- a/src/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -3409,13 +3409,14 @@ void TravelMgr::LoadQuestTravelTable() { Strategy* strat = con->GetStrategy(stratName); - if (strat->getDefaultActions()) - for (uint32 i = 0; i < NextAction::size(strat->getDefaultActions()); i++) - { - NextAction* nextAction = strat->getDefaultActions()[i]; + const std::vector defaultActions = strat->getDefaultActions(); + if (defaultActions.size() > 0) + { + for (NextAction nextAction : defaultActions) + { std::ostringstream aout; - aout << nextAction->getRelevance() << "," << nextAction->getName() + aout << nextAction.getRelevance() << "," << nextAction.getName() << ",,S:" << stratName; if (actions.find(aout.str().c_str()) != actions.end()) @@ -3427,27 +3428,24 @@ void TravelMgr::LoadQuestTravelTable() actions.insert_or_assign(aout.str().c_str(), classSpecLevel); } + } std::vector triggers; strat->InitTriggers(triggers); - for (auto& triggerNode : triggers) - { - // out << " TN:" << triggerNode->getName(); + for (TriggerNode*& triggerNode : triggers) + { if (Trigger* trigger = con->GetTrigger(triggerNode->getName())) { triggerNode->setTrigger(trigger); - NextAction** nextActions = triggerNode->getHandlers(); + std::vector nextActions = triggerNode->getHandlers(); - for (uint32 i = 0; i < NextAction::size(nextActions); i++) + // for (uint32_t i = 0; i < nextActions.size(); ++i) + for (NextAction nextAction : nextActions) { - NextAction* nextAction = nextActions[i]; - // out << " A:" << nextAction->getName() << "(" << - // nextAction->getRelevance() << ")"; - std::ostringstream aout; - aout << nextAction->getRelevance() << "," << nextAction->getName() + aout << nextAction.getRelevance() << "," << nextAction.getName() << "," << triggerNode->getName() << "," << stratName; if (actions.find(aout.str().c_str()) != actions.end()) diff --git a/src/TravelMgr.h b/src/Mgr/Travel/TravelMgr.h similarity index 100% rename from src/TravelMgr.h rename to src/Mgr/Travel/TravelMgr.h diff --git a/src/TravelNode.cpp b/src/Mgr/Travel/TravelNode.cpp similarity index 100% rename from src/TravelNode.cpp rename to src/Mgr/Travel/TravelNode.cpp diff --git a/src/TravelNode.h b/src/Mgr/Travel/TravelNode.h similarity index 100% rename from src/TravelNode.h rename to src/Mgr/Travel/TravelNode.h diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index fcc50c11d6..d8fbd52da8 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -7,7 +7,7 @@ #include #include "Config.h" #include "NewRpgInfo.h" -#include "PlayerbotDungeonSuggestionMgr.h" +#include "PlayerbotDungeonRepository.h" #include "PlayerbotFactory.h" #include "Playerbots.h" #include "PlayerbotGuildMgr.h" @@ -679,7 +679,7 @@ bool PlayerbotAIConfig::Initialize() if (sPlayerbotAIConfig->randomBotSuggestDungeons) { - sPlayerbotDungeonSuggestionMgr->LoadDungeonSuggestions(); + sPlayerbotDungeonRepository->LoadDungeonSuggestions(); } excludedHunterPetFamilies.clear(); diff --git a/src/cs_playerbots.cpp b/src/Script/PlayerbotCommandScript.cpp similarity index 95% rename from src/cs_playerbots.cpp rename to src/Script/PlayerbotCommandScript.cpp index b0b7aa9a6a..4e3c5611f2 100644 --- a/src/cs_playerbots.cpp +++ b/src/Script/PlayerbotCommandScript.cpp @@ -16,7 +16,7 @@ #include "BattleGroundTactics.h" #include "Chat.h" #include "GuildTaskMgr.h" -#include "PerformanceMonitor.h" +#include "PerfMonitor.h" #include "PlayerbotMgr.h" #include "RandomPlayerbotMgr.h" #include "ScriptMgr.h" @@ -76,19 +76,19 @@ class playerbots_commandscript : public CommandScript { if (!strcmp(args, "reset")) { - sPerformanceMonitor->Reset(); + sPerfMonitor->Reset(); return true; } if (!strcmp(args, "tick")) { - sPerformanceMonitor->PrintStats(true, false); + sPerfMonitor->PrintStats(true, false); return true; } if (!strcmp(args, "stack")) { - sPerformanceMonitor->PrintStats(false, true); + sPerfMonitor->PrintStats(false, true); return true; } @@ -102,7 +102,7 @@ class playerbots_commandscript : public CommandScript return true; } - sPerformanceMonitor->PrintStats(); + sPerfMonitor->PrintStats(); return true; } @@ -209,4 +209,4 @@ class playerbots_commandscript : public CommandScript } }; -void AddSC_playerbots_commandscript() { new playerbots_commandscript(); } +void AddPlayerbotsCommandscripts() { new playerbots_commandscript(); } diff --git a/src/Script/PlayerbotCommandScript.h b/src/Script/PlayerbotCommandScript.h new file mode 100644 index 0000000000..f17ae7ecf4 --- /dev/null +++ b/src/Script/PlayerbotCommandScript.h @@ -0,0 +1 @@ +void AddPlayerbotsCommandscripts(); diff --git a/src/Playerbots.cpp b/src/Script/Playerbots.cpp similarity index 99% rename from src/Playerbots.cpp rename to src/Script/Playerbots.cpp index 97e72e4216..8a8e1e0b73 100644 --- a/src/Playerbots.cpp +++ b/src/Script/Playerbots.cpp @@ -26,11 +26,11 @@ #include "PlayerScript.h" #include "PlayerbotAIConfig.h" #include "PlayerbotGuildMgr.h" -#include "PlayerbotSpellCache.h" +#include "PlayerbotSpellRepository.h" #include "PlayerbotWorldThreadProcessor.h" #include "RandomPlayerbotMgr.h" #include "ScriptMgr.h" -#include "cs_playerbots.h" +#include "PlayerbotCommandScript.h" #include "cmath" #include "BattleGroundTactics.h" @@ -365,7 +365,7 @@ class PlayerbotsWorldScript : public WorldScript LOG_INFO("server.loading", ">> Loaded playerbots config in {} ms", GetMSTimeDiffToNow(oldMSTime)); LOG_INFO("server.loading", " "); - sPlayerbotSpellCache->Initialize(); + sPlayerbotSpellRepository->Initialize(); LOG_INFO("server.loading", "Playerbots World Thread Processor initialized"); } @@ -515,6 +515,6 @@ void AddPlayerbotsScripts() new PlayerbotsScript(); new PlayerBotsBGScript(); AddPlayerbotsSecureLoginScripts(); - AddSC_playerbots_commandscript(); + AddPlayerbotsCommandscripts(); PlayerBotsGuildValidationScript(); } diff --git a/src/Playerbots.h b/src/Script/Playerbots.h similarity index 100% rename from src/Playerbots.h rename to src/Script/Playerbots.h diff --git a/src/PlayerbotsSecureLogin.cpp b/src/Script/PlayerbotsSecureLogin.cpp similarity index 100% rename from src/PlayerbotsSecureLogin.cpp rename to src/Script/PlayerbotsSecureLogin.cpp diff --git a/src/PlayerbotOperation.h b/src/Script/WorldThr/PlayerbotOperation.h similarity index 100% rename from src/PlayerbotOperation.h rename to src/Script/WorldThr/PlayerbotOperation.h diff --git a/src/PlayerbotOperations.h b/src/Script/WorldThr/PlayerbotOperations.h similarity index 99% rename from src/PlayerbotOperations.h rename to src/Script/WorldThr/PlayerbotOperations.h index 8711f34610..cd8851902c 100644 --- a/src/PlayerbotOperations.h +++ b/src/Script/WorldThr/PlayerbotOperations.h @@ -15,7 +15,7 @@ #include "Player.h" #include "PlayerbotAI.h" #include "PlayerbotMgr.h" -#include "PlayerbotDbStore.h" +#include "PlayerbotRepository.h" #include "RandomPlayerbotMgr.h" #include "WorldSession.h" #include "WorldSessionMgr.h" @@ -418,7 +418,7 @@ class BotLogoutGroupCleanupOperation : public PlayerbotOperation Group* group = bot->GetGroup(); if (group && !bot->InBattleground() && !bot->InBattlegroundQueue() && botAI->HasActivePlayerMaster()) - sPlayerbotDbStore->Save(botAI); + sPlayerbotRepository->Save(botAI); return true; } diff --git a/src/PlayerbotWorldThreadProcessor.cpp b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp similarity index 100% rename from src/PlayerbotWorldThreadProcessor.cpp rename to src/Script/WorldThr/PlayerbotWorldThreadProcessor.cpp diff --git a/src/PlayerbotWorldThreadProcessor.h b/src/Script/WorldThr/PlayerbotWorldThreadProcessor.h similarity index 100% rename from src/PlayerbotWorldThreadProcessor.h rename to src/Script/WorldThr/PlayerbotWorldThreadProcessor.h diff --git a/src/strategy/Queue.cpp b/src/Script/WorldThr/Queue.cpp similarity index 100% rename from src/strategy/Queue.cpp rename to src/Script/WorldThr/Queue.cpp diff --git a/src/strategy/Queue.h b/src/Script/WorldThr/Queue.h similarity index 100% rename from src/strategy/Queue.h rename to src/Script/WorldThr/Queue.h diff --git a/src/playerbots_loader.cpp b/src/Script/playerbots_loader.cpp similarity index 100% rename from src/playerbots_loader.cpp rename to src/Script/playerbots_loader.cpp diff --git a/src/ServerFacade.h b/src/ServerFacade.h deleted file mode 100644 index 0ea93f0779..0000000000 --- a/src/ServerFacade.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_SERVERFACADE_H -#define _PLAYERBOT_SERVERFACADE_H - -#include "Common.h" - -class Player; -class Unit; -class WorldObject; -class WorldPacket; - -class ServerFacade -{ -public: - ServerFacade(){}; - virtual ~ServerFacade(){}; - static ServerFacade* instance() - { - static ServerFacade instance; - return &instance; - } - -public: - float GetDistance2d(Unit* unit, WorldObject* wo); - float GetDistance2d(Unit* unit, float x, float y); - bool IsDistanceLessThan(float dist1, float dist2); - bool IsDistanceGreaterThan(float dist1, float dist2); - bool IsDistanceGreaterOrEqualThan(float dist1, float dist2); - bool IsDistanceLessOrEqualThan(float dist1, float dist2); - - void SetFacingTo(Player* bot, WorldObject* wo, bool force = false); - Unit* GetChaseTarget(Unit* target); - - void SendPacket(Player *player, WorldPacket* packet); -}; - -#define sServerFacade ServerFacade::instance() - -#endif diff --git a/src/BroadcastHelper.cpp b/src/Util/BroadcastHelper.cpp similarity index 100% rename from src/BroadcastHelper.cpp rename to src/Util/BroadcastHelper.cpp diff --git a/src/BroadcastHelper.h b/src/Util/BroadcastHelper.h similarity index 100% rename from src/BroadcastHelper.h rename to src/Util/BroadcastHelper.h diff --git a/src/Util/Helpers.cpp b/src/Util/Helpers.cpp new file mode 100644 index 0000000000..fab0b4835d --- /dev/null +++ b/src/Util/Helpers.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#include "Helpers.h" + +#include +#include +#include +#include +#include +#include +#include + +/** + * Case-insensitive substring search. + */ +char* strstri(char const* haystack, char const* needle) +{ + if (!*needle) + { + return (char*)haystack; + } + + for (; *haystack; ++haystack) + { + if (tolower(*haystack) == tolower(*needle)) + { + char const* h = haystack; + char const* n = needle; + + for (; *h && *n; ++h, ++n) + { + if (tolower(*h) != tolower(*n)) + { + break; + } + } + + if (!*n) + { + return (char*)haystack; + } + } + } + + return 0; +} + +/** + * Trim whitespace from the left side of a string (in place). + */ +std::string& ltrim(std::string& s) +{ + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) { return !std::isspace(c); })); + return s; +} + +/** + * Trim whitespace from the right side of a string (in place). + */ +std::string& rtrim(std::string& s) +{ + s.erase(std::find_if(s.rbegin(), s.rend(), [](int c) { return !std::isspace(c); }).base(), s.end()); + return s; +} + +/** + * Trim whitespace from both ends of a string (in place). + */ +std::string& trim(std::string& s) { return ltrim(rtrim(s)); } + +/** + * Split a string using a C-string delimiter. + */ +void split(std::vector& dest, std::string const str, char const* delim) +{ + char* pTempStr = strdup(str.c_str()); + char* pWord = strtok(pTempStr, delim); + + while (pWord != nullptr) + { + dest.push_back(pWord); + pWord = strtok(nullptr, delim); + } + + free(pTempStr); +} + +/** + * Split a string using a single character delimiter. + */ +std::vector& split(std::string const s, char delim, std::vector& elems) +{ + std::stringstream ss(s); + std::string item; + + while (getline(ss, item, delim)) + { + elems.push_back(item); + } + + return elems; +} + +/** + * Split a string using a single character delimiter. + */ +std::vector split(std::string const s, char delim) +{ + std::vector elems; + return split(s, delim, elems); +} diff --git a/src/Util/Helpers.h b/src/Util/Helpers.h new file mode 100644 index 0000000000..90d5b64271 --- /dev/null +++ b/src/Util/Helpers.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_HELPERS_H +#define _PLAYERBOT_HELPERS_H + +#include +#include + +/** + * Case-insensitive substring search. + * + * @param haystack The string to search in + * @param needle The substring to search for + * @return Pointer to the first matching position in haystack, or nullptr if not found. + */ +char* strstri(char const* haystack, char const* needle); + +/** + * Trim whitespace from the left side of a string (in place). + * + * @param s The string to trim + * @return Reference to the modified string + */ +std::string& ltrim(std::string& s); + +/** + * Trim whitespace from the right side of a string (in place). + * + * @param s The string to trim + * @return Reference to the modified string + */ +std::string& rtrim(std::string& s); + +/** + * Trim whitespace from both ends of a string (in place). + * + * @param s The string to trim + * @return Reference to the modified string + */ +std::string& trim(std::string& s); + +/** + * Split a string using a C-string delimiter. + * + * @param dest Vector to store split tokens + * @param str String to split + * @param delim C-string delimiter + */ +void split(std::vector& dest, std::string const str, char const* delim); + +/** + * Split a string using a single character delimiter. + * + * @param s String to split + * @param delim Delimiter character + * @param elems Vector to store split tokens + * @return Reference to the vector containing tokens + */ +std::vector& split(std::string const s, char delim, std::vector& elems); + +/** + * Split a string using a single character delimiter. + * + * @param s String to split + * @param delim Delimiter character + * @return Vector containing split tokens + */ +std::vector split(std::string const s, char delim); + +#endif diff --git a/src/Util/LazyCalculatedValue.h b/src/Util/LazyCalculatedValue.h new file mode 100644 index 0000000000..bef54e2ddf --- /dev/null +++ b/src/Util/LazyCalculatedValue.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_LAZYCALCULATEDVALUE_H +#define _PLAYERBOT_LAZYCALCULATEDVALUE_H + +/** + * @brief Lazy calculation helper. + * + * Stores a function pointer (calculator) and its owner instance, and + * calculates the value only when it is requested for the first time. + * The result is cached until Reset() is called. + * + * @tparam TValue Type of the calculated value. + * @tparam TOwner Type of the owner class containing the calculator function. + */ +template +class LazyCalculatedValue +{ +public: + /** + * @brief Type of the calculator function. + * + * This is a pointer to a member function of TOwner returning TValue. + */ + typedef TValue (TOwner::*Calculator)(); + +public: + /** + * @brief Constructor. + * + * @param owner Pointer to the owner object. + * @param calculator Pointer to the member function used to calculate the value. + */ + LazyCalculatedValue(TOwner* owner, Calculator calculator) : calculator(calculator), owner(owner) { Reset(); } + +public: + /** + * @brief Get the cached value or calculate it if needed. + * + * If the value has not been calculated yet, it calls the calculator + * on the owner and caches the result. + * + * @return TValue The calculated or cached value. + */ + TValue GetValue() + { + if (!calculated) + { + value = (owner->*calculator)(); + calculated = true; + } + + return value; + } + + /** + * @brief Reset the cached state. + * + * After calling Reset(), the next call to GetValue() will recalculate + * the value again. + */ + void Reset() { calculated = false; } + +protected: + Calculator calculator; ///< Pointer to calculator member function + TOwner* owner; ///< Owner instance + bool calculated; ///< Whether value has already been calculated + TValue value; ///< Cached value +}; + +#endif diff --git a/src/PlaceholderHelper.cpp b/src/Util/PlaceholderHelper.cpp similarity index 100% rename from src/PlaceholderHelper.cpp rename to src/Util/PlaceholderHelper.cpp diff --git a/src/PlaceholderHelper.h b/src/Util/PlaceholderHelper.h similarity index 95% rename from src/PlaceholderHelper.h rename to src/Util/PlaceholderHelper.h index 2f290b0900..5ce57d7204 100644 --- a/src/PlaceholderHelper.h +++ b/src/Util/PlaceholderHelper.h @@ -10,7 +10,7 @@ #include "Common.h" #include "Player.h" -#include "PlayerbotDungeonSuggestionMgr.h" +#include "PlayerbotDungeonRepository.h" typedef std::map PlaceholderMap; diff --git a/src/ServerFacade.cpp b/src/Util/ServerFacade.cpp similarity index 86% rename from src/ServerFacade.cpp rename to src/Util/ServerFacade.cpp index f85525bc31..d69944c04f 100644 --- a/src/ServerFacade.cpp +++ b/src/Util/ServerFacade.cpp @@ -41,13 +41,19 @@ bool ServerFacade::IsDistanceLessOrEqualThan(float dist1, float dist2) { return void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool force) { + if (!bot) + return; + float angle = bot->GetAngle(wo); + // if (!force && bot->isMoving()) // bot->SetFacingTo(bot->GetAngle(wo)); // else // { bot->SetOrientation(angle); - bot->SendMovementFlagUpdate(); + + if (!bot->IsRooted()) + bot->SendMovementFlagUpdate(); // } } @@ -60,16 +66,14 @@ Unit* ServerFacade::GetChaseTarget(Unit* target) { return static_cast const*>(movementGen)->GetTarget(); } - else - { - return static_cast const*>(movementGen)->GetTarget(); - } + + return static_cast const*>(movementGen)->GetTarget(); } return nullptr; } -void ServerFacade::SendPacket(Player *player, WorldPacket *packet) +void ServerFacade::SendPacket(Player* player, WorldPacket* packet) { - return player->GetSession()->SendPacket(packet); + player->GetSession()->SendPacket(packet); } diff --git a/src/Util/ServerFacade.h b/src/Util/ServerFacade.h new file mode 100644 index 0000000000..6668fa9562 --- /dev/null +++ b/src/Util/ServerFacade.h @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it + * and/or modify it under version 3 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_SERVERFACADE_H +#define _PLAYERBOT_SERVERFACADE_H + +#include "Common.h" + +class Player; +class Unit; +class WorldObject; +class WorldPacket; + +/** + * @brief Provides a simplified interface to server engine operations. + * + * ServerFacade acts as a wrapper around common server functions used by + * the Playerbot system. It centralizes utility methods for distance + * calculations, facing, chase target retrieval, and packet sending. + */ +class ServerFacade +{ +public: + ServerFacade() {} + virtual ~ServerFacade() {} + + /** + * @brief Get singleton instance. + * + * @return ServerFacade* Pointer to the singleton instance. + */ + static ServerFacade* instance() + { + static ServerFacade instance; + return &instance; + } + +public: + /** + * @brief Get 2D distance between a unit and a world object. + * + * The result is rounded to one decimal place. + * + * @param unit Source unit. + * @param wo Target world object. + * @return float Distance in yards. + */ + float GetDistance2d(Unit* unit, WorldObject* wo); + + /** + * @brief Get 2D distance between a unit and coordinates. + * + * The result is rounded to one decimal place. + * + * @param unit Source unit. + * @param x Target X coordinate. + * @param y Target Y coordinate. + * @return float Distance in yards. + */ + float GetDistance2d(Unit* unit, float x, float y); + + /** + * @brief Compare two distances. + * + * @param dist1 First distance. + * @param dist2 Second distance. + * @return true if dist1 < dist2. + */ + bool IsDistanceLessThan(float dist1, float dist2); + + /** + * @brief Compare two distances. + * + * @param dist1 First distance. + * @param dist2 Second distance. + * @return true if dist1 > dist2. + */ + bool IsDistanceGreaterThan(float dist1, float dist2); + + /** + * @brief Compare two distances. + * + * @param dist1 First distance. + * @param dist2 Second distance. + * @return true if dist1 >= dist2. + */ + bool IsDistanceGreaterOrEqualThan(float dist1, float dist2); + + /** + * @brief Compare two distances. + * + * @param dist1 First distance. + * @param dist2 Second distance. + * @return true if dist1 <= dist2. + */ + bool IsDistanceLessOrEqualThan(float dist1, float dist2); + + /** + * @brief Set bot facing towards a world object. + * + * @param bot Player bot to rotate. + * @param wo Target world object. + * @param force If true, force facing even while moving. + */ + void SetFacingTo(Player* bot, WorldObject* wo, bool force = false); + + /** + * @brief Get the current chase target of a unit. + * + * @param target Unit that is chasing. + * @return Unit* The chase target, or nullptr if not chasing. + */ + Unit* GetChaseTarget(Unit* target); + + /** + * @brief Send a raw packet to a player. + * + * @param player Player to receive the packet. + * @param packet Packet to send. + */ + void SendPacket(Player* player, WorldPacket* packet); +}; + +/** Global singleton accessor. */ +#define sServerFacade ServerFacade::instance() + +#endif diff --git a/src/cs_playerbots.h b/src/cs_playerbots.h deleted file mode 100644 index e2e7de6d01..0000000000 --- a/src/cs_playerbots.h +++ /dev/null @@ -1 +0,0 @@ -void AddSC_playerbots_commandscript(); diff --git a/src/strategy/Action.cpp b/src/strategy/Action.cpp deleted file mode 100644 index 08c0af98d4..0000000000 --- a/src/strategy/Action.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "Action.h" - -#include "Playerbots.h" -#include "Timer.h" - -uint32 NextAction::size(NextAction** actions) -{ - if (!actions) - return 0; - - uint32 size = 0; - for (size = 0; actions[size];) - ++size; - - return size; -} - -NextAction** NextAction::clone(NextAction** actions) -{ - if (!actions) - return nullptr; - - uint32 size = NextAction::size(actions); - - NextAction** res = new NextAction*[size + 1]; - for (uint32 i = 0; i < size; i++) - res[i] = new NextAction(*actions[i]); - - res[size] = nullptr; - - return res; -} - -NextAction** NextAction::merge(NextAction** left, NextAction** right) -{ - uint32 leftSize = NextAction::size(left); - uint32 rightSize = NextAction::size(right); - - NextAction** res = new NextAction*[leftSize + rightSize + 1]; - - for (uint32 i = 0; i < leftSize; i++) - res[i] = new NextAction(*left[i]); - - for (uint32 i = 0; i < rightSize; i++) - res[leftSize + i] = new NextAction(*right[i]); - - res[leftSize + rightSize] = nullptr; - - NextAction::destroy(left); - NextAction::destroy(right); - - return res; -} - -NextAction** NextAction::array(uint32 nil, ...) -{ - va_list vl; - va_start(vl, nil); - - uint32 size = 0; - NextAction* cur = nullptr; - do - { - cur = va_arg(vl, NextAction*); - ++size; - } while (cur); - - va_end(vl); - - NextAction** res = new NextAction*[size]; - va_start(vl, nil); - for (uint32 i = 0; i < size; i++) - res[i] = va_arg(vl, NextAction*); - va_end(vl); - - return res; -} - -void NextAction::destroy(NextAction** actions) -{ - if (!actions) - return; - - for (uint32 i = 0; actions[i]; i++) - delete actions[i]; - - delete[] actions; -} - -Value* Action::GetTargetValue() { return context->GetValue(GetTargetName()); } - -Unit* Action::GetTarget() { return GetTargetValue()->Get(); } - -ActionBasket::ActionBasket(ActionNode* action, float relevance, bool skipPrerequisites, Event event) - : action(action), relevance(relevance), skipPrerequisites(skipPrerequisites), event(event), created(getMSTime()) -{ -} - -bool ActionBasket::isExpired(uint32 msecs) { return getMSTime() - created >= msecs; } diff --git a/src/strategy/Strategy.cpp b/src/strategy/Strategy.cpp deleted file mode 100644 index 753615c498..0000000000 --- a/src/strategy/Strategy.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "Strategy.h" - -#include "Playerbots.h" - -class ActionNodeFactoryInternal : public NamedObjectFactory -{ -public: - ActionNodeFactoryInternal() - { - creators["melee"] = &melee; - creators["healthstone"] = &healthstone; - creators["be near"] = &follow_master_random; - creators["attack anything"] = &attack_anything; - creators["move random"] = &move_random; - creators["move to loot"] = &move_to_loot; - creators["food"] = &food; - creators["drink"] = &drink; - creators["mana potion"] = &mana_potion; - creators["healing potion"] = &healing_potion; - creators["flee"] = &flee; - } - -private: - static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("melee", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* healthstone([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("healthstone", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("healing potion"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* follow_master_random([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("be near", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("follow"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* attack_anything([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("attack anything", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* move_random([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("move random", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("stay line"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* move_to_loot([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("move to loot", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* food([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("food", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* drink([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("drink", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* mana_potion([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mana potion", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* healing_potion([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("healing potion", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("food"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* flee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("flee", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -Strategy::Strategy(PlayerbotAI* botAI) : PlayerbotAIAware(botAI) -{ - actionNodeFactories.Add(new ActionNodeFactoryInternal()); -} - -ActionNode* Strategy::GetAction(std::string const name) { return actionNodeFactories.GetContextObject(name, botAI); } diff --git a/src/strategy/deathknight/BloodDKStrategy.cpp b/src/strategy/deathknight/BloodDKStrategy.cpp deleted file mode 100644 index 1f2793d92c..0000000000 --- a/src/strategy/deathknight/BloodDKStrategy.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "BloodDKStrategy.h" - -#include "Playerbots.h" - -class BloodDKStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - BloodDKStrategyActionNodeFactory() - { - // creators["melee"] = &melee; - // creators["blood strike"] = &blood_strike; - creators["rune strike"] = &rune_strike; - creators["heart strike"] = &heart_strike; - creators["death strike"] = &death_strike; - // creators["death grip"] = &death_grip; - // creators["plague strike"] = &plague_strike; - // creators["pestilence"] = &pestilence; - creators["icy touch"] = &icy_touch; - // creators["obliterate"] = &obliterate; - // creators["blood boil"] = &blood_boil; - // creators["mark of_blood"] = &mark_of_blood; - // creators["blood presence"] = &blood_presence; - // creators["rune tap"] = &rune_tap; - // creators["vampiric blood"] = &vampiric_blood; - // creators["death pact"] = &death_pact; - // creators["death rune_mastery"] = &death_rune_mastery; - // creators["hysteria"] = &hysteria; - // creators["dancing weapon"] = &dancing_weapon; - creators["dark command"] = &dark_command; - creators["taunt spell"] = &dark_command; - } - -private: - static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rune strike", - /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("icy touch", - /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* heart_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("heart strike", - /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("death strike", - /*P*/ NextAction::array(0, new NextAction("frost presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* dark_command([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("dark command", - /*P*/ NextAction::array(0, new NextAction("frost presence"), NULL), - /*A*/ NextAction::array(0, new NextAction("death grip"), NULL), - /*C*/ NULL); - } -}; - -BloodDKStrategy::BloodDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) -{ - actionNodeFactories.Add(new BloodDKStrategyActionNodeFactory()); -} - -NextAction** BloodDKStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("rune strike", ACTION_DEFAULT + 0.8f), new NextAction("icy touch", ACTION_DEFAULT + 0.7f), - new NextAction("heart strike", ACTION_DEFAULT + 0.6f), new NextAction("blood strike", ACTION_DEFAULT + 0.5f), - new NextAction("dancing rune weapon", ACTION_DEFAULT + 0.4f), - new NextAction("death coil", ACTION_DEFAULT + 0.3f), new NextAction("plague strike", ACTION_DEFAULT + 0.2f), - new NextAction("horn of winter", ACTION_DEFAULT + 0.1f), new NextAction("melee", ACTION_DEFAULT), NULL); -} - -void BloodDKStrategy::InitTriggers(std::vector& triggers) -{ - GenericDKStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode( - "rune strike", NextAction::array(0, new NextAction("rune strike", ACTION_NORMAL + 3), nullptr))); - triggers.push_back( - new TriggerNode("blood tap", NextAction::array(0, new NextAction("blood tap", ACTION_HIGH + 5), nullptr))); - 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("army of the dead", ACTION_HIGH + 4), - new NextAction("death strike", ACTION_HIGH + 3), nullptr))); - triggers.push_back( - new TriggerNode("critical health", NextAction::array(0, new NextAction("vampiric blood", ACTION_HIGH + 5), nullptr))); - triggers.push_back( - new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode( - "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), nullptr))); -} diff --git a/src/strategy/deathknight/FrostDKStrategy.cpp b/src/strategy/deathknight/FrostDKStrategy.cpp deleted file mode 100644 index f25fa6824b..0000000000 --- a/src/strategy/deathknight/FrostDKStrategy.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "FrostDKStrategy.h" - -#include "Playerbots.h" - -class FrostDKStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - FrostDKStrategyActionNodeFactory() - { - creators["icy touch"] = &icy_touch; - creators["obliterate"] = &obliterate; - creators["howling blast"] = &howling_blast; - creators["frost strike"] = &frost_strike; - // creators["chains of ice"] = &chains_of_ice; - creators["rune strike"] = &rune_strike; - // creators["icy clutch"] = &icy_clutch; - // creators["horn of winter"] = &horn_of_winter; - // creators["killing machine"] = &killing_machine; - // creators["frost presence"] = &frost_presence; - // creators["deathchill"] = &deathchill; - // creators["icebound fortitude"] = &icebound_fortitude; - // creators["mind freeze"] = &mind_freeze; - // creators["hungering cold"] = &hungering_cold; - creators["unbreakable armor"] = &unbreakable_armor; - // creators["improved icy talons"] = &improved_icy_talons; - } - -private: - static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("icy touch", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* obliterate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("obliterate", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* rune_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rune strike", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* frost_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("frost strike", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* howling_blast([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("howling blast", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* unbreakable_armor([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("unbreakable armor", - /*P*/ NextAction::array(0, new NextAction("blood tap"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -FrostDKStrategy::FrostDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) -{ - actionNodeFactories.Add(new FrostDKStrategyActionNodeFactory()); -} - -NextAction** FrostDKStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("obliterate", ACTION_DEFAULT + 0.7f), - new NextAction("frost strike", ACTION_DEFAULT + 0.4f), - new NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f), - new NextAction("horn of winter", ACTION_DEFAULT + 0.1f), new NextAction("melee", ACTION_DEFAULT), NULL); -} - -void FrostDKStrategy::InitTriggers(std::vector& triggers) -{ - GenericDKStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode( - "unbreakable armor", NextAction::array(0, new NextAction("unbreakable armor", ACTION_DEFAULT + 0.6f), nullptr))); - - triggers.push_back(new TriggerNode( - "freezing fog", NextAction::array(0, new NextAction("howling blast", ACTION_DEFAULT + 0.5f), nullptr))); - - triggers.push_back(new TriggerNode( - "high blood rune", NextAction::array(0, new NextAction("blood strike", ACTION_DEFAULT + 0.2f), nullptr))); - - triggers.push_back(new TriggerNode( - "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); - - triggers.push_back( - new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode( - "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 2), 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) -{ - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("howling blast", ACTION_HIGH + 4), nullptr))); -} diff --git a/src/strategy/deathknight/UnholyDKStrategy.cpp b/src/strategy/deathknight/UnholyDKStrategy.cpp deleted file mode 100644 index 1740ec3999..0000000000 --- a/src/strategy/deathknight/UnholyDKStrategy.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "UnholyDKStrategy.h" - -#include "Playerbots.h" - -class UnholyDKStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - UnholyDKStrategyActionNodeFactory() - { - // Unholy - // creators["bone shield"] = &bone_shield; - // creators["plague strike"] = &plague_strike; - // creators["death grip"] = &death_grip; - // creators["death coil"] = &death_coil; - creators["death strike"] = &death_strike; - // creators["unholy blight"] = &unholy_blight; - creators["scourge strike"] = &scourge_strike; - // creators["death and decay"] = &death_and_decay; - // creators["unholy pressence"] = &unholy_pressence; - // creators["raise dead"] = &raise_dead; - // creators["army of the dead"] = &army of the dead; - // creators["summon gargoyle"] = &army of the dead; - // creators["anti magic shell"] = &anti_magic_shell; - // creators["anti magic zone"] = &anti_magic_zone; - creators["ghoul frenzy"] = &ghoul_frenzy; - creators["corpse explosion"] = &corpse_explosion; - creators["icy touch"] = &icy_touch; - } - -private: - static ActionNode* death_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("death strike", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* ghoul_frenzy([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ghoul frenzy", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* corpse_explosion([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("corpse explosion", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* scourge_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("scourge strike", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* icy_touch([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("icy touch", - /*P*/ NextAction::array(0, new NextAction("blood presence"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -UnholyDKStrategy::UnholyDKStrategy(PlayerbotAI* botAI) : GenericDKStrategy(botAI) -{ - actionNodeFactories.Add(new UnholyDKStrategyActionNodeFactory()); -} - -NextAction** UnholyDKStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("death and decay", ACTION_HIGH + 5), - new NextAction("summon gargoyle", ACTION_DEFAULT + 0.4f), - // new NextAction("empower rune weapon", ACTION_DEFAULT + 0.3f), - new NextAction("horn of winter", ACTION_DEFAULT + 0.2f), - new NextAction("death coil", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void UnholyDKStrategy::InitTriggers(std::vector& triggers) -{ - GenericDKStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode( - "death and decay cooldown", NextAction::array(0, - new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f), - new NextAction("scourge strike", ACTION_DEFAULT + 0.8f), - new NextAction("icy touch", ACTION_DEFAULT + 0.7f), - new NextAction("blood strike", ACTION_DEFAULT + 0.6f), - new NextAction("plague strike", ACTION_DEFAULT + 0.5f), - nullptr))); - - triggers.push_back(new TriggerNode("dd cd and no desolation", - NextAction::array(0, new NextAction("blood strike", ACTION_DEFAULT + 0.75f), nullptr))); - - // triggers.push_back( - // new TriggerNode("icy touch", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); - // triggers.push_back(new TriggerNode( - // "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "high frost rune", NextAction::array(0, - new NextAction("icy touch", ACTION_NORMAL + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "high blood rune", NextAction::array(0, new NextAction("blood strike", ACTION_NORMAL + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "high unholy rune", NextAction::array(0, - new NextAction("plague strike", ACTION_NORMAL + 1), nullptr))); - - triggers.push_back( - new TriggerNode("dd cd and plague strike 3s", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr))); - - triggers.push_back( - new TriggerNode("dd cd and icy touch 3s", NextAction::array(0, new NextAction("icy touch", ACTION_HIGH + 2), nullptr))); - - triggers.push_back( - new TriggerNode("no rune", NextAction::array(0, new NextAction("empower rune weapon", ACTION_HIGH + 1), nullptr))); - - // triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction(, ACTION_NORMAL + 2), nullptr))); - triggers.push_back(new TriggerNode( - "army of the dead", NextAction::array(0, new NextAction("army of the dead", ACTION_HIGH + 6), nullptr))); - triggers.push_back( - new TriggerNode("bone shield", NextAction::array(0, new NextAction("bone shield", ACTION_HIGH + 3), nullptr))); -} - -void UnholyDKAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "loot available", NextAction::array(0, new NextAction("corpse explosion", ACTION_NORMAL + 1), nullptr))); - triggers.push_back(new TriggerNode( - "medium aoe", NextAction::array(0, new NextAction("death and decay", ACTION_NORMAL + 3), - new NextAction("corpse explosion", ACTION_NORMAL + 3), nullptr))); -} diff --git a/src/strategy/druid/BearTankDruidStrategy.cpp b/src/strategy/druid/BearTankDruidStrategy.cpp deleted file mode 100644 index 42bb81c448..0000000000 --- a/src/strategy/druid/BearTankDruidStrategy.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "BearTankDruidStrategy.h" - -#include "Playerbots.h" - -class BearTankDruidStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - BearTankDruidStrategyActionNodeFactory() - { - creators["melee"] = &melee; - creators["feral charge - bear"] = &feral_charge_bear; - creators["swipe (bear)"] = &swipe_bear; - creators["faerie fire (feral)"] = &faerie_fire_feral; - creators["bear form"] = &bear_form; - creators["dire bear form"] = &dire_bear_form; - creators["mangle (bear)"] = &mangle_bear; - creators["maul"] = &maul; - creators["bash"] = &bash; - creators["swipe"] = &swipe; - creators["lacerate"] = &lacerate; - creators["demoralizing roar"] = &demoralizing_roar; - creators["taunt spell"] = &growl; - } - -private: - static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("melee", - /*P*/ NextAction::array(0, new NextAction("feral charge - bear"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* feral_charge_bear([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("feral charge - bear", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("reach melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* swipe_bear([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("swipe (bear)", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("faerie fire (feral)", - /*P*/ NextAction::array(0, new NextAction("feral charge - bear"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* bear_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("bear form", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* dire_bear_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("dire bear form", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NextAction::array(0, new NextAction("bear form"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* mangle_bear([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mangle (bear)", - /*P*/ nullptr, - // /*A*/ NextAction::array(0, new NextAction("lacerate"), nullptr), - nullptr, - /*C*/ nullptr); - } - - static ActionNode* maul([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("maul", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* bash([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("bash", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* swipe([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("swipe", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* lacerate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("lacerate", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("maul"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* growl([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("growl", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* demoralizing_roar([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("demoralizing roar", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -BearTankDruidStrategy::BearTankDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) -{ - actionNodeFactories.Add(new BearTankDruidStrategyActionNodeFactory()); -} - -NextAction** BearTankDruidStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("mangle (bear)", ACTION_DEFAULT + 0.5f), - new NextAction("faerie fire (feral)", ACTION_DEFAULT + 0.4f), new NextAction("lacerate", ACTION_DEFAULT + 0.3f), - new NextAction("maul", ACTION_DEFAULT + 0.2f), new NextAction("enrage", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void BearTankDruidStrategy::InitTriggers(std::vector& triggers) -{ - FeralDruidStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode( - "enemy out of melee", NextAction::array(0, new NextAction("feral charge - bear", ACTION_NORMAL + 8), nullptr))); - // triggers.push_back(new TriggerNode("thorns", NextAction::array(0, new NextAction("thorns", ACTION_HIGH + 9), - // nullptr))); - triggers.push_back( - new TriggerNode("bear form", NextAction::array(0, new NextAction("dire bear form", ACTION_HIGH + 8), nullptr))); - triggers.push_back(new TriggerNode( - "low health", NextAction::array(0, new NextAction("frenzied regeneration", ACTION_HIGH + 7), nullptr))); - triggers.push_back(new TriggerNode( - "faerie fire (feral)", NextAction::array(0, new NextAction("faerie fire (feral)", ACTION_HIGH + 7), nullptr))); - triggers.push_back( - new TriggerNode("lose aggro", NextAction::array(0, new NextAction("growl", ACTION_HIGH + 8), nullptr))); - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("demoralizing roar", ACTION_HIGH + 6), - new NextAction("swipe (bear)", ACTION_HIGH + 6), nullptr))); - triggers.push_back( - new TriggerNode("light aoe", NextAction::array(0, new NextAction("swipe (bear)", ACTION_HIGH + 5), nullptr))); - triggers.push_back( - new TriggerNode("bash", NextAction::array(0, new NextAction("bash", ACTION_INTERRUPT + 2), nullptr))); - triggers.push_back( - new TriggerNode("bash on enemy healer", - NextAction::array(0, new NextAction("bash on enemy healer", ACTION_INTERRUPT + 1), nullptr))); -} diff --git a/src/strategy/druid/CasterDruidStrategy.cpp b/src/strategy/druid/CasterDruidStrategy.cpp deleted file mode 100644 index 657fedaa69..0000000000 --- a/src/strategy/druid/CasterDruidStrategy.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "CasterDruidStrategy.h" - -#include "AiObjectContext.h" -#include "FeralDruidStrategy.h" - -class CasterDruidStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - CasterDruidStrategyActionNodeFactory() - { - creators["faerie fire"] = &faerie_fire; - creators["hibernate"] = &hibernate; - creators["entangling roots"] = &entangling_roots; - creators["entangling roots on cc"] = &entangling_roots_on_cc; - creators["wrath"] = &wrath; - creators["starfall"] = &starfall; - creators["insect swarm"] = &insect_swarm; - creators["moonfire"] = &moonfire; - creators["starfire"] = &starfire; - creators["moonkin form"] = &moonkin_form; - } - -private: - static ActionNode* faerie_fire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("faerie fire", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* hibernate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("hibernate", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ NextAction::array(0, new NextAction("entangling roots"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* entangling_roots([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("entangling roots", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("entangling roots on cc", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* wrath([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("wrath", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* starfall([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("starfall", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* insect_swarm([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("insect swarm", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* moonfire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("moonfire", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* starfire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("starfire", - /*P*/ NextAction::array(0, new NextAction("moonkin form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* moonkin_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("moonkin form", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -CasterDruidStrategy::CasterDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI) -{ - actionNodeFactories.Add(new CasterDruidStrategyActionNodeFactory()); - actionNodeFactories.Add(new ShapeshiftDruidStrategyActionNodeFactory()); -} - -NextAction** CasterDruidStrategy::getDefaultActions() -{ - return NextAction::array(0, - new NextAction("starfall", ACTION_HIGH + 1.0f), - new NextAction("force of nature", ACTION_DEFAULT + 1.0f), - new NextAction("wrath", ACTION_DEFAULT + 0.1f), - // new NextAction("starfire", ACTION_NORMAL), - nullptr); -} - -void CasterDruidStrategy::InitTriggers(std::vector& triggers) -{ - GenericDruidStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", - // ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("eclipse (lunar) cooldown", - NextAction::array(0, new NextAction("starfire", ACTION_DEFAULT + 0.2f), nullptr))); - triggers.push_back(new TriggerNode("eclipse (solar) cooldown", - NextAction::array(0, new NextAction("wrath", ACTION_DEFAULT + 0.2f), nullptr))); - - 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)", - NextAction::array(0, new NextAction("starfire", ACTION_NORMAL + 6), nullptr))); - triggers.push_back( - new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 9), nullptr))); - - triggers.push_back(new TriggerNode("enemy too close for spell", - NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr))); -} - -void CasterDruidAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("hurricane channel check", NextAction::array(0, new NextAction("cancel channel", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("hurricane", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode( - "light aoe", NextAction::array(0, new NextAction("insect swarm on attacker", ACTION_NORMAL + 3), - new NextAction("moonfire on attacker", ACTION_NORMAL + 3), NULL))); -} - -void CasterDruidDebuffStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("faerie fire", NextAction::array(0, new NextAction("faerie fire", ACTION_HIGH), nullptr))); -} diff --git a/src/strategy/druid/CatDpsDruidStrategy.cpp b/src/strategy/druid/CatDpsDruidStrategy.cpp deleted file mode 100644 index 641156f951..0000000000 --- a/src/strategy/druid/CatDpsDruidStrategy.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "CatDpsDruidStrategy.h" - -#include "AiObjectContext.h" - -class CatDpsDruidStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - CatDpsDruidStrategyActionNodeFactory() - { - creators["faerie fire (feral)"] = &faerie_fire_feral; - creators["melee"] = &melee; - creators["feral charge - cat"] = &feral_charge_cat; - creators["cat form"] = &cat_form; - creators["claw"] = &claw; - creators["mangle (cat)"] = &mangle_cat; - creators["rake"] = &rake; - creators["ferocious bite"] = &ferocious_bite; - creators["rip"] = &rip; - creators["pounce"] = &pounce; - creators["ravage"] = &ravage; - } - -private: - static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("faerie fire (feral)", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("melee", - /*P*/ NextAction::array(0, new NextAction("feral charge - cat"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* feral_charge_cat([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("feral charge - cat", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("reach melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cat form", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* claw([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("claw", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mangle (cat)", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rake", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ferocious bite", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("rip"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rip", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* pounce([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("pounce", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("ravage"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* ravage([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ravage", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("shred"), nullptr), - /*C*/ nullptr); - } -}; - -CatDpsDruidStrategy::CatDpsDruidStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) -{ - actionNodeFactories.Add(new CatDpsDruidStrategyActionNodeFactory()); -} - -NextAction** CatDpsDruidStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("tiger's fury", ACTION_DEFAULT + 0.1f), nullptr); -} - -void CatDpsDruidStrategy::InitTriggers(std::vector& triggers) -{ - FeralDruidStrategy::InitTriggers(triggers); - - // Default priority - triggers.push_back(new TriggerNode("almost full energy available", - NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr))); - triggers.push_back(new TriggerNode("combo points not full", - NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr))); - triggers.push_back(new TriggerNode("almost full energy available", - NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr))); - triggers.push_back(new TriggerNode("combo points not full and high energy", - NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.3f), nullptr))); - triggers.push_back(new TriggerNode("almost full energy available", - NextAction::array(0, new NextAction("claw", ACTION_DEFAULT + 0.2f), nullptr))); - triggers.push_back(new TriggerNode("combo points not full and high energy", - 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))); - - // 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("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 + 6), nullptr))); - triggers.push_back(new TriggerNode( - "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))); - - // AOE - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("swipe (cat)", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode( - "light aoe", NextAction::array(0, new NextAction("rake on attacker", ACTION_HIGH + 2), nullptr))); - // Reach target - triggers.push_back(new TriggerNode( - "enemy out of melee", NextAction::array(0, new NextAction("feral charge - cat", ACTION_HIGH + 9), nullptr))); - triggers.push_back( - new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("dash", ACTION_HIGH + 8), nullptr))); -} - -void CatAoeDruidStrategy::InitTriggers(std::vector& triggers) {} diff --git a/src/strategy/druid/GenericDruidNonCombatStrategy.cpp b/src/strategy/druid/GenericDruidNonCombatStrategy.cpp deleted file mode 100644 index 3b42160a3e..0000000000 --- a/src/strategy/druid/GenericDruidNonCombatStrategy.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericDruidNonCombatStrategy.h" - -#include "Playerbots.h" -#include "AiFactory.h" - -class GenericDruidNonCombatStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericDruidNonCombatStrategyActionNodeFactory() - { - creators["thorns"] = þs; - creators["thorns on party"] = þs_on_party; - creators["mark of the wild"] = &mark_of_the_wild; - creators["mark of the wild on party"] = &mark_of_the_wild_on_party; - // creators["innervate"] = &innervate; - creators["regrowth_on_party"] = ®rowth_on_party; - creators["rejuvenation on party"] = &rejuvenation_on_party; - creators["remove curse on party"] = &remove_curse_on_party; - creators["abolish poison on party"] = &abolish_poison_on_party; - creators["revive"] = &revive; - } - -private: - static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("thorns", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* thorns_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("thorns on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* mark_of_the_wild([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mark of the wild", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* mark_of_the_wild_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mark of the wild on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("regrowth on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rejuvenation on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("remove curse on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("abolish poison on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* revive([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("revive", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ NULL, - /*C*/ NULL); - } - // static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode ("innervate", - // /*P*/ nullptr, - // /*A*/ NextAction::array(0, new NextAction("drink"), nullptr), - // /*C*/ nullptr); - // } -}; - -GenericDruidNonCombatStrategy::GenericDruidNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory()); -} - -void GenericDruidNonCombatStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("mark of the wild", NextAction::array(0, new NextAction("mark of the wild", 14.0f), nullptr))); - // triggers.push_back(new TriggerNode("thorns", NextAction::array(0, new NextAction("thorns", 12.0f), nullptr))); - // triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("abolish poison", 21.0f), - // nullptr))); - triggers.push_back(new TriggerNode("party member cure poison", NextAction::array(0, new NextAction("abolish poison on party", 20.0f), nullptr))); - triggers.push_back(new TriggerNode("party member dead", NextAction::array(0, new NextAction("revive", ACTION_CRITICAL_HEAL + 10), nullptr))); - // triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("innervate", ACTION_EMERGENCY - // + 5), nullptr))); triggers.push_back(new TriggerNode("swimming", NextAction::array(0, new NextAction("aquatic - // form", 1.0f), nullptr))); - - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); - - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5), - nullptr))); - - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), - nullptr))); - - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1), - nullptr))); - - triggers.push_back( - new TriggerNode("party member almost full health", - NextAction::array(0, new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2), NULL))); - - triggers.push_back( - new TriggerNode("party member remove curse", - NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), nullptr))); - triggers.push_back( - new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); - - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 7), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5), - nullptr))); - triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), - nullptr))); - triggers.push_back(new TriggerNode("party member medium health", NextAction::array(0, - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 3), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 1), - nullptr))); - triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, - new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), - new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2), - nullptr))); - triggers.push_back(new TriggerNode("party member remove curse", NextAction::array(0, - new NextAction("remove curse on party", ACTION_DISPEL + 7), - nullptr))); - - int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot()); - if (specTab == 0 || specTab == 2) // Balance or Restoration - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); - if (specTab == 1) // Feral - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply stone", 1.0f), nullptr))); - -} - -GenericDruidBuffStrategy::GenericDruidBuffStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericDruidNonCombatStrategyActionNodeFactory()); -} - -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 main tank", NextAction::array(0, - new NextAction("thorns on main tank", 11.0f), - nullptr))); - triggers.push_back(new TriggerNode("thorns", NextAction::array(0, - new NextAction("thorns", 10.0f), - nullptr))); -} diff --git a/src/strategy/druid/GenericDruidStrategy.cpp b/src/strategy/druid/GenericDruidStrategy.cpp deleted file mode 100644 index b1fec20eb5..0000000000 --- a/src/strategy/druid/GenericDruidStrategy.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericDruidStrategy.h" - -#include "Playerbots.h" - -class GenericDruidStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericDruidStrategyActionNodeFactory() - { - creators["melee"] = &melee; - creators["caster form"] = &caster_form; - creators["cure poison"] = &cure_poison; - creators["cure poison on party"] = &cure_poison_on_party; - creators["abolish poison"] = &abolish_poison; - creators["abolish poison on party"] = &abolish_poison_on_party; - creators["rebirth"] = &rebirth; - creators["entangling roots on cc"] = &entangling_roots_on_cc; - creators["innervate"] = &innervate; - } - -private: - static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("melee", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* caster_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("caster form", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* cure_poison([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cure poison", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* cure_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cure poison on party", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* abolish_poison([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("abolish poison", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("abolish poison on party", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* rebirth([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rebirth", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* entangling_roots_on_cc([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("entangling roots on cc", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* innervate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("innervate", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("mana potion"), nullptr), - /*C*/ nullptr); - } -}; - -GenericDruidStrategy::GenericDruidStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericDruidStrategyActionNodeFactory()); -} - -void GenericDruidStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("barkskin", ACTION_HIGH + 7), nullptr))); - - // triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("regrowth", - // ACTION_MEDIUM_HEAL + 2), nullptr))); triggers.push_back(new TriggerNode("party member low health", - // NextAction::array(0, new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 1), nullptr))); - // triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("regrowth", - // ACTION_CRITICAL_HEAL + 2), new NextAction("healing touch", ACTION_CRITICAL_HEAL + 2), nullptr))); - // triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new NextAction("regrowth - // on party", ACTION_CRITICAL_HEAL + 1), new NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 1), - // nullptr))); triggers.push_back(new TriggerNode("party member dead", NextAction::array(0, new - // NextAction("rebirth", ACTION_HIGH + 1), nullptr))); triggers.push_back(new TriggerNode("low mana", - // NextAction::array(0, new NextAction("innervate", ACTION_EMERGENCY + 5), nullptr))); - triggers.push_back(new TriggerNode("combat party member dead", - NextAction::array(0, new NextAction("rebirth", ACTION_HIGH + 9), NULL))); - triggers.push_back(new TriggerNode("being attacked", - NextAction::array(0, new NextAction("nature's grasp", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); -} - -void DruidCureStrategy::InitTriggers(std::vector& triggers) -{ - // triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("abolish poison", - // ACTION_DISPEL + 2), nullptr))); - triggers.push_back( - new TriggerNode("party member cure poison", - NextAction::array(0, new NextAction("abolish poison on party", ACTION_DISPEL + 1), nullptr))); - - triggers.push_back( - new TriggerNode("party member remove curse", - NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL))); - -} - -void DruidBoostStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "nature's swiftness", NextAction::array(0, new NextAction("nature's swiftness", ACTION_HIGH + 9), nullptr))); -} - -void DruidCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "entangling roots", NextAction::array(0, new NextAction("entangling roots on cc", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode( - "entangling roots kite", NextAction::array(0, new NextAction("entangling roots", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode( - "hibernate", NextAction::array(0, new NextAction("hibernate on cc", ACTION_HIGH + 3), nullptr))); -} - -void DruidHealerDpsStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("healer should attack", - NextAction::array(0, - new NextAction("cancel tree form", ACTION_DEFAULT + 0.3f), - new NextAction("moonfire", ACTION_DEFAULT + 0.2f), - new NextAction("wrath", ACTION_DEFAULT + 0.1f), - new NextAction("starfire", ACTION_DEFAULT), - nullptr))); - - // long cast time - // triggers.push_back( - // new TriggerNode("medium aoe and healer should attack", - // NextAction::array(0, - // new NextAction("hurricane", ACTION_DEFAULT + 0.7f), - // nullptr))); -} diff --git a/src/strategy/druid/HealDruidStrategy.cpp b/src/strategy/druid/HealDruidStrategy.cpp deleted file mode 100644 index 7e052a3463..0000000000 --- a/src/strategy/druid/HealDruidStrategy.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "HealDruidStrategy.h" - -#include "Playerbots.h" - -class HealDruidStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - HealDruidStrategyActionNodeFactory() { - creators["nourish on party"] = &nourtish_on_party; - // creators["wild growth on party"] = &wild_growth_on_party; - // creators["rejuvenation on party"] = &rejuvenation_on_party; - // creators["regrowth on party"] = ®rowth_on_party; - } - -private: - static ActionNode* nourtish_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("nourish on party", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("healing touch on party"), nullptr), - /*C*/ nullptr); - } - // static ActionNode* wild_growth_on_party([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode("wild growth on party", - // /*P*/ NextAction::array(0, new NextAction("tree form"), nullptr), - // /*A*/ nullptr, - // /*C*/ nullptr); - // } - // static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode("rejuvenation on party", - // /*P*/ NextAction::array(0, new NextAction("tree form"), nullptr), - // /*A*/ nullptr, - // /*C*/ nullptr); - // } - // static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode("regrowth on party", - // /*P*/ NextAction::array(0, new NextAction("tree form"), nullptr), - // /*A*/ nullptr, - // /*C*/ nullptr); - // } -}; - -HealDruidStrategy::HealDruidStrategy(PlayerbotAI* botAI) : GenericDruidStrategy(botAI) -{ - actionNodeFactories.Add(new HealDruidStrategyActionNodeFactory()); -} - -void HealDruidStrategy::InitTriggers(std::vector& triggers) -{ - GenericDruidStrategy::InitTriggers(triggers); - - // triggers.push_back( - // new TriggerNode("tree form", NextAction::array(0, new NextAction("tree form", ACTION_HIGH + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 9), nullptr))); - - // CRITICAL - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, - new NextAction("tree form", ACTION_CRITICAL_HEAL + 4.1f), - new NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 4), - new NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 3), - new NextAction("wild growth on party", ACTION_CRITICAL_HEAL + 2), - new NextAction("nourish on party", ACTION_CRITICAL_HEAL + 1), - // new NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 0), - nullptr))); - - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, new NextAction("nature's swiftness", ACTION_CRITICAL_HEAL + 4), nullptr))); - - triggers.push_back(new TriggerNode( - "group heal setting", - NextAction::array(0, - new NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f), - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f), - new NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f), - nullptr))); - - triggers.push_back( - new TriggerNode("medium group heal setting", - NextAction::array(0, - new NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f), - new NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f), nullptr))); - - // LOW - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("tree form", ACTION_MEDIUM_HEAL + 1.5f), - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 1.4f), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 1.3f), - new NextAction("swiftmend on party", ACTION_MEDIUM_HEAL + 1.2), - new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 1.1f), - nullptr))); - - // MEDIUM - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, - new NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f), - new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f), - new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f), - new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 0.2f), - new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 0.1f), nullptr))); - - // almost full - triggers.push_back( - new TriggerNode("party member almost full health", - NextAction::array(0, new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 0.3f), - new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 0.2f), - new NextAction("regrowth on party", ACTION_LIGHT_HEAL + 0.1f), nullptr))); - - triggers.push_back( - new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), nullptr))); - - triggers.push_back(new TriggerNode("enemy too close for spell", - NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr))); -} diff --git a/src/strategy/druid/OffhealDruidCatStrategy.cpp b/src/strategy/druid/OffhealDruidCatStrategy.cpp deleted file mode 100644 index 7059070970..0000000000 --- a/src/strategy/druid/OffhealDruidCatStrategy.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - - #include "OffhealDruidCatStrategy.h" - - #include "Playerbots.h" - #include "Strategy.h" - - class OffhealDruidCatStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - OffhealDruidCatStrategyActionNodeFactory() - { - creators["cat form"] = &cat_form; - creators["mangle (cat)"] = &mangle_cat; - creators["shred"] = &shred; - creators["rake"] = &rake; - creators["rip"] = &rip; - creators["ferocious bite"] = &ferocious_bite; - creators["savage roar"] = &savage_roar; - creators["faerie fire (feral)"] = &faerie_fire_feral; - creators["healing touch on party"] = &healing_touch_on_party; - creators["regrowth on party"] = ®rowth_on_party; - creators["rejuvenation on party"] = &rejuvenation_on_party; - } - -private: - static ActionNode* cat_form([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cat form", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* mangle_cat([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mangle (cat)", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* shred([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("shred", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("claw"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* rake([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rake", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* rip([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rip", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* ferocious_bite([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ferocious bite", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("rip"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* savage_roar([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("savage roar", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* faerie_fire_feral([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("faerie fire (feral)", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* healing_touch_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("healing touch on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ NextAction::array(0, new NextAction("cat form"), nullptr)); - } - - static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("regrowth on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ NextAction::array(0, new NextAction("cat form"), nullptr)); - } - - static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rejuvenation on party", - /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr), - /*A*/ nullptr, - /*C*/ NextAction::array(0, new NextAction("cat form"), nullptr)); - } -}; - -OffhealDruidCatStrategy::OffhealDruidCatStrategy(PlayerbotAI* botAI) : FeralDruidStrategy(botAI) -{ - actionNodeFactories.Add(new OffhealDruidCatStrategyActionNodeFactory()); -} - -NextAction** OffhealDruidCatStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("mangle (cat)", ACTION_DEFAULT + 0.5f), - new NextAction("shred", ACTION_DEFAULT + 0.4f), - new NextAction("rake", ACTION_DEFAULT + 0.3f), new NextAction("melee", ACTION_DEFAULT), - new NextAction("cat form", ACTION_DEFAULT - 0.1f), nullptr); -} - -void OffhealDruidCatStrategy::InitTriggers(std::vector& triggers) -{ - FeralDruidStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("cat form", NextAction::array(0, new NextAction("cat form", ACTION_HIGH + 8), nullptr))); - triggers.push_back( - 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 + 6), nullptr))); - triggers.push_back(new TriggerNode( - "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("almost full energy available", - NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr))); - triggers.push_back(new TriggerNode("combo points not full", - NextAction::array(0, new NextAction("shred", ACTION_DEFAULT + 0.4f), nullptr))); - triggers.push_back(new TriggerNode( - "faerie fire (feral)", NextAction::array(0, new NextAction("faerie fire (feral)", ACTION_NORMAL), nullptr))); - triggers.push_back(new TriggerNode("enemy out of melee", - NextAction::array(0, new NextAction("feral charge - cat", ACTION_HIGH + 9), - new NextAction("dash", ACTION_HIGH + 8), nullptr))); - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("swipe (cat)", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode( - "low energy", NextAction::array(0, new NextAction("tiger's fury", ACTION_NORMAL + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "party member critical health", - NextAction::array(0, new NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 5), nullptr))); - triggers.push_back(new TriggerNode( - "party member low health", - NextAction::array(0, new NextAction("healing touch on party", ACTION_MEDIUM_HEAL + 5), nullptr))); - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 8), nullptr))); - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_EMERGENCY + 3), nullptr))); - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 4), nullptr))); -} diff --git a/src/strategy/dungeons/wotlk/WotlkDungeonActionContext.h b/src/strategy/dungeons/wotlk/WotlkDungeonActionContext.h deleted file mode 100644 index a53f95154e..0000000000 --- a/src/strategy/dungeons/wotlk/WotlkDungeonActionContext.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _PLAYERBOT_WOTLKDUNGEONACTIONCONTEXT_H -#define _PLAYERBOT_WOTLKDUNGEONACTIONCONTEXT_H - -#include "utgardekeep/UtgardeKeepActionContext.h" -#include "nexus/NexusActionContext.h" -#include "azjolnerub/AzjolNerubActionContext.h" -#include "oldkingdom/OldKingdomActionContext.h" -#include "draktharonkeep/DrakTharonKeepActionContext.h" -#include "violethold/VioletHoldActionContext.h" -#include "gundrak/GundrakActionContext.h" -#include "hallsofstone/HallsOfStoneActionContext.h" -#include "hallsoflightning/HallsOfLightningActionContext.h" -#include "oculus/OculusActionContext.h" -#include "utgardepinnacle/UtgardePinnacleActionContext.h" -#include "cullingofstratholme/CullingOfStratholmeActionContext.h" -#include "forgeofsouls/ForgeOfSoulsActionContext.h" -#include "pitofsaron/PitOfSaronActionContext.h" -#include "trialofthechampion/TrialOfTheChampionActionContext.h" -// #include "hallsofreflection/HallsOfReflectionActionContext.h" - -#endif diff --git a/src/strategy/dungeons/wotlk/WotlkDungeonTriggerContext.h b/src/strategy/dungeons/wotlk/WotlkDungeonTriggerContext.h deleted file mode 100644 index 1a3d7a94a3..0000000000 --- a/src/strategy/dungeons/wotlk/WotlkDungeonTriggerContext.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _PLAYERBOT_WOTLKDUNGEONTRIGGERCONTEXT_H -#define _PLAYERBOT_WOTLKDUNGEONTRIGGERCONTEXT_H - -#include "utgardekeep/UtgardeKeepTriggerContext.h" -#include "nexus/NexusTriggerContext.h" -#include "azjolnerub/AzjolNerubTriggerContext.h" -#include "oldkingdom/OldKingdomTriggerContext.h" -#include "draktharonkeep/DrakTharonKeepTriggerContext.h" -#include "violethold/VioletHoldTriggerContext.h" -#include "gundrak/GundrakTriggerContext.h" -#include "hallsofstone/HallsOfStoneTriggerContext.h" -#include "hallsoflightning/HallsOfLightningTriggerContext.h" -#include "oculus/OculusTriggerContext.h" -#include "utgardepinnacle/UtgardePinnacleTriggerContext.h" -#include "cullingofstratholme/CullingOfStratholmeTriggerContext.h" -#include "forgeofsouls/ForgeOfSoulsTriggerContext.h" -#include "pitofsaron/PitOfSaronTriggerContext.h" -#include "trialofthechampion/TrialOfTheChampionTriggerContext.h" -// #include "hallsofreflection/HallsOfReflectionTriggerContext.h" - -#endif diff --git a/src/strategy/generic/BattlegroundStrategy.cpp b/src/strategy/generic/BattlegroundStrategy.cpp deleted file mode 100644 index 444acf06b1..0000000000 --- a/src/strategy/generic/BattlegroundStrategy.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "BattlegroundStrategy.h" - -#include "Playerbots.h" - -void BGStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg join", relevance), nullptr))); - triggers.push_back(new TriggerNode("bg invite active", NextAction::array(0, new NextAction("bg status check", relevance), nullptr))); - triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("bg strategy check", relevance), nullptr))); -} - -BGStrategy::BGStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} - -void BattlegroundStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("bg waiting", NextAction::array(0, new NextAction("bg move to start", ACTION_BG), nullptr))); - triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg move to objective", ACTION_BG), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg check objective", ACTION_BG + 1), nullptr))); - triggers.push_back(new TriggerNode("dead", NextAction::array(0, new NextAction("bg reset objective force", ACTION_EMERGENCY), nullptr))); - // triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy - // flag carrier", 80.0f), nullptr))); triggers.push_back(new TriggerNode("team flagcarrier near", - // NextAction::array(0, new NextAction("bg protect fc", 40.0f), nullptr))); triggers.push_back(new - // TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", 90.0f), nullptr))); -} - -void WarsongStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", ACTION_EMERGENCY ), nullptr))); - triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", ACTION_RAID + 1.0f), nullptr))); - triggers.push_back(new TriggerNode("team flagcarrier near", NextAction::array(0, new NextAction("bg protect fc", ACTION_RAID), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", ACTION_BG), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("player has flag", NextAction::array(0, new NextAction("bg move to objective", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("timer bg", NextAction::array(0, new NextAction("bg reset objective force", ACTION_EMERGENCY), nullptr))); -} - -void AlteracStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("alliance no snowfall gy", NextAction::array(0, new NextAction("bg move to objective", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("timer bg", NextAction::array(0, new NextAction("bg reset objective force", ACTION_EMERGENCY), nullptr))); -} - -void ArathiStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", ACTION_BG), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); -} - -void EyeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("bg use buff", ACTION_BG), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("bg use buff", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("enemy flagcarrier near", NextAction::array(0, new NextAction("attack enemy flag carrier", ACTION_RAID), nullptr))); - triggers.push_back(new TriggerNode("player has flag",NextAction::array(0, new NextAction("bg move to objective", ACTION_EMERGENCY), nullptr))); -} - -//TODO: Do Priorities -void IsleStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("bg active", NextAction::array(0, new NextAction("bg check flag", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("enter vehicle", ACTION_MOVE + 8.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("leave vehicle", ACTION_MOVE + 7.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("hurl boulder", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("fire cannon", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("napalm", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("steam blast", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("ram", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("ram", ACTION_MOVE + 9.1f), nullptr))); - triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("steam rush", ACTION_MOVE + 9.2f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("incendiary rocket", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("rocket blast", ACTION_MOVE + 9.0f), nullptr))); - // this is bugged: it doesn't work, and stops glaive throw working (which is needed to take down gate) - // triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("blade salvo", ACTION_MOVE + 9.0f), nullptr))); - triggers.push_back(new TriggerNode("in vehicle", NextAction::array(0, new NextAction("glaive throw", ACTION_MOVE + 9.0f), nullptr))); -} - -void ArenaStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("no possible targets", NextAction::array(0, new NextAction("arena tactics", ACTION_BG), nullptr))); -} diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp deleted file mode 100644 index 6cb59cda34..0000000000 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "ChatCommandHandlerStrategy.h" - -#include "Playerbots.h" - -class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory -{ -public: - ChatCommandActionNodeFactoryInternal() { creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut; } - -private: - static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* botAI) - { - return new ActionNode("tank attack chat shortcut", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ NextAction::array(0, new NextAction("attack my target", 100.0f), nullptr)); - } -}; - -void ChatCommandHandlerStrategy::InitTriggers(std::vector& triggers) -{ - PassTroughStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("rep", NextAction::array(0, new NextAction("reputation", relevance), nullptr))); - triggers.push_back(new TriggerNode("q", NextAction::array(0, new NextAction("query quest", relevance), - new NextAction("query item usage", relevance), nullptr))); - triggers.push_back(new TriggerNode("add all loot", NextAction::array(0, new NextAction("add all loot", relevance), - new NextAction("loot", relevance), nullptr))); - triggers.push_back(new TriggerNode("u", NextAction::array(0, new NextAction("use", relevance), nullptr))); - triggers.push_back(new TriggerNode("c", NextAction::array(0, new NextAction("item count", relevance), nullptr))); - triggers.push_back( - new TriggerNode("items", NextAction::array(0, new NextAction("item count", relevance), nullptr))); - triggers.push_back(new TriggerNode("inv", NextAction::array(0, new NextAction("item count", relevance), nullptr))); - triggers.push_back(new TriggerNode("e", NextAction::array(0, new NextAction("equip", relevance), nullptr))); - triggers.push_back(new TriggerNode("ue", NextAction::array(0, new NextAction("unequip", relevance), nullptr))); - triggers.push_back(new TriggerNode("t", NextAction::array(0, new NextAction("trade", relevance), nullptr))); - triggers.push_back(new TriggerNode("nt", NextAction::array(0, new NextAction("trade", relevance), nullptr))); - triggers.push_back(new TriggerNode("s", NextAction::array(0, new NextAction("sell", relevance), nullptr))); - triggers.push_back(new TriggerNode("b", NextAction::array(0, new NextAction("buy", relevance), nullptr))); - triggers.push_back(new TriggerNode("r", NextAction::array(0, new NextAction("reward", relevance), nullptr))); - triggers.push_back( - new TriggerNode("attack", NextAction::array(0, new NextAction("attack my target", relevance), nullptr))); - triggers.push_back( - new TriggerNode("accept", NextAction::array(0, new NextAction("accept quest", relevance), nullptr))); - triggers.push_back( - new TriggerNode("follow", NextAction::array(0, new NextAction("follow chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("stay", NextAction::array(0, new NextAction("stay chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("move from group", NextAction::array(0, new NextAction("move from group chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("flee", NextAction::array(0, new NextAction("flee chat shortcut", relevance), nullptr))); - triggers.push_back(new TriggerNode( - "tank attack", NextAction::array(0, new NextAction("tank attack chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("grind", NextAction::array(0, new NextAction("grind chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("talk", NextAction::array(0, new NextAction("gossip hello", relevance), - new NextAction("talk to quest giver", relevance), nullptr))); - triggers.push_back( - new TriggerNode("enter vehicle", NextAction::array(0, new NextAction("enter vehicle", relevance), nullptr))); - triggers.push_back( - new TriggerNode("leave vehicle", NextAction::array(0, new NextAction("leave vehicle", relevance), nullptr))); - triggers.push_back( - new TriggerNode("cast", NextAction::array(0, new NextAction("cast custom spell", relevance), nullptr))); - triggers.push_back( - new TriggerNode("castnc", NextAction::array(0, new NextAction("cast custom nc spell", relevance), nullptr))); - triggers.push_back( - new TriggerNode("revive", NextAction::array(0, new NextAction("spirit healer", relevance), nullptr))); - triggers.push_back( - new TriggerNode("runaway", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("warning", NextAction::array(0, new NextAction("runaway chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("max dps", NextAction::array(0, new NextAction("max dps chat shortcut", relevance), nullptr))); - triggers.push_back( - new TriggerNode("attackers", NextAction::array(0, new NextAction("tell attackers", relevance), nullptr))); - triggers.push_back( - new TriggerNode("target", NextAction::array(0, new NextAction("tell target", relevance), nullptr))); - triggers.push_back( - new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr))); - triggers.push_back( - new TriggerNode("bwl", NextAction::array(0, new NextAction("bwl chat shortcut", relevance), NULL))); - triggers.push_back( - new TriggerNode("dps", NextAction::array(0, new NextAction("tell estimated dps", relevance), NULL))); - triggers.push_back( - new TriggerNode("disperse", NextAction::array(0, new NextAction("disperse set", relevance), NULL))); - triggers.push_back( - new TriggerNode("open items", NextAction::array(0, new NextAction("open items", relevance), nullptr))); - triggers.push_back( - new TriggerNode("qi", NextAction::array(0, new NextAction("query item usage", relevance), nullptr))); - triggers.push_back( - new TriggerNode("unlock items", NextAction::array(0, new NextAction("unlock items", relevance), nullptr))); - triggers.push_back( - new TriggerNode("unlock traded item", NextAction::array(0, new NextAction("unlock traded item", relevance), nullptr))); - triggers.push_back( - new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); - triggers.push_back(new TriggerNode("tame", NextAction::array(0, new NextAction("tame", relevance), nullptr))); - triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); - triggers.push_back(new TriggerNode("pet attack", NextAction::array(0, new NextAction("pet attack", relevance), nullptr))); - triggers.push_back(new TriggerNode("roll", NextAction::array(0, new NextAction("roll", relevance), nullptr))); -} - -ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) -{ - actionNodeFactories.Add(new ChatCommandActionNodeFactoryInternal()); - - supported.push_back("quests"); - supported.push_back("stats"); - supported.push_back("leave"); - supported.push_back("reputation"); - supported.push_back("log"); - supported.push_back("los"); - supported.push_back("rpg status"); - supported.push_back("rpg do quest"); - supported.push_back("aura"); - supported.push_back("drop"); - supported.push_back("share"); - supported.push_back("ll"); - supported.push_back("ss"); - supported.push_back("release"); - supported.push_back("teleport"); - supported.push_back("taxi"); - supported.push_back("repair"); - supported.push_back("talents"); - supported.push_back("spells"); - supported.push_back("co"); - supported.push_back("nc"); - supported.push_back("de"); - supported.push_back("trainer"); - supported.push_back("maintenance"); - supported.push_back("remove glyph"); - supported.push_back("autogear"); - supported.push_back("equip upgrade"); - supported.push_back("chat"); - supported.push_back("home"); - supported.push_back("destroy"); - supported.push_back("reset botAI"); - supported.push_back("emote"); - supported.push_back("buff"); - supported.push_back("help"); - supported.push_back("gb"); - supported.push_back("bank"); - supported.push_back("invite"); - supported.push_back("lfg"); - supported.push_back("spell"); - supported.push_back("rti"); - supported.push_back("position"); - supported.push_back("summon"); - supported.push_back("who"); - supported.push_back("save mana"); - supported.push_back("formation"); - supported.push_back("stance"); - supported.push_back("sendmail"); - supported.push_back("mail"); - supported.push_back("outfit"); - supported.push_back("go"); - supported.push_back("debug"); - supported.push_back("cdebug"); - supported.push_back("cs"); - supported.push_back("wts"); - supported.push_back("hire"); - supported.push_back("craft"); - supported.push_back("flag"); - supported.push_back("range"); - supported.push_back("ra"); - supported.push_back("give leader"); - supported.push_back("cheat"); - supported.push_back("ginvite"); - supported.push_back("guild promote"); - supported.push_back("guild demote"); - supported.push_back("guild remove"); - supported.push_back("guild leave"); - supported.push_back("rtsc"); - supported.push_back("drink"); - supported.push_back("calc"); - supported.push_back("open items"); - supported.push_back("qi"); - supported.push_back("unlock items"); - supported.push_back("unlock traded item"); - supported.push_back("tame"); - supported.push_back("glyphs"); // Added for custom Glyphs - supported.push_back("glyph equip"); // Added for custom Glyphs - supported.push_back("pet"); - supported.push_back("pet attack"); -} diff --git a/src/strategy/generic/CombatStrategy.cpp b/src/strategy/generic/CombatStrategy.cpp deleted file mode 100644 index e194eb883d..0000000000 --- a/src/strategy/generic/CombatStrategy.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "CombatStrategy.h" - -#include "Playerbots.h" -#include "Strategy.h" - -void CombatStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("enemy out of spell", - NextAction::array(0, new NextAction("reach spell", ACTION_HIGH), nullptr))); - // drop target relevance 99 (lower than Worldpacket triggers) - triggers.push_back( - new TriggerNode("invalid target", NextAction::array(0, new NextAction("drop target", 99), nullptr))); - triggers.push_back( - new TriggerNode("mounted", NextAction::array(0, new NextAction("check mount state", 54), nullptr))); - // triggers.push_back(new TriggerNode("out of react range", NextAction::array(0, new NextAction("flee to master", - // 55), nullptr))); - triggers.push_back(new TriggerNode("combat stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("not facing target", - NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr))); - // triggers.push_back(new TriggerNode("pet attack", NextAction::array(0, new NextAction("pet attack", 40.0f), nullptr))); - // The pet-attack trigger is commented out because it was forcing the bot's pet to attack, overriding stay and follow commands. - // Pets will automatically attack the bot's enemy if they are in "defensive" or "aggressive" - // stance, or if the master issues an attack command. - // triggers.push_back(new TriggerNode("combat long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), - // new NextAction("repop", 0.8f), nullptr))); -} - -AvoidAoeStrategy::AvoidAoeStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} - -// class AvoidAoeStrategyMultiplier : public Multiplier -// { -// public: -// AvoidAoeStrategyMultiplier(PlayerbotAI* botAI) : Multiplier(botAI, "run away on area debuff") {} - -// public: -// virtual float GetValue(Action* action); - -// private: -// }; - -// float AvoidAoeStrategyMultiplier::GetValue(Action* action) -// { -// if (!action) -// return 1.0f; - -// std::string name = action->getName(); -// if (name == "follow" || name == "co" || name == "nc" || name == "drop target") -// return 1.0f; - -// uint32 spellId = AI_VALUE2(uint32, "spell id", name); -// const SpellInfo* const pSpellInfo = sSpellMgr->GetSpellInfo(spellId); -// if (!pSpellInfo) return 1.0f; - -// if (spellId && pSpellInfo->Targets & TARGET_FLAG_DEST_LOCATION) -// return 1.0f; -// else if (spellId && pSpellInfo->Targets & TARGET_FLAG_SOURCE_LOCATION) -// return 1.0f; - -// uint32 castTime = pSpellInfo->CalcCastTime(bot); - -// if (AI_VALUE2(bool, "has area debuff", "self target") && spellId && castTime > 0) -// { -// return 0.0f; -// } - -// return 1.0f; -// } - -NextAction** AvoidAoeStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("avoid aoe", ACTION_EMERGENCY), nullptr); -} - -void AvoidAoeStrategy::InitTriggers(std::vector& triggers) -{ -} - -void AvoidAoeStrategy::InitMultipliers(std::vector& multipliers) -{ - // multipliers.push_back(new AvoidAoeStrategyMultiplier(botAI)); -} - -TankFaceStrategy::TankFaceStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} - -NextAction** TankFaceStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("tank face", ACTION_MOVE), nullptr); -} - -void TankFaceStrategy::InitTriggers(std::vector& triggers) -{ -} - -NextAction** CombatFormationStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("combat formation move", ACTION_NORMAL), nullptr); -} diff --git a/src/strategy/generic/DeadStrategy.cpp b/src/strategy/generic/DeadStrategy.cpp deleted file mode 100644 index 764813cfc9..0000000000 --- a/src/strategy/generic/DeadStrategy.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "DeadStrategy.h" - -#include "Playerbots.h" - -void DeadStrategy::InitTriggers(std::vector& triggers) -{ - PassTroughStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("often", NextAction::array(0, new NextAction("auto release", relevance), nullptr))); - triggers.push_back( - new TriggerNode("bg active", NextAction::array(0, new NextAction("auto release", relevance), nullptr))); - triggers.push_back( - new TriggerNode("dead", NextAction::array(0, new NextAction("find corpse", relevance), nullptr))); - triggers.push_back(new TriggerNode( - "corpse near", NextAction::array(0, new NextAction("revive from corpse", relevance - 1.0f), nullptr))); - triggers.push_back(new TriggerNode("resurrect request", - NextAction::array(0, new NextAction("accept resurrect", relevance), nullptr))); - triggers.push_back( - new TriggerNode("falling far", NextAction::array(0, new NextAction("repop", relevance + 1.f), nullptr))); - triggers.push_back( - new TriggerNode("location stuck", NextAction::array(0, new NextAction("repop", relevance + 1), nullptr))); - triggers.push_back(new TriggerNode( - "can self resurrect", NextAction::array(0, new NextAction("self resurrect", relevance + 2.0f), nullptr))); -} - -DeadStrategy::DeadStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) {} diff --git a/src/strategy/generic/EmoteStrategy.cpp b/src/strategy/generic/EmoteStrategy.cpp deleted file mode 100644 index 8e38a4b7d7..0000000000 --- a/src/strategy/generic/EmoteStrategy.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "EmoteStrategy.h" - -#include "Playerbots.h" - -void EmoteStrategy::InitTriggers(std::vector& triggers) -{ - if (sPlayerbotAIConfig->randomBotEmote) - { - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("talk", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("emote", 1.0f), nullptr))); - triggers.push_back( - new TriggerNode("receive text emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr))); - triggers.push_back( - new TriggerNode("receive emote", NextAction::array(0, new NextAction("emote", 10.0f), nullptr))); - } - - if (sPlayerbotAIConfig->randomBotTalk) - { - triggers.push_back(new TriggerNode( - "often", - NextAction::array(0, new NextAction("suggest what to do", 10.0f), new NextAction("suggest dungeon", 3.0f), - new NextAction("suggest trade", 3.0f), nullptr))); - } - - if (sPlayerbotAIConfig->enableGreet) - triggers.push_back( - new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr))); - - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("rpg mount anim", 1.0f), nullptr))); -} diff --git a/src/strategy/generic/GroupStrategy.cpp b/src/strategy/generic/GroupStrategy.cpp deleted file mode 100644 index 9cfba6e2fc..0000000000 --- a/src/strategy/generic/GroupStrategy.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GroupStrategy.h" - -#include "Playerbots.h" - -void GroupStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("invite nearby", 4.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("invite guild", 4.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("leave far away", 4.0f), nullptr))); - triggers.push_back(new TriggerNode("seldom", NextAction::array(0, new NextAction("reset instances", 1.0f), nullptr))); -} diff --git a/src/strategy/generic/GuildStrategy.cpp b/src/strategy/generic/GuildStrategy.cpp deleted file mode 100644 index 3a5df2f168..0000000000 --- a/src/strategy/generic/GuildStrategy.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GuildStrategy.h" - -#include "Playerbots.h" - -void GuildStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("often", NextAction::array(0, new NextAction("offer petition nearby", 4.0f), nullptr))); - triggers.push_back( - new TriggerNode("often", NextAction::array(0, new NextAction("guild manage nearby", 4.0f), nullptr))); - triggers.push_back( - new TriggerNode("petition signed", NextAction::array(0, new NextAction("turn in petition", 10.0f), nullptr))); - triggers.push_back( - new TriggerNode("buy tabard", NextAction::array(0, new NextAction("buy tabard", 10.0f), nullptr))); - triggers.push_back( - new TriggerNode("leave large guild", NextAction::array(0, new NextAction("guild leave", 4.0f), nullptr))); -} diff --git a/src/strategy/generic/LootNonCombatStrategy.cpp b/src/strategy/generic/LootNonCombatStrategy.cpp deleted file mode 100644 index caf901b8b9..0000000000 --- a/src/strategy/generic/LootNonCombatStrategy.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "LootNonCombatStrategy.h" - -#include "Playerbots.h" - -void LootNonCombatStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("loot available", NextAction::array(0, new NextAction("loot", 6.0f), nullptr))); - triggers.push_back( - new TriggerNode("far from loot target", NextAction::array(0, new NextAction("move to loot", 7.0f), nullptr))); - triggers.push_back(new TriggerNode("can loot", NextAction::array(0, new NextAction("open loot", 8.0f), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("add all loot", 5.0f), nullptr))); -} - -void GatherStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("timer", NextAction::array(0, new NextAction("add gathering loot", 5.0f), nullptr))); -} - -void RevealStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("often", NextAction::array(0, new NextAction("reveal gathering item", 50.0f), nullptr))); -} - -void UseBobberStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("can use fishing bobber", NextAction::array(0, new NextAction("use fishing bobber", 20.0f), nullptr))); - triggers.push_back( - new TriggerNode("random", NextAction::array(0, new NextAction("remove bobber strategy", 20.0f), nullptr))); -} diff --git a/src/strategy/generic/MaintenanceStrategy.cpp b/src/strategy/generic/MaintenanceStrategy.cpp deleted file mode 100644 index 3e35f5bfff..0000000000 --- a/src/strategy/generic/MaintenanceStrategy.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "MaintenanceStrategy.h" - -#include "Playerbots.h" - -NextAction** MaintenanceStrategy::getDefaultActions() { return nullptr; } - -void MaintenanceStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 6.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("use random recipe", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("disenchant random item", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("enchant random item", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("smart destroy item", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("move stuck", NextAction::array(0, new NextAction("reset", 1.0f), nullptr))); - // triggers.push_back(new TriggerNode("move long stuck", NextAction::array(0, new NextAction("hearthstone", 0.9f), new NextAction("repop", 0.8f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("use random quest item", 0.9f), nullptr))); - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("auto share quest", 0.9f), nullptr))); -} diff --git a/src/strategy/generic/NonCombatStrategy.cpp b/src/strategy/generic/NonCombatStrategy.cpp deleted file mode 100644 index 09a24c6737..0000000000 --- a/src/strategy/generic/NonCombatStrategy.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "NonCombatStrategy.h" - -#include "Playerbots.h" - -void NonCombatStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f), - // new NextAction("check values", 1.0f), - nullptr))); - // triggers.push_back(new TriggerNode("near dark portal", NextAction::array(0, new NextAction("move to dark portal", 1.0f), nullptr))); - // triggers.push_back(new TriggerNode("at dark portal azeroth", NextAction::array(0, new NextAction("use dark portal azeroth", 1.0f), nullptr))); - // triggers.push_back(new TriggerNode("at dark portal outland", NextAction::array(0, new NextAction("move from dark portal", 1.0f), nullptr))); - // triggers.push_back(new TriggerNode("vehicle near", NextAction::array(0, new NextAction("enter vehicle", 10.0f), nullptr))); -} - -void CollisionStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("collision", NextAction::array(0, new NextAction("move out of collision", 2.0f), nullptr))); -} - -void MountStrategy::InitTriggers(std::vector& triggers) -{ - /*triggers.push_back(new TriggerNode("no possible targets", NextAction::array(0, new NextAction("mount", 1.0f), - nullptr))); triggers.push_back(new TriggerNode("no rpg target", NextAction::array(0, new NextAction("mount", 1.0f), - nullptr)));*/ - /*triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("mount", 4.0f), nullptr)));*/ -} - -void WorldBuffStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("need world buff", NextAction::array(0, new NextAction("world buff", 1.0f), nullptr))); -} - -void MasterFishingStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("very often", NextAction::array(0, new NextAction("move near water" , 10.0f), nullptr))); - - triggers.push_back(new TriggerNode("very often", NextAction::array(0, new NextAction("go fishing" , 10.0f), nullptr))); - - triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("end master fishing", 12.0f), - new NextAction("equip upgrades", 6.0f), nullptr))); -} diff --git a/src/strategy/generic/RpgStrategy.cpp b/src/strategy/generic/RpgStrategy.cpp deleted file mode 100644 index 13173fd2ec..0000000000 --- a/src/strategy/generic/RpgStrategy.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "RpgStrategy.h" - -#include "Playerbots.h" -#include "RpgSubActions.h" - -float RpgActionMultiplier::GetValue(Action* action) -{ - if (action == nullptr) - return 1.0f; - - std::string const nextAction = AI_VALUE(std::string, "next rpg action"); - std::string const name = action->getName(); - - if (!nextAction.empty() && dynamic_cast(action) && name != nextAction) - return 0.0f; - - return 1.0f; -} - -RpgStrategy::RpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} - -NextAction** RpgStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("rpg", 1.0f), nullptr); } - -void RpgStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("no rpg target", NextAction::array(0, new NextAction("choose rpg target", 5.0f), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("move random", 1.10f), NULL))); - triggers.push_back(new TriggerNode("far from rpg target", - NextAction::array(0, new NextAction("move to rpg target", 5.0f), nullptr))); - - // Sub actions - triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg stay", 1.101f), nullptr))); - triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg work", 1.101f), nullptr))); - triggers.push_back(new TriggerNode("rpg", NextAction::array(0, new NextAction("rpg emote", 1.101f), nullptr))); - triggers.push_back( - new TriggerNode("has rpg target", NextAction::array(0, new NextAction("rpg cancel", 1.101f), nullptr))); - // triggers.push_back(new TriggerNode("rpg taxi", NextAction::array(0, new NextAction("rpg taxi", 1.005f), - // nullptr))); - triggers.push_back( - new TriggerNode("rpg discover", NextAction::array(0, new NextAction("rpg discover", 1.210f), nullptr))); - triggers.push_back( - new TriggerNode("rpg start quest", NextAction::array(0, new NextAction("rpg start quest", 1.180f), nullptr))); - triggers.push_back( - new TriggerNode("rpg end quest", NextAction::array(0, new NextAction("rpg end quest", 1.190f), nullptr))); - triggers.push_back(new TriggerNode("rpg buy", NextAction::array(0, new NextAction("rpg buy", 1.130f), nullptr))); - // triggers.push_back(new TriggerNode("rpg sell", NextAction::array(0, new NextAction("rpg sell", 1.100f), - // nullptr))); - triggers.push_back( - new TriggerNode("rpg repair", NextAction::array(0, new NextAction("rpg repair", 1.195f), nullptr))); - // triggers.push_back(new TriggerNode("rpg train", NextAction::array(0, new NextAction("rpg train", 1.080f), - // nullptr))); - triggers.push_back(new TriggerNode("rpg heal", NextAction::array(0, new NextAction("rpg heal", 1.125f), nullptr))); - triggers.push_back( - new TriggerNode("rpg home bind", NextAction::array(0, new NextAction("rpg home bind", 1.160f), nullptr))); - // triggers.push_back(new TriggerNode("rpg queue bg", NextAction::array(0, new NextAction("rpg queue bg", 1.085f), - // nullptr))); - triggers.push_back( - new TriggerNode("rpg buy petition", NextAction::array(0, new NextAction("rpg buy petition", 1.140f), nullptr))); - triggers.push_back(new TriggerNode("rpg use", NextAction::array(0, new NextAction("rpg use", 1.102f), nullptr))); - // triggers.push_back(new TriggerNode("rpg spell", NextAction::array(0, new NextAction("rpg spell", 1.001f), - // nullptr))); triggers.push_back(new TriggerNode("rpg craft", NextAction::array(0, new NextAction("rpg - // craft", 1.001f), nullptr))); - // triggers.push_back(new TriggerNode("rpg trade useful", NextAction::array(0, new NextAction("rpg trade - // useful", 1.030f), nullptr))); triggers.push_back(new TriggerNode("rpg duel", NextAction::array(0, new - // NextAction("rpg duel", 1.010f), nullptr))); -} - -void RpgStrategy::InitMultipliers(std::vector& multipliers) -{ - multipliers.push_back(new RpgActionMultiplier(botAI)); -} diff --git a/src/strategy/generic/SayStrategy.cpp b/src/strategy/generic/SayStrategy.cpp deleted file mode 100644 index fe9e5f54e5..0000000000 --- a/src/strategy/generic/SayStrategy.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "SayStrategy.h" - -#include "Playerbots.h" - -void SayStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("critical health", - NextAction::array(0, new NextAction("say::critical health", 99.0f), nullptr))); - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("say::low health", 99.0f), nullptr))); - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("say::low mana", 99.0f), nullptr))); - triggers.push_back(new TriggerNode("tank aoe", NextAction::array(0, new NextAction("say::taunt", 99.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("say::aoe", 99.0f), nullptr))); -} diff --git a/src/strategy/generic/StayStrategy.cpp b/src/strategy/generic/StayStrategy.cpp deleted file mode 100644 index 2237cc99ea..0000000000 --- a/src/strategy/generic/StayStrategy.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "StayStrategy.h" - -#include "Playerbots.h" - -void StayStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "return to stay position", - NextAction::array(0, new NextAction("return to stay position", ACTION_MOVE), nullptr))); -} - -NextAction** StayStrategy::getDefaultActions() { return NextAction::array(0, new NextAction("stay", 1.0f), nullptr); } - -void SitStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("sit", NextAction::array(0, new NextAction("sit", 1.5f), nullptr))); -} diff --git a/src/strategy/generic/TravelStrategy.cpp b/src/strategy/generic/TravelStrategy.cpp deleted file mode 100644 index 2f335a466e..0000000000 --- a/src/strategy/generic/TravelStrategy.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "TravelStrategy.h" - -#include "Playerbots.h" - -TravelStrategy::TravelStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} - -NextAction** TravelStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("travel", 1.0f), nullptr); -} - -void TravelStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("no travel target", - NextAction::array(0, new NextAction("choose travel target", 6.f), nullptr))); - triggers.push_back(new TriggerNode("far from travel target", - NextAction::array(0, new NextAction("move to travel target", 1), nullptr))); -} diff --git a/src/strategy/generic/WorldPacketHandlerStrategy.cpp b/src/strategy/generic/WorldPacketHandlerStrategy.cpp deleted file mode 100644 index e09408c296..0000000000 --- a/src/strategy/generic/WorldPacketHandlerStrategy.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "WorldPacketHandlerStrategy.h" - -void WorldPacketHandlerStrategy::InitTriggers(std::vector& triggers) -{ - PassTroughStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("group invite", NextAction::array(0, new NextAction("accept invitation", relevance), nullptr))); - triggers.push_back( - new TriggerNode("uninvite", NextAction::array(0, new NextAction("uninvite", relevance), nullptr))); - triggers.push_back( - new TriggerNode("uninvite guid", NextAction::array(0, new NextAction("uninvite", relevance), nullptr))); - triggers.push_back( - new TriggerNode("group set leader", NextAction::array(0, /*new NextAction("leader", relevance),*/ nullptr))); - triggers.push_back(new TriggerNode( - "not enough money", NextAction::array(0, new NextAction("tell not enough money", relevance), nullptr))); - triggers.push_back( - new TriggerNode("not enough reputation", - NextAction::array(0, new NextAction("tell not enough reputation", relevance), nullptr))); - triggers.push_back( - new TriggerNode("cannot equip", NextAction::array(0, new NextAction("tell cannot equip", relevance), nullptr))); - triggers.push_back( - new TriggerNode("use game object", NextAction::array(0, new NextAction("add loot", relevance), - new NextAction("use meeting stone", relevance), nullptr))); - triggers.push_back( - new TriggerNode("gossip hello", NextAction::array(0, new NextAction("trainer", relevance), nullptr))); - triggers.push_back(new TriggerNode("activate taxi", NextAction::array(0, new NextAction("remember taxi", relevance), - new NextAction("taxi", relevance), nullptr))); - triggers.push_back(new TriggerNode("taxi done", NextAction::array(0, new NextAction("taxi", relevance), nullptr))); - triggers.push_back(new TriggerNode("trade status", NextAction::array(0, new NextAction("accept trade", relevance), new NextAction("equip upgrades", relevance), nullptr))); - triggers.push_back(new TriggerNode("trade status extended", NextAction::array(0, new NextAction("trade status extended", relevance), nullptr))); - triggers.push_back(new TriggerNode("area trigger", NextAction::array(0, new NextAction("reach area trigger", relevance), nullptr))); - triggers.push_back(new TriggerNode("within area trigger", NextAction::array(0, new NextAction("area trigger", relevance), nullptr))); - triggers.push_back(new TriggerNode("loot response", NextAction::array(0, new NextAction("store loot", relevance), nullptr))); - triggers.push_back(new TriggerNode("item push result", NextAction::array(0, new NextAction("unlock items", relevance), - new NextAction("open items", relevance), - new NextAction("query item usage", relevance), - new NextAction("equip upgrades", relevance), nullptr))); - triggers.push_back(new TriggerNode("item push result", NextAction::array(0, new NextAction("quest item push result", relevance), nullptr))); - triggers.push_back(new TriggerNode("ready check finished", NextAction::array(0, new NextAction("finish ready check", relevance), nullptr))); - // triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("security check", relevance), new NextAction("check mail", relevance), nullptr))); - triggers.push_back(new TriggerNode("guild invite", NextAction::array(0, new NextAction("guild accept", relevance), nullptr))); - triggers.push_back(new TriggerNode("petition offer", NextAction::array(0, new NextAction("petition sign", relevance), nullptr))); - triggers.push_back(new TriggerNode("lfg proposal", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr))); - triggers.push_back(new TriggerNode("lfg proposal active", NextAction::array(0, new NextAction("lfg accept", relevance), nullptr))); - triggers.push_back(new TriggerNode("arena team invite", NextAction::array(0, new NextAction("arena team accept", relevance), nullptr))); - //triggers.push_back(new TriggerNode("no non bot players around", NextAction::array(0, new NextAction("delay", relevance), nullptr))); - triggers.push_back(new TriggerNode("bg status", NextAction::array(0, new NextAction("bg status", relevance), nullptr))); - triggers.push_back(new TriggerNode("xpgain", NextAction::array(0, new NextAction("xp gain", relevance), nullptr))); - triggers.push_back( - new TriggerNode("levelup", NextAction::array(0, new NextAction("auto maintenance on levelup", relevance + 3), nullptr))); - // triggers.push_back(new TriggerNode("group destroyed", NextAction::array(0, new NextAction("reset botAI", - // relevance), nullptr))); - triggers.push_back(new TriggerNode("group list", NextAction::array(0, new NextAction("reset botAI", relevance), nullptr))); - triggers.push_back(new TriggerNode("see spell", NextAction::array(0, new NextAction("see spell", relevance), nullptr))); - - triggers.push_back(new TriggerNode("release spirit", NextAction::array(0, new NextAction("release", relevance), nullptr))); - triggers.push_back(new TriggerNode("revive from corpse", NextAction::array(0, new NextAction("revive from corpse", relevance), nullptr))); - triggers.push_back(new TriggerNode("master loot roll", NextAction::array(0, new NextAction("master loot roll", relevance), nullptr))); - - // quest ? - //triggers.push_back(new TriggerNode("quest confirm", NextAction::array(0, new NextAction("quest confirm", relevance), nullptr))); - triggers.push_back(new TriggerNode("questgiver quest details", NextAction::array(0, new NextAction("turn in query quest", relevance), nullptr))); - - // loot roll - triggers.push_back(new TriggerNode("very often", NextAction::array(0, new NextAction("loot roll", relevance), nullptr))); -} - -WorldPacketHandlerStrategy::WorldPacketHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) -{ - supported.push_back("loot roll"); - supported.push_back("check mount state"); - supported.push_back("party command"); - supported.push_back("ready check"); - supported.push_back("uninvite"); - supported.push_back("lfg role check"); - supported.push_back("lfg teleport"); - supported.push_back("random bot update"); - supported.push_back("inventory change failure"); - supported.push_back("bg status"); - - // quests - supported.push_back("quest update add kill"); - // supported.push_back("quest update add item"); - supported.push_back("quest update failed"); - supported.push_back("quest update failed timer"); - supported.push_back("quest update complete"); - supported.push_back("confirm quest"); -} - -void ReadyCheckStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("timer", NextAction::array(0, new NextAction("ready check", relevance), nullptr))); -} diff --git a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp b/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp deleted file mode 100644 index e758187362..0000000000 --- a/src/strategy/hunter/GenericHunterNonCombatStrategy.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericHunterNonCombatStrategy.h" - -#include "Playerbots.h" - -class GenericHunterNonCombatStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericHunterNonCombatStrategyActionNodeFactory() - { - creators["rapid fire"] = &rapid_fire; - creators["boost"] = &rapid_fire; - creators["aspect of the pack"] = &aspect_of_the_pack; - } - -private: - static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rapid fire", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("readiness"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("aspect of the pack", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("aspect of the cheetah"), nullptr), - /*C*/ nullptr); - } -}; - -GenericHunterNonCombatStrategy::GenericHunterNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericHunterNonCombatStrategyActionNodeFactory()); -} - -void GenericHunterNonCombatStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("trueshot aura", NextAction::array(0, new NextAction("trueshot aura", 2.0f), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, - new NextAction("apply stone", 1.0f), - new NextAction("apply oil", 1.0f), - nullptr))); - triggers.push_back(new TriggerNode("low ammo", NextAction::array(0, new NextAction("say::low ammo", ACTION_NORMAL), nullptr))); - triggers.push_back(new TriggerNode("no track", NextAction::array(0, new NextAction("track humanoids", ACTION_NORMAL), nullptr))); - triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("equip upgrades", ACTION_HIGH + 1), nullptr))); - // triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("switch to melee", - // ACTION_NORMAL + 1), new NextAction("say::no ammo", ACTION_NORMAL), nullptr))); triggers.push_back(new - // TriggerNode("has ammo", NextAction::array(0, new NextAction("switch to ranged", ACTION_NORMAL), nullptr))); -} - -void HunterPetStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("call pet", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("pet not happy", NextAction::array(0, new NextAction("feed pet", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("hunters pet medium health", NextAction::array(0, new NextAction("mend pet", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("hunters pet dead", NextAction::array(0, new NextAction("revive pet", 60.0f), nullptr))); -} diff --git a/src/strategy/hunter/GenericHunterStrategy.cpp b/src/strategy/hunter/GenericHunterStrategy.cpp deleted file mode 100644 index dab3726190..0000000000 --- a/src/strategy/hunter/GenericHunterStrategy.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericHunterStrategy.h" - -#include "Playerbots.h" -#include "Strategy.h" - -class GenericHunterStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericHunterStrategyActionNodeFactory() - { - creators["rapid fire"] = &rapid_fire; - creators["boost"] = &rapid_fire; - creators["aspect of the pack"] = &aspect_of_the_pack; - creators["aspect of the dragonhawk"] = &aspect_of_the_dragonhawk; - creators["feign death"] = &feign_death; - creators["wing clip"] = &wing_clip; - creators["mongoose bite"] = &mongoose_bite; - creators["raptor strike"] = &raptor_strike; - creators["explosive trap"] = &explosive_trap; - } - -private: - static ActionNode* rapid_fire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rapid fire", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("readiness"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* aspect_of_the_pack([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("aspect of the pack", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("aspect of the cheetah"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* aspect_of_the_dragonhawk([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("aspect of the dragonhawk", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("aspect of the hawk"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* feign_death([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("feign death", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* wing_clip([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("wing clip", - /*P*/ nullptr, - // /*A*/ NextAction::array(0, new NextAction("mongoose bite"), nullptr), - nullptr, - /*C*/ nullptr); - } - - static ActionNode* mongoose_bite([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mongoose bite", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("raptor strike"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* raptor_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("raptor strike", - /*P*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* explosive_trap([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("explosive trap", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("immolation trap"), nullptr), - /*C*/ nullptr); - } -}; - -GenericHunterStrategy::GenericHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericHunterStrategyActionNodeFactory()); -} - -void GenericHunterStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - - // Mark/Ammo/Mana Triggers - triggers.push_back(new TriggerNode("no ammo", NextAction::array(0, new NextAction("equip upgrades", 30.0f), nullptr))); - triggers.push_back(new TriggerNode("hunter's mark", NextAction::array(0, new NextAction("hunter's mark", 29.5f), nullptr))); - triggers.push_back(new TriggerNode("rapid fire", NextAction::array(0, new NextAction("rapid fire", 29.0f), nullptr))); - triggers.push_back(new TriggerNode("aspect of the viper", NextAction::array(0, new NextAction("aspect of the viper", 28.0f), NULL))); - triggers.push_back(new TriggerNode("aspect of the hawk", NextAction::array(0, new NextAction("aspect of the dragonhawk", 27.5f), nullptr))); - - // Aggro/Threat/Defensive Triggers - triggers.push_back(new TriggerNode("has aggro", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr))); - triggers.push_back(new TriggerNode("low tank threat", NextAction::array(0, new NextAction("misdirection on main tank", 27.0f), NULL))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("deterrence", 35.0f), nullptr))); - triggers.push_back(new TriggerNode("concussive shot on snare target", NextAction::array(0, new NextAction("concussive shot", 20.0f), nullptr))); - triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("feign death", 35.0f), nullptr))); - triggers.push_back(new TriggerNode("hunters pet medium health", NextAction::array(0, new NextAction("mend pet", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("hunters pet low health", NextAction::array(0, new NextAction("mend pet", 21.0f), nullptr))); - - // Dispel Triggers - triggers.push_back(new TriggerNode("tranquilizing shot enrage", NextAction::array(0, new NextAction("tranquilizing shot", 61.0f), NULL))); - triggers.push_back(new TriggerNode("tranquilizing shot magic", NextAction::array(0, new NextAction("tranquilizing shot", 61.0f), NULL))); - - // Ranged-based Triggers - triggers.push_back(new TriggerNode("enemy within melee", NextAction::array(0, - new NextAction("explosive trap", 37.0f), - new NextAction("mongoose bite", 22.0f), - new NextAction("wing clip", 21.0f), nullptr))); - - triggers.push_back(new TriggerNode("enemy too close for auto shot", NextAction::array(0, - new NextAction("disengage", 35.0f), - new NextAction("flee", 34.0f), nullptr))); -} - -// ===== AoE Strategy, 2/3+ enemies ===== -AoEHunterStrategy::AoEHunterStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) {} - -void AoEHunterStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("volley channel check", NextAction::array(0, new NextAction("cancel channel", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("volley", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("multi-shot", 21.0f), nullptr))); -} - -void HunterBoostStrategy::InitTriggers(std::vector& triggers) -{ -} - -void HunterCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("scare beast", NextAction::array(0, new NextAction("scare beast on cc", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("freezing trap", NextAction::array(0, new NextAction("freezing trap on cc", 23.0f), nullptr))); -} - -void HunterTrapWeaveStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("immolation trap no cd", NextAction::array(0, new NextAction("reach melee", 23.0f), nullptr))); -} diff --git a/src/strategy/hunter/SurvivalHunterStrategy.cpp b/src/strategy/hunter/SurvivalHunterStrategy.cpp deleted file mode 100644 index 78908354a7..0000000000 --- a/src/strategy/hunter/SurvivalHunterStrategy.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "SurvivalHunterStrategy.h" -#include "Playerbots.h" - -// ===== Action Node Factory ===== -class SurvivalHunterStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - SurvivalHunterStrategyActionNodeFactory() - { - creators["auto shot"] = &auto_shot; - creators["kill command"] = &kill_command; - creators["kill shot"] = &kill_shot; - creators["explosive shot"] = &explosive_shot; - creators["black arrow"] = &black_arrow; - creators["viper sting"] = &viper_sting; - creators["serpent sting"] = serpent_sting; - creators["aimed shot"] = &aimed_shot; - creators["arcane shot"] = &arcane_shot; - creators["steady shot"] = &steady_shot; - creators["multi-shot"] = &multi_shot; - creators["volley"] = &volley; - } - -private: - static ActionNode* auto_shot(PlayerbotAI*) { return new ActionNode("auto shot", nullptr, nullptr, nullptr); } - static ActionNode* kill_command(PlayerbotAI*) { return new ActionNode("kill command", nullptr, nullptr, nullptr); } - static ActionNode* kill_shot(PlayerbotAI*) { return new ActionNode("kill shot", nullptr, nullptr, nullptr); } - static ActionNode* explosive_shot(PlayerbotAI*) { return new ActionNode("explosive shot", nullptr, nullptr, nullptr); } - static ActionNode* black_arrow(PlayerbotAI*) { return new ActionNode("black arrow", nullptr, nullptr, nullptr); } - static ActionNode* viper_sting(PlayerbotAI*) { return new ActionNode("viper sting", nullptr, nullptr, nullptr); } - static ActionNode* serpent_sting(PlayerbotAI*) { return new ActionNode("serpent sting", nullptr, nullptr, nullptr); } - static ActionNode* aimed_shot(PlayerbotAI*) { return new ActionNode("aimed shot", nullptr, nullptr, nullptr); } - static ActionNode* arcane_shot(PlayerbotAI*) { return new ActionNode("arcane shot", nullptr, nullptr, nullptr); } - static ActionNode* steady_shot(PlayerbotAI*) { return new ActionNode("steady shot", nullptr, nullptr, nullptr); } - static ActionNode* multi_shot(PlayerbotAI*) { return new ActionNode("multi shot", nullptr, nullptr, nullptr); } - static ActionNode* volley(PlayerbotAI*) { return new ActionNode("volley", nullptr, nullptr, nullptr); } -}; - -// ===== Single Target Strategy ===== -SurvivalHunterStrategy::SurvivalHunterStrategy(PlayerbotAI* botAI) : GenericHunterStrategy(botAI) -{ - actionNodeFactories.Add(new SurvivalHunterStrategyActionNodeFactory()); -} - -// ===== Default Actions ===== -NextAction** SurvivalHunterStrategy::getDefaultActions() -{ - return NextAction::array(0, - new NextAction("kill command", 5.9f), - new NextAction("kill shot", 5.8f), - new NextAction("explosive shot", 5.7f), - new NextAction("black arrow", 5.6f), - new NextAction("serpent sting", 5.5f), - new NextAction("aimed shot", 5.4f), - new NextAction("arcane shot", 5.3f), - new NextAction("steady shot", 5.2f), - new NextAction("auto shot", 5.1f), nullptr); -} - -// ===== Trigger Initialization === -void SurvivalHunterStrategy::InitTriggers(std::vector& triggers) -{ - GenericHunterStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("lock and load", NextAction::array(0, new NextAction("explosive shot rank 4", 28.0f), nullptr))); - triggers.push_back(new TriggerNode("lock and load", NextAction::array(0, new NextAction("explosive shot rank 3", 27.5f), nullptr))); - triggers.push_back(new TriggerNode("lock and load", NextAction::array(0, new NextAction("explosive shot rank 2", 27.0f), nullptr))); - triggers.push_back(new TriggerNode("lock and load", NextAction::array(0, new NextAction("explosive shot rank 1", 26.5f), nullptr))); - - triggers.push_back(new TriggerNode("kill command", NextAction::array(0, new NextAction("kill command", 18.5f), nullptr))); - triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("kill shot", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("explosive shot", NextAction::array(0, new NextAction("explosive shot", 17.5f), nullptr))); - triggers.push_back(new TriggerNode("black arrow", NextAction::array(0, new NextAction("black arrow", 16.5f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("viper sting", 16.0f), nullptr))); - triggers.push_back(new TriggerNode("no stings", NextAction::array(0, new NextAction("serpent sting", 15.5f), nullptr))); - triggers.push_back(new TriggerNode("serpent sting on attacker", NextAction::array(0, new NextAction("serpent sting on attacker", 15.0f), nullptr))); -} diff --git a/src/strategy/mage/FrostMageStrategy.cpp b/src/strategy/mage/FrostMageStrategy.cpp deleted file mode 100644 index 369fc1c885..0000000000 --- a/src/strategy/mage/FrostMageStrategy.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "FrostMageStrategy.h" - -#include "Playerbots.h" - -// ===== Action Node Factory ===== -class FrostMageStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - FrostMageStrategyActionNodeFactory() - { - creators["cold snap"] = &cold_snap; - creators["ice barrier"] = &ice_barrier; - creators["summon water elemental"] = &summon_water_elemental; - creators["deep freeze"] = &deep_freeze; - creators["icy veins"] = &icy_veins; - creators["frostbolt"] = &frostbolt; - creators["ice lance"] = &ice_lance; - creators["fire blast"] = &fire_blast; - creators["fireball"] = &fireball; - creators["frostfire bolt"] = &frostfire_bolt; - } - -private: - static ActionNode* cold_snap(PlayerbotAI*) { return new ActionNode("cold snap", nullptr, nullptr, nullptr); } - static ActionNode* ice_barrier(PlayerbotAI*) { return new ActionNode("ice barrier", nullptr, nullptr, nullptr); } - static ActionNode* summon_water_elemental(PlayerbotAI*) { return new ActionNode("summon water elemental", nullptr, nullptr, nullptr); } - static ActionNode* deep_freeze(PlayerbotAI*) { return new ActionNode("deep freeze", nullptr, nullptr, nullptr); } - static ActionNode* icy_veins(PlayerbotAI*) { return new ActionNode("icy veins", nullptr, nullptr, nullptr); } - static ActionNode* frostbolt(PlayerbotAI*) { return new ActionNode("frostbolt", nullptr, nullptr, nullptr); } - static ActionNode* ice_lance(PlayerbotAI*) { return new ActionNode("ice lance", nullptr, nullptr, nullptr); } - static ActionNode* fire_blast(PlayerbotAI*) { return new ActionNode("fire blast", nullptr, nullptr, nullptr); } - static ActionNode* fireball(PlayerbotAI*) { return new ActionNode("fireball", nullptr, nullptr, nullptr); } - static ActionNode* frostfire_bolt(PlayerbotAI*) { return new ActionNode("frostfire bolt", nullptr, nullptr, nullptr); } -}; - -// ===== Single Target Strategy ===== -FrostMageStrategy::FrostMageStrategy(PlayerbotAI* botAI) : GenericMageStrategy(botAI) -{ - actionNodeFactories.Add(new FrostMageStrategyActionNodeFactory()); -} - -// ===== Default Actions ===== -NextAction** FrostMageStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("frostbolt", 5.4f), - new NextAction("ice lance", 5.3f), // cast during movement - new NextAction("fire blast", 5.2f), // cast during movement if ice lance is not learned - new NextAction("shoot", 5.1f), - new NextAction("fireball", 5.0f), nullptr); -} - -// ===== Trigger Initialization === -void FrostMageStrategy::InitTriggers(std::vector& triggers) -{ - GenericMageStrategy::InitTriggers(triggers); - - // Pet/Defensive triggers - triggers.push_back(new TriggerNode("no pet", NextAction::array(0, new NextAction("summon water elemental", 30.0f), nullptr))); - triggers.push_back(new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("ice barrier", 29.0f), nullptr))); - triggers.push_back(new TriggerNode("being attacked", NextAction::array(0, new NextAction("ice barrier", 29.0f), nullptr))); - - // Proc/Freeze triggers - triggers.push_back(new TriggerNode("brain freeze", NextAction::array(0, new NextAction("frostfire bolt", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("fingers of frost", NextAction::array(0, - new NextAction("deep freeze", 19.0f), - new NextAction("frostbolt", 18.0f), nullptr))); - - triggers.push_back(new TriggerNode("frostbite on target", NextAction::array(0, - new NextAction("deep freeze", 19.0f), - new NextAction("frostbolt", 18.0f), nullptr))); - - triggers.push_back(new TriggerNode("frost nova on target", NextAction::array(0, - new NextAction("deep freeze", 19.0f), - new NextAction("frostbolt", 18.0f), nullptr))); - -} diff --git a/src/strategy/mage/GenericMageStrategy.cpp b/src/strategy/mage/GenericMageStrategy.cpp deleted file mode 100644 index f8d5667f2e..0000000000 --- a/src/strategy/mage/GenericMageStrategy.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericMageStrategy.h" -#include "AiFactory.h" -#include "Playerbots.h" -#include "RangedCombatStrategy.h" - -class GenericMageStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericMageStrategyActionNodeFactory() - { - creators["frostbolt"] = &frostbolt; - creators["frostfire bolt"] = &frostfire_bolt; - creators["ice lance"] = &ice_lance; - creators["fire blast"] = &fire_blast; - creators["scorch"] = &scorch; - creators["frost nova"] = &frost_nova; - creators["cone of cold"] = &cone_of_cold; - creators["icy veins"] = &icy_veins; - creators["combustion"] = &combustion; - creators["evocation"] = &evocation; - creators["dragon's breath"] = &dragons_breath; - creators["blast wave"] = &blast_wave; - creators["remove curse"] = &remove_curse; - creators["remove curse on party"] = &remove_curse_on_party; - creators["fireball"] = &fireball; - } - -private: - static ActionNode* frostbolt([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("frostbolt", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("shoot"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* frostfire_bolt([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("frostfire bolt", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("fireball"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* ice_lance([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ice lance", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* fire_blast([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("fire blast", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* scorch([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("scorch", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("shoot"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* frost_nova([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("frost nova", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* cone_of_cold([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cone of cold", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* icy_veins([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("icy veins", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* combustion([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("combustion", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* evocation([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("evocation", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("mana potion"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* dragons_breath([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("dragon's breath", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* blast_wave([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("blast wave", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* remove_curse([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("remove curse", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("remove lesser curse"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("remove curse on party", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("remove lesser curse on party"), nullptr), - /*C*/ nullptr); - } - static ActionNode* fireball([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("fireball", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("shoot"), nullptr), - /*C*/ nullptr); - } -}; - -GenericMageStrategy::GenericMageStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericMageStrategyActionNodeFactory()); -} - -void GenericMageStrategy::InitTriggers(std::vector& triggers) -{ - RangedCombatStrategy::InitTriggers(triggers); - - // Threat Triggers - triggers.push_back(new TriggerNode("high threat", NextAction::array(0, new NextAction("mirror image", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("invisibility", 30.0f), nullptr))); - - // Defensive Triggers - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("ice block", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("mana shield", 85.0f), nullptr))); - triggers.push_back(new TriggerNode("fire ward", NextAction::array(0, new NextAction("fire ward", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("frost ward", NextAction::array(0, new NextAction("frost ward", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("enemy is close and no firestarter strategy", NextAction::array(0, new NextAction("frost nova", 50.0f), nullptr))); - triggers.push_back(new TriggerNode("enemy too close for spell and no firestarter strategy", NextAction::array(0, new NextAction("blink back", 35.0f), nullptr))); - - // Mana Threshold Triggers - Player* bot = botAI->GetBot(); - if (bot->HasSpell(42985)) // Mana Sapphire - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana sapphire", 90.0f), nullptr))); - else if (bot->HasSpell(27101)) // Mana Emerald - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana emerald", 90.0f), nullptr))); - else if (bot->HasSpell(10054)) // Mana Ruby - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana ruby", 90.0f), nullptr))); - else if (bot->HasSpell(10053)) // Mana Citrine - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana citrine", 90.0f), nullptr))); - else if (bot->HasSpell(3552)) // Mana Jade - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana jade", 90.0f), nullptr))); - else if (bot->HasSpell(759)) // Mana Agate - triggers.push_back(new TriggerNode("high mana", NextAction::array(0, new NextAction("use mana agate", 90.0f), nullptr))); - - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("mana potion", 90.0f), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("evocation", 90.0f), nullptr))); - - // Counterspell / Spellsteal Triggers - triggers.push_back(new TriggerNode("spellsteal", NextAction::array(0, new NextAction("spellsteal", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("counterspell on enemy healer", NextAction::array(0, new NextAction("counterspell on enemy healer", 40.0f), nullptr))); -} - -void MageCureStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("remove curse", NextAction::array(0, new NextAction("remove curse", 41.0f), nullptr))); - triggers.push_back(new TriggerNode("remove curse on party", NextAction::array(0, new NextAction("remove curse on party", 40.0f), nullptr))); -} - -void MageBoostStrategy::InitTriggers(std::vector& triggers) -{ - Player* bot = botAI->GetBot(); - int tab = AiFactory::GetPlayerSpecTab(bot); - - if (tab == 0) // Arcane - { - triggers.push_back(new TriggerNode("arcane power", NextAction::array(0, new NextAction("arcane power", 29.0f), nullptr))); - triggers.push_back(new TriggerNode("icy veins", NextAction::array(0, new NextAction("icy veins", 28.5f), nullptr))); - triggers.push_back(new TriggerNode("mirror image", NextAction::array(0, new NextAction("mirror image", 28.0f), nullptr))); - } - else if (tab == 1) - { - if (bot->HasSpell(44614) /*Frostfire Bolt*/ && bot->HasAura(15047) /*Ice Shards*/) - { // Frostfire - triggers.push_back(new TriggerNode("combustion", NextAction::array(0, new NextAction("combustion", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("icy veins", NextAction::array(0, new NextAction("icy veins", 17.5f), nullptr))); - triggers.push_back(new TriggerNode("mirror image", NextAction::array(0, new NextAction("mirror image", 17.0f), nullptr))); - } - else - { // Fire - triggers.push_back(new TriggerNode("combustion", NextAction::array(0, new NextAction("combustion", 18.0f), nullptr))); - triggers.push_back(new TriggerNode("mirror image", NextAction::array(0, new NextAction("mirror image", 17.5f), nullptr))); - } - } - else if (tab == 2) // Frost - { - triggers.push_back(new TriggerNode("cold snap", NextAction::array(0, new NextAction("cold snap", 28.0f), nullptr))); - triggers.push_back(new TriggerNode("icy veins", NextAction::array(0, new NextAction("icy veins", 27.5f), nullptr))); - triggers.push_back(new TriggerNode("mirror image", NextAction::array(0, new NextAction("mirror image", 26.0f), nullptr))); - } -} - -void MageCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("polymorph", NextAction::array(0, new NextAction("polymorph", 30.0f), nullptr))); -} - -void MageAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("blizzard channel check", NextAction::array(0, new NextAction("cancel channel", 26.0f), nullptr))); - - Player* bot = botAI->GetBot(); - int tab = AiFactory::GetPlayerSpecTab(bot); - - if (tab == 0) // Arcane - { - triggers.push_back(new TriggerNode("flamestrike active and medium aoe", NextAction::array(0, new NextAction("blizzard", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("flamestrike", 23.0f), - new NextAction("blizzard", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("arcane explosion", 21.0f), nullptr))); - } - else if (tab == 1) // Fire and Frostfire - { - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("dragon's breath", 39.0f), - new NextAction("blast wave", 38.0f), - new NextAction("flamestrike", 23.0f), - new NextAction("blizzard", 22.0f), nullptr))); - - triggers.push_back(new TriggerNode("flamestrike active and medium aoe", NextAction::array(0, new NextAction("blizzard", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("firestarter", NextAction::array(0, new NextAction("flamestrike", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("living bomb on attackers", NextAction::array(0, new NextAction("living bomb on attackers", 21.0f), nullptr))); - } - else if (tab == 2) // Frost - { - triggers.push_back(new TriggerNode("flamestrike active and medium aoe", NextAction::array(0, new NextAction("blizzard", 24.0f), nullptr))); - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("flamestrike", 23.0f), - new NextAction("blizzard", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, new NextAction("cone of cold", 21.0f), nullptr))); - } -} diff --git a/src/strategy/paladin/DpsPaladinStrategy.cpp b/src/strategy/paladin/DpsPaladinStrategy.cpp deleted file mode 100644 index 209e0200c4..0000000000 --- a/src/strategy/paladin/DpsPaladinStrategy.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "DpsPaladinStrategy.h" - -#include "Playerbots.h" -#include "Strategy.h" - -class DpsPaladinStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - DpsPaladinStrategyActionNodeFactory() - { - creators["sanctity aura"] = &sanctity_aura; - creators["retribution aura"] = &retribution_aura; - creators["seal of corruption"] = &seal_of_corruption; - creators["seal of vengeance"] = &seal_of_vengeance; - creators["seal of command"] = &seal_of_command; - creators["blessing of might"] = &blessing_of_might; - creators["crusader strike"] = &crusader_strike; - creators["repentance"] = &repentance; - creators["repentance on enemy healer"] = &repentance_on_enemy_healer; - creators["repentance on snare target"] = &repentance_on_snare_target; - creators["repentance of shield"] = &repentance_or_shield; - } - -private: - static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of corruption", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of vengeance"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of vengeance", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of command"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of command", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of righteousness"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("blessing of might", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("blessing of kings"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("crusader strike", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - ACTION_NODE_A(repentance, "repentance", "hammer of justice"); - ACTION_NODE_A(repentance_on_enemy_healer, "repentance on enemy healer", "hammer of justice on enemy healer"); - ACTION_NODE_A(repentance_on_snare_target, "repentance on snare target", "hammer of justice on snare target"); - ACTION_NODE_A(sanctity_aura, "sanctity aura", "retribution aura"); - ACTION_NODE_A(retribution_aura, "retribution aura", "devotion aura"); - ACTION_NODE_A(repentance_or_shield, "repentance", "divine shield"); -}; - -DpsPaladinStrategy::DpsPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) -{ - actionNodeFactories.Add(new DpsPaladinStrategyActionNodeFactory()); -} - -NextAction** DpsPaladinStrategy::getDefaultActions() -{ - return NextAction::array(0, - new NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), - new NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f), - new NextAction("crusader strike", ACTION_DEFAULT + 0.4f), - new NextAction("divine storm", ACTION_DEFAULT + 0.3f), - new NextAction("consecration", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void DpsPaladinStrategy::InitTriggers(std::vector& triggers) -{ - GenericPaladinStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode( - // "enough mana", NextAction::array(0, new NextAction("consecration", ACTION_DEFAULT + 0.2f), nullptr))); - triggers.push_back( - new TriggerNode("art of war", NextAction::array(0, new NextAction("exorcism", ACTION_DEFAULT + 0.2f), nullptr))); - triggers.push_back( - new TriggerNode("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", ACTION_HIGH + 5), nullptr))); - - triggers.push_back(new TriggerNode( - "avenging wrath", NextAction::array(0, new NextAction("avenging wrath", ACTION_HIGH + 2), 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))); triggers.push_back(new TriggerNode("judgement", NextAction::array(0, - // new NextAction("judgement", ACTION_HIGH + 10), nullptr))); triggers.push_back(new TriggerNode("enemy is close", - // NextAction::array(0, new NextAction("consecration", ACTION_INTERRUPT), nullptr))); triggers.push_back(new - // TriggerNode("repentance on enemy healer", NextAction::array(0, new NextAction("repentance on enemy healer", - // ACTION_INTERRUPT + 2), nullptr))); triggers.push_back(new TriggerNode("repentance on snare target", - // NextAction::array(0, new NextAction("repentance on snare target", ACTION_INTERRUPT + 2), nullptr))); - // 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 + 4), - new NextAction("consecration", ACTION_HIGH + 3), nullptr))); - // 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", - NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), NULL))); -} diff --git a/src/strategy/paladin/GenericPaladinStrategy.cpp b/src/strategy/paladin/GenericPaladinStrategy.cpp deleted file mode 100644 index aec2c4f8cc..0000000000 --- a/src/strategy/paladin/GenericPaladinStrategy.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericPaladinStrategy.h" - -#include "GenericPaladinStrategyActionNodeFactory.h" -#include "Playerbots.h" - -GenericPaladinStrategy::GenericPaladinStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericPaladinStrategyActionNodeFactory()); -} - -void GenericPaladinStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("divine shield", - ACTION_HIGH + 5), nullptr))); - triggers.push_back( - new TriggerNode("hammer of justice interrupt", - NextAction::array(0, new NextAction("hammer of justice", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "hammer of justice on enemy healer", - NextAction::array(0, new NextAction("hammer of justice on enemy healer", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "hammer of justice on snare target", - NextAction::array(0, new NextAction("hammer of justice on snare target", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("lay on hands", ACTION_EMERGENCY), nullptr))); - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, new NextAction("lay on hands on party", ACTION_EMERGENCY + 1), nullptr))); - triggers.push_back(new TriggerNode( - "protect party member", - NextAction::array(0, new NextAction("blessing of protection on party", ACTION_EMERGENCY + 2), nullptr))); - triggers.push_back( - new TriggerNode("high mana", NextAction::array(0, new NextAction("divine plea", ACTION_HIGH), NULL))); -} - -void PaladinCureStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "cleanse cure disease", NextAction::array(0, new NextAction("cleanse disease", ACTION_DISPEL + 2), nullptr))); - triggers.push_back( - new TriggerNode("cleanse party member cure disease", - NextAction::array(0, new NextAction("cleanse disease on party", ACTION_DISPEL + 1), nullptr))); - triggers.push_back(new TriggerNode( - "cleanse cure poison", NextAction::array(0, new NextAction("cleanse poison", ACTION_DISPEL + 2), nullptr))); - triggers.push_back( - new TriggerNode("cleanse party member cure poison", - NextAction::array(0, new NextAction("cleanse poison on party", ACTION_DISPEL + 1), nullptr))); - triggers.push_back(new TriggerNode( - "cleanse cure magic", NextAction::array(0, new NextAction("cleanse magic", ACTION_DISPEL + 2), nullptr))); - triggers.push_back( - new TriggerNode("cleanse party member cure magic", - NextAction::array(0, new NextAction("cleanse magic on party", ACTION_DISPEL + 1), nullptr))); -} - -void PaladinBoostStrategy::InitTriggers(std::vector& triggers) -{ - - // triggers.push_back(new TriggerNode("divine favor", NextAction::array(0, new NextAction("divine favor", - // ACTION_HIGH + 1), nullptr))); -} - -void PaladinCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("turn undead", NextAction::array(0, new NextAction("turn undead", ACTION_HIGH + 1), nullptr))); -} - -void PaladinHealerDpsStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("healer should attack", - NextAction::array(0, - new NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), - new NextAction("holy shock", ACTION_DEFAULT + 0.5f), - new NextAction("shield of righteousness", ACTION_DEFAULT + 0.4f), - new NextAction("judgement of light", ACTION_DEFAULT + 0.3f), - new NextAction("consecration", ACTION_DEFAULT + 0.2f), - new NextAction("exorcism", ACTION_DEFAULT+ 0.1f), - nullptr))); -} diff --git a/src/strategy/paladin/HealPaladinStrategy.cpp b/src/strategy/paladin/HealPaladinStrategy.cpp deleted file mode 100644 index 3b368d03f0..0000000000 --- a/src/strategy/paladin/HealPaladinStrategy.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "HealPaladinStrategy.h" - -#include "Playerbots.h" -#include "Strategy.h" - -class HealPaladinStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - // HealPaladinStrategyActionNodeFactory() - // { - // creators["concentration aura"] = &concentration_aura; - // } - -private: - // ACTION_NODE_A(concentration_aura, "concentration aura", "devotion aura"); -}; - -HealPaladinStrategy::HealPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) -{ - actionNodeFactories.Add(new HealPaladinStrategyActionNodeFactory()); -} - -NextAction** HealPaladinStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("judgement of light", ACTION_DEFAULT), nullptr); -} - -void HealPaladinStrategy::InitTriggers(std::vector& triggers) -{ - GenericPaladinStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode("concentration aura", NextAction::array(0, new NextAction("concentration - // aura", ACTION_NORMAL), nullptr))); - triggers.push_back( - new TriggerNode("seal", NextAction::array(0, new NextAction("seal of wisdom", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode( - "medium mana", NextAction::array(0, new NextAction("divine illumination", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("divine favor", ACTION_HIGH + 1), nullptr))); - // triggers.push_back(new TriggerNode("blessing", NextAction::array(0, new NextAction("blessing of sanctuary", - // ACTION_HIGH + 9), nullptr))); - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_EMERGENCY + 3), nullptr))); - - triggers.push_back( - new TriggerNode("medium group heal setting", - NextAction::array(0, new NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5), - new NextAction("avenging wrath", ACTION_HIGH + 4), - nullptr))); - - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, new NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("divine sacrifice", ACTION_CRITICAL_HEAL + 5), - new NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4), nullptr))); - - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5), nullptr))); - - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("holy light on party", ACTION_LIGHT_HEAL + 9), - new NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8), nullptr))); - - triggers.push_back(new TriggerNode( - "party member almost full health", - NextAction::array(0, new NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "beacon of light on main tank", - NextAction::array(0, new NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7), nullptr))); - - triggers.push_back(new TriggerNode( - "sacred shield on main tank", - NextAction::array(0, new NextAction("sacred shield on main tank", ACTION_CRITICAL_HEAL + 6), nullptr))); -} diff --git a/src/strategy/paladin/OffhealRetPaladinStrategy.cpp b/src/strategy/paladin/OffhealRetPaladinStrategy.cpp deleted file mode 100644 index 3dd9c904c9..0000000000 --- a/src/strategy/paladin/OffhealRetPaladinStrategy.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "OffhealRetPaladinStrategy.h" - -#include "Playerbots.h" -#include "Strategy.h" - -class OffhealRetPaladinStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - OffhealRetPaladinStrategyActionNodeFactory() - { - creators["retribution aura"] = &retribution_aura; - creators["seal of corruption"] = &seal_of_corruption; - creators["seal of vengeance"] = &seal_of_vengeance; - creators["seal of command"] = &seal_of_command; - creators["blessing of might"] = &blessing_of_might; - creators["crusader strike"] = &crusader_strike; - creators["divine plea"] = &divine_plea; - } - -private: - static ActionNode* retribution_aura([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("retribution aura", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("devotion aura"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of corruption", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of vengeance"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of vengeance", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of command"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of command", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of righteousness"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* blessing_of_might([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("blessing of might", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("blessing of kings"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* crusader_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("crusader strike", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* divine_plea([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("divine plea", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -OffhealRetPaladinStrategy::OffhealRetPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) -{ - actionNodeFactories.Add(new OffhealRetPaladinStrategyActionNodeFactory()); -} - -NextAction** OffhealRetPaladinStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("hammer of wrath", ACTION_DEFAULT + 0.6f), - new NextAction("judgement of wisdom", ACTION_DEFAULT + 0.5f), - new NextAction("crusader strike", ACTION_DEFAULT + 0.4f), - new NextAction("divine storm", ACTION_DEFAULT + 0.3f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void OffhealRetPaladinStrategy::InitTriggers(std::vector& triggers) -{ - GenericPaladinStrategy::InitTriggers(triggers); - - // Damage Triggers - triggers.push_back( - new TriggerNode("seal", NextAction::array(0, new NextAction("seal of corruption", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("seal of wisdom", ACTION_HIGH + 5), - new NextAction("divine plea", ACTION_HIGH + 4), nullptr))); - triggers.push_back( - new TriggerNode("art of war", NextAction::array(0, new NextAction("exorcism", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode( - "avenging wrath", NextAction::array(0, new NextAction("avenging wrath", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("divine storm", ACTION_HIGH + 4), - new NextAction("consecration", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode("enemy out of melee", - NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode( - "retribution aura", NextAction::array(0, new NextAction("retribution aura", ACTION_NORMAL), nullptr))); - triggers.push_back(new TriggerNode( - "blessing of might", NextAction::array(0, new NextAction("blessing of might", ACTION_NORMAL + 1), nullptr))); - triggers.push_back(new TriggerNode( - "low health", NextAction::array(0, new NextAction("holy light", ACTION_CRITICAL_HEAL + 2), nullptr))); - - // Healing Triggers - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, new NextAction("holy shock on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("holy light on party", ACTION_CRITICAL_HEAL + 4), nullptr))); - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("holy light on party", ACTION_MEDIUM_HEAL + 5), nullptr))); - triggers.push_back(new TriggerNode( - "party member medium health", - NextAction::array(0, new NextAction("flash of light on party", ACTION_LIGHT_HEAL + 8), nullptr))); - triggers.push_back(new TriggerNode( - "party member almost full health", - NextAction::array(0, new NextAction("flash of light on party", ACTION_LIGHT_HEAL + 3), nullptr))); - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_EMERGENCY + 3), nullptr))); - triggers.push_back(new TriggerNode( - "beacon of light on main tank", - NextAction::array(0, new NextAction("beacon of light on main tank", ACTION_CRITICAL_HEAL + 7), nullptr))); -} diff --git a/src/strategy/paladin/TankPaladinStrategy.cpp b/src/strategy/paladin/TankPaladinStrategy.cpp deleted file mode 100644 index 145f205d31..0000000000 --- a/src/strategy/paladin/TankPaladinStrategy.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "TankPaladinStrategy.h" - -#include "Playerbots.h" - -class TankPaladinStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - TankPaladinStrategyActionNodeFactory() - { - // creators["seal of vengeance"] = &seal_of_vengeance; - creators["seal of corruption"] = &seal_of_corruption; - creators["seal of vengeance"] = &seal_of_vengeance; - creators["seal of command"] = &seal_of_command; - creators["hand of reckoning"] = &hand_of_reckoning; - creators["taunt spell"] = &hand_of_reckoning; - } - -private: - // static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode("seal of vengeance", - // /*P*/ nullptr, - // /*A*/ NextAction::array(0, new NextAction("seal of righteousness"), nullptr), - // /*C*/ nullptr); - // } - static ActionNode* seal_of_command([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of command", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of corruption"), nullptr), - /*C*/ nullptr); - } - static ActionNode* seal_of_corruption([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of corruption", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of vengeance"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* seal_of_vengeance([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("seal of vengeance", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("seal of righteousness"), nullptr), - /*C*/ nullptr); - } - ACTION_NODE_A(hand_of_reckoning, "hand of reckoning", "righteous defense"); -}; - -TankPaladinStrategy::TankPaladinStrategy(PlayerbotAI* botAI) : GenericPaladinStrategy(botAI) -{ - actionNodeFactories.Add(new TankPaladinStrategyActionNodeFactory()); -} - -NextAction** TankPaladinStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("shield of righteousness", ACTION_DEFAULT + 0.6f), - new NextAction("hammer of the righteous", ACTION_DEFAULT + 0.5f), - new NextAction("judgement of wisdom", ACTION_DEFAULT + 0.4f), - // new NextAction("avenger's shield", ACTION_NORMAL + 3), - // new NextAction("consecration", ACTION_NORMAL + 2), - new NextAction("melee", ACTION_DEFAULT), NULL); -} - -void TankPaladinStrategy::InitTriggers(std::vector& triggers) -{ - GenericPaladinStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("seal", NextAction::array(0, new NextAction("seal of corruption", 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))); - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("consecration", ACTION_HIGH + 7), - new NextAction("avenger's shield", ACTION_HIGH + 6), nullptr))); - // triggers.push_back(new TriggerNode("avenger's shield", NextAction::array(0, new NextAction("avenger's shield", - // ACTION_HIGH + 7), nullptr))); - triggers.push_back(new TriggerNode( - "lose aggro", NextAction::array(0, new NextAction("hand of reckoning", ACTION_HIGH + 7), nullptr))); - // triggers.push_back(new TriggerNode("almost full health", NextAction::array(0, new NextAction("holy shield", - // ACTION_HIGH + 4), nullptr))); - triggers.push_back(new TriggerNode("medium health", - NextAction::array(0, new NextAction("holy shield", ACTION_HIGH + 4), nullptr))); - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("holy shield", ACTION_HIGH + 4), nullptr))); - triggers.push_back(new TriggerNode("critical health", - NextAction::array(0, new NextAction("holy shield", ACTION_HIGH + 4), nullptr))); - // triggers.push_back(new TriggerNode("blessing", NextAction::array(0, new NextAction("blessing of sanctuary", - // ACTION_HIGH + 9), nullptr))); - triggers.push_back(new TriggerNode( - "avenging wrath", NextAction::array(0, new NextAction("avenging wrath", 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( - "righteous fury", NextAction::array(0, new NextAction("righteous fury", ACTION_HIGH + 8), nullptr))); - triggers.push_back( - new TriggerNode("medium group heal setting", - NextAction::array(0, new NextAction("divine sacrifice", ACTION_HIGH + 5), nullptr))); - triggers.push_back(new TriggerNode( - "enough mana", NextAction::array(0, new NextAction("consecration", ACTION_HIGH + 4), 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 out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), nullptr))); -} diff --git a/src/strategy/priest/GenericPriestStrategy.cpp b/src/strategy/priest/GenericPriestStrategy.cpp deleted file mode 100644 index acf9d39d86..0000000000 --- a/src/strategy/priest/GenericPriestStrategy.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericPriestStrategy.h" - -#include "GenericPriestStrategyActionNodeFactory.h" -#include "HealPriestStrategy.h" -#include "Playerbots.h" - -GenericPriestStrategy::GenericPriestStrategy(PlayerbotAI* botAI) : RangedCombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); -} - -void GenericPriestStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode("medium health", NextAction::array(0, new NextAction("greater heal", 25.0f), - // nullptr))); triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("power word: - // shield", 61.0f), new NextAction("greater heal", 60.0f), nullptr))); triggers.push_back(new TriggerNode("critical - // health", NextAction::array(0, new NextAction("remove shadowform", 72.0f), new NextAction("power word: - // shield", 71.0f), new NextAction("flash heal", 70.0f), nullptr))); triggers.push_back(new TriggerNode("party - // member critical health", NextAction::array(0, new NextAction("remove shadowform", 62.0f), new NextAction("power - // word: shield on party", 61.0f), new NextAction("flash heal on party", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("fade", 55.0f), nullptr))); - // triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new NextAction("psychic - // scream", 50.0f), nullptr))); triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new - // NextAction("inner focus", 42.0f), nullptr))); triggers.push_back(new TriggerNode("medium mana", - // NextAction::array(0, new NextAction("symbol of hope", ACTION_EMERGENCY), nullptr))); triggers.push_back(new - // TriggerNode("low mana", NextAction::array(0, new NextAction("consume magic", 10.0f), nullptr))); - // triggers.push_back( - // new TriggerNode("inner focus", NextAction::array(0, new NextAction("inner focus", 42.0f), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("desperate prayer", - ACTION_HIGH + 5), nullptr))); - // triggers.push_back(new TriggerNode("enemy is close", NextAction::array(0, new - // NextAction("elune's grace", ACTION_EMERGENCY), nullptr))); triggers.push_back(new TriggerNode("chastise", - // NextAction::array(0, new NextAction("chastise", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("power word: shield", ACTION_NORMAL), NULL))); - - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("power word: shield", ACTION_HIGH), NULL))); - - triggers.push_back( - new TriggerNode("medium mana", - NextAction::array(0, - new NextAction("shadowfiend", ACTION_HIGH + 2), - new NextAction("inner focus", ACTION_HIGH + 1), nullptr))); - - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("hymn of hope", ACTION_HIGH), NULL))); - - triggers.push_back(new TriggerNode("enemy too close for spell", - NextAction::array(0, new NextAction("flee", ACTION_MOVE + 9), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("being attacked", - NextAction::array(0, new NextAction("power word: shield", ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 60.0f), nullptr))); -} - -PriestCureStrategy::PriestCureStrategy(PlayerbotAI* botAI) : Strategy(botAI) -{ - actionNodeFactories.Add(new CurePriestStrategyActionNodeFactory()); -} - -void PriestCureStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("dispel magic", NextAction::array(0, new NextAction("dispel magic", 41.0f), nullptr))); - triggers.push_back(new TriggerNode("dispel magic on party", - NextAction::array(0, new NextAction("dispel magic on party", 40.0f), nullptr))); - triggers.push_back( - new TriggerNode("cure disease", NextAction::array(0, new NextAction("abolish disease", 31.0f), nullptr))); - triggers.push_back(new TriggerNode( - "party member cure disease", NextAction::array(0, new NextAction("abolish disease on party", 30.0f), nullptr))); -} - -void PriestBoostStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("power infusion", NextAction::array(0, new NextAction("power infusion", 41.0f), nullptr))); - triggers.push_back(new TriggerNode("boost", NextAction::array(0, new NextAction("shadowfiend", 20.0f), nullptr))); -} - -void PriestCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("shackle undead", NextAction::array(0, new NextAction("shackle undead", 31.0f), nullptr))); -} - -void PriestHealerDpsStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("healer should attack", - NextAction::array(0, - new NextAction("shadow word: pain", ACTION_DEFAULT + 0.5f), - new NextAction("holy fire", ACTION_DEFAULT + 0.4f), - new NextAction("smite", ACTION_DEFAULT + 0.3f), - new NextAction("mind blast", ACTION_DEFAULT + 0.2f), - new NextAction("shoot", ACTION_DEFAULT), - nullptr))); - - triggers.push_back( - new TriggerNode("medium aoe and healer should attack", - NextAction::array(0, - new NextAction("mind sear", ACTION_DEFAULT + 0.5f), - nullptr))); -} diff --git a/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h b/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h deleted file mode 100644 index d96f2e19d7..0000000000 --- a/src/strategy/priest/GenericPriestStrategyActionNodeFactory.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_GENERICPRIESTSTRATEGYACTIONNODEFACTORY_H -#define _PLAYERBOT_GENERICPRIESTSTRATEGYACTIONNODEFACTORY_H - -#include "Action.h" -#include "NamedObjectContext.h" - -class GenericPriestStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericPriestStrategyActionNodeFactory() - { - creators["inner fire"] = &inner_fire; - creators["holy nova"] = &holy_nova; - creators["power word: fortitude"] = &power_word_fortitude; - creators["power word: fortitude on party"] = &power_word_fortitude_on_party; - creators["divine spirit"] = &divine_spirit; - creators["divine spirit on party"] = &divine_spirit_on_party; - creators["power word: shield"] = &power_word_shield; - // creators["power word: shield on party"] = &power_word_shield_on_party; - creators["renew"] = &renew; - creators["renew on party"] = &renew_on_party; - creators["greater heal"] = &greater_heal; - creators["greater heal on party"] = &greater_heal_on_party; - creators["heal"] = &heal; - creators["heal on party"] = &heal_on_party; - creators["lesser heal"] = &lesser_heal; - creators["lesser heal on party"] = &lesser_heal_on_party; - creators["flash heal"] = &flash_heal; - creators["flash heal on party"] = &flash_heal_on_party; - creators["psychic scream"] = &psychic_scream; - // creators["fade"] = &fade; - creators["shadowfiend"] = &shadowfiend; - } - -private: - static ActionNode* inner_fire([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("inner fire", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* holy_nova([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("holy nova", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* power_word_fortitude([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("power word: fortitude", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* power_word_fortitude_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("power word: fortitude on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* divine_spirit([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("divine spirit", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* divine_spirit_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("divine spirit on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* power_word_shield([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("power word: shield", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - // /*A*/ NextAction::array(0, new NextAction("renew", 50.0f), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* power_word_shield_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("power word: shield on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - // /*A*/ NextAction::array(0, new NextAction("renew on party", 50.0f), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* renew([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("renew", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* renew_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("renew on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* greater_heal([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("greater heal", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("heal"), NULL), - /*C*/ NULL); - } - static ActionNode* greater_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("greater heal on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("heal on party"), NULL), - /*C*/ NULL); - } - static ActionNode* heal([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("heal", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("lesser heal"), NULL), - /*C*/ NULL); - } - static ActionNode* heal_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("heal on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("lesser heal on party"), NULL), - /*C*/ NULL); - } - static ActionNode* lesser_heal([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("lesser heal", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* lesser_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("lesser heal on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } - static ActionNode* flash_heal([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("flash heal", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("greater heal"), NULL), - /*C*/ NULL); - } - static ActionNode* flash_heal_on_party([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("flash heal on party", - /*P*/ NextAction::array(0, new NextAction("remove shadowform"), NULL), - /*A*/ NextAction::array(0, new NextAction("greater heal on party"), NULL), - /*C*/ NULL); - } - static ActionNode* psychic_scream([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("psychic scream", - /*P*/ NULL, - /*A*/ NextAction::array(0, new NextAction("fade"), NULL), - /*C*/ NULL); - } - // static ActionNode* fade([[maybe_unused]] PlayerbotAI* botAI) - // { - // return new ActionNode ("fade", - // /*P*/ NULL, - // /*A*/ NextAction::array(0, new NextAction("flee"), NULL), - // /*C*/ NULL); - // } - static ActionNode* shadowfiend([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("shadowfiend", - /*P*/ NULL, - // /*A*/ NextAction::array(0, new NextAction("hymn of hope"), NULL), - /*A*/ NULL, - /*C*/ NULL); - } -}; - -class CurePriestStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - CurePriestStrategyActionNodeFactory() - { - creators["abolish disease"] = &abolish_disease; - creators["abolish disease on party"] = &abolish_disease_on_party; - } - -private: - ACTION_NODE_A(abolish_disease, "abolish disease", "cure disease"); - ACTION_NODE_A(abolish_disease_on_party, "abolish disease on party", "cure disease on party"); -}; - -#endif diff --git a/src/strategy/priest/HealPriestStrategy.cpp b/src/strategy/priest/HealPriestStrategy.cpp deleted file mode 100644 index ecb59f6a79..0000000000 --- a/src/strategy/priest/HealPriestStrategy.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "HealPriestStrategy.h" - -#include "GenericPriestStrategyActionNodeFactory.h" -#include "Playerbots.h" - -HealPriestStrategy::HealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) -{ - actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); -} - -NextAction** HealPriestStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("shoot", ACTION_DEFAULT), nullptr); -} - -void HealPriestStrategy::InitTriggers(std::vector& triggers) -{ - GenericPriestStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode( - // "enemy out of spell", - // NextAction::array(0, new NextAction("reach spell", ACTION_NORMAL + 9), NULL))); - - // triggers.push_back(new TriggerNode( - // "medium aoe heal", - // NextAction::array(0, - // new NextAction("circle of healing on party", ACTION_MEDIUM_HEAL + 8), - // // new NextAction("power word: shield on almost full health below", ACTION_MEDIUM_HEAL + 7), - // NULL))); - - triggers.push_back(new TriggerNode( - "group heal setting", - NextAction::array(0, - new NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 8), - new NextAction("power word: shield on not full", ACTION_MEDIUM_HEAL + 7), - nullptr))); - - triggers.push_back(new TriggerNode( - "medium group heal setting", - NextAction::array(0, new NextAction("divine hymn", ACTION_CRITICAL_HEAL + 7), - new NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("power word: shield on not full", ACTION_CRITICAL_HEAL + 5), - new NextAction("prayer of healing on party", ACTION_CRITICAL_HEAL + 4), - nullptr))); - - triggers.push_back(new TriggerNode( - "party member critical health", - NextAction::array(0, new NextAction("power word: shield on party", ACTION_CRITICAL_HEAL + 5), - new NextAction("penance on party", ACTION_CRITICAL_HEAL + 4), - new NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 3), - new NextAction("flash heal on party", ACTION_CRITICAL_HEAL + 2), - nullptr))); - - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("power word: shield on party", ACTION_MEDIUM_HEAL + 4), - new NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 3), - new NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("flash heal on party", ACTION_MEDIUM_HEAL + 0), nullptr))); - - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("power word: shield on party", ACTION_LIGHT_HEAL + 9), - new NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 7), - new NextAction("penance on party", ACTION_LIGHT_HEAL + 6), - new NextAction("flash heal on party", ACTION_LIGHT_HEAL + 5), - // new NextAction("renew on party", ACTION_LIGHT_HEAL + 8), - nullptr))); - - triggers.push_back( - new TriggerNode("party member almost full health", - NextAction::array(0, - // new NextAction("penance on party", ACTION_LIGHT_HEAL + 3), - new NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 2), - new NextAction("renew on party", ACTION_LIGHT_HEAL + 1), - nullptr))); - - // triggers.push_back(new TriggerNode("almost full health", NextAction::array(0, new NextAction("renew", 43.f), - // nullptr))); triggers.push_back(new TriggerNode("party member almost full health", NextAction::array(0, new - // NextAction("heal on party", 41.0f), new NextAction("renew on party", 40.0f), nullptr))); triggers.push_back(new - // TriggerNode("party member medium health", NextAction::array(0, new NextAction("greater heal on party", 47.0f), - // nullptr))); triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, new - // NextAction("power word: shield on party", 51.0f), new NextAction("greater heal on party", 50.0f), nullptr))); - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 10), nullptr))); - // triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("prayer of - // mending", 49.0f), nullptr))); triggers.push_back(new TriggerNode("medium aoe heal", NextAction::array(0, new - // NextAction("circle of healing on party", 48.0f), nullptr))); triggers.push_back(new TriggerNode("binding heal", - // NextAction::array(0, new NextAction("binding heal", 52.0f), nullptr))); triggers.push_back(new TriggerNode("low - // mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); - - triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("pain suppression", ACTION_EMERGENCY + 1), nullptr))); - triggers.push_back( - new TriggerNode("protect party member", - NextAction::array(0, new NextAction("pain suppression on party", ACTION_EMERGENCY), nullptr))); -} diff --git a/src/strategy/priest/HolyPriestStrategy.cpp b/src/strategy/priest/HolyPriestStrategy.cpp deleted file mode 100644 index bdf804edcd..0000000000 --- a/src/strategy/priest/HolyPriestStrategy.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "HolyPriestStrategy.h" - -#include "Playerbots.h" - -class HolyPriestStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - HolyPriestStrategyActionNodeFactory() { creators["smite"] = &smite; } - -private: - static ActionNode* smite([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("smite", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("shoot"), nullptr), - /*C*/ nullptr); - } -}; - -HolyPriestStrategy::HolyPriestStrategy(PlayerbotAI* botAI) : HealPriestStrategy(botAI) -{ - actionNodeFactories.Add(new HolyPriestStrategyActionNodeFactory()); -} - -NextAction** HolyPriestStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("smite", ACTION_DEFAULT + 0.2f), - new NextAction("mana burn", ACTION_DEFAULT + 0.1f), - new NextAction("starshards", ACTION_DEFAULT), nullptr); -} - -void HolyPriestStrategy::InitTriggers(std::vector& triggers) -{ - HealPriestStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("holy fire", NextAction::array(0, new NextAction("holy fire", ACTION_NORMAL + 9), nullptr))); - triggers.push_back( - new TriggerNode("shadowfiend", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("medium mana", NextAction::array(0, new NextAction("shadowfiend", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("low mana", NextAction::array(0, new NextAction("mana burn", ACTION_HIGH), nullptr))); -} - -HolyHealPriestStrategy::HolyHealPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) -{ - actionNodeFactories.Add(new GenericPriestStrategyActionNodeFactory()); -} - -NextAction** HolyHealPriestStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("shoot", ACTION_DEFAULT), nullptr); -} - -void HolyHealPriestStrategy::InitTriggers(std::vector& triggers) -{ - GenericPriestStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("group heal setting", - NextAction::array(0, - new NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 9), - new NextAction("circle of healing on party", ACTION_MEDIUM_HEAL + 8), nullptr))); - - triggers.push_back(new TriggerNode( - "medium group heal setting", - NextAction::array(0, new NextAction("divine hymn", ACTION_CRITICAL_HEAL + 7), - new NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("circle of healing on party", ACTION_CRITICAL_HEAL + 5), - new NextAction("prayer of healing on party", ACTION_CRITICAL_HEAL + 4), nullptr))); - - triggers.push_back(new TriggerNode( - "party member critical health", - NextAction::array(0, - new NextAction("guardian spirit on party", ACTION_CRITICAL_HEAL + 6), - new NextAction("power word: shield on party", ACTION_CRITICAL_HEAL + 5), - new NextAction("prayer of mending on party", ACTION_CRITICAL_HEAL + 3), - new NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("flash heal on party", ACTION_CRITICAL_HEAL + 1), - nullptr))); - - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("circle of healing on party", ACTION_MEDIUM_HEAL + 4), - new NextAction("prayer of mending on party", ACTION_MEDIUM_HEAL + 3), - new NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("flash heal on party", ACTION_MEDIUM_HEAL + 1), nullptr))); - - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("circle of healing on party", ACTION_LIGHT_HEAL + 7), - new NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 6), - new NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 5), - new NextAction("flash heal on party", ACTION_LIGHT_HEAL + 4), - // new NextAction("renew on party", ACTION_LIGHT_HEAL + 8), - nullptr))); - - triggers.push_back( - new TriggerNode("party member almost full health", - NextAction::array(0, - new NextAction("renew on party", ACTION_LIGHT_HEAL + 2), - new NextAction("prayer of mending on party", ACTION_LIGHT_HEAL + 1), - nullptr))); - - triggers.push_back(new TriggerNode( - "party member to heal out of spell range", - NextAction::array(0, new NextAction("reach party member to heal", ACTION_CRITICAL_HEAL + 10), nullptr))); -} diff --git a/src/strategy/priest/PriestNonCombatStrategy.cpp b/src/strategy/priest/PriestNonCombatStrategy.cpp deleted file mode 100644 index 3851310646..0000000000 --- a/src/strategy/priest/PriestNonCombatStrategy.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "PriestNonCombatStrategy.h" - -#include "Playerbots.h" -#include "PriestNonCombatStrategyActionNodeFactory.h" - -PriestNonCombatStrategy::PriestNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) -{ - actionNodeFactories.Add(new PriestNonCombatStrategyActionNodeFactory()); -} - -void PriestNonCombatStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode("power word: fortitude", NextAction::array(0, new NextAction("power word: - // fortitude", 12.0f), nullptr))); triggers.push_back(new TriggerNode("divine spirit", NextAction::array(0, new - // NextAction("divine spirit", 14.0f), nullptr))); - triggers.push_back( - new TriggerNode("inner fire", NextAction::array(0, new NextAction("inner fire", 10.0f), nullptr))); - // triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("greater heal", 70.0f), - // nullptr))); triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, new - // NextAction("greater heal on party", 60.0f), nullptr))); triggers.push_back(new TriggerNode("medium health", - // NextAction::array(0, new NextAction("renew", 41.0f), nullptr))); triggers.push_back(new TriggerNode("party member - // medium health", NextAction::array(0, new NextAction("renew on party", 40.0f), nullptr))); triggers.push_back(new - // TriggerNode("medium aoe heal", NextAction::array(0, new NextAction("lightwell", 42.f), nullptr))); - triggers.push_back(new TriggerNode( - "party member dead", NextAction::array(0, new NextAction("remove shadowform", ACTION_CRITICAL_HEAL + 11), - new NextAction("resurrection", ACTION_CRITICAL_HEAL + 10), nullptr))); - // triggers.push_back(new TriggerNode("swimming", NextAction::array(0, new NextAction("levitate", 1.0f), nullptr))); - triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("apply oil", 1.0f), nullptr))); - triggers.push_back( - new TriggerNode("party member critical health", - NextAction::array(0, new NextAction("renew on party", ACTION_CRITICAL_HEAL + 3), - new NextAction("penance on party", ACTION_CRITICAL_HEAL + 2), - new NextAction("greater heal on party", ACTION_CRITICAL_HEAL + 1), NULL))); - - triggers.push_back( - new TriggerNode("party member low health", - NextAction::array(0, new NextAction("renew on party", ACTION_MEDIUM_HEAL + 3), - new NextAction("penance on party", ACTION_MEDIUM_HEAL + 2), - new NextAction("greater heal on party", ACTION_MEDIUM_HEAL + 1), NULL))); - - triggers.push_back( - new TriggerNode("party member medium health", - NextAction::array(0, new NextAction("renew on party", ACTION_LIGHT_HEAL + 9), - new NextAction("penance on party", ACTION_LIGHT_HEAL + 8), NULL))); - - triggers.push_back( - new TriggerNode("party member almost full health", - NextAction::array(0, new NextAction("renew on party", ACTION_LIGHT_HEAL + 3), NULL))); - - triggers.push_back( - new TriggerNode("group heal setting", NextAction::array(0, new NextAction("circle of healing on party", 27.0f), NULL))); - triggers.push_back(new TriggerNode("new pet", - NextAction::array(0, new NextAction("set pet stance", 10.0f), nullptr))); -} - -void PriestBuffStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - triggers.push_back( - new TriggerNode("prayer of fortitude on party", - NextAction::array(0, new NextAction("prayer of fortitude on party", 12.0f), nullptr))); - triggers.push_back( - new TriggerNode("prayer of spirit on party", - NextAction::array(0, new NextAction("prayer of spirit on party", 14.0f), nullptr))); - triggers.push_back( - new TriggerNode("power word: fortitude on party", - NextAction::array(0, new NextAction("power word: fortitude on party", 11.0f), nullptr))); - triggers.push_back(new TriggerNode("divine spirit on party", - NextAction::array(0, new NextAction("divine spirit on party", 13.0f), nullptr))); - // triggers.push_back(new TriggerNode("fear ward", NextAction::array(0, new NextAction("fear ward", 10.0f), - // nullptr))); triggers.push_back(new TriggerNode("touch of weakness", NextAction::array(0, new NextAction("touch of - // weakness", 10.0f), nullptr))); triggers.push_back(new TriggerNode("shadowguard", NextAction::array(0, new - // NextAction("shadowguard", 10.0f), nullptr))); -} - -void PriestShadowResistanceStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("shadow protection", - NextAction::array(0, new NextAction("shadow protection", 12.0f), nullptr))); - triggers.push_back( - new TriggerNode("shadow protection on party", - NextAction::array(0, new NextAction("shadow protection on party", 11.0f), nullptr))); - // triggers.push_back(new TriggerNode("shadow protection on party", NextAction::array(0, new NextAction("shadow - // protection on party", 10.0f), nullptr))); -} diff --git a/src/strategy/priest/ShadowPriestStrategy.cpp b/src/strategy/priest/ShadowPriestStrategy.cpp deleted file mode 100644 index e6565b722c..0000000000 --- a/src/strategy/priest/ShadowPriestStrategy.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "ShadowPriestStrategy.h" - -#include "Playerbots.h" -#include "ShadowPriestStrategyActionNodeFactory.h" - -ShadowPriestStrategy::ShadowPriestStrategy(PlayerbotAI* botAI) : GenericPriestStrategy(botAI) -{ - actionNodeFactories.Add(new ShadowPriestStrategyActionNodeFactory()); -} - -NextAction** ShadowPriestStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("mind blast", ACTION_DEFAULT + 0.3f), - new NextAction("mind flay", ACTION_DEFAULT + 0.2f), - new NextAction("shadow word: death", ACTION_DEFAULT + 0.1f), // cast during movement - new NextAction("shoot", ACTION_DEFAULT), nullptr); -} - -void ShadowPriestStrategy::InitTriggers(std::vector& triggers) -{ - GenericPriestStrategy::InitTriggers(triggers); - - // triggers.push_back(new TriggerNode("enemy out of spell", NextAction::array(0, new NextAction("reach spell", - // ACTION_MOVE + 9), nullptr))); - triggers.push_back( - new TriggerNode("shadowform", NextAction::array(0, new NextAction("shadowform", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("dispersion", ACTION_HIGH - + 5), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("dispersion", ACTION_HIGH - + 5), nullptr))); - triggers.push_back( - new TriggerNode("vampiric embrace", NextAction::array(0, new NextAction("vampiric embrace", 16.0f), nullptr))); - triggers.push_back( - new TriggerNode("silence", NextAction::array(0, new NextAction("silence", ACTION_INTERRUPT + 1), nullptr))); - triggers.push_back( - new TriggerNode("silence on enemy healer", - NextAction::array(0, new NextAction("silence on enemy healer", ACTION_INTERRUPT), nullptr))); - // triggers.push_back(new TriggerNode("shadowfiend", NextAction::array(0, new NextAction("shadowfiend", - // ACTION_HIGH), nullptr))); triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new - // NextAction("shadowfiend", ACTION_HIGH), nullptr))); triggers.push_back(new TriggerNode("low mana", - // NextAction::array(0, new NextAction("mana burn", ACTION_HIGH), nullptr))); -} - -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_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("mind sear channel check", NextAction::array(0, new NextAction("cancel channel", ACTION_HIGH + 5), 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) -{ - triggers.push_back(new TriggerNode( - "vampiric touch", NextAction::array(0, new NextAction("vampiric touch", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode( - "devouring plague", NextAction::array(0, new NextAction("devouring plague", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode( - "shadow word: pain", NextAction::array(0, new NextAction("shadow word: pain", ACTION_HIGH + 1), nullptr))); - // triggers.push_back(new TriggerNode("feedback", NextAction::array(0, new NextAction("feedback", 80.0f), - // nullptr))); triggers.push_back(new TriggerNode("hex of weakness", NextAction::array(0, new NextAction("hex of - // weakness", 10.0f), nullptr))); -} diff --git a/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp b/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp deleted file mode 100644 index 1b784683fc..0000000000 --- a/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "RaidBwlStrategy.h" - -#include "Strategy.h" - -void RaidBwlStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("often", - NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL))); - - triggers.push_back(new TriggerNode("bwl suppression device", - NextAction::array(0, new NextAction("bwl turn off suppression device", ACTION_RAID), NULL))); - - triggers.push_back(new TriggerNode("bwl affliction bronze", - NextAction::array(0, new NextAction("bwl use hourglass sand", ACTION_RAID), NULL))); -} diff --git a/src/strategy/raids/eyeofeternity/RaidEoEStrategy.cpp b/src/strategy/raids/eyeofeternity/RaidEoEStrategy.cpp deleted file mode 100644 index d06aa27f0d..0000000000 --- a/src/strategy/raids/eyeofeternity/RaidEoEStrategy.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "RaidEoEStrategy.h" -#include "RaidEoEMultipliers.h" -#include "Strategy.h" - -void RaidEoEStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("malygos", - NextAction::array(0, new NextAction("malygos position", ACTION_MOVE), nullptr))); - triggers.push_back(new TriggerNode("malygos", - NextAction::array(0, new NextAction("malygos target", ACTION_RAID + 1), nullptr))); - // triggers.push_back(new TriggerNode("power spark", - // NextAction::array(0, new NextAction("pull power spark", ACTION_RAID + 2), nullptr))); - // triggers.push_back(new TriggerNode("power spark", - // NextAction::array(0, new NextAction("kill power spark", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("group flying", - NextAction::array(0, new NextAction("eoe fly drake", ACTION_NORMAL + 1), nullptr))); - triggers.push_back(new TriggerNode("drake combat", - NextAction::array(0, new NextAction("eoe drake attack", ACTION_NORMAL + 5), nullptr))); -} - -void RaidEoEStrategy::InitMultipliers(std::vector &multipliers) -{ - multipliers.push_back(new MalygosMultiplier(botAI)); -} diff --git a/src/strategy/raids/gruulslair/RaidGruulsLairStrategy.cpp b/src/strategy/raids/gruulslair/RaidGruulsLairStrategy.cpp deleted file mode 100644 index bd7c9cd970..0000000000 --- a/src/strategy/raids/gruulslair/RaidGruulsLairStrategy.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "RaidGruulsLairStrategy.h" -#include "RaidGruulsLairMultipliers.h" - -void RaidGruulsLairStrategy::InitTriggers(std::vector& triggers) -{ - // High King Maulgar - triggers.push_back(new TriggerNode("high king maulgar is main tank", NextAction::array(0, - new NextAction("high king maulgar main tank attack maulgar", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar is first assist tank", NextAction::array(0, - new NextAction("high king maulgar first assist tank attack olm", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar is second assist tank", NextAction::array(0, - new NextAction("high king maulgar second assist tank attack blindeye", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar is mage tank", NextAction::array(0, - new NextAction("high king maulgar mage tank attack krosh", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar is moonkin tank", NextAction::array(0, - new NextAction("high king maulgar moonkin tank attack kiggler", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar determining kill order", NextAction::array(0, - new NextAction("high king maulgar assign dps priority", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar healer in danger", NextAction::array(0, - new NextAction("high king maulgar healer find safe position", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar boss channeling whirlwind", NextAction::array(0, - new NextAction("high king maulgar run away from whirlwind", ACTION_EMERGENCY + 6), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar wild felstalker spawned", NextAction::array(0, - new NextAction("high king maulgar banish felstalker", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("high king maulgar pulling olm and blindeye", NextAction::array(0, - new NextAction("high king maulgar misdirect olm and blindeye", ACTION_RAID + 2), nullptr))); - - // Gruul the Dragonkiller - triggers.push_back(new TriggerNode("gruul the dragonkiller boss engaged by main tank", NextAction::array(0, - new NextAction("gruul the dragonkiller main tank position boss", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("gruul the dragonkiller boss engaged by range", NextAction::array(0, - new NextAction("gruul the dragonkiller spread ranged", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("gruul the dragonkiller incoming shatter", NextAction::array(0, - new NextAction("gruul the dragonkiller shatter spread", ACTION_EMERGENCY + 6), nullptr))); -} - -void RaidGruulsLairStrategy::InitMultipliers(std::vector& multipliers) -{ - multipliers.push_back(new HighKingMaulgarDisableTankAssistMultiplier(botAI)); - multipliers.push_back(new HighKingMaulgarAvoidWhirlwindMultiplier(botAI)); - multipliers.push_back(new HighKingMaulgarDisableArcaneShotOnKroshMultiplier(botAI)); - multipliers.push_back(new HighKingMaulgarDisableMageTankAOEMultiplier(botAI)); - multipliers.push_back(new GruulTheDragonkillerMainTankMovementMultiplier(botAI)); - multipliers.push_back(new GruulTheDragonkillerGroundSlamMultiplier(botAI)); -} diff --git a/src/strategy/raids/icecrown/RaidIccStrategy.cpp b/src/strategy/raids/icecrown/RaidIccStrategy.cpp deleted file mode 100644 index 1acf1e7884..0000000000 --- a/src/strategy/raids/icecrown/RaidIccStrategy.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include "RaidIccStrategy.h" - -#include "RaidIccMultipliers.h" - -void RaidIccStrategy::InitTriggers(std::vector& triggers) -{ - //Lord Marrogwar - triggers.push_back(new TriggerNode("icc lm", - NextAction::array(0, new NextAction("icc lm tank position", ACTION_RAID + 5), - new NextAction("icc spike", ACTION_RAID + 3), nullptr))); - - //Lady Deathwhisper - triggers.push_back(new TriggerNode("icc dark reckoning", - NextAction::array(0, new NextAction("icc dark reckoning", ACTION_MOVE + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc lady deathwhisper", - NextAction::array(0, new NextAction("icc ranged position lady deathwhisper", ACTION_MOVE + 2), - new NextAction("icc adds lady deathwhisper", ACTION_RAID + 3), - new NextAction("icc shade lady deathwhisper", ACTION_RAID + 4), nullptr))); - - //Gunship Battle - triggers.push_back(new TriggerNode("icc rotting frost giant tank position", - NextAction::array(0, new NextAction("icc rotting frost giant tank position", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc gunship cannon near", - NextAction::array(0, new NextAction("icc gunship enter cannon", ACTION_RAID + 6), nullptr))); - - triggers.push_back( new TriggerNode("icc in cannon", - NextAction::array(0, new NextAction("icc cannon fire", ACTION_RAID+5), nullptr))); - - triggers.push_back(new TriggerNode("icc gunship teleport ally", - NextAction::array(0, new NextAction("icc gunship teleport ally", ACTION_RAID + 4), nullptr))); - - triggers.push_back(new TriggerNode("icc gunship teleport horde", - NextAction::array(0, new NextAction("icc gunship teleport horde", ACTION_RAID + 4), nullptr))); - - //DBS - triggers.push_back(new TriggerNode("icc dbs", - NextAction::array(0, new NextAction("icc dbs tank position", ACTION_RAID + 3), - new NextAction("icc adds dbs", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc dbs main tank rune of blood", - NextAction::array(0, new NextAction("taunt spell", ACTION_EMERGENCY + 4), nullptr))); - - //DOGS - triggers.push_back(new TriggerNode("icc stinky precious main tank mortal wound", - NextAction::array(0, new NextAction("taunt spell", ACTION_EMERGENCY + 4), nullptr))); - - //FESTERGUT - triggers.push_back(new TriggerNode("icc festergut group position", - NextAction::array(0, new NextAction("icc festergut group position", ACTION_MOVE + 4), nullptr))); - - triggers.push_back(new TriggerNode("icc festergut main tank gastric bloat", - NextAction::array(0, new NextAction("taunt spell", ACTION_EMERGENCY + 6), nullptr))); - - triggers.push_back(new TriggerNode("icc festergut spore", - NextAction::array(0, new NextAction("icc festergut spore", ACTION_MOVE + 5), nullptr))); - - //ROTFACE - triggers.push_back(new TriggerNode("icc rotface tank position", - NextAction::array(0, new NextAction("icc rotface tank position", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc rotface group position", - NextAction::array(0, new NextAction("icc rotface group position", ACTION_RAID + 6), nullptr))); - - triggers.push_back(new TriggerNode("icc rotface move away from explosion", - NextAction::array(0, new NextAction("icc rotface move away from explosion", ACTION_RAID +7), nullptr))); - - //PP - triggers.push_back(new TriggerNode("icc putricide volatile ooze", - NextAction::array(0, new NextAction("icc putricide volatile ooze", ACTION_RAID + 4), nullptr))); - - triggers.push_back(new TriggerNode("icc putricide gas cloud", - NextAction::array(0, new NextAction("icc putricide gas cloud", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc putricide growing ooze puddle", - NextAction::array(0, new NextAction("icc putricide growing ooze puddle", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("icc putricide main tank mutated plague", - NextAction::array(0, new NextAction("taunt spell", ACTION_RAID + 10), nullptr))); - - triggers.push_back(new TriggerNode("icc putricide malleable goo", - NextAction::array(0, new NextAction("icc putricide avoid malleable goo", ACTION_RAID + 2), nullptr))); - - //BPC - triggers.push_back(new TriggerNode("icc bpc keleseth tank", - NextAction::array(0, new NextAction("icc bpc keleseth tank", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("icc bpc main tank", - NextAction::array(0, new NextAction("icc bpc main tank", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("icc bpc empowered vortex", - NextAction::array(0, new NextAction("icc bpc empowered vortex", ACTION_RAID + 4), nullptr))); - - triggers.push_back(new TriggerNode("icc bpc kinetic bomb", - NextAction::array(0, new NextAction("icc bpc kinetic bomb", ACTION_RAID + 6), nullptr))); - - triggers.push_back(new TriggerNode("icc bpc ball of flame", - NextAction::array(0, new NextAction("icc bpc ball of flame", ACTION_RAID + 7), nullptr))); - - //BQL - triggers.push_back(new TriggerNode("icc bql group position", - NextAction::array(0, new NextAction("icc bql group position", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode("icc bql pact of darkfallen", - NextAction::array(0, new NextAction("icc bql pact of darkfallen", ACTION_RAID +1), nullptr))); - - triggers.push_back(new TriggerNode("icc bql vampiric bite", - NextAction::array(0, new NextAction("icc bql vampiric bite", ACTION_EMERGENCY + 5), nullptr))); - - //Sister Svalna - triggers.push_back(new TriggerNode("icc valkyre spear", - NextAction::array(0, new NextAction("icc valkyre spear", ACTION_EMERGENCY + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc sister svalna", - NextAction::array(0, new NextAction("icc sister svalna", ACTION_RAID + 5), nullptr))); - - //VDW - triggers.push_back(new TriggerNode("icc valithria group", - NextAction::array(0, new NextAction("icc valithria group", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("icc valithria portal", - NextAction::array(0, new NextAction("icc valithria portal", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc valithria heal", - NextAction::array(0, new NextAction("icc valithria heal", ACTION_RAID+2), nullptr))); - - triggers.push_back(new TriggerNode("icc valithria dream cloud", - NextAction::array(0, new NextAction("icc valithria dream cloud", ACTION_RAID + 4), nullptr))); - - //SINDRAGOSA - triggers.push_back(new TriggerNode("icc sindragosa group position", - NextAction::array(0, new NextAction("icc sindragosa group position", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa frost beacon", - NextAction::array(0, new NextAction("icc sindragosa frost beacon", ACTION_RAID + 5), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa blistering cold", - NextAction::array(0, new NextAction("icc sindragosa blistering cold", ACTION_EMERGENCY + 4), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa unchained magic", - NextAction::array(0, new NextAction("icc sindragosa unchained magic", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa chilled to the bone", - NextAction::array(0, new NextAction("icc sindragosa chilled to the bone", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa mystic buffet", - NextAction::array(0, new NextAction("icc sindragosa mystic buffet", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa main tank mystic buffet", - NextAction::array(0, new NextAction("taunt spell", ACTION_EMERGENCY + 3), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa frost bomb", - NextAction::array(0, new NextAction("icc sindragosa frost bomb", ACTION_RAID + 7), nullptr))); - - triggers.push_back(new TriggerNode("icc sindragosa tank swap position", - NextAction::array(0, new NextAction("icc sindragosa tank swap position", ACTION_EMERGENCY + 2), nullptr))); - - //LICH KING - triggers.push_back(new TriggerNode("icc lich king shadow trap", - NextAction::array(0, new NextAction("icc lich king shadow trap", ACTION_RAID + 6), nullptr))); - - triggers.push_back(new TriggerNode("icc lich king necrotic plague", - NextAction::array(0, new NextAction("icc lich king necrotic plague", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("icc lich king winter", - NextAction::array(0, new NextAction("icc lich king winter", ACTION_RAID +5), nullptr))); - - triggers.push_back(new TriggerNode("icc lich king adds", - NextAction::array(0, new NextAction("icc lich king adds", ACTION_RAID +2), nullptr))); -} - -void RaidIccStrategy::InitMultipliers(std::vector& multipliers) -{ - multipliers.push_back(new IccLadyDeathwhisperMultiplier(botAI)); - multipliers.push_back(new IccAddsDbsMultiplier(botAI)); - multipliers.push_back(new IccDogsMultiplier(botAI)); - multipliers.push_back(new IccFestergutMultiplier(botAI)); - multipliers.push_back(new IccRotfaceMultiplier(botAI)); - multipliers.push_back(new IccAddsPutricideMultiplier(botAI)); - multipliers.push_back(new IccBpcAssistMultiplier(botAI)); - multipliers.push_back(new IccBqlMultiplier(botAI)); - multipliers.push_back(new IccValithriaDreamCloudMultiplier(botAI)); - multipliers.push_back(new IccSindragosaMultiplier(botAI)); - multipliers.push_back(new IccLichKingAddsMultiplier(botAI)); -} diff --git a/src/strategy/raids/magtheridon/RaidMagtheridonStrategy.cpp b/src/strategy/raids/magtheridon/RaidMagtheridonStrategy.cpp deleted file mode 100644 index 27281dde84..0000000000 --- a/src/strategy/raids/magtheridon/RaidMagtheridonStrategy.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "RaidMagtheridonStrategy.h" -#include "RaidMagtheridonMultipliers.h" - -void RaidMagtheridonStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("magtheridon incoming blast nova", NextAction::array(0, - new NextAction("magtheridon use manticron cube", ACTION_EMERGENCY + 10), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon need to manage timers and assignments", NextAction::array(0, - new NextAction("magtheridon manage timers and assignments", ACTION_EMERGENCY + 1), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon burning abyssal spawned", NextAction::array(0, - new NextAction("magtheridon warlock cc burning abyssal", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon boss engaged by ranged", NextAction::array(0, - new NextAction("magtheridon spread ranged", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon pulling west and east channelers", NextAction::array(0, - new NextAction("magtheridon misdirect hellfire channelers", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon boss engaged by main tank", NextAction::array(0, - new NextAction("magtheridon main tank position boss", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon first three channelers engaged by main tank", NextAction::array(0, - new NextAction("magtheridon main tank attack first three channelers", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon nw channeler engaged by first assist tank", NextAction::array(0, - new NextAction("magtheridon first assist tank attack nw channeler", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon ne channeler engaged by second assist tank", NextAction::array(0, - new NextAction("magtheridon second assist tank attack ne channeler", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode("magtheridon determining kill order", NextAction::array(0, - new NextAction("magtheridon assign dps priority", ACTION_RAID + 1), nullptr))); -} - -void RaidMagtheridonStrategy::InitMultipliers(std::vector& multipliers) -{ - multipliers.push_back(new MagtheridonUseManticronCubeMultiplier(botAI)); - multipliers.push_back(new MagtheridonWaitToAttackMultiplier(botAI)); - multipliers.push_back(new MagtheridonDisableOffTankAssistMultiplier(botAI)); -} diff --git a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp b/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp deleted file mode 100644 index 59b7b24dbb..0000000000 --- a/src/strategy/raids/ulduar/RaidUlduarStrategy.cpp +++ /dev/null @@ -1,323 +0,0 @@ -#include "RaidUlduarStrategy.h" - -#include "RaidUlduarMultipliers.h" - -void RaidUlduarStrategy::InitTriggers(std::vector& triggers) -{ - // - // Flame Leviathan - // - triggers.push_back(new TriggerNode( - "flame leviathan vehicle near", - NextAction::array(0, new NextAction("flame leviathan enter vehicle", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "flame leviathan on vehicle", - NextAction::array(0, new NextAction("flame leviathan vehicle", ACTION_RAID + 1), nullptr))); - - // - // Razorscale - // - triggers.push_back(new TriggerNode( - "razorscale avoid devouring flames", - NextAction::array(0, new NextAction("razorscale avoid devouring flames", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale avoid sentinel", - NextAction::array(0, new NextAction("razorscale avoid sentinel", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale flying alone", - NextAction::array(0, new NextAction("razorscale ignore flying alone", ACTION_MOVE + 5), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale avoid whirlwind", - NextAction::array(0, new NextAction("razorscale avoid whirlwind", ACTION_RAID + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale grounded", - NextAction::array(0, new NextAction("razorscale grounded", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale harpoon trigger", - NextAction::array(0, new NextAction("razorscale harpoon action", ACTION_MOVE), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale fuse armor trigger", - NextAction::array(0, new NextAction("razorscale fuse armor action", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "razorscale fire resistance trigger", - NextAction::array(0, new NextAction("razorscale fire resistance action", ACTION_RAID), nullptr))); - - // - // Ignis - // - triggers.push_back(new TriggerNode( - "ignis fire resistance trigger", - NextAction::array(0, new NextAction("ignis fire resistance action", ACTION_RAID), nullptr))); - - // - // Iron Assembly - // - triggers.push_back(new TriggerNode( - "iron assembly lightning tendrils trigger", - NextAction::array(0, new NextAction("iron assembly lightning tendrils action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "iron assembly overload trigger", - NextAction::array(0, new NextAction("iron assembly overload action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "iron assembly rune of power trigger", - NextAction::array(0, new NextAction("iron assembly rune of power action", ACTION_RAID), nullptr))); - - // - // Kologarn - // - triggers.push_back(new TriggerNode( - "kologarn fall from floor trigger", - NextAction::array(0, new NextAction("kologarn fall from floor action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn rti target trigger", - NextAction::array(0, new NextAction("kologarn rti target action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn eyebeam trigger", - NextAction::array(0, new NextAction("kologarn eyebeam action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn attack dps target trigger", - NextAction::array(0, new NextAction("attack rti target", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn mark dps target trigger", - NextAction::array(0, new NextAction("kologarn mark dps target action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn nature resistance trigger", - NextAction::array(0, new NextAction("kologarn nature resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn rubble slowdown trigger", - NextAction::array(0, new NextAction("kologarn rubble slowdown action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "kologarn crunch armor trigger", - NextAction::array(0, new NextAction("kologarn crunch armor action", ACTION_RAID), nullptr))); - - // - // Auriaya - // - triggers.push_back(new TriggerNode( - "auriaya fall from floor trigger", - NextAction::array(0, new NextAction("auriaya fall from floor action", ACTION_RAID), nullptr))); - - // - // Hodir - // - triggers.push_back(new TriggerNode( - "hodir near snowpacked icicle", - NextAction::array(0, new NextAction("hodir move snowpacked icicle", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "hodir biting cold", - NextAction::array(0, new NextAction("hodir biting cold jump", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "hodir frost resistance trigger", - NextAction::array(0, new NextAction("hodir frost resistance action", ACTION_RAID), nullptr))); - - // - // Freya - // - triggers.push_back(new TriggerNode( - "freya near nature bomb", - NextAction::array(0, new NextAction("freya move away nature bomb", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "freya nature resistance trigger", - NextAction::array(0, new NextAction("freya nature resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "freya fire resistance trigger", - NextAction::array(0, new NextAction("freya fire resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "freya mark dps target trigger", - NextAction::array(0, new NextAction("freya mark dps target action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "freya move to healing spore trigger", - NextAction::array(0, new NextAction("freya move to healing spore action", ACTION_RAID), nullptr))); - - // - // Thorim - // - triggers.push_back(new TriggerNode( - "thorim nature resistance trigger", - NextAction::array(0, new NextAction("thorim nature resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim frost resistance trigger", - NextAction::array(0, new NextAction("thorim frost resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim unbalancing strike trigger", - NextAction::array(0, new NextAction("thorim unbalancing strike action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim mark dps target trigger", - NextAction::array(0, new NextAction("thorim mark dps target action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim gauntlet positioning trigger", - NextAction::array(0, new NextAction("thorim gauntlet positioning action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim arena positioning trigger", - NextAction::array(0, new NextAction("thorim arena positioning action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim fall from floor trigger", - NextAction::array(0, new NextAction("thorim fall from floor action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "thorim phase 2 positioning trigger", - NextAction::array(0, new NextAction("thorim phase 2 positioning action", ACTION_RAID), nullptr))); - - // - // Mimiron - // - triggers.push_back(new TriggerNode( - "mimiron p3wx2 laser barrage trigger", - NextAction::array(0, new NextAction("mimiron p3wx2 laser barrage action", ACTION_RAID + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron shock blast trigger", - NextAction::array(0, new NextAction("mimiron shock blast action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron fire resistance trigger", - NextAction::array(0, new NextAction("mimiron fire resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron phase 1 positioning trigger", - NextAction::array(0, new NextAction("mimiron phase 1 positioning action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron rapid burst trigger", - NextAction::array(0, new NextAction("mimiron rapid burst action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron aerial command unit trigger", - NextAction::array(0, new NextAction("mimiron aerial command unit action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron rocket strike trigger", - NextAction::array(0, new NextAction("mimiron rocket strike action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron phase 4 mark dps trigger", - NextAction::array(0, new NextAction("mimiron phase 4 mark dps action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "mimiron cheat trigger", - NextAction::array(0, new NextAction("mimiron cheat action", ACTION_RAID), nullptr))); - - // - // General Vezax - // - triggers.push_back(new TriggerNode( - "vezax cheat trigger", - NextAction::array(0, new NextAction("vezax cheat action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "vezax shadow crash trigger", - NextAction::array(0, new NextAction("vezax shadow crash action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "vezax mark of the faceless trigger", - NextAction::array(0, new NextAction("vezax mark of the faceless action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "vezax shadow resistance trigger", - NextAction::array(0, new NextAction("vezax shadow resistance action", ACTION_RAID), nullptr))); - - // - // Yogg-Saron - // - triggers.push_back(new TriggerNode( - "sara shadow resistance trigger", - NextAction::array(0, new NextAction("sara shadow resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron shadow resistance trigger", - NextAction::array(0, new NextAction("yogg-saron shadow resistance action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron ominous cloud cheat trigger", - NextAction::array(0, new NextAction("yogg-saron ominous cloud cheat action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron guardian positioning trigger", - NextAction::array(0, new NextAction("yogg-saron guardian positioning action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron sanity trigger", - NextAction::array(0, new NextAction("yogg-saron sanity action", ACTION_RAID + 1), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron death orb trigger", - NextAction::array(0, new NextAction("yogg-saron death orb action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron malady of the mind trigger", - NextAction::array(0, new NextAction("yogg-saron malady of the mind action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron mark target trigger", - NextAction::array(0, new NextAction("yogg-saron mark target action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron brain link trigger", - NextAction::array(0, new NextAction("yogg-saron brain link action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron move to enter portal trigger", - NextAction::array(0, new NextAction("yogg-saron move to enter portal action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron use portal trigger", - NextAction::array(0, new NextAction("yogg-saron use portal action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron fall from floor trigger", - NextAction::array(0, new NextAction("yogg-saron fall from floor action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron boss room movement cheat trigger", - NextAction::array(0, new NextAction("yogg-saron boss room movement cheat action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron illusion room trigger", - NextAction::array(0, new NextAction("yogg-saron illusion room action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron move to exit portal trigger", - NextAction::array(0, new NextAction("yogg-saron move to exit portal action", ACTION_RAID), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron lunatic gaze trigger", - NextAction::array(0, new NextAction("yogg-saron lunatic gaze action", ACTION_EMERGENCY), nullptr))); - - triggers.push_back(new TriggerNode( - "yogg-saron phase 3 positioning trigger", - NextAction::array(0, new NextAction("yogg-saron phase 3 positioning action", ACTION_RAID), nullptr))); -} - -void RaidUlduarStrategy::InitMultipliers(std::vector& multipliers) -{ - multipliers.push_back(new FlameLeviathanMultiplier(botAI)); -} diff --git a/src/strategy/rogue/AssassinationRogueStrategy.cpp b/src/strategy/rogue/AssassinationRogueStrategy.cpp deleted file mode 100644 index ab192713a8..0000000000 --- a/src/strategy/rogue/AssassinationRogueStrategy.cpp +++ /dev/null @@ -1,114 +0,0 @@ - -#include "AssassinationRogueStrategy.h" - -#include "Playerbots.h" - -class AssassinationRogueStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - AssassinationRogueStrategyActionNodeFactory() - { - creators["mutilate"] = &mutilate; - creators["envenom"] = &envenom; - creators["backstab"] = &backstab; - creators["rupture"] = &rupture; - } - -private: - static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mutilate", - /*P*/ NULL, - /*A*/ NextAction::array(0, new NextAction("backstab"), nullptr), - /*C*/ NULL); - } - static ActionNode* envenom([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("envenom", - /*P*/ NULL, - /*A*/ NextAction::array(0, new NextAction("rupture"), nullptr), - /*C*/ NULL); - } - static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("backstab", - /*P*/ NULL, - /*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr), - /*C*/ NULL); - } - static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rupture", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr), - /*C*/ nullptr); - } -}; - -AssassinationRogueStrategy::AssassinationRogueStrategy(PlayerbotAI* ai) : MeleeCombatStrategy(ai) -{ - actionNodeFactories.Add(new AssassinationRogueStrategyActionNodeFactory()); -} - -NextAction** AssassinationRogueStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("melee", ACTION_DEFAULT), NULL); -} - -void AssassinationRogueStrategy::InitTriggers(std::vector& triggers) -{ - MeleeCombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("high energy available", - NextAction::array(0, new NextAction("garrote", ACTION_HIGH + 7), - new NextAction("ambush", ACTION_HIGH + 6), nullptr))); - - triggers.push_back(new TriggerNode("high energy available", - NextAction::array(0, new NextAction("mutilate", ACTION_NORMAL + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "hunger for blood", NextAction::array(0, new NextAction("hunger for blood", ACTION_HIGH + 6), NULL))); - - triggers.push_back(new TriggerNode("slice and dice", - NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 5), NULL))); - - triggers.push_back(new TriggerNode("combo points 3 available", - NextAction::array(0, new NextAction("envenom", ACTION_HIGH + 5), - new NextAction("eviscerate", ACTION_HIGH + 3), nullptr))); - - triggers.push_back(new TriggerNode("target with combo points almost dead", - NextAction::array(0, new NextAction("envenom", ACTION_HIGH + 4), - new NextAction("eviscerate", ACTION_HIGH + 2), nullptr))); - - triggers.push_back( - new TriggerNode("expose armor", NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), NULL))); - - triggers.push_back( - new TriggerNode("medium threat", NextAction::array(0, new NextAction("vanish", ACTION_HIGH), NULL))); - - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_HIGH + 9), - new NextAction("feint", ACTION_HIGH + 8), nullptr))); - - triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("cloak of shadows", ACTION_HIGH + 7), nullptr))); - - triggers.push_back( - new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), NULL))); - - triggers.push_back( - new TriggerNode("kick on enemy healer", - NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), NULL))); - - triggers.push_back( - new TriggerNode("medium aoe", NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), NULL))); - - triggers.push_back(new TriggerNode( - "low tank threat", - NextAction::array(0, new NextAction("tricks of the trade on main tank", ACTION_HIGH + 7), NULL))); - - triggers.push_back(new TriggerNode( - "enemy out of melee", - NextAction::array(0, new NextAction("stealth", ACTION_HIGH + 3), new NextAction("sprint", ACTION_HIGH + 2), - new NextAction("reach melee", ACTION_HIGH + 1), NULL))); -} diff --git a/src/strategy/rogue/DpsRogueStrategy.cpp b/src/strategy/rogue/DpsRogueStrategy.cpp deleted file mode 100644 index a1e511df33..0000000000 --- a/src/strategy/rogue/DpsRogueStrategy.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "DpsRogueStrategy.h" - -#include "Playerbots.h" - -class DpsRogueStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - DpsRogueStrategyActionNodeFactory() - { - creators["mutilate"] = &mutilate; - creators["sinister strike"] = &sinister_strike; - creators["kick"] = &kick; - creators["kidney shot"] = &kidney_shot; - creators["backstab"] = &backstab; - creators["melee"] = &melee; - creators["rupture"] = &rupture; - } - -private: - static ActionNode* melee([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("melee", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr), - /*C*/ nullptr); - } - static ActionNode* mutilate([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("mutilate", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("sinister strike"), nullptr), - /*C*/ nullptr); - } - static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("sinister strike", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - static ActionNode* kick([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("kick", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("kidney shot"), nullptr), - /*C*/ nullptr); - } - static ActionNode* kidney_shot([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("kidney shot", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - static ActionNode* backstab([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("backstab", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("mutilate"), nullptr), - /*C*/ nullptr); - } - static ActionNode* rupture([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("rupture", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("eviscerate"), nullptr), - /*C*/ nullptr); - } -}; - -DpsRogueStrategy::DpsRogueStrategy(PlayerbotAI* botAI) : MeleeCombatStrategy(botAI) -{ - actionNodeFactories.Add(new DpsRogueStrategyActionNodeFactory()); -} - -NextAction** DpsRogueStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("killing spree", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void DpsRogueStrategy::InitTriggers(std::vector& triggers) -{ - MeleeCombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("high energy available", - NextAction::array(0, new NextAction("garrote", ACTION_HIGH + 7), - new NextAction("ambush", ACTION_HIGH + 6), nullptr))); - - triggers.push_back(new TriggerNode( - "high energy available", NextAction::array(0, new NextAction("sinister strike", ACTION_NORMAL + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "slice and dice", NextAction::array(0, new NextAction("slice and dice", ACTION_HIGH + 2), nullptr))); - - triggers.push_back(new TriggerNode("combo points available", - NextAction::array(0, new NextAction("rupture", ACTION_HIGH + 1), - new NextAction("eviscerate", ACTION_HIGH), nullptr))); - - triggers.push_back(new TriggerNode("target with combo points almost dead", - NextAction::array(0, new NextAction("eviscerate", ACTION_HIGH + 2), nullptr))); - - triggers.push_back( - new TriggerNode("medium threat", NextAction::array(0, new NextAction("vanish", ACTION_HIGH), nullptr))); - - triggers.push_back( - new TriggerNode("low health", NextAction::array(0, new NextAction("evasion", ACTION_HIGH + 9), - new NextAction("feint", ACTION_HIGH + 8), nullptr))); - - triggers.push_back(new TriggerNode( - "critical health", NextAction::array(0, new NextAction("cloak of shadows", ACTION_HIGH + 7), nullptr))); - - triggers.push_back( - new TriggerNode("kick", NextAction::array(0, new NextAction("kick", ACTION_INTERRUPT + 2), nullptr))); - - triggers.push_back( - new TriggerNode("kick on enemy healer", - NextAction::array(0, new NextAction("kick on enemy healer", ACTION_INTERRUPT + 1), nullptr))); - - // triggers.push_back(new TriggerNode( - // "behind target", - // NextAction::array(0, new NextAction("backstab", ACTION_NORMAL), nullptr))); - - triggers.push_back( - new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 3), nullptr))); - - triggers.push_back(new TriggerNode("blade flurry", - NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH + 2), nullptr))); - - triggers.push_back(new TriggerNode( - "enemy out of melee", - NextAction::array(0, new NextAction("stealth", ACTION_HIGH + 3), new NextAction("sprint", ACTION_HIGH + 2), - new NextAction("reach melee", ACTION_HIGH + 1), nullptr))); - - triggers.push_back(new TriggerNode("expose armor", - NextAction::array(0, new NextAction("expose armor", ACTION_HIGH + 3), nullptr))); - - triggers.push_back(new TriggerNode( - "low tank threat", - NextAction::array(0, new NextAction("tricks of the trade on main tank", ACTION_HIGH + 7), nullptr))); -} - -class StealthedRogueStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - StealthedRogueStrategyActionNodeFactory() - { - creators["ambush"] = &ambush; - creators["cheap shot"] = &cheap_shot; - creators["garrote"] = &garrote; - creators["sap"] = &sap; - creators["sinister strike"] = &sinister_strike; - } - -private: - static ActionNode* ambush([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("ambush", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("garrote"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* cheap_shot([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("cheap shot", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* garrote([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("garrote", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* sap([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("sap", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* sinister_strike([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("sinister strike", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("cheap shot"), nullptr), - /*C*/ nullptr); - } -}; - -StealthedRogueStrategy::StealthedRogueStrategy(PlayerbotAI* botAI) : Strategy(botAI) -{ - actionNodeFactories.Add(new StealthedRogueStrategyActionNodeFactory()); -} - -NextAction** StealthedRogueStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("ambush", ACTION_NORMAL + 4), new NextAction("backstab", ACTION_NORMAL + 3), - new NextAction("cheap shot", ACTION_NORMAL + 2), new NextAction("sinister strike", ACTION_NORMAL + 1), - new NextAction("melee", ACTION_NORMAL), nullptr); -} - -void StealthedRogueStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("combo points available", - NextAction::array(0, new NextAction("eviscerate", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("kick", NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode("kick on enemy healer", - NextAction::array(0, new NextAction("cheap shot", ACTION_INTERRUPT), nullptr))); - triggers.push_back( - new TriggerNode("behind target", NextAction::array(0, new NextAction("ambush", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("not behind target", NextAction::array(0, new NextAction("cheap shot", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("enemy flagcarrier near", - NextAction::array(0, new NextAction("sprint", ACTION_EMERGENCY + 1), nullptr))); - triggers.push_back( - new TriggerNode("unstealth", NextAction::array(0, new NextAction("unstealth", ACTION_NORMAL), nullptr))); - /*triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("food", ACTION_EMERGENCY + - * 1), nullptr)));*/ - triggers.push_back(new TriggerNode( - "no stealth", NextAction::array(0, new NextAction("check stealth", ACTION_EMERGENCY), nullptr))); - triggers.push_back( - new TriggerNode("sprint", NextAction::array(0, new NextAction("sprint", ACTION_INTERRUPT), nullptr))); -} - -void StealthStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("stealth", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT), nullptr))); -} - -void RogueAoeStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("light aoe", NextAction::array(0, new NextAction("blade flurry", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode( - "medium aoe", NextAction::array(0, new NextAction("fan of knives", ACTION_NORMAL + 5), nullptr))); -} - -void RogueBoostStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode( - "adrenaline rush", NextAction::array(0, new NextAction("adrenaline rush", ACTION_HIGH + 2), nullptr))); -} - -void RogueCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("sap", NextAction::array(0, new NextAction("stealth", ACTION_INTERRUPT), - new NextAction("sap", ACTION_INTERRUPT), nullptr))); -} diff --git a/src/strategy/rpg/NewRpgStrategy.cpp b/src/strategy/rpg/NewRpgStrategy.cpp deleted file mode 100644 index 019b0c6b80..0000000000 --- a/src/strategy/rpg/NewRpgStrategy.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "NewRpgStrategy.h" - -#include "Playerbots.h" - -NewRpgStrategy::NewRpgStrategy(PlayerbotAI* botAI) : Strategy(botAI) {} - -NextAction** NewRpgStrategy::getDefaultActions() -{ - // the releavance should be greater than grind - return NextAction::array(0, - new NextAction("new rpg status update", 11.0f), - nullptr); -} - -void NewRpgStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back( - new TriggerNode("go grind status", NextAction::array(0, new NextAction("new rpg go grind", 3.0f), nullptr))); - - triggers.push_back( - new TriggerNode("go camp status", NextAction::array(0, new NextAction("new rpg go camp", 3.0f), nullptr))); - - triggers.push_back( - new TriggerNode("wander random status", NextAction::array(0, new NextAction("new rpg wander random", 3.0f), nullptr))); - - triggers.push_back( - new TriggerNode("wander npc status", NextAction::array(0, new NextAction("new rpg wander npc", 3.0f), nullptr))); - - triggers.push_back( - new TriggerNode("do quest status", NextAction::array(0, new NextAction("new rpg do quest", 3.0f), nullptr))); - - triggers.push_back( - new TriggerNode("travel flight status", NextAction::array(0, new NextAction("new rpg travel flight", 3.0f), nullptr))); -} - -void NewRpgStrategy::InitMultipliers(std::vector& multipliers) -{ - // multipliers.push_back(new RpgActionMultiplier(botAI)); -} diff --git a/src/strategy/shaman/EnhancementShamanStrategy.cpp b/src/strategy/shaman/EnhancementShamanStrategy.cpp deleted file mode 100644 index c38b040960..0000000000 --- a/src/strategy/shaman/EnhancementShamanStrategy.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "EnhancementShamanStrategy.h" - -#include "Playerbots.h" - -// ===== Action Node Factory ===== -class EnhancementShamanStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - EnhancementShamanStrategyActionNodeFactory() - { - creators["stormstrike"] = &stormstrike; - creators["lava lash"] = &lava_lash; - creators["feral spirit"] = &feral_spirit; - creators["lightning bolt"] = &lightning_bolt; - creators["earth shock"] = &earth_shock; - creators["flame shock"] = &flame_shock; - creators["shamanistic rage"] = &shamanistic_rage; - creators["call of the elements"] = &call_of_the_elements; - creators["lightning shield"] = &lightning_shield; - } - -private: - static ActionNode* stormstrike(PlayerbotAI*) { return new ActionNode("stormstrike", nullptr, nullptr, nullptr); } - static ActionNode* lava_lash([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("lava lash", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("melee"), nullptr), - /*C*/ nullptr); - } - static ActionNode* feral_spirit(PlayerbotAI*) { return new ActionNode("feral spirit", nullptr, nullptr, nullptr); } - static ActionNode* lightning_bolt(PlayerbotAI*) { return new ActionNode("lightning bolt", nullptr, nullptr, nullptr); } - static ActionNode* earth_shock(PlayerbotAI*) { return new ActionNode("earth shock", nullptr, nullptr, nullptr); } - static ActionNode* flame_shock(PlayerbotAI*) { return new ActionNode("flame shock", nullptr, nullptr, nullptr); } - static ActionNode* shamanistic_rage(PlayerbotAI*) { return new ActionNode("shamanistic rage", nullptr, nullptr, nullptr); } - static ActionNode* call_of_the_elements(PlayerbotAI*) { return new ActionNode("call of the elements", nullptr, nullptr, nullptr); } - static ActionNode* lightning_shield(PlayerbotAI*) { return new ActionNode("lightning shield", nullptr, nullptr, nullptr); } -}; - -// ===== Single Target Strategy ===== -EnhancementShamanStrategy::EnhancementShamanStrategy(PlayerbotAI* botAI) : GenericShamanStrategy(botAI) -{ - actionNodeFactories.Add(new EnhancementShamanStrategyActionNodeFactory()); -} - -// ===== Default Actions ===== -NextAction** EnhancementShamanStrategy::getDefaultActions() -{ - return NextAction::array(0, - new NextAction("stormstrike", 5.5f), - new NextAction("feral spirit", 5.4f), - new NextAction("earth shock", 5.3f), - new NextAction("lava lash", 5.2f), - new NextAction("melee", 5.0f), NULL); -} - -// ===== Trigger Initialization === -void EnhancementShamanStrategy::InitTriggers(std::vector& triggers) -{ - GenericShamanStrategy::InitTriggers(triggers); - - // Totem Trigger - triggers.push_back(new TriggerNode("call of the elements and enemy within melee", NextAction::array(0, new NextAction("call of the elements", 60.0f), nullptr))); - - // Spirit Walk Trigger - triggers.push_back(new TriggerNode("spirit walk ready", NextAction::array(0, new NextAction("spirit walk", 50.0f), nullptr))); - - // Damage Triggers - triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("maelstrom weapon 5", NextAction::array(0, new NextAction("lightning bolt", 20.0f), nullptr))); - triggers.push_back(new TriggerNode("maelstrom weapon 4", NextAction::array(0, new NextAction("lightning bolt", 19.5f), nullptr))); - triggers.push_back(new TriggerNode("flame shock", NextAction::array(0, new NextAction("flame shock", 19.0f), nullptr))); - triggers.push_back(new TriggerNode("lightning shield", NextAction::array(0, new NextAction("lightning shield", 18.5f), nullptr))); - - // Health/Mana Triggers - triggers.push_back(new TriggerNode("medium mana", NextAction::array(0, new NextAction("shamanistic rage", 23.0f), nullptr))); - triggers.push_back(new TriggerNode("low health", NextAction::array(0, new NextAction("shamanistic rage", 23.0f), nullptr))); -} diff --git a/src/strategy/shaman/ShamanNonCombatStrategy.cpp b/src/strategy/shaman/ShamanNonCombatStrategy.cpp deleted file mode 100644 index 623b013e44..0000000000 --- a/src/strategy/shaman/ShamanNonCombatStrategy.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "ShamanNonCombatStrategy.h" -#include "AiFactory.h" -#include "Strategy.h" -#include "Playerbots.h" - -class ShamanNonCombatStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - ShamanNonCombatStrategyActionNodeFactory() - { - creators["flametongue weapon"] = &flametongue_weapon; - creators["frostbrand weapon"] = &frostbrand_weapon; - creators["windfury weapon"] = &windfury_weapon; - creators["earthliving weapon"] = &earthliving_weapon; - creators["wind shear"] = &wind_shear; - creators["purge"] = &purge; - } - -private: - static ActionNode* flametongue_weapon([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("flametongue weapon", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("rockbiter weapon"), nullptr), - /*C*/ nullptr); - } - static ActionNode* frostbrand_weapon([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("frostbrand weapon", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("flametongue weapon"), nullptr), - /*C*/ nullptr); - } - static ActionNode* windfury_weapon([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("windfury weapon", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("flametongue weapon"), nullptr), - /*C*/ nullptr); - } - static ActionNode* earthliving_weapon([[maybe_unused]] PlayerbotAI* botAI) - { - return new ActionNode("earthliving weapon", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("flametongue weapon"), nullptr), - /*C*/ nullptr); - } - static ActionNode* wind_shear(PlayerbotAI*) { return new ActionNode("wind shear", nullptr, nullptr, nullptr); } - static ActionNode* purge(PlayerbotAI*) { return new ActionNode("purge", nullptr, nullptr, nullptr); } -}; - -ShamanNonCombatStrategy::ShamanNonCombatStrategy(PlayerbotAI* botAI) : NonCombatStrategy(botAI) -{ - actionNodeFactories.Add(new ShamanNonCombatStrategyActionNodeFactory()); -} - -void ShamanNonCombatStrategy::InitTriggers(std::vector& triggers) -{ - NonCombatStrategy::InitTriggers(triggers); - - // Totemic Recall - triggers.push_back(new TriggerNode("totemic recall", NextAction::array(0, new NextAction("totemic recall", 60.0f), nullptr))); - - // Healing/Resurrect Triggers - triggers.push_back(new TriggerNode("party member dead", NextAction::array(0, new NextAction("ancestral spirit", ACTION_CRITICAL_HEAL + 10), nullptr))); - triggers.push_back(new TriggerNode("party member critical health", NextAction::array(0, - new NextAction("riptide on party", 31.0f), - new NextAction("healing wave on party", 30.0f), NULL))); - triggers.push_back(new TriggerNode("party member low health",NextAction::array(0, - new NextAction("riptide on party", 29.0f), - new NextAction("healing wave on party", 28.0f), NULL))); - triggers.push_back(new TriggerNode("party member medium health",NextAction::array(0, - new NextAction("riptide on party", 27.0f), - new NextAction("healing wave on party", 26.0f), NULL))); - triggers.push_back(new TriggerNode("party member almost full health",NextAction::array(0, - new NextAction("riptide on party", 25.0f), - new NextAction("lesser healing wave on party", 24.0f), NULL))); - triggers.push_back(new TriggerNode("group heal setting",NextAction::array(0, new NextAction("chain heal on party", 27.0f), NULL))); - - // Cure Triggers - triggers.push_back(new TriggerNode("cure poison", NextAction::array(0, new NextAction("cure poison", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cure poison", NextAction::array(0, new NextAction("cure poison on party", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("cure disease", NextAction::array(0, new NextAction("cure disease", 31.0f), nullptr))); - triggers.push_back(new TriggerNode("party member cure disease", NextAction::array(0, new NextAction("cure disease on party", 30.0f), nullptr))); - - // Out of Combat Buff Triggers - Player* bot = botAI->GetBot(); - int tab = AiFactory::GetPlayerSpecTab(bot); - - if (tab == 0) // Elemental - { - triggers.push_back(new TriggerNode("main hand weapon no imbue", NextAction::array(0, new NextAction("flametongue weapon", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("water shield", NextAction::array(0, new NextAction("water shield", 21.0f), nullptr))); - } - else if (tab == 1) // Enhancement - { - triggers.push_back(new TriggerNode("main hand weapon no imbue", NextAction::array(0, new NextAction("windfury weapon", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("off hand weapon no imbue", NextAction::array(0, new NextAction("flametongue weapon", 21.0f), nullptr))); - triggers.push_back(new TriggerNode("lightning shield", NextAction::array(0, new NextAction("lightning shield", 20.0f), nullptr))); - } - else if (tab == 2) // Restoration - { - triggers.push_back(new TriggerNode("main hand weapon no imbue",NextAction::array(0, new NextAction("earthliving weapon", 22.0f), nullptr))); - triggers.push_back(new TriggerNode("water shield", NextAction::array(0, new NextAction("water shield", 20.0f), nullptr))); - } - - // Buff Triggers while swimming - triggers.push_back(new TriggerNode("water breathing", NextAction::array(0, new NextAction("water breathing", 12.0f), nullptr))); - triggers.push_back(new TriggerNode("water walking", NextAction::array(0, new NextAction("water walking", 12.0f), nullptr))); - triggers.push_back(new TriggerNode("water breathing on party", NextAction::array(0, new NextAction("water breathing on party", 11.0f), nullptr))); - triggers.push_back(new TriggerNode("water walking on party", NextAction::array(0, new NextAction("water walking on party", 11.0f), nullptr))); - - // Pet Triggers - triggers.push_back(new TriggerNode("has pet", NextAction::array(0, new NextAction("toggle pet spell", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("new pet", NextAction::array(0, new NextAction("set pet stance", 65.0f), nullptr))); -} - -void ShamanNonCombatStrategy::InitMultipliers(std::vector& multipliers) -{ - NonCombatStrategy::InitMultipliers(multipliers); -} diff --git a/src/strategy/warlock/GenericWarlockStrategy.cpp b/src/strategy/warlock/GenericWarlockStrategy.cpp deleted file mode 100644 index dfa704ff58..0000000000 --- a/src/strategy/warlock/GenericWarlockStrategy.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericWarlockStrategy.h" -#include "Strategy.h" -#include "Playerbots.h" - -class GenericWarlockStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - GenericWarlockStrategyActionNodeFactory() - { - creators["banish on cc"] = &banish_on_cc; - creators["fear on cc"] = &fear_on_cc; - creators["spell lock"] = &spell_lock; - creators["devour magic purge"] = &devour_magic_purge; - creators["devour magic cleanse"] = &devour_magic_cleanse; - } - -private: - static ActionNode* banish_on_cc(PlayerbotAI*) { return new ActionNode("banish on cc", nullptr, nullptr, nullptr); } - static ActionNode* fear_on_cc(PlayerbotAI*) { return new ActionNode("fear on cc", nullptr, nullptr, nullptr); } - static ActionNode* spell_lock(PlayerbotAI*) { return new ActionNode("spell lock", nullptr, nullptr, nullptr); } - static ActionNode* devour_magic_purge(PlayerbotAI*) { return new ActionNode("devour magic purge", nullptr, nullptr, nullptr); } - static ActionNode* devour_magic_cleanse(PlayerbotAI*) { return new ActionNode("devour magic cleanse", nullptr, nullptr, nullptr); } -}; - -GenericWarlockStrategy::GenericWarlockStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - actionNodeFactories.Add(new GenericWarlockStrategyActionNodeFactory()); -} - -NextAction** GenericWarlockStrategy::getDefaultActions() { return NextAction::array(0, nullptr); } - -void GenericWarlockStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("low mana", NextAction::array(0, new NextAction("life tap", 95.0f), nullptr))); - triggers.push_back(new TriggerNode("medium threat", NextAction::array(0, new NextAction("soulshatter", 55.0f), nullptr))); - triggers.push_back(new TriggerNode("spell lock", NextAction::array(0, new NextAction("spell lock", 40.0f), nullptr))); - triggers.push_back(new TriggerNode("no soul shard", NextAction::array(0, new NextAction("create soul shard", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("too many soul shards", NextAction::array(0, new NextAction("destroy soul shard", 60.0f), nullptr))); - triggers.push_back(new TriggerNode("devour magic purge", NextAction::array(0, new NextAction("devour magic purge", 50.0f), nullptr))); - triggers.push_back(new TriggerNode("devour magic cleanse", NextAction::array(0, new NextAction("devour magic cleanse", 50.0f), nullptr))); -} - -// ===== AoE Strategy, 3+ enemies ===== - -void AoEWarlockStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, - new NextAction("immolation aura", 26.0f), - new NextAction("shadowfury", 23.0f), - new NextAction("shadowflame", 22.5f), - new NextAction("seed of corruption on attacker", 22.0f), - new NextAction("seed of corruption", 21.5f), - new NextAction("rain of fire", 21.0f), nullptr))); - - triggers.push_back( - new TriggerNode("rain of fire channel check", NextAction::array(0, new NextAction("cancel channel", 21.5f), nullptr))); -} - -void WarlockBoostStrategy::InitTriggers(std::vector& triggers) -{ - // Placeholder for future boost triggers -} - -void WarlockPetStrategy::InitTriggers(std::vector& triggers) -{ - // Placeholder for future pet triggers -} - -void WarlockCcStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("banish", NextAction::array(0, new NextAction("banish on cc", 33.0f), nullptr))); - triggers.push_back(new TriggerNode("fear", NextAction::array(0, new NextAction("fear on cc", 32.0f), nullptr))); -} - -// Combat strategy for using Curse of Agony -// Enabled by default for the Affliction spec -// To enable, type "co +curse of agony" -// To disable, type "co -curse of agony" -void WarlockCurseOfAgonyStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of agony on attacker", NextAction::array(0, new NextAction("curse of agony on attacker", 18.5f), nullptr))); - triggers.push_back(new TriggerNode("curse of agony", NextAction::array(0, new NextAction("curse of agony", 17.0f), nullptr))); -} - -// Combat strategy for using Curse of the Elements -// Enabled by default for the Destruction spec -// To enable, type "co +curse of elements" -// To disable, type "co -curse of elements" -void WarlockCurseOfTheElementsStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of the elements", NextAction::array(0, new NextAction("curse of the elements", 29.0f), nullptr))); -} - -// Combat strategy for using Curse of Doom -// Disabled by default -// To enable, type "co +curse of doom" -// To disable, type "co -curse of doom" -void WarlockCurseOfDoomStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of doom", NextAction::array(0, new NextAction("curse of doom", 29.0f), nullptr))); -} - -// Combat strategy for using Curse of Exhaustion -// Disabled by default -// To enable, type "co +curse of exhaustion" -// To disable, type "co -curse of exhaustion" -void WarlockCurseOfExhaustionStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of exhaustion", NextAction::array(0, new NextAction("curse of exhaustion", 29.0f), nullptr))); -} - -// Combat strategy for using Curse of Tongues -// Disabled by default -// To enable, type "co +curse of tongues" -// To disable, type "co -curse of tongues" -void WarlockCurseOfTonguesStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of tongues", NextAction::array(0, new NextAction("curse of tongues", 29.0f), nullptr))); -} - -// Combat strategy for using Curse of Weakness -// Disabled by default -// To enable, type "co +curse of weakness" -// To disable, type "co -curse of weakness" -void WarlockCurseOfWeaknessStrategy::InitTriggers(std::vector& triggers) -{ - triggers.push_back(new TriggerNode("curse of weakness", NextAction::array(0, new NextAction("curse of weakness", 29.0f), nullptr))); -} diff --git a/src/strategy/warrior/ArmsWarriorStrategy.cpp b/src/strategy/warrior/ArmsWarriorStrategy.cpp deleted file mode 100644 index ca96758337..0000000000 --- a/src/strategy/warrior/ArmsWarriorStrategy.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "ArmsWarriorStrategy.h" - -#include "Playerbots.h" - -class ArmsWarriorStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - ArmsWarriorStrategyActionNodeFactory() - { - creators["charge"] = &charge; - creators["death wish"] = &death_wish; - creators["piercing howl"] = &piercing_howl; - creators["mocking blow"] = &mocking_blow; - creators["heroic strike"] = &heroic_strike; - creators["enraged regeneration"] = &enraged_regeneration; - creators["retaliation"] = &retaliation; - creators["shattering throw"] = &shattering_throw; - } - -private: - ACTION_NODE_A(charge, "charge", "reach melee"); - ACTION_NODE_A(death_wish, "death wish", "bloodrage"); - ACTION_NODE_A(piercing_howl, "piercing howl", "mocking blow"); - ACTION_NODE_A(mocking_blow, "mocking blow", "hamstring"); - ACTION_NODE_A(heroic_strike, "heroic strike", "melee"); - - static ActionNode* enraged_regeneration(PlayerbotAI* botAI) - { - return new ActionNode("enraged regeneration", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* retaliation(PlayerbotAI* botAI) - { - return new ActionNode("retaliation", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* shattering_throw(PlayerbotAI* botAI) - { - return new ActionNode("shattering throw", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -ArmsWarriorStrategy::ArmsWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) -{ - actionNodeFactories.Add(new ArmsWarriorStrategyActionNodeFactory()); -} - -NextAction** ArmsWarriorStrategy::getDefaultActions() -{ - return NextAction::array(0, new NextAction("bladestorm", ACTION_DEFAULT + 0.2f), - new NextAction("mortal strike", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), nullptr); -} - -void ArmsWarriorStrategy::InitTriggers(std::vector& triggers) -{ - GenericWarriorStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("enemy out of melee", - NextAction::array(0, new NextAction("charge", ACTION_MOVE + 10), nullptr))); - - triggers.push_back(new TriggerNode("battle stance", - NextAction::array(0, new NextAction("battle stance", ACTION_HIGH + 10), nullptr))); - - triggers.push_back(new TriggerNode("battle shout", - NextAction::array(0, new NextAction("battle shout", ACTION_HIGH + 9), nullptr))); - - triggers.push_back(new TriggerNode("rend", - NextAction::array(0, new NextAction("rend", ACTION_HIGH + 8), nullptr))); - - triggers.push_back(new TriggerNode("rend on attacker", - NextAction::array(0, new NextAction("rend on attacker", ACTION_HIGH + 8), nullptr))); - - triggers.push_back(new TriggerNode("mortal strike", - NextAction::array(0, new NextAction("mortal strike", ACTION_HIGH + 3), nullptr))); - - triggers.push_back(new TriggerNode("target critical health", - NextAction::array(0, new NextAction("execute", ACTION_HIGH + 5), nullptr))); - - triggers.push_back(new TriggerNode("sudden death", - NextAction::array(0, new NextAction("execute", ACTION_HIGH + 5), nullptr))); - - triggers.push_back(new TriggerNode("hamstring", - NextAction::array(0, new NextAction("piercing howl", ACTION_HIGH), nullptr))); - - triggers.push_back(new TriggerNode("overpower", - NextAction::array(0, new NextAction("overpower", ACTION_HIGH + 4), nullptr))); - - triggers.push_back(new TriggerNode("taste for blood", - NextAction::array(0, new NextAction("overpower", ACTION_HIGH + 4), nullptr))); - - triggers.push_back(new TriggerNode("victory rush", - NextAction::array(0, new NextAction("victory rush", ACTION_INTERRUPT), nullptr))); - - triggers.push_back(new TriggerNode("high rage available", - NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH), - new NextAction("slam", ACTION_HIGH + 1), - nullptr))); - // triggers.push_back(new TriggerNode("medium rage available", - // NextAction::array(0, new NextAction("slam", ACTION_HIGH + 1), - // new NextAction("thunder clap", ACTION_HIGH), - // 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("critical health", - NextAction::array(0, new NextAction("intimidating shout", ACTION_EMERGENCY), nullptr))); - - triggers.push_back(new TriggerNode("medium health", - NextAction::array(0, new NextAction("enraged regeneration", ACTION_EMERGENCY), nullptr))); - - triggers.push_back(new TriggerNode("almost full health", - NextAction::array(0, new NextAction("retaliation", ACTION_EMERGENCY + 1), nullptr))); - - triggers.push_back(new TriggerNode("shattering throw trigger", - NextAction::array(0, new NextAction("shattering throw", ACTION_INTERRUPT + 1), nullptr))); - - // triggers.push_back(new TriggerNode("medium aoe", - // NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 2), nullptr))); - /* - triggers.push_back(new TriggerNode("medium aoe", - NextAction::array(0, new NextAction("sweeping strikes", ACTION_HIGH + 7), - new NextAction("bladestorm", ACTION_HIGH + 6), - nullptr))); - */ -} diff --git a/src/strategy/warrior/FuryWarriorStrategy.cpp b/src/strategy/warrior/FuryWarriorStrategy.cpp deleted file mode 100644 index 0ab7f589dc..0000000000 --- a/src/strategy/warrior/FuryWarriorStrategy.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "FuryWarriorStrategy.h" - -#include "Playerbots.h" - -class FuryWarriorStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - FuryWarriorStrategyActionNodeFactory() - { - creators["charge"] = &charge; - creators["intercept"] = &intercept; - // creators["death wish"] = &death_wish; - creators["piercing howl"] = &piercing_howl; - // creators["bloodthirst"] = &bloodthirst; - creators["pummel"] = &pummel; - creators["enraged regeneration"] = &enraged_regeneration; - } - -private: - ACTION_NODE_A(charge, "charge", "intercept"); - ACTION_NODE_A(intercept, "intercept", "reach melee"); - ACTION_NODE_A(piercing_howl, "piercing howl", "hamstring"); - // ACTION_NODE_A(death_wish, "death wish", "berserker rage"); - // ACTION_NODE_A(bloodthirst, "bloodthirst", "melee"); - ACTION_NODE_A(pummel, "pummel", "intercept"); - - static ActionNode* enraged_regeneration(PlayerbotAI* botAI) - { - return new ActionNode("enraged regeneration", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -FuryWarriorStrategy::FuryWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) -{ - actionNodeFactories.Add(new FuryWarriorStrategyActionNodeFactory()); -} - -NextAction** FuryWarriorStrategy::getDefaultActions() -{ - return NextAction::array( - 0, new NextAction("bloodthirst", ACTION_DEFAULT + 0.5f), new NextAction("whirlwind", ACTION_DEFAULT + 0.4f), - new NextAction("sunder armor", ACTION_DEFAULT + 0.3f), new NextAction("execute", ACTION_DEFAULT + 0.2f), - // new NextAction("overpower", ACTION_DEFAULT + 0.1f), - new NextAction("melee", ACTION_DEFAULT), NULL); -} - -void FuryWarriorStrategy::InitTriggers(std::vector& triggers) -{ - GenericWarriorStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode("enemy out of melee", - NextAction::array(0, new NextAction("charge", ACTION_MOVE + 9), nullptr))); - triggers.push_back(new TriggerNode( - "berserker stance", NextAction::array(0, new NextAction("berserker stance", ACTION_HIGH + 9), nullptr))); - triggers.push_back(new TriggerNode("battle shout", - NextAction::array(0, new NextAction("battle shout", ACTION_HIGH + 8), nullptr))); - // triggers.push_back(new TriggerNode("target critical health", NextAction::array(0, new NextAction("execute", - // ACTION_HIGH + 4), nullptr))); triggers.push_back(new TriggerNode("sudden death", NextAction::array(0, new - // NextAction("execute", ACTION_HIGH + 4), nullptr))); triggers.push_back(new TriggerNode("hamstring", - // NextAction::array(0, new NextAction("piercing howl", ACTION_HIGH + 1), nullptr))); - triggers.push_back( - new TriggerNode("pummel on enemy healer", - NextAction::array(0, new NextAction("pummel on enemy healer", ACTION_INTERRUPT), nullptr))); - triggers.push_back( - new TriggerNode("pummel", NextAction::array(0, new NextAction("pummel", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "victory rush", NextAction::array(0, new NextAction("victory rush", ACTION_INTERRUPT), nullptr))); - // triggers.push_back(new TriggerNode("intercept on snare target", NextAction::array(0, new NextAction("intercept on - // snare target", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("bloodthirst", NextAction::array(0, new NextAction("bloodthirst", ACTION_HIGH + 7), nullptr))); - triggers.push_back( - new TriggerNode("whirlwind", NextAction::array(0, new NextAction("whirlwind", ACTION_HIGH + 6), nullptr))); - triggers.push_back( - new TriggerNode("instant slam", NextAction::array(0, new NextAction("slam", ACTION_HIGH + 5), nullptr))); - triggers.push_back( - new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode("medium rage available", - NextAction::array(0, new NextAction("heroic strike", ACTION_DEFAULT + 0.1f), NULL))); - // triggers.push_back(new TriggerNode("berserker rage", NextAction::array(0, new NextAction("berserker rage", - // ACTION_HIGH + 2), nullptr))); triggers.push_back(new TriggerNode("light aoe", NextAction::array(0, - // new NextAction("whirlwind", ACTION_HIGH + 2), - // nullptr))); - - triggers.push_back( - new TriggerNode("death wish", NextAction::array(0, new NextAction("death wish", ACTION_HIGH), nullptr))); - triggers.push_back( - new TriggerNode("recklessness", NextAction::array(0, new NextAction("recklessness", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("critical health", - NextAction::array(0, new NextAction("enraged regeneration", ACTION_EMERGENCY), nullptr))); -} diff --git a/src/strategy/warrior/GenericWarriorStrategy.cpp b/src/strategy/warrior/GenericWarriorStrategy.cpp deleted file mode 100644 index 7cb8bb15f7..0000000000 --- a/src/strategy/warrior/GenericWarriorStrategy.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "GenericWarriorStrategy.h" - -#include "Playerbots.h" - -GenericWarriorStrategy::GenericWarriorStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - // actionNodeFactories.Add(new WarriorStanceRequirementActionNodeFactory()); -} - -void GenericWarriorStrategy::InitTriggers(std::vector& triggers) -{ - CombatStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode( - "enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_HIGH + 1), nullptr))); - /*triggers.push_back(new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 1), - nullptr))); triggers.push_back(new TriggerNode("shield bash", NextAction::array(0, new NextAction("shield bash", - ACTION_INTERRUPT + 4), nullptr))); triggers.push_back(new TriggerNode("shield bash on enemy healer", - NextAction::array(0, new NextAction("shield bash on enemy healer", ACTION_INTERRUPT + 3), nullptr))); - triggers.push_back(new TriggerNode("critical health", NextAction::array(0, new NextAction("intimidating shout", - ACTION_EMERGENCY), nullptr)));*/ -} - -class WarrirorAoeStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - WarrirorAoeStrategyActionNodeFactory() - { - // creators["whirlwind"] = &whirlwind; - } - -private: - // ACTION_NODE_A(whirlwind, "whirlwind", "cleave"); -}; - -WarrirorAoeStrategy::WarrirorAoeStrategy(PlayerbotAI* botAI) : CombatStrategy(botAI) -{ - actionNodeFactories.Add(new WarrirorAoeStrategyActionNodeFactory()); -} - -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( - "medium aoe", NextAction::array(0, new NextAction("sweeping strikes", ACTION_HIGH + 7), - new NextAction("bladestorm", ACTION_HIGH + 6), - nullptr))); - */ - triggers.push_back(new TriggerNode( - "light aoe", NextAction::array(0, new NextAction("sweeping strikes", ACTION_HIGH + 7), - new NextAction("bladestorm", ACTION_HIGH + 6), - new NextAction("thunder clap", ACTION_HIGH + 5), - new NextAction("shockwave", ACTION_HIGH + 4), - // new NextAction("whirlwind", 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/GenericWarriorStrategy.h b/src/strategy/warrior/GenericWarriorStrategy.h deleted file mode 100644 index afd14a593a..0000000000 --- a/src/strategy/warrior/GenericWarriorStrategy.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_GENERICWARRIORSTRATEGY_H -#define _PLAYERBOT_GENERICWARRIORSTRATEGY_H - -#include "CombatStrategy.h" - -class PlayerbotAI; - -// Stance requirements -class WarriorStanceRequirementActionNodeFactory : public NamedObjectFactory -{ -public: - WarriorStanceRequirementActionNodeFactory() - { - // battle only - creators["charge"] = &charge; - creators["mocking blow"] = &mocking_blow; - creators["overpower"] = &overpower; - creators["retaliation"] = &retaliation; - creators["shattering throw"] = &shattering_throw; - - // temp - creators["mortal strike"] = &mortal_strike; - - // berserker only - creators["berserker rage"] = &berserker_rage; - creators["recklessness"] = &recklessness; - creators["whirlwind"] = &whirlwind; - creators["pummel"] = &pummel; - creators["intercept"] = &intercept; - - // defensive only - creators["taunt"] = &taunt; - creators["revenge"] = &revenge; - creators["shield block"] = &shield_block; - creators["disarm"] = &disarm; - creators["shield wall"] = &shield_wall; - creators["intervene"] = &intervene; - } - -private: - ACTION_NODE_P(charge, "charge", "battle stance"); - ACTION_NODE_P(mocking_blow, "mocking blow", "battle stance"); - ACTION_NODE_P(overpower, "overpower", "battle stance"); - ACTION_NODE_P(berserker_rage, "berserker rage", "berserker stance"); - ACTION_NODE_P(recklessness, "recklessness", "berserker stance"); - ACTION_NODE_P(whirlwind, "whirlwind", "berserker stance"); - ACTION_NODE_P(pummel, "pummel", "berserker stance"); - ACTION_NODE_P(intercept, "intercept", "berserker stance"); - ACTION_NODE_P(taunt, "taunt", "defensive stance"); - ACTION_NODE_P(revenge, "revenge", "defensive stance"); - ACTION_NODE_P(shield_block, "shield block", "defensive stance"); - ACTION_NODE_P(disarm, "disarm", "defensive stance"); - ACTION_NODE_P(shield_wall, "shield wall", "defensive stance"); - ACTION_NODE_P(intervene, "intervene", "defensive stance"); - // temp - ACTION_NODE_P(mortal_strike, "mortal strike", "battle stance"); - ACTION_NODE_P(retaliation, "retaliation", "battle stance"); - ACTION_NODE_P(shattering_throw, "shattering throw", "battle stance"); -}; - -class GenericWarriorStrategy : public CombatStrategy -{ -public: - GenericWarriorStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "warrior"; } -}; - -class WarrirorAoeStrategy : public CombatStrategy -{ -public: - WarrirorAoeStrategy(PlayerbotAI* botAI); - - void InitTriggers(std::vector& triggers) override; - std::string const getName() override { return "aoe"; } -}; - -#endif diff --git a/src/strategy/warrior/TankWarriorStrategy.cpp b/src/strategy/warrior/TankWarriorStrategy.cpp deleted file mode 100644 index cbb712c1fe..0000000000 --- a/src/strategy/warrior/TankWarriorStrategy.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license, you may redistribute it - * and/or modify it under version 3 of the License, or (at your option), any later version. - */ - -#include "TankWarriorStrategy.h" - -#include "Playerbots.h" - -class TankWarriorStrategyActionNodeFactory : public NamedObjectFactory -{ -public: - TankWarriorStrategyActionNodeFactory() - { - creators["charge"] = &charge; - creators["sunder armor"] = &sunder_armor; - creators["commanding shout"] = &commanding_shout; - // creators["shield slam"] = &shield_slam; - creators["devastate"] = &devastate; - creators["last stand"] = &last_stand; - creators["heroic throw on snare target"] = &heroic_throw_on_snare_target; - creators["heroic throw taunt"] = &heroic_throw_taunt; - creators["taunt"] = &taunt; - creators["taunt spell"] = &taunt; - creators["vigilance"] = &vigilance; - creators["enraged regeneration"] = &enraged_regeneration; - } - -private: - // ACTION_NODE_A(charge, "charge", "intercept with stance"); - ACTION_NODE_A(charge, "charge", "reach melee"); - ACTION_NODE_A(sunder_armor, "sunder armor", "melee"); - ACTION_NODE_A(commanding_shout, "commanding shout", "battle shout"); - // ACTION_NODE_A(shield_slam, "shield slam", "heroic strike"); - ACTION_NODE_A(devastate, "devastate", "sunder armor"); - ACTION_NODE_A(last_stand, "last stand", "intimidating shout"); - ACTION_NODE_A(heroic_throw_on_snare_target, "heroic throw on snare target", "taunt on snare target"); - ACTION_NODE_A(heroic_throw_taunt, "heroic throw", "shield slam"); - static ActionNode* taunt(PlayerbotAI* botAI) - { - return new ActionNode("taunt", - /*P*/ nullptr, - /*A*/ NextAction::array(0, new NextAction("heroic throw taunt"), nullptr), - /*C*/ nullptr); - } - - static ActionNode* vigilance(PlayerbotAI* botAI) - { - return new ActionNode("vigilance", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } - - static ActionNode* enraged_regeneration(PlayerbotAI* botAI) - { - return new ActionNode("enraged regeneration", - /*P*/ nullptr, - /*A*/ nullptr, - /*C*/ nullptr); - } -}; - -TankWarriorStrategy::TankWarriorStrategy(PlayerbotAI* botAI) : GenericWarriorStrategy(botAI) -{ - actionNodeFactories.Add(new TankWarriorStrategyActionNodeFactory()); -} - -NextAction** TankWarriorStrategy::getDefaultActions() -{ - return NextAction::array( - 0, 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); -} - -void TankWarriorStrategy::InitTriggers(std::vector& triggers) -{ - GenericWarriorStrategy::InitTriggers(triggers); - - triggers.push_back(new TriggerNode( - "vigilance", - NextAction::array(0, new NextAction("vigilance", ACTION_HIGH + 7), nullptr))); - 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( - "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))); - triggers.push_back( - new TriggerNode("bloodrage", NextAction::array(0, new NextAction("bloodrage", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("sunder armor", NextAction::array(0, new NextAction("devastate", ACTION_HIGH + 2), nullptr))); - triggers.push_back(new TriggerNode("medium rage available", - NextAction::array(0, new NextAction("shield slam", ACTION_HIGH + 2), - new NextAction("devastate", ACTION_HIGH + 1), - nullptr))); - triggers.push_back(new TriggerNode( - "shield block", NextAction::array(0, new NextAction("shield block", ACTION_INTERRUPT + 1), nullptr))); - triggers.push_back( - new TriggerNode("revenge", NextAction::array(0, new NextAction("revenge", ACTION_HIGH + 2), nullptr))); - triggers.push_back( - new TriggerNode("disarm", NextAction::array(0, new NextAction("disarm", ACTION_HIGH + 1), nullptr))); - triggers.push_back( - new TriggerNode("lose aggro", NextAction::array(0, new NextAction("taunt", ACTION_INTERRUPT + 1), nullptr))); - triggers.push_back(new TriggerNode( - "taunt on snare target", - NextAction::array(0, new NextAction("heroic throw on snare target", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "low health", NextAction::array(0, new NextAction("shield wall", ACTION_MEDIUM_HEAL), nullptr))); - triggers.push_back(new TriggerNode("critical health", - NextAction::array(0, new NextAction("last stand", ACTION_EMERGENCY + 3), - new NextAction("enraged regeneration", ACTION_EMERGENCY + 2), - nullptr))); - // triggers.push_back(new TriggerNode("medium aoe", NextAction::array(0, new NextAction("battle shout taunt", - // ACTION_HIGH + 1), nullptr))); - triggers.push_back(new TriggerNode( - "high aoe", NextAction::array(0, new NextAction("challenging shout", ACTION_HIGH + 3), nullptr))); - triggers.push_back(new TriggerNode( - "concussion blow", NextAction::array(0, new NextAction("concussion blow", ACTION_INTERRUPT), nullptr))); - triggers.push_back( - new TriggerNode("shield bash", NextAction::array(0, new NextAction("shield bash", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "shield bash on enemy healer", - NextAction::array(0, new NextAction("shield bash on enemy healer", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode( - "spell reflection", NextAction::array(0, new NextAction("spell reflection", ACTION_INTERRUPT + 1), nullptr))); - triggers.push_back(new TriggerNode( - "victory rush", NextAction::array(0, new NextAction("victory rush", ACTION_INTERRUPT), nullptr))); - triggers.push_back(new TriggerNode("sword and board", - NextAction::array(0, new NextAction("shield slam", ACTION_INTERRUPT), nullptr))); - triggers.push_back( - new TriggerNode("rend", NextAction::array(0, new NextAction("rend", ACTION_NORMAL + 1), nullptr))); - triggers.push_back(new TriggerNode( - "rend on attacker", NextAction::array(0, new NextAction("rend on attacker", ACTION_NORMAL + 1), nullptr))); - triggers.push_back(new TriggerNode("protect party member", - NextAction::array(0, new NextAction("intervene", ACTION_EMERGENCY), nullptr))); - triggers.push_back(new TriggerNode( - "high rage available", NextAction::array(0, new NextAction("heroic strike", ACTION_HIGH), nullptr))); - triggers.push_back(new TriggerNode("medium rage available", - NextAction::array(0, new NextAction("thunder clap", ACTION_HIGH + 1), nullptr))); -}