forked from insider42/scriptdev2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorm_peaks.cpp
More file actions
275 lines (232 loc) · 9.54 KB
/
storm_peaks.cpp
File metadata and controls
275 lines (232 loc) · 9.54 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
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
269
270
271
272
273
274
275
/* Copyright (C) 2006 - 2011 ScriptDev2 <http://www.scriptdev2.com/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Storm_Peaks
SD%Complete: 100
SDComment: Vendor Support (31247). Quest support: 12970, 12684
SDCategory: Storm Peaks
EndScriptData */
/* ContentData
npc_loklira_the_crone
npc_roxi_ramrocket
npc_frostborn_scout
EndContentData */
#include "precompiled.h"
/*######
## npc_frostborn_scout
######*/
enum Scout
{
QUEST_MISSING_SCOUT = 12864,
GOSSIP_TEXTID_SCOUT_1 = 13611,
GOSSIP_TEXTID_SCOUT_2 = 13612,
GOSSIP_TEXTID_SCOUT_3 = 13613,
GOSSIP_TEXTID_SCOUT_4 = 13614
};
#define GOSSIP_ITEM_SCOUT_1 "Are you okay? I've come to take you back to Frosthold if you can stand."
#define GOSSIP_ITEM_SCOUT_2 "I'm sorry that I didn't get here sooner. What happened?"
#define GOSSIP_ITEM_SCOUT_3 "I'll go get some help. Hang in there."
bool GossipHello_npc_frostborn_scout(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(QUEST_MISSING_SCOUT) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_1, pCreature->GetGUID());
return true;
}
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_frostborn_scout(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_2, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_3, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_4, pCreature->GetGUID());
pPlayer->AreaExploredOrEventHappens(QUEST_MISSING_SCOUT);
break;
}
return true;
}
/*######
## npc_loklira_the_crone
######*/
#define GOSSIP_ITEM_TELL_ME "Tell me about this proposal."
#define GOSSIP_ITEM_WHAT_HAPPENED "What happened then?"
#define GOSSIP_ITEM_YOU_WANT_ME "You want me to take part in the Hyldsmeet to end the war?"
#define GOSSIP_ITEM_VERY_WELL "Very well. I'll take part in this competition."
enum
{
GOSSIP_TEXTID_LOKLIRA1 = 13777,
GOSSIP_TEXTID_LOKLIRA2 = 13778,
GOSSIP_TEXTID_LOKLIRA3 = 13779,
GOSSIP_TEXTID_LOKLIRA4 = 13780,
QUEST_THE_HYLDSMEET = 12970,
CREDIT_LOKLIRA = 30467
};
bool GossipHello_npc_loklira_the_crone(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(QUEST_THE_HYLDSMEET) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELL_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA1, pCreature->GetGUID());
return true;
}
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_loklira_the_crone(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_HAPPENED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA2, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_YOU_WANT_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA3, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERY_WELL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA4, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->TalkedToCreature(CREDIT_LOKLIRA, pCreature->GetGUID());
pPlayer->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
/*######
## npc_thorim
######*/
#define GOSSIP_ITEM_THORIM1 "Can you tell me what became of Sif?"
#define GOSSIP_ITEM_THORIM2 "He did more than that, Thorim. He controls Ulduar now."
#define GOSSIP_ITEM_THORIM3 "It needn't end this way."
enum
{
QUEST_SIBLING_RIVALRY = 13064,
SPELL_THORIM_STORY_KILL_CREDIT = 56940,
GOSSIP_TEXTID_THORIM1 = 13799,
GOSSIP_TEXTID_THORIM2 = 13801,
GOSSIP_TEXTID_THORIM3 = 13802,
GOSSIP_TEXTID_THORIM4 = 13803
};
bool GossipHello_npc_thorim(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(QUEST_SIBLING_RIVALRY) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM1, pCreature->GetGUID());
}
else
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_thorim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM2, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM3, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM4, pCreature->GetGUID());
pCreature->CastSpell(pPlayer, SPELL_THORIM_STORY_KILL_CREDIT, true);
break;
}
return true;
}
/*######
## npc_roxi_ramrocket
######*/
#define GOSSIP_TEXT_RAMROCKET1 "How do you fly in this cold climate?"
#define GOSSIP_TEXT_RAMROCKET2 "I hear you sell motorcycle parts."
enum
{
SPELL_MECHANO_HOG = 60866,
SPELL_MEKGINEER_CHOPPER = 60867
};
bool GossipHello_npc_roxi_ramrocket(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isTrainer())
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_RAMROCKET1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
if (pCreature->isVendor())
{
if (pPlayer->HasSpell(SPELL_MECHANO_HOG) || pPlayer->HasSpell(SPELL_MEKGINEER_CHOPPER))
{
if (pPlayer->HasSkill(SKILL_ENGINEERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 450)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_RAMROCKET2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
}
}
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_roxi_ramrocket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_TRAIN:
pPlayer->SEND_TRAINERLIST(pCreature->GetGUID());
break;
case GOSSIP_ACTION_TRADE:
pPlayer->SEND_VENDORLIST(pCreature->GetGUID());
break;
}
return true;
}
void AddSC_storm_peaks()
{
Script* newscript;
newscript = new Script;
newscript->Name = "npc_frostborn_scout";
newscript->pGossipHello = &GossipHello_npc_frostborn_scout;
newscript->pGossipSelect = &GossipSelect_npc_frostborn_scout;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_loklira_the_crone";
newscript->pGossipHello = &GossipHello_npc_loklira_the_crone;
newscript->pGossipSelect = &GossipSelect_npc_loklira_the_crone;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_thorim";
newscript->pGossipHello = &GossipHello_npc_thorim;
newscript->pGossipSelect = &GossipSelect_npc_thorim;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_roxi_ramrocket";
newscript->pGossipHello = &GossipHello_npc_roxi_ramrocket;
newscript->pGossipSelect = &GossipSelect_npc_roxi_ramrocket;
newscript->RegisterSelf();
}