forked from mangoszero/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatCommandHandlerStrategy.cpp
More file actions
186 lines (150 loc) · 6.01 KB
/
ChatCommandHandlerStrategy.cpp
File metadata and controls
186 lines (150 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#include "botpch.h"
#include "../../playerbot.h"
#include "ChatCommandHandlerStrategy.h"
using namespace ai;
class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory<ActionNode>
{
public:
ChatCommandActionNodeFactoryInternal()
{
creators["tank attack chat shortcut"] = &tank_attack_chat_shortcut;
}
private:
static ActionNode* tank_attack_chat_shortcut(PlayerbotAI* ai)
{
return new ActionNode ("tank attack chat shortcut",
/*P*/ NULL,
/*A*/ NULL,
/*C*/ NextAction::array(0, new NextAction("attack my target", 100.0f), NULL));
}
};
void ChatCommandHandlerStrategy::InitTriggers(std::list<TriggerNode*> &triggers)
{
PassTroughStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode(
"rep",
NextAction::array(0, new NextAction("reputation", relevance), NULL)));
triggers.push_back(new TriggerNode(
"q",
NextAction::array(0,
new NextAction("query quest", relevance),
new NextAction("query item usage", relevance), NULL)));
triggers.push_back(new TriggerNode(
"add all loot",
NextAction::array(0, new NextAction("add all loot", relevance), new NextAction("loot", relevance), NULL)));
triggers.push_back(new TriggerNode(
"u",
NextAction::array(0, new NextAction("use", relevance), NULL)));
triggers.push_back(new TriggerNode(
"c",
NextAction::array(0, new NextAction("item count", relevance), NULL)));
triggers.push_back(new TriggerNode(
"e",
NextAction::array(0, new NextAction("equip", relevance), NULL)));
triggers.push_back(new TriggerNode(
"ue",
NextAction::array(0, new NextAction("unequip", relevance), NULL)));
triggers.push_back(new TriggerNode(
"t",
NextAction::array(0, new NextAction("trade", relevance), NULL)));
triggers.push_back(new TriggerNode(
"nt",
NextAction::array(0, new NextAction("trade", relevance), NULL)));
triggers.push_back(new TriggerNode(
"s",
NextAction::array(0, new NextAction("sell", relevance), NULL)));
triggers.push_back(new TriggerNode(
"b",
NextAction::array(0, new NextAction("buy", relevance), NULL)));
triggers.push_back(new TriggerNode(
"r",
NextAction::array(0, new NextAction("reward", relevance), NULL)));
triggers.push_back(new TriggerNode(
"attack",
NextAction::array(0, new NextAction("attack my target", relevance), NULL)));
triggers.push_back(new TriggerNode(
"accept",
NextAction::array(0, new NextAction("accept quest", relevance), NULL)));
triggers.push_back(new TriggerNode(
"follow",
NextAction::array(0, new NextAction("follow chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"stay",
NextAction::array(0, new NextAction("stay chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"flee",
NextAction::array(0, new NextAction("flee chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"tank attack",
NextAction::array(0, new NextAction("tank attack chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"grind",
NextAction::array(0, new NextAction("grind chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"talk",
NextAction::array(0, new NextAction("gossip hello", relevance), NULL)));
triggers.push_back(new TriggerNode(
"cast",
NextAction::array(0, new NextAction("cast custom spell", relevance), NULL)));
triggers.push_back(new TriggerNode(
"revive",
NextAction::array(0, new NextAction("spirit healer", relevance), NULL)));
triggers.push_back(new TriggerNode(
"runaway",
NextAction::array(0, new NextAction("runaway chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"warning",
NextAction::array(0, new NextAction("runaway chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"max dps",
NextAction::array(0, new NextAction("max dps chat shortcut", relevance), NULL)));
triggers.push_back(new TriggerNode(
"attackers",
NextAction::array(0, new NextAction("tell attackers", relevance), NULL)));
triggers.push_back(new TriggerNode(
"jump",
NextAction::array(0, new NextAction("jump", relevance), NULL)));
triggers.push_back(new TriggerNode(
"jump up",
NextAction::array(0, new NextAction("jump up", relevance), NULL)));
}
ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* ai) : PassTroughStrategy(ai)
{
actionNodeFactories.Add(new ChatCommandActionNodeFactoryInternal());
supported.push_back("quests");
supported.push_back("stats");
supported.push_back("leave");
supported.push_back("reputation");
supported.push_back("log");
supported.push_back("los");
supported.push_back("drop");
supported.push_back("ll");
supported.push_back("release");
supported.push_back("teleport");
supported.push_back("taxi");
supported.push_back("repair");
supported.push_back("talents");
supported.push_back("spells");
supported.push_back("co");
supported.push_back("nc");
supported.push_back("dead");
supported.push_back("trainer");
supported.push_back("chat");
supported.push_back("home");
supported.push_back("destroy");
supported.push_back("reset ai");
supported.push_back("emote");
supported.push_back("buff");
supported.push_back("help");
supported.push_back("gb");
supported.push_back("bank");
supported.push_back("invite");
supported.push_back("spell");
supported.push_back("rti");
supported.push_back("position");
supported.push_back("summon");
supported.push_back("who");
supported.push_back("save mana");
supported.push_back("jump");
supported.push_back("jump up");
}