diff --git a/src/strategy/AiObjectContext.cpp b/src/strategy/AiObjectContext.cpp index 1735d56d..71b129cc 100644 --- a/src/strategy/AiObjectContext.cpp +++ b/src/strategy/AiObjectContext.cpp @@ -17,9 +17,9 @@ #include "ValueContext.h" #include "WorldPacketActionContext.h" #include "WorldPacketTriggerContext.h" -#include "raids/RaidActionContext.h" #include "raids/RaidStrategyContext.h" -#include "raids/RaidTriggerContext.h" +#include "raids/blackwinglair/RaidBwlActionContext.h" +#include "raids/blackwinglair/RaidBwlTriggerContext.h" #include "raids/naxxramas/RaidNaxxActionContext.h" #include "raids/naxxramas/RaidNaxxTriggerContext.h" #include "raids/moltencore/RaidMcActionContext.h" @@ -38,7 +38,7 @@ AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI) actionContexts.Add(new ActionContext()); actionContexts.Add(new ChatActionContext()); actionContexts.Add(new WorldPacketActionContext()); - actionContexts.Add(new RaidActionContext()); + actionContexts.Add(new RaidBwlActionContext()); actionContexts.Add(new RaidNaxxActionContext()); actionContexts.Add(new RaidUlduarActionContext()); actionContexts.Add(new RaidMcActionContext()); @@ -47,7 +47,7 @@ AiObjectContext::AiObjectContext(PlayerbotAI* botAI) : PlayerbotAIAware(botAI) triggerContexts.Add(new TriggerContext()); triggerContexts.Add(new ChatTriggerContext()); triggerContexts.Add(new WorldPacketTriggerContext()); - triggerContexts.Add(new RaidTriggerContext()); + triggerContexts.Add(new RaidBwlTriggerContext()); triggerContexts.Add(new RaidNaxxTriggerContext()); triggerContexts.Add(new RaidUlduarTriggerContext()); triggerContexts.Add(new RaidMcTriggerContext()); diff --git a/src/strategy/raids/RaidActionContext.h b/src/strategy/raids/RaidActionContext.h deleted file mode 100644 index e96c71e1..00000000 --- a/src/strategy/raids/RaidActionContext.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it - * and/or modify it under version 2 of the License, or (at your option), any later version. - */ - -#ifndef _PLAYERBOT_RAIDACTIONCONTEXTACTION_H -#define _PLAYERBOT_RAIDACTIONCONTEXTACTION_H - -#include "Action.h" -#include "NamedObjectContext.h" -#include "raids/blackwinglair/RaidBwlActions.h" - -class RaidActionContext : public NamedObjectContext -{ -public: - RaidActionContext() - { - creators["bwl check onyxia scale cloak"] = &RaidActionContext::bwl_check_onyxia_scale_cloak; - creators["bwl turn off suppression device"] = &RaidActionContext::bwl_turn_off_suppression_device; - } - -private: - static Action* bwl_check_onyxia_scale_cloak(PlayerbotAI* botAI) - { - return new BwlOnyxiaScaleCloakAuraCheckAction(botAI); - } - static Action* bwl_turn_off_suppression_device(PlayerbotAI* botAI) - { - return new BwlTurnOffSuppressionDeviceAction(botAI); - } -}; - -#endif diff --git a/src/strategy/raids/RaidTriggerContext.h b/src/strategy/raids/RaidTriggerContext.h deleted file mode 100644 index 69b45002..00000000 --- a/src/strategy/raids/RaidTriggerContext.h +++ /dev/null @@ -1,23 +0,0 @@ -// /* -// * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it -// and/or modify it under version 2 of the License, or (at your option), any later version. -// */ - -#ifndef _PLAYERBOT_RAIDTRIGGERCONTEXT_H -#define _PLAYERBOT_RAIDTRIGGERCONTEXT_H - -#include "AiObjectContext.h" -#include "NamedObjectContext.h" -#include "raids/blackwinglair/RaidBwlTriggers.h" -#include "raids/naxxramas/RaidNaxxTriggers.h" - -class RaidTriggerContext : public NamedObjectContext -{ -public: - RaidTriggerContext() { creators["bwl suppression device"] = &RaidTriggerContext::bwl_suppression_device; } - -private: - static Trigger* bwl_suppression_device(PlayerbotAI* ai) { return new BwlSuppressionDeviceTrigger(ai); } -}; - -#endif \ No newline at end of file diff --git a/src/strategy/raids/blackwinglair/RaidBwlActionContext.h b/src/strategy/raids/blackwinglair/RaidBwlActionContext.h new file mode 100644 index 00000000..7b73f410 --- /dev/null +++ b/src/strategy/raids/blackwinglair/RaidBwlActionContext.h @@ -0,0 +1,24 @@ +#ifndef _PLAYERBOT_RAIDBWLACTIONCONTEXT_H +#define _PLAYERBOT_RAIDBWLACTIONCONTEXT_H + +#include "Action.h" +#include "NamedObjectContext.h" +#include "RaidBwlActions.h" + +class RaidBwlActionContext : public NamedObjectContext +{ +public: + RaidBwlActionContext() + { + creators["bwl check onyxia scale cloak"] = &RaidBwlActionContext::bwl_check_onyxia_scale_cloak; + creators["bwl turn off suppression device"] = &RaidBwlActionContext::bwl_turn_off_suppression_device; + creators["bwl use hourglass sand"] = &RaidBwlActionContext::bwl_use_hourglass_sand; + } + +private: + static Action* bwl_check_onyxia_scale_cloak(PlayerbotAI* botAI) { return new BwlOnyxiaScaleCloakAuraCheckAction(botAI); } + static Action* bwl_turn_off_suppression_device(PlayerbotAI* botAI) { return new BwlTurnOffSuppressionDeviceAction(botAI); } + static Action* bwl_use_hourglass_sand(PlayerbotAI* botAI) { return new BwlUseHourglassSandAction(botAI); } +}; + +#endif diff --git a/src/strategy/raids/blackwinglair/RaidBwlActions.cpp b/src/strategy/raids/blackwinglair/RaidBwlActions.cpp index 5ab02fef..54b21791 100644 --- a/src/strategy/raids/blackwinglair/RaidBwlActions.cpp +++ b/src/strategy/raids/blackwinglair/RaidBwlActions.cpp @@ -27,4 +27,6 @@ bool BwlTurnOffSuppressionDeviceAction::Execute(Event event) go->SetGoState(GO_STATE_ACTIVE); } return true; -} \ No newline at end of file +} + +bool BwlUseHourglassSandAction::Execute(Event event) { return botAI->CastSpell(23645, bot); } diff --git a/src/strategy/raids/blackwinglair/RaidBwlActions.h b/src/strategy/raids/blackwinglair/RaidBwlActions.h index 1822ebde..24dcf399 100644 --- a/src/strategy/raids/blackwinglair/RaidBwlActions.h +++ b/src/strategy/raids/blackwinglair/RaidBwlActions.h @@ -23,4 +23,11 @@ public: bool Execute(Event event) override; }; -#endif \ No newline at end of file +class BwlUseHourglassSandAction : public Action +{ +public: + BwlUseHourglassSandAction(PlayerbotAI* botAI) : Action(botAI, "bwl use hourglass sand") {} + bool Execute(Event event) override; +}; + +#endif diff --git a/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp b/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp index 6c7d79e5..1b784683 100644 --- a/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp +++ b/src/strategy/raids/blackwinglair/RaidBwlStrategy.cpp @@ -4,10 +4,12 @@ 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("often", + NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL))); - triggers.push_back( - new TriggerNode("bwl suppression device", + triggers.push_back(new TriggerNode("bwl suppression device", NextAction::array(0, new NextAction("bwl turn off suppression device", ACTION_RAID), NULL))); -} \ No newline at end of file + + 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/blackwinglair/RaidBwlTriggerContext.h b/src/strategy/raids/blackwinglair/RaidBwlTriggerContext.h new file mode 100644 index 00000000..aa6b57c9 --- /dev/null +++ b/src/strategy/raids/blackwinglair/RaidBwlTriggerContext.h @@ -0,0 +1,22 @@ +#ifndef _PLAYERBOT_RAIDBWLTRIGGERCONTEXT_H +#define _PLAYERBOT_RAIDBWLTRIGGERCONTEXT_H + +#include "AiObjectContext.h" +#include "NamedObjectContext.h" +#include "RaidBwlTriggers.h" + +class RaidBwlTriggerContext : public NamedObjectContext +{ +public: + RaidBwlTriggerContext() + { + creators["bwl suppression device"] = &RaidBwlTriggerContext::bwl_suppression_device; + creators["bwl affliction bronze"] = &RaidBwlTriggerContext::bwl_affliction_bronze; + } + +private: + static Trigger* bwl_suppression_device(PlayerbotAI* ai) { return new BwlSuppressionDeviceTrigger(ai); } + static Trigger* bwl_affliction_bronze(PlayerbotAI* ai) { return new BwlAfflictionBronzeTrigger(ai); } +}; + +#endif diff --git a/src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp b/src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp index 089a3f11..e34e7a9a 100644 --- a/src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp +++ b/src/strategy/raids/blackwinglair/RaidBwlTriggers.cpp @@ -19,4 +19,6 @@ bool BwlSuppressionDeviceTrigger::IsActive() return true; } return false; -} \ No newline at end of file +} + +bool BwlAfflictionBronzeTrigger::IsActive() { return bot->HasAura(23170); } diff --git a/src/strategy/raids/blackwinglair/RaidBwlTriggers.h b/src/strategy/raids/blackwinglair/RaidBwlTriggers.h index 8f26ad7b..fc19acd5 100644 --- a/src/strategy/raids/blackwinglair/RaidBwlTriggers.h +++ b/src/strategy/raids/blackwinglair/RaidBwlTriggers.h @@ -12,4 +12,11 @@ public: bool IsActive() override; }; -#endif \ No newline at end of file +class BwlAfflictionBronzeTrigger : public Trigger +{ +public: + BwlAfflictionBronzeTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl affliction bronze") {} + bool IsActive() override; +}; + +#endif