diff --git a/src/strategy/actions/ChatActionContext.h b/src/strategy/actions/ChatActionContext.h index 1775e066..a2faa178 100644 --- a/src/strategy/actions/ChatActionContext.h +++ b/src/strategy/actions/ChatActionContext.h @@ -166,6 +166,7 @@ class ChatActionContext : public NamedObjectContext creators["rtsc"] = &ChatActionContext::rtsc; creators["naxx chat shortcut"] = &ChatActionContext::naxx_chat_shortcut; creators["bwl chat shortcut"] = &ChatActionContext::bwl_chat_shortcut; + creators["tell expected dps"] = &ChatActionContext::tell_expected_dps; } @@ -258,6 +259,7 @@ class ChatActionContext : public NamedObjectContext static Action* rtsc(PlayerbotAI* botAI) { return new RTSCAction(botAI); } static Action* naxx_chat_shortcut(PlayerbotAI* ai) { return new NaxxChatShortcutAction(ai); } static Action* bwl_chat_shortcut(PlayerbotAI* ai) { return new BwlChatShortcutAction(ai); } + static Action* tell_expected_dps(PlayerbotAI* ai) { return new TellExpectedDpsAction(ai); } }; #endif diff --git a/src/strategy/actions/TellLosAction.cpp b/src/strategy/actions/TellLosAction.cpp index 461df0d9..6d7df103 100644 --- a/src/strategy/actions/TellLosAction.cpp +++ b/src/strategy/actions/TellLosAction.cpp @@ -125,4 +125,11 @@ bool TellAuraAction::Execute(Event event) } } return true; +} + +bool TellExpectedDpsAction::Execute(Event event) +{ + float dps = AI_VALUE(float, "expected group dps"); + botAI->TellMaster("Expected Group DPS: " + std::to_string(dps)); + return true; } \ No newline at end of file diff --git a/src/strategy/actions/TellLosAction.h b/src/strategy/actions/TellLosAction.h index 5879fd85..01e1567e 100644 --- a/src/strategy/actions/TellLosAction.h +++ b/src/strategy/actions/TellLosAction.h @@ -28,4 +28,12 @@ class TellAuraAction : public Action virtual bool Execute(Event event); }; + +class TellExpectedDpsAction : public Action +{ + public: + TellExpectedDpsAction(PlayerbotAI* ai) : Action(ai, "tell expected dps") {} + + virtual bool Execute(Event event); +}; #endif diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 52842a91..d35ad0c8 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -60,6 +60,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger triggers.push_back(new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr))); triggers.push_back(new TriggerNode("naxx", NextAction::array(0, new NextAction("naxx chat shortcut", relevance), NULL))); 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 expected dps", relevance), NULL))); } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index 6e9f2d6c..830eb983 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -114,6 +114,7 @@ class ChatTriggerContext : public NamedObjectContext creators["drink"] = &ChatTriggerContext::drink; creators["naxx"] = &ChatTriggerContext::naxx; creators["bwl"] = &ChatTriggerContext::bwl; + creators["dps"] = &ChatTriggerContext::dps; } private: @@ -208,6 +209,7 @@ class ChatTriggerContext : public NamedObjectContext static Trigger* drink(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "drink"); } static Trigger* naxx(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "naxx"); } static Trigger* bwl(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "bwl"); } + static Trigger* dps(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "dps"); } }; #endif