mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
tell expected group dps
This commit is contained in:
@@ -166,6 +166,7 @@ class ChatActionContext : public NamedObjectContext<Action>
|
||||
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<Action>
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -60,6 +60,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& 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)
|
||||
|
||||
@@ -114,6 +114,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
|
||||
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<Trigger>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user