naxx chat short cut

This commit is contained in:
Yunfan Li
2023-06-11 23:20:57 +08:00
parent 81149246c4
commit c9367debeb
6 changed files with 26 additions and 2 deletions

View File

@@ -164,6 +164,7 @@ class ChatActionContext : public NamedObjectContext<Action>
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<Action>
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

View File

@@ -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;
}

View File

@@ -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