-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathorgrimmar.cpp
More file actions
198 lines (169 loc) · 6.48 KB
/
orgrimmar.cpp
File metadata and controls
198 lines (169 loc) · 6.48 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
/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* 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, 6566
SDCategory: Orgrimmar
EndScriptData */
/* ContentData
npc_shenthul
npc_thrall_warchief
EndContentData */
#include "precompiled.h"
/*######
## npc_shenthul
######*/
enum
{
QUEST_SHATTERED_SALUTE = 2460
};
struct npc_shenthulAI : public ScriptedAI
{
npc_shenthulAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
uint32 m_uiSaluteTimer;
uint32 m_uiResetTimer;
ObjectGuid m_playerGuid;
void Reset() override
{
m_uiSaluteTimer = 0;
m_uiResetTimer = 0;
m_playerGuid.Clear();
}
void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) override
{
if (m_uiResetTimer && uiTextEmote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
EnterEvadeMode();
}
}
void DoStartQuestEvent(Player* pPlayer)
{
m_playerGuid = pPlayer->GetObjectGuid();
m_uiSaluteTimer = 6000;
}
void UpdateAI(const uint32 uiDiff) override
{
if (m_uiResetTimer)
{
if (m_uiResetTimer <= uiDiff)
{
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);
}
m_uiResetTimer = 0;
EnterEvadeMode();
}
else
m_uiResetTimer -= uiDiff;
}
if (m_uiSaluteTimer)
{
if (m_uiSaluteTimer <= uiDiff)
{
m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE);
m_uiResetTimer = 60000;
m_uiSaluteTimer = 0;
}
else
m_uiSaluteTimer -= uiDiff;
}
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->DoStartQuestEvent(pPlayer);
}
return true;
}
/*######
## npc_thrall_warchief
######*/
enum
{
QUEST_ID_WHAT_THE_WIND_CARRIES = 6566,
};
bool GossipHello_npc_thrall_warchief(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid());
if (pPlayer->GetQuestStatus(QUEST_ID_WHAT_THE_WIND_CARRIES) == 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_ID_WHAT_THE_WIND_CARRIES);
break;
}
return true;
}
void AddSC_orgrimmar()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "npc_shenthul";
pNewScript->GetAI = &GetAI_npc_shenthul;
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_shenthul;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_thrall_warchief";
pNewScript->pGossipHello = &GossipHello_npc_thrall_warchief;
pNewScript->pGossipSelect = &GossipSelect_npc_thrall_warchief;
pNewScript->RegisterSelf();
}