bwl strategy

This commit is contained in:
Yunfan Li
2023-08-28 21:21:58 +08:00
parent b97876dbc2
commit dba908be9e
18 changed files with 196 additions and 20 deletions

View File

@@ -165,6 +165,8 @@ class ChatActionContext : public NamedObjectContext<Action>
creators["guild leave"] = &ChatActionContext::guild_leave;
creators["rtsc"] = &ChatActionContext::rtsc;
creators["naxx chat shortcut"] = &ChatActionContext::naxx_chat_shortcut;
creators["bwl chat shortcut"] = &ChatActionContext::bwl_chat_shortcut;
}
private:
@@ -255,6 +257,7 @@ class ChatActionContext : public NamedObjectContext<Action>
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); }
static Action* bwl_chat_shortcut(PlayerbotAI* ai) { return new BwlChatShortcutAction(ai); }
};
#endif

View File

@@ -200,4 +200,17 @@ bool NaxxChatShortcutAction::Execute(Event event)
botAI->ChangeStrategy("+naxx", BOT_STATE_COMBAT);
bot->Say("Add Naxx Strategies!", LANG_UNIVERSAL);
return true;
}
}
bool BwlChatShortcutAction::Execute(Event event)
{
Player* master = GetMaster();
if (!master)
return false;
botAI->Reset();
botAI->ChangeStrategy("+bwl", BOT_STATE_NON_COMBAT);
botAI->ChangeStrategy("+bwl", BOT_STATE_COMBAT);
bot->Say("Add Bwl Strategies!", LANG_UNIVERSAL);
return true;
}

View File

@@ -80,4 +80,11 @@ class NaxxChatShortcutAction : public Action
NaxxChatShortcutAction(PlayerbotAI* ai) : Action(ai, "naxx chat shortcut") {}
virtual bool Execute(Event event);
};
class BwlChatShortcutAction : public Action
{
public:
BwlChatShortcutAction(PlayerbotAI* ai) : Action(ai, "bwl chat shortcut") {}
virtual bool Execute(Event event);
};
#endif