-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpc_trainer.cpp
More file actions
217 lines (197 loc) · 7.34 KB
/
npc_trainer.cpp
File metadata and controls
217 lines (197 loc) · 7.34 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
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
/* ####################################################### *\
Sicker NPC - Sicker <World Trainer>
- Riding
- Skills
Version: 1.0
Status: Compiled and Tested on 335.64
(C) 2018 Developed by Sicker
All rights reserved.
\* ####################################################### */
/*
SQL QUERY:
DO NOT CHANGE!
INSERT INTO `creature_template` (`entry`, `modelid1`, `name`, `subname`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `unit_class`, `AIName`, `ScriptName`)
VALUES ('190051', '1542', 'Sicker', 'World Trainer', '80', '80', '0', '35', '65', '1.0', '1.8', '0.5', '1', 'SmartAI', 'TRAINER_NPC');
*/
#include "../../../scripts/ScriptPCH.h"
#include "ScriptMgr.h"
#include "Log.h"
#include "Chat.h"
#include "WorldSession.h"
#include "ScriptedGossip.h"
#include "ScriptedCreature.h"
#include "GossipDef.h"
#include "Auras\SpellAuras.h"
#include "RBAC.h"
#include "Common.h"
#include "Player.h"
class TRAINER_NPC : public CreatureScript {
public: TRAINER_NPC() : CreatureScript("TRAINER_NPC") {}
class TRAINER_NPCAI : public ScriptedAI {
public: TRAINER_NPCAI(Creature* creature) : ScriptedAI(creature) { }
bool GossipHello(Player * player) override {
return OnGossipHello(player, me);
}
bool OnGossipHello(Player * player, Creature* Sicker) {
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "======= Training =======", GOSSIP_SENDER_MAIN, 90);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface\\Icons\\Spell_Nature_Swiftness:30|t Learn All Riding Skills", GOSSIP_SENDER_MAIN, 1);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|TInterface\\Icons\\Ability_DualWield:30|t Learn all Weapon Skills", GOSSIP_SENDER_MAIN, 2);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "====================", GOSSIP_SENDER_MAIN, 90);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "|cffFF0000|TInterface\\icons\\achievement_reputation_01:30 |t Nevermind...|r", GOSSIP_SENDER_MAIN, 0);
player->PlayerTalkClass->SendGossipMenu(907, Sicker->GetGUID());
return true;
}
bool GossipSelect(Player* player, uint32, uint32 OptionID) override {
uint32 UI_Sender = player->PlayerTalkClass->GetGossipOptionSender(OptionID);
uint32 UI_Action = player->PlayerTalkClass->GetGossipOptionAction(OptionID);
return OnGossipSelect(player, me, UI_Sender, UI_Action);
}
bool OnGossipSelect(Player* player, Creature* Sicker, uint32 SICKER_SENDER, uint32 SICKER_ACTION) {
player->PlayerTalkClass->ClearMenus();
if (SICKER_SENDER == GOSSIP_SENDER_MAIN) {
switch (SICKER_ACTION) {
case 0:
player->PlayerTalkClass->SendCloseGossip();
break;
case 1:
player->GetSession()->GetPlayer()->LearnSpell(33388, false);
player->GetSession()->GetPlayer()->LearnSpell(33391, false);
player->GetSession()->GetPlayer()->LearnSpell(34090, false);
player->GetSession()->GetPlayer()->LearnSpell(34091, false);
player->GetSession()->GetPlayer()->LearnSpell(34093, false);
player->PlayerTalkClass->SendCloseGossip();
break;
case 2:
case 21:
switch (player->getClass()) {
case CLASS_WARRIOR:
player->LearnSpell(5011, false);
player->LearnSpell(266, false);
player->LearnSpell(264, false);
player->LearnSpell(2567, false);
player->LearnSpell(5009, false);
player->LearnSpell(200, false);
player->LearnSpell(199, false);
player->LearnSpell(202, false);
player->LearnSpell(197, false);
player->LearnSpell(227, false);
player->LearnSpell(198, false);
player->LearnSpell(196, false);
player->LearnSpell(201, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
player->LearnSpell(674, false);
break;
case CLASS_PALADIN:
player->LearnSpell(200, false);
player->LearnSpell(199, false);
player->LearnSpell(202, false);
player->LearnSpell(197, false);
player->LearnSpell(198, false);
player->LearnSpell(196, false);
player->LearnSpell(201, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
break;
case CLASS_DEATH_KNIGHT:
player->LearnSpell(200, false);
player->LearnSpell(199, false);
player->LearnSpell(202, false);
player->LearnSpell(197, false);
player->LearnSpell(198, false);
player->LearnSpell(196, false);
player->LearnSpell(201, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
player->LearnSpell(674, false);
break;
case CLASS_ROGUE:
player->LearnSpell(5011, false);
player->LearnSpell(266, false);
player->LearnSpell(264, false);
player->LearnSpell(2567, false);
player->LearnSpell(198, false);
player->LearnSpell(196, false);
player->LearnSpell(201, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
player->LearnSpell(674, false);
break;
case CLASS_DRUID:
player->LearnSpell(200, false);
player->LearnSpell(199, false);
player->LearnSpell(197, false);
player->LearnSpell(198, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
break;
case CLASS_PRIEST:
player->LearnSpell(5009, false);
player->LearnSpell(227, false);
player->LearnSpell(198, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
break;
case CLASS_MAGE:
player->LearnSpell(5009, false);
player->LearnSpell(197, false);
player->LearnSpell(201, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
break;
case CLASS_WARLOCK:
player->LearnSpell(5009, false);
player->LearnSpell(197, false);
player->LearnSpell(201, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
break;
case CLASS_HUNTER:
player->LearnSpell(5011, false);
player->LearnSpell(266, false);
player->LearnSpell(2567, false);
player->LearnSpell(200, false);
player->LearnSpell(202, false);
player->LearnSpell(197, false);
player->LearnSpell(227, false);
player->LearnSpell(196, false);
player->LearnSpell(201, false);
player->LearnSpell(1180, false);
player->LearnSpell(204, false);
player->LearnSpell(203, false);
player->LearnSpell(674, false);
break;
case CLASS_SHAMAN:
player->LearnSpell(199, false);
player->LearnSpell(197, false);
player->LearnSpell(198, false);
player->LearnSpell(204, false);
player->LearnSpell(1180, false);
player->LearnSpell(227, false);
player->LearnSpell(203, false);
player->LearnSpell(196, false);
player->LearnSpell(674, false);
break;
}
player->UpdateWeaponsSkillsToMaxSkillsForLevel();
player->PlayerTalkClass->SendCloseGossip();
break;
case 90:
break;
}
}
return true;
}
};
CreatureAI* GetAI(Creature* creature) const override {
return new TRAINER_NPCAI(creature);
}
};
void AddSC_TRAINER_NPC() {
new TRAINER_NPC();
}