forked from ike3/mangosbot-bots
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathChatHelper.h
90 lines (67 loc) · 3.35 KB
/
ChatHelper.h
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
#pragma once
using namespace std;
typedef set<uint32> ItemIds;
typedef set<uint32> SpellIds;
namespace ai
{
class ItemQualifier;
class WorldPosition;
class GuidPosition;
class ChatHelper : public PlayerbotAIAware
{
public:
ChatHelper(PlayerbotAI* ai);
public:
static string formatMoney(uint32 copper);
static uint32 parseMoney(string& text);
static string formatQuest(Quest const* quest);
static string formatItem(ItemQualifier& itemQualifier, int count = 0, int total = 0);
static string formatItem(ItemPrototype const * proto, int count = 0, int total = 0);
static string formatItem(Item* item, int count = 0, int total = 0);
static string formatQItem(uint32 itemId);
static ItemIds parseItems(string& text);
static set<string> parseItemQualifiers(string& text);
static uint32 parseItemQuality(string text);
static bool parseItemClass(string text, uint32* itemClass, uint32* itemSubClass);
static uint32 parseSlot(string text);
static string formatSpell(SpellEntry const *sInfo);
static string formatSpell(uint32 spellId) {const SpellEntry* const spellInfo = sSpellTemplate.LookupEntry<SpellEntry>(spellId); if (!spellInfo) return ""; return formatSpell(spellInfo);};
uint32 parseSpell(string& text);
static string formatGameobject(GameObject* go);
static list<ObjectGuid> parseGameobjects(string& text);
static string formatWorldobject(WorldObject* wo);
static string formatWorldEntry(int32 entry);
static list<int32> parseWorldEntries(string& text);
static string formatQuestObjective(string name, int available, int required);
static string formatValue(string type, string code, string name, string color = "0000FFFF");
static string parseValue(string type, string& text);
static string formatChat(ChatMsg chat);
static ChatMsg parseChat(string& text);
static string specName(Player* player);
static string formatClass(Player* player, int spec);
static string formatClass(uint8 cls);
static string formatRace(uint8 race);
static string formatSkill(uint32 skill);
uint32 parseSkill(string& text);
static string formatAngle(float angle);
static string formatWorldPosition(WorldPosition& pos);
static string formatGuidPosition(GuidPosition& guidP);
static string formatBoolean(bool flag);
static bool parseable(string text);
void eraseAllSubStr(std::string& mainStr, const std::string& toErase);
static void PopulateSpellNameList();
static vector<uint32> SpellIds(const string& name);
private:
static map<string, uint32> consumableSubClasses;
static map<string, uint32> tradeSubClasses;
static map<string, uint32> itemQualities;
static map<string, uint32> projectileSubClasses;
static map<string, uint32> slots;
static map<string, uint32> skills;
static map<string, ChatMsg> chats;
static map<uint8, string> classes;
static map<uint8, string> races;
static map<uint8, map<uint8, string> > specs;
static unordered_map<string, vector<uint32>> spellIds;
};
};