-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathorgrimmar.cpp
More file actions
274 lines (235 loc) · 8.76 KB
/
orgrimmar.cpp
File metadata and controls
274 lines (235 loc) · 8.76 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
/* 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: Orgrimmar
SD%Complete: 100
SDComment: Quest support: 2460, 5727, 6566
SDCategory: Orgrimmar
EndScriptData */
/* ContentData
npc_neeru_fireblade npc_text + gossip options text missing
npc_shenthul
npc_thrall_warchief
EndContentData */
#include "precompiled.h"
/*######
## npc_neeru_fireblade
######*/
#define QUEST_5727 5727
bool GossipHello_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid());
if (pPlayer->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You may speak frankly, Neeru...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetObjectGuid());
return true;
}
bool GossipSelect_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(QUEST_5727);
break;
}
return true;
}
/*######
## npc_shenthul
######*/
enum
{
QUEST_SHATTERED_SALUTE = 2460
};
struct MANGOS_DLL_DECL npc_shenthulAI : public ScriptedAI
{
npc_shenthulAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
bool CanTalk;
bool CanEmote;
uint32 Salute_Timer;
uint32 Reset_Timer;
ObjectGuid m_playerGuid;
void Reset()
{
CanTalk = false;
CanEmote = false;
Salute_Timer = 6000;
Reset_Timer = 0;
m_playerGuid.Clear();
}
void ReceiveEmote(Player* pPlayer, uint32 emote)
{
if (emote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
{
if (CanEmote)
{
pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
Reset();
}
}
}
void UpdateAI(const uint32 diff)
{
if (CanEmote)
{
if (Reset_Timer < diff)
{
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid))
{
if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
pPlayer->FailQuest(QUEST_SHATTERED_SALUTE);
}
Reset();
} else Reset_Timer -= diff;
}
if (CanTalk && !CanEmote)
{
if (Salute_Timer < diff)
{
m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE);
CanEmote = true;
Reset_Timer = 60000;
} else Salute_Timer -= diff;
}
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_shenthul(Creature* pCreature)
{
return new npc_shenthulAI(pCreature);
}
bool QuestAccept_npc_shenthul(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_SHATTERED_SALUTE)
{
if (npc_shenthulAI* pShenAI = dynamic_cast<npc_shenthulAI*>(pCreature->AI()))
{
pShenAI->CanTalk = true;
pShenAI->m_playerGuid = pPlayer->GetObjectGuid();
}
}
return true;
}
/*######
## npc_thrall_warchief
######*/
#define QUEST_6566 6566
#define SPELL_CHAIN_LIGHTNING 16033
#define SPELL_SHOCK 16034
//TODO: verify abilities/timers
struct MANGOS_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI
{
npc_thrall_warchiefAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
uint32 ChainLightning_Timer;
uint32 Shock_Timer;
void Reset()
{
ChainLightning_Timer = 2000;
Shock_Timer = 8000;
}
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (ChainLightning_Timer < diff)
{
DoCastSpellIfCan(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING);
ChainLightning_Timer = 9000;
}else ChainLightning_Timer -= diff;
if (Shock_Timer < diff)
{
DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHOCK);
Shock_Timer = 15000;
}else Shock_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_thrall_warchief(Creature* pCreature)
{
return new npc_thrall_warchiefAI(pCreature);
}
bool GossipHello_npc_thrall_warchief(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid());
if (pPlayer->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please share your wisdom with me, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetObjectGuid());
return true;
}
bool GossipSelect_npc_thrall_warchief(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What discoveries?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(5733, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Usurper?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
pPlayer->SEND_GOSSIP_MENU(5734, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
pPlayer->SEND_GOSSIP_MENU(5735, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I... I did not think of it that way, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
pPlayer->SEND_GOSSIP_MENU(5736, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+5:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I live only to serve, Warchief! My life is empty and meaningless without your guidance.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
pPlayer->SEND_GOSSIP_MENU(5737, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+6:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Of course, Warchief!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
pPlayer->SEND_GOSSIP_MENU(5738, pCreature->GetObjectGuid());
break;
case GOSSIP_ACTION_INFO_DEF+7:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(QUEST_6566);
break;
}
return true;
}
void AddSC_orgrimmar()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_neeru_fireblade";
newscript->pGossipHello = &GossipHello_npc_neeru_fireblade;
newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_shenthul";
newscript->GetAI = &GetAI_npc_shenthul;
newscript->pQuestAcceptNPC = &QuestAccept_npc_shenthul;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_thrall_warchief";
newscript->GetAI = &GetAI_npc_thrall_warchief;
newscript->pGossipHello = &GossipHello_npc_thrall_warchief;
newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief;
newscript->RegisterSelf();
}