Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_netherstorm.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
6/* ScriptData
7SDName: Netherstorm
8SD%Complete: 80
9SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10299, 10321, 10322, 10323, 10329, 10330, 10338, 10365(Shutting Down Manaforge), 10198, 10191
10SDCategory: Netherstorm
11EndScriptData */
12
13/* ContentData
14npc_manaforge_control_console
15go_manaforge_control_console
16npc_commander_dawnforge
17npc_bessy
18npc_maxx_a_million
19go_captain_tyralius_prison
20EndContentData */
21
22#include "ScriptMgr.h"
23#include "ScriptedCreature.h"
24#include "ScriptedGossip.h"
25#include "ScriptedEscortAI.h"
26#include "Player.h"
27
28/*######
29## npc_manaforge_control_console
30######*/
31
32//used by 20209, 20417, 20418, 20440, signed for 20209
34{
41
46
49
53
55 SPELL_INTERRUPT_1 = 35016, //ACID mobs should cast this
56 SPELL_INTERRUPT_2 = 35176, //ACID mobs should cast this (Manaforge Ara-version)
57};
58
60{
61public:
62 npc_manaforge_control_console() : CreatureScript("npc_manaforge_control_console") { }
63
65 {
66 return new npc_manaforge_control_consoleAI(creature);
67 }
68
70 {
72
76 bool Wave;
80
82 {
83 Event_Timer = 3000;
84 Wave_Timer = 0;
85 Phase = 1;
86 Wave = false;
87 someplayer = 0;
88 goConsole = 0;
89 add = NULL;
90 }
91
92 void EnterCombat(Unit* /*who*/) OVERRIDE { }
93
94 /*void SpellHit(Unit* caster, const SpellInfo* spell) OVERRIDE
95 {
96 //we have no way of telling the Creature was hit by spell -> got aura applied after 10-12 seconds
97 //then no way for the mobs to actually stop the shutdown as intended.
98 if (spell->Id == SPELL_INTERRUPT_1)
99 DoSay("Silence! I kill you!", LANG_UNIVERSAL, NULL);
100 }*/
101
102 void JustDied(Unit* /*killer*/) OVERRIDE
103 {
105
106 if (someplayer)
107 {
109 {
110 switch (me->GetEntry())
111 {
113 player->FailQuest(10299);
114 player->FailQuest(10329);
115 break;
117 player->FailQuest(10321);
118 player->FailQuest(10330);
119 break;
121 player->FailQuest(10322);
122 player->FailQuest(10338);
123 break;
125 player->FailQuest(10323);
126 player->FailQuest(10365);
127 break;
128 }
129 }
130 }
131
132 if (goConsole)
134 go->RemoveFlag(GAMEOBJECT_FIELD_FLAGS, GO_FLAG_IN_USE);
135 }
136
138 {
139 switch (creature->GetEntry())
140 {
142 if (rand()%2)
143 {
144 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2933.68f, 4162.55f, 164.00f, 1.60f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
145 if (add) add->GetMotionMaster()->MovePoint(0, 2927.36f, 4212.97f, 164.00f);
146 }
147 else
148 {
149 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2927.36f, 4212.97f, 164.00f, 4.94f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
150 if (add) add->GetMotionMaster()->MovePoint(0, 2933.68f, 4162.55f, 164.00f);
151 }
152 Wave_Timer = 30000;
153 break;
155 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2445.21f, 2765.26f, 134.49f, 3.93f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
156 if (add) add->GetMotionMaster()->MovePoint(0, 2424.21f, 2740.15f, 133.81f);
157 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2429.86f, 2731.85f, 134.53f, 1.31f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
158 if (add) add->GetMotionMaster()->MovePoint(0, 2435.37f, 2766.04f, 133.81f);
159 Wave_Timer = 20000;
160 break;
162 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2986.80f, 2205.36f, 165.37f, 3.74f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
163 if (add) add->GetMotionMaster()->MovePoint(0, 2985.15f, 2197.32f, 164.79f);
164 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2952.91f, 2191.20f, 165.32f, 0.22f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
165 if (add) add->GetMotionMaster()->MovePoint(0, 2060.01f, 2185.27f, 164.67f);
166 Wave_Timer = 15000;
167 break;
169 if (rand()%2)
170 {
171 add = me->SummonCreature(ENTRY_ARA_TECH, 4035.11f, 4038.97f, 194.27f, 2.57f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
172 if (add) add->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f);
173 add = me->SummonCreature(ENTRY_ARA_TECH, 4033.66f, 4036.79f, 194.28f, 2.57f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
174 if (add) add->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f);
175 add = me->SummonCreature(ENTRY_ARA_TECH, 4037.13f, 4037.30f, 194.23f, 2.57f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
176 if (add) add->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f);
177 }
178 else
179 {
180 add = me->SummonCreature(ENTRY_ARA_TECH, 3099.59f, 4049.30f, 194.22f, 0.05f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
181 if (add) add->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f);
182 add = me->SummonCreature(ENTRY_ARA_TECH, 3999.72f, 4046.75f, 194.22f, 0.05f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
183 if (add) add->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f);
184 add = me->SummonCreature(ENTRY_ARA_TECH, 3996.81f, 4048.26f, 194.22f, 0.05f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
185 if (add) add->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f);
186 }
187 Wave_Timer = 15000;
188 break;
189 }
190 }
192 {
193 switch (creature->GetEntry())
194 {
196 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2946.52f, 4201.42f, 163.47f, 3.54f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
197 if (add) add->GetMotionMaster()->MovePoint(0, 2927.49f, 4192.81f, 163.00f);
198 break;
200 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2453.88f, 2737.85f, 133.27f, 2.59f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
201 if (add) add->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f);
202 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2441.62f, 2735.32f, 134.49f, 1.97f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
203 if (add) add->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f);
204 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2450.73f, 2754.50f, 134.49f, 3.29f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
205 if (add) add->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f);
206 break;
208 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2956.18f, 2202.85f, 165.32f, 5.45f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
209 if (add) add->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f);
210 add = me->SummonCreature(ENTRY_SUNFURY_TECH, 2975.30f, 2211.50f, 165.32f, 4.55f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
211 if (add) add->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f);
212 add = me->SummonCreature(ENTRY_SUNFURY_PROT, 2965.02f, 2217.45f, 164.16f, 4.96f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
213 if (add) add->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f);
214 break;
216 add = me->SummonCreature(ENTRY_ARA_ENGI, 3994.51f, 4020.46f, 192.18f, 0.91f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
217 if (add) add->GetMotionMaster()->MovePoint(0, 4008.35f, 4035.04f, 192.70f);
218 add = me->SummonCreature(ENTRY_ARA_GORKLONN, 4021.56f, 4059.35f, 193.59f, 4.44f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
219 if (add) add->GetMotionMaster()->MovePoint(0, 4016.62f, 4039.89f, 193.46f);
220 break;
221 }
222 }
223
225 {
226 if (Event_Timer <= diff)
227 {
228 switch (Phase)
229 {
230 case 1:
231 if (someplayer)
232 {
234 if (u && u->GetTypeId() == TypeID::TYPEID_PLAYER)
235 Talk(EMOTE_START, u);
236 }
237 Event_Timer = 60000;
238 Wave = true;
239 ++Phase;
240 break;
241 case 2:
242 Talk(EMOTE_60);
243 Event_Timer = 30000;
244 ++Phase;
245 break;
246 case 3:
247 Talk(EMOTE_30);
248 Event_Timer = 20000;
250 ++Phase;
251 break;
252 case 4:
253 Talk(EMOTE_10);
254 Event_Timer = 10000;
255 Wave = false;
256 ++Phase;
257 break;
258 case 5:
260 if (someplayer)
261 {
263 player->KilledMonsterCredit(me->GetEntry(), me->GetGUID());
265 }
266
267 if (goConsole)
269 go->RemoveFlag(GAMEOBJECT_FIELD_FLAGS, GO_FLAG_IN_USE);
270
271 ++Phase;
272 break;
273 }
274 }
275 else
276 Event_Timer -= diff;
277
278 if (Wave)
279 {
280 if (Wave_Timer <= diff)
281 {
283 }
284 else
285 Wave_Timer -= diff;
286 }
287 }
288 };
289};
290
291/*######
292## go_manaforge_control_console
293######*/
294
297{
298public:
299 go_manaforge_control_console() : GameObjectScript("go_manaforge_control_console") { }
300
302 {
303 if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
304 {
305 player->PrepareQuestMenu(go->GetGUID());
306 player->SendPreparedQuest(go->GetGUID());
307 }
308
309 Creature* manaforge = NULL;
310
311 switch (go->GetAreaId())
312 {
313 case 3726: //b'naar
314 if ((player->GetQuestStatus(10299) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10329) == QUEST_STATUS_INCOMPLETE) &&
315 player->HasItemCount(29366))
316 manaforge = player->SummonCreature(ENTRY_BNAAR_C_CONSOLE, 2918.95f, 4189.98f, 161.88f, 0.34f, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
317 break;
318 case 3730: //coruu
319 if ((player->GetQuestStatus(10321) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10330) == QUEST_STATUS_INCOMPLETE) &&
320 player->HasItemCount(29396))
321 manaforge = player->SummonCreature(ENTRY_CORUU_C_CONSOLE, 2426.77f, 2750.38f, 133.24f, 2.14f, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
322 break;
323 case 3734: //duro
324 if ((player->GetQuestStatus(10322) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10338) == QUEST_STATUS_INCOMPLETE) &&
325 player->HasItemCount(29397))
326 manaforge = player->SummonCreature(ENTRY_DURO_C_CONSOLE, 2976.48f, 2183.29f, 163.20f, 1.85f, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
327 break;
328 case 3722: //ara
329 if ((player->GetQuestStatus(10323) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10365) == QUEST_STATUS_INCOMPLETE) &&
330 player->HasItemCount(29411))
331 manaforge = player->SummonCreature(ENTRY_ARA_C_CONSOLE, 4013.71f, 4028.76f, 192.10f, 1.25f, TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000);
332 break;
333 }
334
335 if (manaforge)
336 {
337 CAST_AI(npc_manaforge_control_console::npc_manaforge_control_consoleAI, manaforge->AI())->someplayer = player->GetGUID();
338 CAST_AI(npc_manaforge_control_console::npc_manaforge_control_consoleAI, manaforge->AI())->goConsole = go->GetGUID();
340 }
341 return true;
342 }
343};
344
345/*######
346## npc_commander_dawnforge
347######*/
348
349// The Speech of Dawnforge, Ardonis & Pathaleon
369
370// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image
372{
373 19830, // Ardonis
374 19831, // Dawnforge
375 21504 // Pathaleon
376};
377
379{
380public:
381 npc_commander_dawnforge() : CreatureScript("npc_commander_dawnforge") { }
382
384 {
385 return new npc_commander_dawnforgeAI(creature);
386 }
387
389 {
391
395
400
403
405 {
406 PlayerGUID = 0;
407 ardonisGUID = 0;
408 pathaleonGUID = 0;
409
410 Phase = 1;
411 PhaseSubphase = 0;
412 Phase_Timer = 4000;
413 isEvent = false;
414 }
415
416 void EnterCombat(Unit* /*who*/) OVERRIDE { }
417
419 {
420 pathaleonGUID = summoned->GetGUID();
421 }
422
423 // Emote Ardonis and Pathaleon
425 {
429
430 if (!ardonis || !pathaleon || !player)
431 return;
432
433 //Calculate the angle to Pathaleon
434 angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
435 angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
436
437 //Turn Dawnforge and update
438 me->SetOrientation(angle_dawnforge);
439 me->SendUpdateToPlayer(player);
440 //Turn Ardonis and update
442 ardonis->SendUpdateToPlayer(player);
443
444 //Set them to kneel
445 me->SetStandState(UNIT_STAND_STATE_KNEEL);
447 }
448
449 //Set them back to each other
451 {
452 if (Unit* ardonis = ObjectAccessor::GetUnit(*me, ardonisGUID))
453 {
455
456 if (!player)
457 return;
458
459 angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
460 angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
461
462 //Turn Dawnforge and update
463 me->SetOrientation(angle_dawnforge);
464 me->SendUpdateToPlayer(player);
465 //Turn Ardonis and update
466 ardonis->SetOrientation(angle_ardonis);
467 ardonis->SendUpdateToPlayer(player);
468
469 //Set state
470 me->SetStandState(UNIT_STAND_STATE_STAND);
471 ardonis->SetStandState(UNIT_STAND_STATE_STAND);
472 }
473 }
474
475 bool CanStartEvent(Player* player)
476 {
477 if (!isEvent)
478 {
479 Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
480 if (!ardonis)
481 return false;
482
483 ardonisGUID = ardonis->GetGUID();
484 PlayerGUID = player->GetGUID();
485
486 isEvent = true;
487
489 return true;
490 }
491
492 SF_LOG_DEBUG("scripts", "npc_commander_dawnforge event already in progress, need to wait.");
493 return false;
494 }
495
497 {
498 //Is event even running?
499 if (!isEvent)
500 return;
501
502 //Phase timing
503 if (Phase_Timer >= diff)
504 {
505 Phase_Timer -= diff;
506 return;
507 }
508
512
513 if (!ardonis || !player)
514 {
515 Reset();
516 return;
517 }
518
519 if (Phase > 4 && !pathaleon)
520 {
521 Reset();
522 return;
523 }
524
525 //Phase 1 Dawnforge say
526 switch (Phase)
527 {
528 case 1:
530 ++Phase;
531 Phase_Timer = 16000;
532 break;
533 //Phase 2 Ardonis say
534 case 2:
535 ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_1);
536 ++Phase;
537 Phase_Timer = 16000;
538 break;
539 //Phase 3 Dawnforge say
540 case 3:
542 ++Phase;
543 Phase_Timer = 16000;
544 break;
545 //Phase 4 Pathaleon spawns up to phase 9
546 case 4:
547 //spawn pathaleon's image
548 me->SummonCreature(CreatureEntry[2], 2325.851563f, 2799.534668f, 133.084229f, 6.038996f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 90000);
549 ++Phase;
550 Phase_Timer = 500;
551 break;
552 //Phase 5 Pathaleon say
553 case 5:
555 ++Phase;
556 Phase_Timer = 6000;
557 break;
558 //Phase 6
559 case 6:
560 switch (PhaseSubphase)
561 {
562 //Subphase 1: Turn Dawnforge and Ardonis
563 case 0:
566 Phase_Timer = 8000;
567 break;
568 //Subphase 2 Dawnforge say
569 case 1:
571 PhaseSubphase = 0;
572 ++Phase;
573 Phase_Timer = 8000;
574 break;
575 }
576 break;
577 //Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase
578 case 7:
579 switch (PhaseSubphase)
580 {
581 //Subphase 1
582 case 0:
585 Phase_Timer = 12000;
586 break;
587 //Subphase 2
588 case 1:
591 Phase_Timer = 16000;
592 break;
593 //Subphase 3
594 case 2:
596 PhaseSubphase = 0;
597 ++Phase;
598 Phase_Timer = 10000;
599 break;
600 }
601 break;
602 //Phase 8 Dawnforge & Ardonis say
603 case 8:
605 ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_2);
606 ++Phase;
607 Phase_Timer = 4000;
608 break;
609 //Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle
610 case 9:
612 //hide pathaleon, unit will despawn shortly
613 pathaleon->SetVisible(false);
614 PhaseSubphase = 0;
615 ++Phase;
616 Phase_Timer = 3000;
617 break;
618 //Phase 10 Dawnforge say
619 case 10:
622 Reset();
623 break;
624 }
625 }
626 };
627};
628
630{
631public:
632 at_commander_dawnforge() : AreaTriggerScript("at_commander_dawnforge") { }
633
634 bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE
635 {
636 //if player lost aura or not have at all, we should not try start event.
637 if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
638 return false;
639
640 if (player->IsAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
641 {
642 Creature* Dawnforge = player->FindNearestCreature(CreatureEntry[1], 30.0f);
643 if (!Dawnforge)
644 return false;
645
646 if (CAST_AI(npc_commander_dawnforge::npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(player))
647 return true;
648 }
649 return false;
650 }
651};
652
653/*######
654## npc_professor_dabiri
655######*/
657{
659
660 //WHISPER_DABIRI = 0, not existing in database
661
664};
665
666#define GOSSIP_ITEM "I need a new phase distruptor, Professor"
667
669{
670public:
671 npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { }
672
673 //OnQuestAccept:
674 //if (quest->GetQuestId() == QUEST_DIMENSIUS)
675 //creature->AI()->Talk(WHISPER_DABIRI, player);
676
677 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
678 {
679 player->PlayerTalkClass->ClearMenus();
680 if (action == GOSSIP_ACTION_INFO_DEF+1)
681 {
682 creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false);
683 player->CLOSE_GOSSIP_MENU();
684 }
685
686 return true;
687 }
688
689 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
690 {
691 if (creature->IsQuestGiver())
692 player->PrepareQuestMenu(creature->GetGUID());
693
694 if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778))
696
697 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
698
699 return true;
700 }
701};
702
703/*######
704## npc_phase_hunter
705######*/
706
723
725{
726public:
727 npc_phase_hunter() : CreatureScript("npc_phase_hunter") { }
728
730 {
731 return new npc_phase_hunterAI(creature);
732 }
733
735 {
736 npc_phase_hunterAI(Creature* creature) : ScriptedAI(creature) { }
737
738 bool Weak;
742
744
746
748 {
749 Weak = false;
750 Materialize = false;
751 Drained = false;
752 WeakPercent = 25 + (rand() % 16); // 25-40
753
754 PlayerGUID = 0;
755
756 ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
757
758 if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
759 me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
760 }
761
763 {
764 if (who->GetTypeId() == TypeID::TYPEID_PLAYER)
765 PlayerGUID = who->GetGUID();
766 }
767
768 //void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) OVERRIDE
769 //{
770 // DoCast(me, SPELL_DE_MATERIALIZE);
771 //}
772
774 {
775 if (!Materialize)
776 {
778 Materialize = true;
779 }
780
781 if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STATE_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
783
784 if (!UpdateVictim())
785 return;
786
787 // some code to cast spell Mana Burn on random target which has mana
788 if (ManaBurnTimer <= diff)
789 {
790 std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
791 std::list<Unit*> UnitsWithMana;
792
793 for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
794 {
795 if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
796 {
797 if (unit->GetCreateMana() > 0)
798 UnitsWithMana.push_back(unit);
799 }
800 }
801 if (!UnitsWithMana.empty())
802 {
804 ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
805 }
806 else
807 ManaBurnTimer = 3500;
808 } else ManaBurnTimer -= diff;
809
810 if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
811 {
813 && player->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
814 {
816 Weak = true;
817 }
818 if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
819 {
820 Drained = true;
821 int32 uHpPct = int32(me->GetHealthPct());
822
824
825 me->SetHealth(me->CountPctFromMaxHealth(uHpPct));
826 me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
827 me->SetInCombatWith(player);
828 }
829 } // end: support for quest 10190
830
832 }
833 };
834};
835
836/*######
837## npc_bessy
838######*/
848
850{
851public:
852 npc_bessy() : CreatureScript("npc_bessy") { }
853
854 bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
855 {
856 if (quest->GetQuestId() == Q_ALMABTRIEB)
857 {
858 creature->setFaction(113);
859 creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
860 CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
861 }
862 return true;
863 }
864
866 {
867 return new npc_bessyAI(creature);
868 }
869
870 struct npc_bessyAI : public npc_escortAI
871 {
872 npc_bessyAI(Creature* creature) : npc_escortAI(creature) { }
873
874 void JustDied(Unit* /*killer*/) OVERRIDE
875 {
876 if (Player* player = GetPlayerForEscort())
877 player->FailQuest(Q_ALMABTRIEB);
878 }
879
881 {
882 Player* player = GetPlayerForEscort();
883 if (!player)
884 return;
885
886 switch (waypointId)
887 {
888 case 3: //first spawn
889 me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
890 me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
891 me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
892 break;
893 case 7:
894 me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
895 me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
896 break;
897 case 12:
899 if (me->FindNearestCreature(N_THADELL, 30))
901 break;
902 case 13:
903 if (me->FindNearestCreature(N_THADELL, 30))
904 Talk(SAY_THADELL_2, player);
905 break;
906 }
907 }
908
910 {
911 summoned->AI()->AttackStart(me);
912 }
913
915 {
916 me->RestoreFaction();
917 }
918 };
919};
920
921/*######
922## npc_maxx_a_million
923######*/
924
930
932{
933public:
934 npc_maxx_a_million_escort() : CreatureScript("npc_maxx_a_million_escort") { }
935
937 {
938 return new npc_maxx_a_million_escortAI(creature);
939 }
940
942 {
944
945 bool bTake;
947
949 {
950 bTake=false;
951 uiTakeTimer=3000;
952 }
953
955 {
956 Player* player = GetPlayerForEscort();
957 if (!player)
958 return;
959
960 switch (waypointId)
961 {
962 case 7:
963 case 17:
964 case 29:
965 //Find Object and "work"
967 {
968 // take the GO -> animation
969 me->HandleEmoteCommand(EMOTE_STATE_LOOT);
970 SetEscortPaused(true);
971 bTake=true;
972 }
973 break;
974 case 36: //return and quest_complete
976 break;
977 }
978 }
979
980 void JustDied(Unit* /*killer*/) OVERRIDE
981 {
982 if (Player* player = GetPlayerForEscort())
983 player->FailQuest(QUEST_MARK_V_IS_ALIVE);
984 }
985
987 {
989
990 if (bTake)
991 {
992 if (uiTakeTimer < uiDiff)
993 {
994 me->HandleEmoteCommand(EMOTE_STATE_NONE);
996 {
997 SetEscortPaused(false);
998 bTake=false;
999 uiTakeTimer = 3000;
1000 go->Delete();
1001 }
1002 }
1003 else
1004 uiTakeTimer -= uiDiff;
1005 }
1007 }
1008 };
1009
1010 bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
1011 {
1012 if (quest->GetQuestId() == QUEST_MARK_V_IS_ALIVE)
1013 {
1015 {
1016 creature->setFaction(113);
1017 pEscortAI->Start(false, false, player->GetGUID());
1018 }
1019 }
1020 return true;
1021 }
1022};
1023
1024/*######
1025## go_captain_tyralius_prison
1026######*/
1027
1033
1035{
1036 public:
1037 go_captain_tyralius_prison() : GameObjectScript("go_captain_tyralius_prison") { }
1038
1040 {
1041 go->UseDoorOrButton();
1042 if (Creature* tyralius = go->FindNearestCreature(NPC_CAPTAIN_TYRALIUS, 1.0f))
1043 {
1044 player->KilledMonsterCredit(NPC_CAPTAIN_TYRALIUS, 0);
1045 tyralius->AI()->Talk(SAY_FREE);
1046 tyralius->DespawnOrUnsummon(8000);
1047 }
1048 return true;
1049 }
1050};
1051
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
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
#define SF_LOG_DEBUG(filterType__,...)
Definition Log.h:134
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:69
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
#define INTERACTION_DISTANCE
Definition Object.h:21
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
GameObject * GetClosestGameObjectWithEntry(WorldObject *source, uint32 entry, float maxSearchRange)
#define CAST_AI(a, b)
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
@ GAMEOBJECT_TYPE_QUESTGIVER
@ EMOTE_STATE_LOOT
@ EMOTE_STATE_NONE
@ GO_FLAG_IN_USE
@ SPELL_AURA_MOD_DECREASE_SPEED
@ UNIT_STAND_STATE_KNEEL
Definition Unit.h:170
@ UNIT_STAND_STATE_STAND
Definition Unit.h:162
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FIELD_FLAGS
@ GAMEOBJECT_FIELD_FLAGS
AreaTriggerScript(const char *name)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureAI * AI() const
Definition Creature.h:483
CreatureScript(const char *name)
static GameObject * GetGameObject(WorldObject &object, uint64 guid)
GameObjectScript(const char *name)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
static Player * GetPlayer(WorldObject const &, uint64 guid)
static Unit * GetUnit(WorldObject const &, uint64 guid)
uint64 GetGUID() const
Definition Object.h:119
TypeID GetTypeId() const
Definition Object.h:131
uint32 GetEntry() const
Definition Object.h:125
void SendUpdateToPlayer(Player *player)
Definition Object.cpp:259
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
void CompleteQuest(uint32 quest_id)
void AreaExploredOrEventHappens(uint32 questId)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Definition Unit.h:1367
void SetVisible(bool x)
Definition Unit.cpp:4163
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
void SetStandState(uint8 state)
Definition Unit.cpp:5902
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TempSummonType::TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition Object.cpp:2703
bool OnTrigger(Player *player, const AreaTriggerEntry *) OVERRIDE
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
bool OnGossipHello(Player *player, GameObject *go) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnQuestAccept(Player *player, Creature *creature, const Quest *quest) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
@ SPELL_MANA_BURN
C::value_type const & SelectRandomContainerElement(C const &container)
Definition Containers.h:48
float GetAngle(Position const *pos) const
Definition Object.cpp:1860
void SetOrientation(float orientation)
Definition Object.h:323
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
Creature * me
bool HealthBelowPct(uint32 pct) const
ScriptedAI(Creature *creature)
void JustDied(Unit *) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
void WaypointReached(uint32 waypointId) OVERRIDE
npc_bessyAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Player * GetPlayerForEscort()
npc_escortAI(Creature *creature)
void SetEscortPaused(bool on)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ Q_ALMABTRIEB
@ SPAWN_SECOND
@ N_THADELL
@ SAY_THADELL_2
@ SPAWN_FIRST
@ SAY_THADELL_1
ProfessorDabiriData
@ QUEST_DIMENSIUS
@ QUEST_ON_NETHERY_WINGS
@ SPELL_PHASE_DISTRUPTOR
CommanderDawnforgeData
@ QUEST_INFO_GATHERING
@ SAY_COMMANDER_DAWNFORGE_1
@ SAY_COMMANDER_DAWNFORGE_5
@ SAY_COMMANDER_DAWNFORGE_2
@ SAY_ARCANIST_ARDONIS_1
@ SAY_PATHALEON_CULATOR_IMAGE_2
@ SAY_PATHALEON_CULATOR_IMAGE_1
@ SAY_COMMANDER_DAWNFORGE_3
@ SAY_ARCANIST_ARDONIS_2
@ SAY_COMMANDER_DAWNFORGE_4
@ SAY_PATHALEON_CULATOR_IMAGE_2_2
@ SPELL_SUNFURY_DISGUISE
@ SAY_PATHALEON_CULATOR_IMAGE_2_1
@ GO_DRAENEI_MACHINE
@ QUEST_MARK_V_IS_ALIVE
#define GOSSIP_ITEM
PhaseHunterData
@ NPC_PHASE_HUNTER_ENTRY
@ SPELL_MATERIALIZE
@ NPC_DRAINED_PHASE_HUNTER_ENTRY
@ SPELL_RECHARGING_BATTERY
@ SPELL_PHASE_SLIP
@ QUEST_RECHARGING_THE_BATTERIES
@ EMOTE_WEAK
@ SPELL_DE_MATERIALIZE
@ SPELL_MANA_BURN
@ NPC_CAPTAIN_TYRALIUS
const uint32 CreatureEntry[3]
void AddSC_netherstorm()
ManaforgeConsoleData
@ EMOTE_10
@ EMOTE_30
@ ENTRY_ARA_C_CONSOLE
@ EMOTE_START
@ SPELL_INTERRUPT_2
@ SPELL_INTERRUPT_1
@ ENTRY_CORUU_C_CONSOLE
@ ENTRY_BNAAR_C_CONSOLE
@ EMOTE_ABORT
@ EMOTE_60
@ ENTRY_SUNFURY_TECH
@ ENTRY_ARA_TECH
@ ENTRY_SUNFURY_PROT
@ SPELL_DISABLE_VISUAL
@ EMOTE_COMPLETE
@ ENTRY_DURO_C_CONSOLE
@ ENTRY_ARA_GORKLONN
@ ENTRY_ARA_ENGI
@ SPAWN_FIRST