forked from mindsear/TemplateNPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTemplateNPC.h
268 lines (243 loc) · 8.19 KB
/
TemplateNPC.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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#pragma once
#ifndef TALENT_FUNCTIONS_H
#define TALENT_FUNCTIONS_H
#include "Define.h"
#include "Player.h"
#define SPELL_Amani_War_Bear 43688
#define SPELL_Artisan_Riding 34091
#define SPELL_Cold_Weather_Flying 54197
#define SPELL_Teach_Learn_Talent_Specialization_Switches 63680
#define SPELL_Learn_a_Second_Talent_Specialization 63624
enum templateSpells
{
PLATE_MAIL = 750,
MAIL = 8737
};
enum WeaponProficiencies
{
BLOCK = 107,
BOWS = 264,
CROSSBOWS = 5011,
DAGGERS = 1180,
FIST_WEAPONS = 15590,
GUNS = 266,
ONE_H_AXES = 196,
ONE_H_MACES = 198,
ONE_H_SWORDS = 201,
POLEARMS = 200,
SHOOT = 5019,
STAVES = 227,
TWO_H_AXES = 197,
TWO_H_MACES = 199,
TWO_H_SWORDS = 202,
WANDS = 5009,
THROW_WAR = 2567
};
static void LearnWeaponSkills(Player* player)
{
WeaponProficiencies wepSkills[] = {
BLOCK, BOWS, CROSSBOWS, DAGGERS, FIST_WEAPONS, GUNS, ONE_H_AXES, ONE_H_MACES,
ONE_H_SWORDS, POLEARMS, SHOOT, STAVES, TWO_H_AXES, TWO_H_MACES, TWO_H_SWORDS, WANDS, THROW_WAR
};
uint32 size = 17;
for (uint32 i = 0; i < size; ++i)
if (player->HasSpell(wepSkills[i]))
continue;
switch (player->getClass())
{
case CLASS_WARRIOR:
player->LearnSpell(THROW_WAR, false);
player->LearnSpell(TWO_H_SWORDS, false);
player->LearnSpell(TWO_H_MACES, false);
player->LearnSpell(TWO_H_AXES, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(POLEARMS, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(ONE_H_AXES, false);
player->LearnSpell(GUNS, false);
player->LearnSpell(FIST_WEAPONS, false);
player->LearnSpell(DAGGERS, false);
player->LearnSpell(CROSSBOWS, false);
player->LearnSpell(BOWS, false);
player->LearnSpell(BLOCK, false);
break;
case CLASS_PRIEST:
player->LearnSpell(WANDS, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(SHOOT, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(DAGGERS, false);
break;
case CLASS_PALADIN:
player->LearnSpell(TWO_H_SWORDS, false);
player->LearnSpell(TWO_H_MACES, false);
player->LearnSpell(TWO_H_AXES, false);
player->LearnSpell(POLEARMS, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(ONE_H_AXES, false);
player->LearnSpell(BLOCK, false);
break;
case CLASS_ROGUE:
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(ONE_H_AXES, false);
player->LearnSpell(GUNS, false);
player->LearnSpell(FIST_WEAPONS, false);
player->LearnSpell(DAGGERS, false);
player->LearnSpell(CROSSBOWS, false);
player->LearnSpell(BOWS, false);
break;
case CLASS_DEATH_KNIGHT:
player->LearnSpell(TWO_H_SWORDS, false);
player->LearnSpell(TWO_H_MACES, false);
player->LearnSpell(TWO_H_AXES, false);
player->LearnSpell(POLEARMS, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(ONE_H_AXES, false);
break;
case CLASS_MAGE:
player->LearnSpell(WANDS, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(SHOOT, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(DAGGERS, false);
break;
case CLASS_SHAMAN:
player->LearnSpell(TWO_H_MACES, false);
player->LearnSpell(TWO_H_AXES, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(ONE_H_AXES, false);
player->LearnSpell(FIST_WEAPONS, false);
player->LearnSpell(DAGGERS, false);
player->LearnSpell(BLOCK, false);
break;
case CLASS_HUNTER:
player->LearnSpell(THROW_WAR, false);
player->LearnSpell(TWO_H_SWORDS, false);
player->LearnSpell(TWO_H_AXES, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(POLEARMS, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(ONE_H_AXES, false);
player->LearnSpell(GUNS, false);
player->LearnSpell(FIST_WEAPONS, false);
player->LearnSpell(DAGGERS, false);
player->LearnSpell(CROSSBOWS, false);
player->LearnSpell(BOWS, false);
break;
case CLASS_DRUID:
player->LearnSpell(TWO_H_MACES, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(POLEARMS, false);
player->LearnSpell(ONE_H_MACES, false);
player->LearnSpell(FIST_WEAPONS, false);
player->LearnSpell(DAGGERS, false);
break;
case CLASS_WARLOCK:
player->LearnSpell(WANDS, false);
player->LearnSpell(STAVES, false);
player->LearnSpell(SHOOT, false);
player->LearnSpell(ONE_H_SWORDS, false);
player->LearnSpell(DAGGERS, false);
break;
default:
break;
}
player->UpdateWeaponsSkillsToMaxSkillsForLevel();
}
struct TalentTemplate
{
std::string playerClass;
std::string playerSpec;
uint32 talentId;
};
struct GlyphTemplate
{
std::string playerClass;
std::string playerSpec;
uint8 slot;
uint32 glyph;
};
struct HumanGearTemplate
{
std::string playerClass;
std::string playerSpec;
uint8 pos;
uint32 itemEntry;
uint32 enchant;
uint32 socket1;
uint32 socket2;
uint32 socket3;
uint32 bonusEnchant;
uint32 prismaticEnchant;
};
struct AllianceGearTemplate
{
std::string playerClass;
std::string playerSpec;
uint8 pos;
uint32 itemEntry;
uint32 enchant;
uint32 socket1;
uint32 socket2;
uint32 socket3;
uint32 bonusEnchant;
uint32 prismaticEnchant;
};
struct HordeGearTemplate
{
std::string playerClass;
std::string playerSpec;
uint8 pos;
uint32 itemEntry;
uint32 enchant;
uint32 socket1;
uint32 socket2;
uint32 socket3;
uint32 bonusEnchant;
uint32 prismaticEnchant;
};
typedef std::vector<HumanGearTemplate*> HumanGearContainer;
typedef std::vector<AllianceGearTemplate*> AllianceGearContainer;
typedef std::vector<HordeGearTemplate*> HordeGearContainer;
typedef std::vector<TalentTemplate*> TalentContainer;
typedef std::vector<GlyphTemplate*> GlyphContainer;
class sTemplateNPC
{
public:
static sTemplateNPC* instance()
{
static sTemplateNPC* instance = new sTemplateNPC();
return instance;
}
void LoadTalentsContainer();
void LoadGlyphsContainer();
void LoadHumanGearContainer();
void LoadAllianceGearContainer();
void LoadHordeGearContainer();
void ApplyGlyph(Player* player, uint8 slot, uint32 glyphID);
void RemoveAllGlyphs(Player* player);
void ApplyBonus(Player* player, Item* item, EnchantmentSlot slot, uint32 bonusEntry);
bool OverwriteTemplate(Player* /*player*/, std::string& /*playerSpecStr*/);
void ExtractGearTemplateToDB(Player* /*player*/, std::string& /*playerSpecStr*/);
void ExtractTalentTemplateToDB(Player* /*player*/, std::string& /*playerSpecStr*/);
void ExtractGlyphsTemplateToDB(Player* /*player*/, std::string& /*playerSpecStr*/);
bool CanEquipTemplate(Player* /*player*/, std::string& /*playerSpecStr*/);
std::string GetClassString(Player* /*player*/);
std::string sTalentsSpec;
void LearnTemplateTalents(Player* /*player*/);
void LearnTemplateGlyphs(Player* /*player*/);
void EquipTemplateGear(Player* /*player*/);
void LearnPlateMailSpells(Player* /*player*/);
GlyphContainer m_GlyphContainer;
TalentContainer m_TalentContainer;
HumanGearContainer m_HumanGearContainer;
AllianceGearContainer m_AllianceGearContainer;
HordeGearContainer m_HordeGearContainer;
};
#define sTemplateNpcMgr sTemplateNPC::instance()
#endif