diff --git a/src/strategy/actions/ChatActionContext.h b/src/strategy/actions/ChatActionContext.h index 3565483c..e9d2c1ab 100644 --- a/src/strategy/actions/ChatActionContext.h +++ b/src/strategy/actions/ChatActionContext.h @@ -164,6 +164,7 @@ class ChatActionContext : public NamedObjectContext creators["guild remove"] = &ChatActionContext::guild_remove; creators["guild leave"] = &ChatActionContext::guild_leave; creators["rtsc"] = &ChatActionContext::rtsc; + creators["naxx chat shortcut"] = &ChatActionContext::naxx_chat_shortcut; } private: @@ -253,6 +254,7 @@ class ChatActionContext : public NamedObjectContext static Action* guild_remove(PlayerbotAI* botAI) { return new GuildRemoveAction(botAI); } static Action* guild_leave(PlayerbotAI* botAI) { return new GuildLeaveAction(botAI); } static Action* rtsc(PlayerbotAI* botAI) { return new RTSCAction(botAI); } + static Action* naxx_chat_shortcut(PlayerbotAI* ai) { return new NaxxChatShortcutAction(ai); } }; #endif diff --git a/src/strategy/actions/ChatShortcutActions.cpp b/src/strategy/actions/ChatShortcutActions.cpp index fa98921e..af44b7c1 100644 --- a/src/strategy/actions/ChatShortcutActions.cpp +++ b/src/strategy/actions/ChatShortcutActions.cpp @@ -188,3 +188,16 @@ bool MaxDpsChatShortcutAction::Execute(Event event) return true; } + +bool NaxxChatShortcutAction::Execute(Event event) +{ + Player* master = GetMaster(); + if (!master) + return false; + + botAI->Reset(); + botAI->ChangeStrategy("+naxx", BOT_STATE_NON_COMBAT); + botAI->ChangeStrategy("+naxx", BOT_STATE_COMBAT); + bot->Say("Add Naxx Strategies!", LANG_UNIVERSAL); + return true; +} \ No newline at end of file diff --git a/src/strategy/actions/ChatShortcutActions.h b/src/strategy/actions/ChatShortcutActions.h index 1eba5703..e9491d2b 100644 --- a/src/strategy/actions/ChatShortcutActions.h +++ b/src/strategy/actions/ChatShortcutActions.h @@ -74,4 +74,10 @@ class MaxDpsChatShortcutAction : public Action bool Execute(Event event) override; }; +class NaxxChatShortcutAction : public Action +{ + public: + NaxxChatShortcutAction(PlayerbotAI* ai) : Action(ai, "naxx chat shortcut") {} + virtual bool Execute(Event event); +}; #endif diff --git a/src/strategy/generic/CastTimeStrategy.cpp b/src/strategy/generic/CastTimeStrategy.cpp index f9d925d8..28359b58 100644 --- a/src/strategy/generic/CastTimeStrategy.cpp +++ b/src/strategy/generic/CastTimeStrategy.cpp @@ -28,8 +28,8 @@ float CastTimeMultiplier::GetValue(Action* action) return 1.0f; uint32 castTime = spellInfo->CalcCastTime(); - if (castTime >= 3000) - return 0.0f; + // if (castTime >= 3000) + // return 0.0f; if (castTime >= 1500) return 0.5f; diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 52face18..878726b0 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -58,6 +58,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger 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("naxx", NextAction::array(0, new NextAction("naxx chat shortcut", relevance), NULL))); } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index ae993887..f421685c 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -112,6 +112,7 @@ class ChatTriggerContext : public NamedObjectContext creators["guild leave"] = &ChatTriggerContext::guild_leave; creators["rtsc"] = &ChatTriggerContext::rtsc; creators["drink"] = &ChatTriggerContext::drink; + creators["naxx"] = &ChatTriggerContext::naxx; } private: @@ -204,6 +205,7 @@ class ChatTriggerContext : public NamedObjectContext static Trigger* guild_leave(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "guild leave"); } static Trigger* rtsc(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "rtsc"); } static Trigger* drink(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "drink"); } + static Trigger* naxx(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "naxx"); } }; #endif