Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_icecrown.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5#include "ScriptMgr.h"
6#include "ScriptedCreature.h"
7#include "ScriptedGossip.h"
8#include "SpellAuras.h"
9#include "Player.h"
10#include "TemporarySummon.h"
11#include "CombatAI.h"
12
13/*######
14## npc_arete
15######*/
16
17#define GOSSIP_ARETE_ITEM1 "Lord-Commander, I would hear your tale."
18#define GOSSIP_ARETE_ITEM2 "<You nod slightly but do not complete the motion as the Lord-Commander narrows his eyes before he continues.>"
19#define GOSSIP_ARETE_ITEM3 "I thought that they now called themselves the Scarlet Onslaught?"
20#define GOSSIP_ARETE_ITEM4 "Where did the grand admiral go?"
21#define GOSSIP_ARETE_ITEM5 "That's fine. When do I start?"
22#define GOSSIP_ARETE_ITEM6 "Let's finish this!"
23#define GOSSIP_ARETE_ITEM7 "That's quite a tale, Lord-Commander."
24
37
39{
40public:
41 npc_arete() : CreatureScript("npc_arete") { }
42
43 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
44 {
45 if (creature->IsQuestGiver())
46 player->PrepareQuestMenu(creature->GetGUID());
47
48 if (player->GetQuestStatus(QUEST_THE_STORY_THUS_FAR) == QUEST_STATUS_INCOMPLETE)
49 {
51 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE1, creature->GetGUID());
52 return true;
53 }
54
55 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
56 return true;
57 }
58
59 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
60 {
61 player->PlayerTalkClass->ClearMenus();
62 switch (action)
63 {
66 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE2, creature->GetGUID());
67 break;
70 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE3, creature->GetGUID());
71 break;
74 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE4, creature->GetGUID());
75 break;
78 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE5, creature->GetGUID());
79 break;
82 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE6, creature->GetGUID());
83 break;
86 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE7, creature->GetGUID());
87 break;
89 player->CLOSE_GOSSIP_MENU();
90 player->AreaExploredOrEventHappens(QUEST_THE_STORY_THUS_FAR);
91 break;
92 }
93
94 return true;
95 }
96};
97
98/*######
99## npc_squire_david
100######*/
101
111
112#define GOSSIP_SQUIRE_ITEM_1 "I am ready to fight!"
113#define GOSSIP_SQUIRE_ITEM_2 "How do the Argent Crusader raiders fight?"
114
116{
117public:
118 npc_squire_david() : CreatureScript("npc_squire_david") { }
119
120 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
121 {
122 if (player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_H) == QUEST_STATUS_INCOMPLETE ||
123 player->GetQuestStatus(QUEST_THE_ASPIRANT_S_CHALLENGE_A) == QUEST_STATUS_INCOMPLETE)//We need more info about it.
124 {
127 }
128
129 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SQUIRE, creature->GetGUID());
130 return true;
131 }
132
133 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
134 {
135 player->PlayerTalkClass->ClearMenus();
136 if (action == GOSSIP_ACTION_INFO_DEF+1)
137 {
138 player->CLOSE_GOSSIP_MENU();
139 creature->SummonCreature(NPC_ARGENT_VALIANT, 8575.451f, 952.472f, 547.554f, 0.38f);
140 }
141 return true;
142 }
143};
144
145/*######
146## npc_argent_valiant
147######*/
148
155
157{
158public:
159 npc_argent_valiant() : CreatureScript("npc_argent_valiant") { }
160
162 {
164 {
165 creature->GetMotionMaster()->MovePoint(0, 8599.258f, 963.951f, 547.553f);
166 creature->setFaction(35); //wrong faction in db?
167 }
168
171
173 {
174 uiChargeTimer = 7000;
175 uiShieldBreakerTimer = 10000;
176 }
177
178 void MovementInform(uint32 uiType, uint32 /*uiId*/) OVERRIDE
179 {
180 if (uiType != POINT_MOTION_TYPE)
181 return;
182
183 me->setFaction(14);
184 }
185
186 void DamageTaken(Unit* pDoneBy, uint32& uiDamage) OVERRIDE
187 {
188 if (uiDamage > me->GetHealth() && pDoneBy->GetTypeId() == TypeID::TYPEID_PLAYER)
189 {
190 uiDamage = 0;
191 pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true);
192 me->setFaction(35);
193 me->DespawnOrUnsummon(5000);
194 me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
196 }
197 }
198
200 {
201 if (!UpdateVictim())
202 return;
203
204 if (uiChargeTimer <= uiDiff)
205 {
207 uiChargeTimer = 7000;
208 } else uiChargeTimer -= uiDiff;
209
210 if (uiShieldBreakerTimer <= uiDiff)
211 {
213 uiShieldBreakerTimer = 10000;
214 } else uiShieldBreakerTimer -= uiDiff;
215
217 }
218 };
219
221 {
222 return new npc_argent_valiantAI(creature);
223 }
224};
225
226/*######
227## npc_guardian_pavilion
228######*/
229
238
240{
241public:
242 npc_guardian_pavilion() : CreatureScript("npc_guardian_pavilion") { }
243
245 {
247 {
248 SetCombatMovement(false);
249 }
250
252
253 {
254 if (me->GetAreaId() != AREA_SUNREAVER_PAVILION && me->GetAreaId() != AREA_SILVER_COVENANT_PAVILION)
255 return;
256
257 if (!who || who->GetTypeId() != TypeID::TYPEID_PLAYER || !me->IsHostileTo(who) || !me->isInBackInMap(who, 5.0f))
258 return;
259
260 if (who->HasAura(SPELL_TRESPASSER_H) || who->HasAura(SPELL_TRESPASSER_A))
261 return;
262
263 if (who->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
264 who->CastSpell(who, SPELL_TRESPASSER_H, true);
265 else
266 who->CastSpell(who, SPELL_TRESPASSER_A, true);
267 }
268 };
269
271 {
272 return new npc_guardian_pavilionAI(creature);
273 }
274};
275
276/*######
277## npc_vereth_the_cunning
278######*/
279
286
288{
289public:
290 npc_vereth_the_cunning() : CreatureScript("npc_vereth_the_cunning") { }
291
293 {
295
297 {
299
300 if (who->GetEntry() == NPC_LITHE_STALKER && me->IsWithinDistInMap(who, 10.0f))
301 {
302 if (Unit* owner = who->GetCharmer())
303 {
304 if (who->HasAura(SPELL_SUBDUED_LITHE_STALKER))
305 {
306 owner->ToPlayer()->KilledMonsterCredit(NPC_GEIST_RETURN_BUNNY_KC, 0);
307 who->ToCreature()->DisappearAndDie();
308 }
309 }
310 }
311 }
312 };
313
315 {
316 return new npc_vereth_the_cunningAI(creature);
317 }
318};
319
320/*######
321* npc_tournament_training_dummy
322######*/
346
348{
349 public:
350 npc_tournament_training_dummy(): CreatureScript("npc_tournament_training_dummy"){ }
351
353 {
355 {
356 SetCombatMovement(false);
357 }
358
361
363 {
364 me->SetControlled(true, UNIT_STATE_STUNNED);
365 me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
366 isVulnerable = false;
367
368 // Cast Defend spells to max stack size
369 switch (me->GetEntry())
370 {
373 break;
375 me->CastCustomSpell(SPELL_RANGED_DEFEND, SPELLVALUE_AURA_STACK, 3, me);
376 break;
377 }
378
379 events.Reset();
380 events.ScheduleEvent(EVENT_DUMMY_RECAST_DEFEND, 5000);
381 }
382
384 {
385 if (!_EnterEvadeMode())
386 return;
387
388 Reset();
389 }
390
391 void DamageTaken(Unit* /*attacker*/, uint32& damage) OVERRIDE
392 {
393 damage = 0;
394 events.RescheduleEvent(EVENT_DUMMY_RESET, 10000);
395 }
396
397 void SpellHit(Unit* caster, SpellInfo const* spell) OVERRIDE
398 {
399 switch (me->GetEntry())
400 {
402 if (spell->Id == SPELL_PLAYER_CHARGE)
403 if (isVulnerable)
404 DoCast(caster, SPELL_CHARGE_CREDIT, true);
405 break;
406 case NPC_MELEE_TARGET:
407 if (spell->Id == SPELL_PLAYER_THRUST)
408 {
409 DoCast(caster, SPELL_MELEE_CREDIT, true);
410
411 if (Unit* target = caster->GetVehicleBase())
412 DoCast(target, SPELL_COUNTERATTACK, true);
413 }
414 break;
416 if (spell->Id == SPELL_PLAYER_BREAK_SHIELD)
417 if (isVulnerable)
418 DoCast(caster, SPELL_RANGED_CREDIT, true);
419 break;
420 }
421
422 if (spell->Id == SPELL_PLAYER_BREAK_SHIELD)
423 if (!me->HasAura(SPELL_CHARGE_DEFEND) && !me->HasAura(SPELL_RANGED_DEFEND))
424 isVulnerable = true;
425 }
426
428 {
429 events.Update(diff);
430
431 switch (events.ExecuteEvent())
432 {
434 switch (me->GetEntry())
435 {
437 {
438 if (!me->HasAura(SPELL_CHARGE_DEFEND))
440 break;
441 }
443 {
444 Aura* defend = me->GetAura(SPELL_RANGED_DEFEND);
445 if (!defend || defend->GetStackAmount() < 3 || defend->GetDuration() <= 8000)
447 break;
448 }
449 }
450 isVulnerable = false;
451 events.ScheduleEvent(EVENT_DUMMY_RECAST_DEFEND, 5000);
452 break;
454 if (UpdateVictim())
455 {
457 events.ScheduleEvent(EVENT_DUMMY_RESET, 10000);
458 }
459 break;
460 }
461
462 if (!UpdateVictim())
463 return;
464
465 if (!me->HasUnitState(UNIT_STATE_STUNNED))
466 me->SetControlled(true, UNIT_STATE_STUNNED);
467 }
468
470 };
471
473 {
474 return new npc_tournament_training_dummyAI(creature);
475 }
476};
477
478// Battle for Crusaders' Pinnacle
480{
484 SPELL_TORCH = 58121,
485
494 NPC_LK = 31013,
495
496 BANNER_SAY = 0, // "The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!"
497 DALFORS_SAY_PRE_1 = 0, // "BY THE LIGHT! Those damned monsters! Look at what they've done to our people!"
498 DALFORS_SAY_PRE_2 = 1, // "Burn it down, boys. Burn it all down."
499 DALFORS_SAY_START = 2, // "Let 'em come. They'll pay for what they've done!"
500 DALFORS_YELL_FINISHED = 3, // "We've done it, lads! We've taken the pinnacle from the Scourge! Report to Father Gustav at once and tell him the good news! We're gonna get to buildin' and settin' up! Go!"
501 LK_TALK_1 = 0, // "Leave no survivors!"
502 LK_TALK_2 = 1, // "Cower before my terrible creations!"
503 LK_TALK_3 = 2, // "Feast my children! Feast upon the flesh of the living!"
504 LK_TALK_4 = 3, // "Lay down your arms and surrender your souls!"
505
515};
516
518{
519 {6458.703f, 403.858f, 490.498f, 3.1205f}, // Dalfors spawn point
520 {6422.950f, 423.335f, 510.451f, 0.0f}, // Dalfors intro pos
521 {6426.343f, 420.515f, 508.650f, 0.0f}, // Dalfors fight pos
522};
523
525{
526 {6462.025f, 403.681f, 489.721f, 3.1007f}, // priest1 spawn point
527 {6421.480f, 423.576f, 510.781f, 5.7421f}, // priest1 intro pos
528};
529
531{
532 {6463.969f, 407.198f, 489.240f, 2.2689f}, // priest2 spawn point
533 {6419.778f, 421.404f, 510.972f, 5.7421f}, // priest2 intro pos
534};
535
537{
538 {6464.371f, 400.944f, 489.186f, 6.1610f}, // priest3 spawn point
539 {6423.516f, 425.782f, 510.774f, 5.7421f}, // priest3 intro pos
540};
541
543{
544 {6462.929f, 409.826f, 489.392f, 3.0968f}, // mason1 spawn point
545 {6428.163f, 421.960f, 508.297f, 0.0f}, // mason1 intro pos
546 {6414.335f, 454.904f, 511.395f, 2.8972f}, // mason1 action pos
547};
548
550{
551 {6462.650f, 405.670f, 489.576f, 2.9414f}, // mason2 spawn point
552 {6426.250f, 419.194f, 508.219f, 0.0f}, // mason2 intro pos
553 {6415.014f, 446.849f, 511.395f, 3.1241f}, // mason2 action pos
554};
555
557{
558 {6462.646f, 401.218f, 489.601f, 2.7864f}, // mason3 spawn point
559 {6423.855f, 416.598f, 508.305f, 0.0f}, // mason3 intro pos
560 {6417.070f, 438.824f, 511.395f, 3.6651f}, // mason3 action pos
561};
562
564{
565public:
566 npc_blessed_banner() : CreatureScript("npc_blessed_banner") { }
567
569 {
571 {
572 HalofSpawned = false;
573 PhaseCount = 0;
574 Summons.DespawnAll();
575
576 SetCombatMovement(false);
577 }
578
580
582
584
586
591
593 {
594 me->setRegeneratingHealth(false);
596 me->AI()->Talk(BANNER_SAY);
597 events.ScheduleEvent(EVENT_SPAWN, 3000);
598 }
599
600 void EnterCombat(Unit* /*who*/) OVERRIDE { }
601
602 void MoveInLineOfSight(Unit* /*who*/) OVERRIDE { }
603
604
606 {
607 Summons.Summon(Summoned);
608 }
609
610 void JustDied(Unit* /*killer*/) OVERRIDE
611 {
612 Summons.DespawnAll();
613 me->DespawnOrUnsummon();
614 }
615
617 {
618 events.Update(diff);
619
620 switch (events.ExecuteEvent())
621 {
622 case EVENT_SPAWN:
623 {
625 {
626 guidDalfors = Dalfors->GetGUID();
627 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
628 }
630 {
631 guidPriest[0] = Priest1->GetGUID();
632 Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
633 }
635 {
636 guidPriest[1] = Priest2->GetGUID();
637 Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
638 }
640 {
641 guidPriest[2] = Priest3->GetGUID();
642 Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
643 }
644 if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
645 {
646 guidMason[0] = Mason1->GetGUID();
647 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
648 }
649 if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
650 {
651 guidMason[1] = Mason2->GetGUID();
652 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
653 }
654 if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
655 {
656 guidMason[2] = Mason3->GetGUID();
657 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
658 }
659 events.ScheduleEvent(EVENT_INTRO_1, 15000);
660 }
661 break;
662 case EVENT_INTRO_1:
663 {
664 if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
665 Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
666 events.ScheduleEvent(EVENT_INTRO_2, 5000);
667 }
668 break;
669 case EVENT_INTRO_2:
670 {
671 if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
672 {
673 Dalfors->SetFacingTo(6.215f);
674 Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
675 }
676 events.ScheduleEvent(EVENT_INTRO_3, 5000);
677 }
678 break;
679 case EVENT_INTRO_3:
680 {
681 if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
682 {
683 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
684 Dalfors->SetHomePosition(DalforsPos[2]);
685 }
686 if (Creature* Priest1 = me->GetCreature(*me, guidPriest[0]))
687 {
688 Priest1->SetFacingTo(5.7421f);
689 Priest1->SetHomePosition(Priest1Pos[1]);
690 }
691 if (Creature* Priest2 = me->GetCreature(*me, guidPriest[1]))
692 {
693 Priest2->SetFacingTo(5.7421f);
694 Priest2->SetHomePosition(Priest2Pos[1]);
695 }
696 if (Creature* Priest3 = me->GetCreature(*me, guidPriest[2]))
697 {
698 Priest3->SetFacingTo(5.7421f);
699 Priest3->SetHomePosition(Priest3Pos[1]);
700 }
701 if (Creature* Mason1 = me->GetCreature(*me, guidMason[0]))
702 {
703 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
704 Mason1->SetHomePosition(Mason1Pos[2]);
705 }
706 if (Creature* Mason2 = me->GetCreature(*me, guidMason[1]))
707 {
708 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
709 Mason2->SetHomePosition(Mason2Pos[2]);
710 }
711 if (Creature* Mason3 = me->GetCreature(*me, guidMason[2]))
712 {
713 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
714 Mason3->SetHomePosition(Mason3Pos[2]);
715 }
716 events.ScheduleEvent(EVENT_START_FIGHT, 5000);
717 events.ScheduleEvent(EVENT_MASON_ACTION, 15000);
718 }
719 break;
721 {
722 if (Creature* Mason1 = me->GetCreature(*me, guidMason[0]))
723 {
724 Mason1->SetFacingTo(2.8972f);
725 Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc
726 }
727 if (Creature* Mason2 = me->GetCreature(*me, guidMason[1]))
728 {
729 Mason2->SetFacingTo(3.1241f);
730 Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc
731 }
732 if (Creature* Mason3 = me->GetCreature(*me, guidMason[2]))
733 {
734 Mason3->SetFacingTo(3.6651f);
735 Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc
736 }
737 }
738 break;
740 {
742 LK->AI()->Talk(LK_TALK_1);
743 if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
744 Dalfors->AI()->Talk(DALFORS_SAY_START);
745 events.ScheduleEvent(EVENT_WAVE_SPAWN, 1000);
746 }
747 break;
748 case EVENT_WAVE_SPAWN:
749 {
750 if (PhaseCount == 3)
751 {
753 LK->AI()->Talk(LK_TALK_2);
754 }
755 else if (PhaseCount == 6)
756 {
758 LK->AI()->Talk(LK_TALK_3);
759 }
760 if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason3Pos[0]))
761 {
762 tempsum->SetHomePosition(DalforsPos[2]);
763 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
764 }
765 if ((std::rand() % 1) == 0)
766 {
768 {
769 tempsum->SetHomePosition(DalforsPos[2]);
770 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
771 }
773 {
774 tempsum->SetHomePosition(DalforsPos[2]);
775 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
776 }
777 }
778 else
779 {
781 {
782 tempsum->SetHomePosition(DalforsPos[2]);
783 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
784 }
786 {
787 tempsum->SetHomePosition(DalforsPos[2]);
788 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
789 }
790 }
791
792 PhaseCount++;
793
794 if (PhaseCount < 8)
795 events.ScheduleEvent(EVENT_WAVE_SPAWN, std::rand() % 20000 + 10000);
796 else
797 events.ScheduleEvent(EVENT_HALOF, std::rand() % 20000 + 10000);
798 }
799 break;
800 case EVENT_HALOF:
801 {
803 LK->AI()->Talk(LK_TALK_4);
804 if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason1Pos[0]))
805 {
806 tempsum->SetHomePosition(DalforsPos[2]);
807 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
808 }
809 if (Creature* tempsum = DoSummon(NPC_SCOURGE_DRUDGE, Mason2Pos[0]))
810 {
811 tempsum->SetHomePosition(DalforsPos[2]);
812 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
813 }
815 {
816 HalofSpawned = true;
817 guidHalof = tempsum->GetGUID();
818 tempsum->SetHomePosition(DalforsPos[2]);
819 tempsum->AI()->AttackStart(GetClosestCreatureWithEntry(me, NPC_BLESSED_BANNER, 100));
820 }
821 }
822 break;
823 case EVENT_ENDED:
824 {
825 Summons.DespawnAll();
826 me->DespawnOrUnsummon();
827 }
828 break;
829 }
830
831 if (PhaseCount == 8)
832 if (Creature* Halof = me->GetCreature(*me, guidHalof))
833 if (Halof->isDead())
834 {
836 Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
837 Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
838 Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
840 if (Creature* Dalfors = me->GetCreature(*me, guidDalfors))
841 Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
842 events.ScheduleEvent(EVENT_ENDED, 10000);
843 }
844 }
845 };
846
848 {
849 return new npc_blessed_bannerAI(creature);
850 }
851};
852
853/*######
854## Borrowed Technology - Id: 13291, The Solution Solution (daily) - Id: 13292, Volatility - Id: 13239, Volatiliy - Id: 13261 (daily)
855######*/
856
858{
859 // Spells
860 SPELL_GRAB = 59318,
864 SPELL_RIDE = 56687,
865
866 // Points
869
870 // Events
872};
873
875{
876 public:
877 npc_frostbrood_skytalon() : CreatureScript("npc_frostbrood_skytalon") { }
878
880 {
882
884
885 void IsSummonedBy(Unit* summoner) OVERRIDE
886 {
887 me->GetMotionMaster()->MovePoint(POINT_GRAB_DECOY, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
888 }
889
891 {
892 if (type != POINT_MOTION_TYPE)
893 return;
894
895 if (id == POINT_GRAB_DECOY)
896 if (TempSummon* summon = me->ToTempSummon())
897 if (Unit* summoner = summon->GetSummoner())
898 DoCast(summoner, SPELL_GRAB);
899 }
900
902 {
904 events.Update(diff);
905
906 while (uint32 eventId = events.ExecuteEvent())
907 {
908 if (eventId == EVENT_FLY_AWAY)
909 {
910 Position randomPosOnRadius;
911 randomPosOnRadius.m_positionZ = (me->GetPositionZ() + 40.0f);
912 me->GetNearPoint2D(randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAngle(me));
913 me->GetMotionMaster()->MovePoint(POINT_FLY_AWAY, randomPosOnRadius);
914 }
915 }
916 }
917
918 void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
919 {
920 switch (spell->Id)
921 {
922 case SPELL_EXPLOSION:
924 break;
925 case SPELL_RIDE:
927 events.ScheduleEvent(EVENT_FLY_AWAY, 100);
928 break;
929 }
930 }
931 };
932
934 {
935 return new npc_frostbrood_skytalonAI(creature);
936 }
937};
938
939/*######
940## The Flesh Giant Champion - Id: 13235
941######*/
973
975{
976 public:
977 npc_margrave_dhakar() : CreatureScript("npc_margrave_dhakar") { }
978
980 {
982
984 {
987
988 _events.Reset();
989 _summons.DespawnAll();
990 }
991
992 void sGossipSelect(Player* player, uint32 sender, uint32 action) OVERRIDE
993 {
994 if (player->GetQuestStatus(QUEST_FLESH_GIANT_CHAMPION) == QUEST_STATUS_INCOMPLETE && !player->IsInCombat())
995 {
996 if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
997 {
998 _events.ScheduleEvent(EVENT_INTRO, 1000);
1000 }
1001 }
1002 }
1003
1005 {
1006 _events.Update(diff);
1007
1008 while (uint32 eventId = _events.ExecuteEvent())
1009 {
1010 switch (eventId)
1011 {
1012 case EVENT_INTRO:
1013 {
1016
1017 if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
1018 {
1019 if (Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX() + 10.0f, morbidus->GetPositionY(), morbidus->GetPositionZ()))
1020 {
1021 _lichKingGuid = lichKing->GetGUID();
1022 lichKing->SetFacingTo(morbidus->GetOrientation());
1023 lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true);
1024 }
1025 }
1026
1027 _events.ScheduleEvent(EVENT_LK_SAY_1, 5000);
1028 break;
1029 }
1030 case EVENT_LK_SAY_1:
1031 {
1032 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1033 lichKing->AI()->Talk(SAY_LK_1);
1034 _events.ScheduleEvent(EVENT_LK_SAY_2, 5000);
1035 break;
1036 }
1037 case EVENT_LK_SAY_2:
1038 {
1039 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1040 lichKing->AI()->Talk(SAY_LK_2);
1041 _events.ScheduleEvent(EVENT_LK_SAY_3, 5000);
1042 break;
1043 }
1044 case EVENT_LK_SAY_3:
1045 {
1046 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1047 lichKing->AI()->Talk(SAY_LK_3);
1048 _events.ScheduleEvent(EVENT_LK_SAY_4, 5000);
1049 break;
1050 }
1051 case EVENT_LK_SAY_4:
1052 {
1053 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1054 lichKing->AI()->Talk(SAY_LK_4);
1055 _events.ScheduleEvent(EVENT_OUTRO, 12000);
1056 break;
1057 }
1058 case EVENT_LK_SAY_5:
1059 {
1060 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1061 lichKing->AI()->Talk(SAY_LK_5);
1062 _events.ScheduleEvent(EVENT_OUTRO, 8000);
1063 break;
1064 }
1065 case EVENT_OUTRO:
1066 {
1067 if (Creature* olakin = me->FindNearestCreature(NPC_OLAKIN, 50.0f, true))
1068 olakin->AI()->Talk(SAY_OLAKIN_PAY);
1069
1070 if (Creature* lichKing = Unit::GetCreature(*me, _lichKingGuid))
1071 lichKing->DespawnOrUnsummon(0);
1072
1073 _events.ScheduleEvent(EVENT_START, 5000);
1074 break;
1075 }
1076 case EVENT_START:
1077 {
1078 if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
1079 {
1081 morbidus->setFaction(FACTION_HOSTILE);
1082 }
1083
1084 break;
1085 }
1086 }
1087 }
1088
1090 }
1091
1092 private:
1096 };
1097
1099 {
1100 return new npc_margrave_dhakarAI(creature);
1101 }
1102};
1103
1105{
1106 public:
1107 npc_morbidus() : CreatureScript("npc_morbidus") { }
1108
1110 {
1111 npc_morbidusAI(Creature* creature) : ScriptedAI(creature) { }
1112
1114 {
1115 if (Creature* dhakar = me->FindNearestCreature(NPC_DHAKAR, 50.0f, true))
1116 dhakar->AI()->Reset();
1117
1118 // this will prevent the event to start without morbidus being alive
1120 me->SetReactState(REACT_PASSIVE);
1121 me->setFaction(FACTION_BASIC);
1122 }
1123 };
1124
1126 {
1127 return new npc_morbidusAI(creature);
1128 }
1129};
1130
1132{
1133 new npc_arete;
1134 new npc_squire_david;
1139 new npc_blessed_banner();
1141 new npc_margrave_dhakar();
1142 new npc_morbidus();
1143}
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition Object.h:55
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
@ EMOTE_STATE_NONE
@ EMOTE_STATE_READY2H
@ SPELL_EFFECT_KNOCK_BACK
@ TEAM_ALLIANCE
@ IMMUNITY_EFFECT
@ UNIT_NPC_FLAG_GOSSIP
Definition Unit.h:687
@ SPELLVALUE_AURA_STACK
Definition Unit.h:119
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ REACT_PASSIVE
Definition Unit.h:1156
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_IMMUNE_TO_NPC
Definition Unit.h:634
@ UNIT_FLAG_DISABLE_MOVE
Definition Unit.h:627
@ UNIT_FLAG_IMMUNE_TO_PC
Definition Unit.h:633
@ UNIT_FLAG_NOT_ATTACKABLE_1
Definition Unit.h:632
@ UNIT_FIELD_NPC_FLAGS
@ UNIT_FIELD_FLAGS
@ UNIT_FIELD_NPC_EMOTESTATE
@ SPELL_CHARGE
@ FACTION_HOSTILE
@ EVENT_SPAWN
@ SPELL_IMMOLATION
@ SPELL_SHIELD_BREAKER
@ SPELL_GRAB
@ SPELL_KILL_CREDIT
@ EVENT_INTRO_1
@ EVENT_INTRO_2
@ EVENT_INTRO_3
@ SPELL_EXPLOSION
@ SPELL_SIMPLE_TELEPORT
@ SPELL_THREAT_PULSE
Definition chapter2.cpp:26
int32 GetDuration() const
Definition SpellAuras.h:119
uint8 GetStackAmount() const
Definition SpellAuras.h:133
virtual void MoveInLineOfSight(Unit *)
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
bool _EnterEvadeMode()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:56
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
void setFaction(uint32 faction)
Definition Unit.h:1699
Unit * GetCharmer() const
Definition Unit.cpp:2348
Unit * GetVehicleBase() const
Definition Unit.cpp:7203
MotionMaster * GetMotionMaster()
Definition Unit.h:2605
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition Unit.cpp:4905
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
float m_positionZ
Definition Object.h:289
float m_positionX
Definition Object.h:287
float m_positionY
Definition Object.h:288
void SetCombatMovement(bool allowMovement)
Creature * me
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition CombatAI.cpp:270
VehicleAI(Creature *c)
Definition CombatAI.cpp:262
void MovementInform(uint32 uiType, uint32) OVERRIDE
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage) OVERRIDE
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustSummoned(Creature *Summoned) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *, SpellInfo const *spell) OVERRIDE
void MovementInform(uint32 type, uint32 id) OVERRIDE
void sGossipSelect(Player *player, uint32 sender, uint32 action) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_morbidusAI(Creature *creature)
void SpellHit(Unit *caster, SpellInfo const *spell) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_TRESPASSER_H
@ SPELL_TRESPASSER_A
#define GOSSIP_SQUIRE_ITEM_1
GuardianPavilion
@ AREA_SILVER_COVENANT_PAVILION
@ SPELL_TRESPASSER_H
@ SPELL_TRESPASSER_A
@ AREA_SUNREAVER_PAVILION
void AddSC_icecrown()
ArgentValiant
@ SPELL_CHARGE
@ SPELL_KILL_CREDIT
@ SPELL_SHIELD_BREAKER
Position const Priest1Pos[2]
FleshGiant
@ EVENT_LK_SAY_4
@ SAY_LK_5
@ SAY_OLAKIN_PAY
@ SAY_LK_4
@ FACTION_BASIC
@ SAY_LK_3
@ EVENT_START
@ EVENT_OUTRO
@ EVENT_LK_SAY_3
@ NPC_MORBIDUS
@ SPELL_SIMPLE_TELEPORT
@ EVENT_LK_SAY_1
@ FACTION_HOSTILE
@ EVENT_LK_SAY_5
@ QUEST_FLESH_GIANT_CHAMPION
@ EVENT_LK_SAY_2
@ NPC_LICH_KING
@ SAY_LK_1
@ SAY_DHAKAR_START
@ SAY_LK_2
@ NPC_DHAKAR
@ NPC_OLAKIN
@ EVENT_INTRO
VerethTheCunning
@ NPC_LITHE_STALKER
@ SPELL_SUBDUED_LITHE_STALKER
@ NPC_GEIST_RETURN_BUNNY_KC
#define GOSSIP_ARETE_ITEM2
Position const Mason1Pos[3]
SquireDavid
@ QUEST_THE_ASPIRANT_S_CHALLENGE_A
@ QUEST_THE_ASPIRANT_S_CHALLENGE_H
@ NPC_ARGENT_VALIANT
@ GOSSIP_TEXTID_SQUIRE
Position const Mason3Pos[3]
Position const Priest3Pos[2]
#define GOSSIP_ARETE_ITEM3
Position const Priest2Pos[2]
#define GOSSIP_ARETE_ITEM6
TournamentDummy
@ SPELL_RANGED_DEFEND
@ SPELL_PLAYER_CHARGE
@ NPC_RANGED_TARGET
@ SPELL_VULNERABLE
@ EVENT_DUMMY_RECAST_DEFEND
@ SPELL_CHARGE_DEFEND
@ SPELL_MELEE_CREDIT
@ SPELL_COUNTERATTACK
@ EVENT_DUMMY_RESET
@ NPC_CHARGE_TARGET
@ SPELL_CHARGE_CREDIT
@ SPELL_RANGED_CREDIT
@ SPELL_PLAYER_BREAK_SHIELD
@ NPC_MELEE_TARGET
@ SPELL_PLAYER_THRUST
#define GOSSIP_ARETE_ITEM1
#define GOSSIP_ARETE_ITEM7
#define GOSSIP_ARETE_ITEM5
BorrowedTechnologyAndVolatility
@ SPELL_EXPLOSION
@ SPELL_IMMOLATION
@ SPELL_GRAB
@ SPELL_PING_BUNNY
@ POINT_GRAB_DECOY
@ POINT_FLY_AWAY
@ SPELL_RIDE
@ EVENT_FLY_AWAY
@ GOSSIP_TEXTID_ARETE4
@ QUEST_THE_STORY_THUS_FAR
@ GOSSIP_TEXTID_ARETE2
@ GOSSIP_TEXTID_ARETE5
@ GOSSIP_TEXTID_ARETE1
@ GOSSIP_TEXTID_ARETE7
@ GOSSIP_TEXTID_ARETE3
@ GOSSIP_TEXTID_ARETE6
BlessedBanner
@ BANNER_SAY
@ DALFORS_SAY_PRE_1
@ EVENT_START_FIGHT
@ SPELL_BLESSING_OF_THE_CRUSADE
@ EVENT_SPAWN
@ EVENT_INTRO_1
@ NPC_HIDEOUS_PLAGEBRINGER
@ SPELL_CRUSADERS_SPIRE_VICTORY
@ EVENT_INTRO_2
@ NPC_HALOF_THE_DEATHBRINGER
@ SPELL_THREAT_PULSE
@ NPC_BLESSED_BANNER
@ NPC_ARGENT_BATTLE_PRIEST
@ LK_TALK_2
@ NPC_REANIMATED_CAPTAIN
@ EVENT_HALOF
@ DALFORS_YELL_FINISHED
@ NPC_ARGENT_MASON
@ EVENT_WAVE_SPAWN
@ LK_TALK_1
@ EVENT_MASON_ACTION
@ SPELL_TORCH
@ NPC_CRUSADER_LORD_DALFORS
@ DALFORS_SAY_PRE_2
@ EVENT_INTRO_3
@ EVENT_ENDED
@ NPC_SCOURGE_DRUDGE
@ LK_TALK_4
@ DALFORS_SAY_START
@ LK_TALK_3
@ NPC_LK
#define GOSSIP_SQUIRE_ITEM_2
#define GOSSIP_ARETE_ITEM4
Position const Mason2Pos[3]
Position const DalforsPos[3]