forked from insider42/scriptdev2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnagrand.cpp
More file actions
677 lines (574 loc) · 26.7 KB
/
nagrand.cpp
File metadata and controls
677 lines (574 loc) · 26.7 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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
/* 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: Nagrand
SD%Complete: 90
SDComment: Quest support: 9868, 9918, 9991, 10044, 10085, 10107, 10108, 10172, 10646. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
SDCategory: Nagrand
EndScriptData */
/* ContentData
mob_lump
npc_altruis_the_sufferer
npc_greatmother_geyah
npc_lantresor_of_the_blade
npc_maghar_captive
npc_creditmarker_visit_with_ancestors
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*######
## mob_lump - TODO: remove gossip, can be done in database
######*/
enum
{
QUEST_NOT_ON_MY_WATCH = 9918,
NPC_LUMPS_QUEST_CREDIT = 18354,
SAY_LUMP_AGGRO_1 = -1000190,
SAY_LUMP_AGGRO_2 = -1000191,
SAY_LUMP_DEFEAT = -1000192,
TEXT_ID_LUMP_1 = 9352,
TEXT_ID_LUMP_2 = 9353,
TEXT_ID_LUMP_3 = 9354,
TEXT_ID_LUMP_4 = 9355,
TEXT_ID_LUMP_5 = 9356,
SPELL_VISUAL_SLEEP = 16093,
SPELL_SPEAR_THROW = 32248,
FACTION_FRIENDLY = 35
};
struct MANGOS_DLL_DECL mob_lumpAI : public ScriptedAI
{
mob_lumpAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_bReset = false;
Reset();
}
uint32 m_uiResetTimer;
uint32 m_uiSpearThrowTimer;
bool m_bReset;
void Reset()
{
m_uiResetTimer = MINUTE*IN_MILLISECONDS;
m_uiSpearThrowTimer = 2000;
if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A)
m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A);
}
void AttackedBy(Unit* pAttacker)
{
if (m_creature->getVictim())
return;
if (m_creature->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
}
void DamageTaken(Unit* pDealer, uint32& uiDamage)
{
if (m_creature->GetHealth() < uiDamage || (m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 30)
{
Player* pPlayer = pDealer->GetCharmerOrOwnerPlayerOrPlayerItself();
if (!m_bReset && pPlayer && pPlayer->GetQuestStatus(QUEST_NOT_ON_MY_WATCH) == QUEST_STATUS_INCOMPLETE)
{
uiDamage = 0; //Take 0 damage
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
// should get unit_flags UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE at faction change, but unclear why/for what reason, skipped (no flags expected as default)
m_creature->setFaction(FACTION_FRIENDLY);
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
DoScriptText(SAY_LUMP_DEFEAT, m_creature, pPlayer);
m_bReset = true;
}
}
}
void Aggro(Unit* pWho)
{
if (m_creature->HasAura(SPELL_VISUAL_SLEEP, EFFECT_INDEX_0))
m_creature->RemoveAurasDueToSpell(SPELL_VISUAL_SLEEP);
if (!m_creature->IsStandState())
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(urand(0, 1) ? SAY_LUMP_AGGRO_1 : SAY_LUMP_AGGRO_2, m_creature, pWho);
}
void UpdateAI(const uint32 uiDiff)
{
// Check if we waiting for a reset
if (m_bReset)
{
if (m_uiResetTimer < uiDiff)
{
EnterEvadeMode();
m_bReset = false;
}
else
m_uiResetTimer -= uiDiff;
}
// Return since we have no target
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
// SpearThrow Timer
if (m_uiSpearThrowTimer < uiDiff)
{
DoCastSpellIfCan(m_creature->getVictim(), SPELL_SPEAR_THROW);
m_uiSpearThrowTimer = 20000;
}
else
m_uiSpearThrowTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_mob_lump(Creature* pCreature)
{
return new mob_lumpAI(pCreature);
}
bool GossipHello_mob_lump(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(QUEST_NOT_ON_MY_WATCH) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need answers, ogre!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_LUMP_1, pCreature->GetGUID());
return true;
}
bool GossipSelect_mob_lump(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Why are Boulderfist out this far? You know that this is Kurenai territory.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_LUMP_2, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_LUMP_3, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "This means war, Lump! War I say!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_LUMP_4, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3:
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_LUMP_5, pCreature->GetGUID());
pPlayer->TalkedToCreature(NPC_LUMPS_QUEST_CREDIT, pCreature->GetGUID());
break;
}
return true;
}
/*######
## npc_altruis_the_sufferer
######*/
enum
{
QUEST_SURVEY = 9991,
QUEST_PUPIL = 10646,
TAXI_PATH_ID = 532
};
bool GossipHello_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
//gossip before obtaining Survey the Land
if (pPlayer->GetQuestStatus(QUEST_SURVEY) == QUEST_STATUS_NONE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I see twisted steel and smell sundered earth.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
//gossip when Survey the Land is incomplete (technically, after the flight)
if (pPlayer->GetQuestStatus(QUEST_SURVEY) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Well...?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
//wowwiki.com/Varedis
if (pPlayer->GetQuestStatus(QUEST_PUPIL) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Story about Illidan's Pupil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30);
pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+10:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Legion?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+11:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+12:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "How do you see them now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+13:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Forge camps?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+14:
pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+20:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+21:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(QUEST_SURVEY);
break;
case GOSSIP_ACTION_INFO_DEF+30:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Story done", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31);
pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+31:
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->AreaExploredOrEventHappens(QUEST_PUPIL);
break;
}
return true;
}
bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (!pPlayer->GetQuestRewardStatus(QUEST_SURVEY)) //Survey the Land
{
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID);
}
return true;
}
/*######
## npc_greatmother_geyah
######*/
//all the textId's for the below is unknown, but i do believe the gossip item texts are proper.
bool GossipHello_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Hello, Greatmother. Garrosh told me that you wanted to speak with me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
}
else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE)
{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
}
else
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You raised all of the orcs here, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Do you believe that?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 4:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Left? How can you choose to leave?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 5:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What is this duty?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 6:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Is there anything I can do for you, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 7:
pPlayer->AreaExploredOrEventHappens(10044);
pPlayer->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 10:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have done all that I could, Greatmother. I thank you for your kind words.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 11:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Greatmother, you are the mother of Durotan?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 12:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 13:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 14:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will return to Azeroth at once, Greatmother.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 15:
pPlayer->AreaExploredOrEventHappens(10172);
pPlayer->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
/*######
## npc_lantresor_of_the_blade
######*/
bool GossipHello_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have killed many of your ogres, Lantresor. I have no fear.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Should I know? You look like an orc to me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And the other half?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have heard of your kind, but I never thought to see the day when I would meet a half-breed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "My apologies. I did not mean to offend. I am here on behalf of my people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What do I need to do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+7:
pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID());
if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(10107);
if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE)
pPlayer->AreaExploredOrEventHappens(10108);
break;
}
return true;
}
/*#####
## npc_maghar_captive
#####*/
enum
{
SAY_MAG_START = -1000482,
SAY_MAG_NO_ESCAPE = -1000483,
SAY_MAG_MORE = -1000484,
SAY_MAG_MORE_REPLY = -1000485,
SAY_MAG_LIGHTNING = -1000486,
SAY_MAG_SHOCK = -1000487,
SAY_MAG_COMPLETE = -1000488,
SPELL_CHAIN_LIGHTNING = 16006,
SPELL_EARTHBIND_TOTEM = 15786,
SPELL_FROST_SHOCK = 12548,
SPELL_HEALING_WAVE = 12491,
QUEST_TOTEM_KARDASH_H = 9868,
NPC_MURK_RAIDER = 18203,
NPC_MURK_BRUTE = 18211,
NPC_MURK_SCAVENGER = 18207,
NPC_MURK_PUTRIFIER = 18202
};
static float m_afAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f};
static float m_afAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f};
struct MANGOS_DLL_DECL npc_maghar_captiveAI : public npc_escortAI
{
npc_maghar_captiveAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
uint32 m_uiChainLightningTimer;
uint32 m_uiHealTimer;
uint32 m_uiFrostShockTimer;
void Reset()
{
m_uiChainLightningTimer = 1000;
m_uiHealTimer = 0;
m_uiFrostShockTimer = 6000;
}
void Aggro(Unit* pWho)
{
m_creature->CastSpell(m_creature, SPELL_EARTHBIND_TOTEM, false);
}
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
{
case 7:
DoScriptText(SAY_MAG_MORE, m_creature);
if (Creature* pTemp = m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
DoScriptText(SAY_MAG_MORE_REPLY, pTemp);
m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 16:
DoScriptText(SAY_MAG_COMPLETE, m_creature);
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, m_creature);
SetRun();
break;
}
}
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == NPC_MURK_BRUTE)
DoScriptText(SAY_MAG_NO_ESCAPE, pSummoned);
if (pSummoned->IsTotem())
return;
pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE);
pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
}
void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell)
{
if (pSpell->Id == SPELL_CHAIN_LIGHTNING)
{
if (urand(0, 9))
return;
DoScriptText(SAY_MAG_LIGHTNING, m_creature);
}
}
void UpdateEscortAI(const uint32 uiDiff)
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiChainLightningTimer < uiDiff)
{
DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
m_uiChainLightningTimer = urand(7000, 14000);
}
else
m_uiChainLightningTimer -= uiDiff;
if (m_creature->GetHealthPercent() < 30.0f)
{
if (m_uiHealTimer < uiDiff)
{
DoCastSpellIfCan(m_creature, SPELL_HEALING_WAVE);
m_uiHealTimer = 5000;
}
else
m_uiHealTimer -= uiDiff;
}
if (m_uiFrostShockTimer < uiDiff)
{
DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_SHOCK);
m_uiFrostShockTimer = urand(7500, 15000);
}
else
m_uiFrostShockTimer -= uiDiff;
DoMeleeAttackIfReady();
}
};
bool QuestAccept_npc_maghar_captive(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
{
if (npc_maghar_captiveAI* pEscortAI = dynamic_cast<npc_maghar_captiveAI*>(pCreature->AI()))
{
pCreature->SetStandState(UNIT_STAND_STATE_STAND);
pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE);
pEscortAI->Start(false, pPlayer->GetGUID(), pQuest);
DoScriptText(SAY_MAG_START, pCreature);
pCreature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
pCreature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
pCreature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
}
}
return true;
}
CreatureAI* GetAI_npc_maghar_captive(Creature* pCreature)
{
return new npc_maghar_captiveAI(pCreature);
}
/*######
## npc_creditmarker_visist_with_ancestors (Quest 10085)
######*/
enum
{
QUEST_VISIT_WITH_ANCESTORS = 10085
};
struct MANGOS_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
{
npc_creditmarker_visit_with_ancestorsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
void Reset() {}
void MoveInLineOfSight(Unit* pWho)
{
if (pWho->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(pWho, 30.0f))
{
if (((Player*)pWho)->GetQuestStatus(QUEST_VISIT_WITH_ANCESTORS) == QUEST_STATUS_INCOMPLETE)
{
uint32 creditMarkerId = m_creature->GetEntry();
if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
{
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
if (!((Player*)pWho)->GetReqKillOrCastCurrentCount(QUEST_VISIT_WITH_ANCESTORS, creditMarkerId))
((Player*)pWho)->KilledMonsterCredit(creditMarkerId, m_creature->GetObjectGuid());
}
}
}
}
};
CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature)
{
return new npc_creditmarker_visit_with_ancestorsAI(pCreature);
}
/*######
## AddSC
######*/
void AddSC_nagrand()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "mob_lump";
pNewScript->GetAI = &GetAI_mob_lump;
pNewScript->pGossipHello = &GossipHello_mob_lump;
pNewScript->pGossipSelect = &GossipSelect_mob_lump;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_altruis_the_sufferer";
pNewScript->pGossipHello = &GossipHello_npc_altruis_the_sufferer;
pNewScript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer;
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_altruis_the_sufferer;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_greatmother_geyah";
pNewScript->pGossipHello = &GossipHello_npc_greatmother_geyah;
pNewScript->pGossipSelect = &GossipSelect_npc_greatmother_geyah;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_lantresor_of_the_blade";
pNewScript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade;
pNewScript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_maghar_captive";
pNewScript->GetAI = &GetAI_npc_maghar_captive;
pNewScript->pQuestAcceptNPC = &QuestAccept_npc_maghar_captive;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_creditmarker_visit_with_ancestors";
pNewScript->GetAI = &GetAI_npc_creditmarker_visit_with_ancestors;
pNewScript->RegisterSelf();
}