Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
zone_sholazar_basin.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: Sholazar_Basin
8SD%Complete: 100
9SDComment: Quest support: 12570, 12573, 12621, 12726
10SDCategory: Sholazar_Basin
11EndScriptData */
12
13/* ContentData
14npc_injured_rainspeaker_oracle
15npc_vekjik
16avatar_of_freya
17npc_haiphoon (Quest: "Song of Wind and Water")
18EndContentData */
19
20#include "ScriptMgr.h"
21#include "ScriptedCreature.h"
22#include "ScriptedGossip.h"
23#include "ScriptedEscortAI.h"
24#include "SpellScript.h"
25#include "SpellAuras.h"
26#include "Vehicle.h"
27#include "CombatAI.h"
28#include "Player.h"
29
30/*######
31## npc_injured_rainspeaker_oracle
32######*/
33
34#define GOSSIP_ITEM1 "I am ready to travel to your village now."
35
46
48{
49public:
50 npc_injured_rainspeaker_oracle() : CreatureScript("npc_injured_rainspeaker_oracle") { }
51
53 {
54 npc_injured_rainspeaker_oracleAI(Creature* creature) : npc_escortAI(creature) { c_guid = creature->GetGUID(); }
55
57
59 {
60 me->RestoreFaction();
61 // if we will have other way to assign this to only one npc remove this part
62 if (GUID_LOPART(me->GetGUID()) != 101030)
63 {
66 }
67 }
68
70 {
71 Player* player = GetPlayerForEscort();
72 if (!player)
73 return;
74
75 switch (waypointId)
76 {
77 case 1:
78 SetRun();
79 break;
80 case 10:
81 case 11:
82 case 12:
83 case 13:
84 case 14:
85 case 15:
86 case 16:
87 case 17:
88 case 18:
89 me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING);
90 me->SetSpeed(MOVE_SWIM, 0.85f, true);
91 me->SetSwim(true);
92 me->SetDisableGravity(true);
93 break;
94 case 19:
95 me->GetMotionMaster()->MoveFall();
96 break;
97 case 28:
99 // me->RestoreFaction();
101 SetRun(false);
102 break;
103 }
104 }
105
106 void JustDied(Unit* /*killer*/) OVERRIDE
107 {
109 return;
110
111 if (Player* player = GetPlayerForEscort())
112 {
113 if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE)
114 player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS);
115 }
116 }
117 };
118
119 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
120 {
121 if (creature->IsQuestGiver())
122 player->PrepareQuestMenu(creature->GetGUID());
123
124 if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) == QUEST_STATUS_INCOMPLETE)
126
127 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
128
129 return true;
130 }
131
132 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
133 {
134 player->PlayerTalkClass->ClearMenus();
135 if (action == GOSSIP_ACTION_INFO_DEF+1)
136 {
137 CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
138 CAST_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f);
139 creature->AI()->Talk(SAY_START_IRO);
140
141 switch (player->GetTeam()){
142 case ALLIANCE:
143 creature->setFaction(FACTION_ESCORTEE_A);
144 break;
145 case HORDE:
146 creature->setFaction(FACTION_ESCORTEE_H);
147 break;
148 }
149 }
150 return true;
151 }
152
153 bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* /*_Quest*/) OVERRIDE
154 {
155 creature->AI()->Talk(SAY_QUEST_ACCEPT_IRO);
156 return false;
157 }
158
160 {
161 return new npc_injured_rainspeaker_oracleAI(creature);
162 }
163};
164
165/*######
166## npc_vekjik
167######*/
168
169#define GOSSIP_VEKJIK_ITEM1 "Shaman Vekjik, I have spoken with the big-tongues and they desire peace. I have brought this offering on their behalf."
170#define GOSSIP_VEKJIK_ITEM2 "No no... I had no intentions of betraying your people. I was only defending myself. it was all a misunderstanding."
171
183
185{
186public:
187 npc_vekjik() : CreatureScript("npc_vekjik") { }
188
189 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
190 {
191 if (creature->IsQuestGiver())
192 player->PrepareQuestMenu(creature->GetGUID());
193
194 if (player->GetQuestStatus(QUEST_MAKING_PEACE) == QUEST_STATUS_INCOMPLETE)
195 {
197 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VEKJIK1, creature->GetGUID());
198 return true;
199 }
200
201 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
202 return true;
203 }
204
205 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
206 {
207 player->PlayerTalkClass->ClearMenus();
208 switch (action)
209 {
212 player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VEKJIK2, creature->GetGUID());
213 break;
215 player->CLOSE_GOSSIP_MENU();
216 creature->AI()->Talk(SAY_TEXTID_VEKJIK1, player);
217 player->AreaExploredOrEventHappens(QUEST_MAKING_PEACE);
218 creature->CastSpell(player, SPELL_FREANZYHEARTS_FURY, false);
219 break;
220 }
221
222 return true;
223 }
224};
225
226/*######
227## avatar_of_freya
228######*/
229
230#define GOSSIP_ITEM_AOF1 "I want to stop the Scourge as much as you do. How can I help?"
231#define GOSSIP_ITEM_AOF2 "You can trust me. I am no friend of the Lich King."
232#define GOSSIP_ITEM_AOF3 "I will not fail."
233
244
246{
247public:
248 npc_avatar_of_freya() : CreatureScript("npc_avatar_of_freya") { }
249
250 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
251 {
252 if (creature->IsQuestGiver())
253 player->PrepareQuestMenu(creature->GetGUID());
254
255 if (player->GetQuestStatus(QUEST_FREYA_PACT) == QUEST_STATUS_INCOMPLETE)
257
258 player->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXTID_AVATAR1, creature->GetGUID());
259 return true;
260 }
261
262 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
263 {
264 player->PlayerTalkClass->ClearMenus();
265 switch (action)
266 {
269 player->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXTID_AVATAR2, creature->GetGUID());
270 break;
273 player->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXTID_AVATAR3, creature->GetGUID());
274 break;
276 player->CastSpell(player, SPELL_FREYA_CONVERSATION, true);
277 player->CLOSE_GOSSIP_MENU();
278 break;
279 }
280 return true;
281 }
282};
283
284/*######
285## npc_bushwhacker
286######*/
287
289{
290public:
291 npc_bushwhacker() : CreatureScript("npc_bushwhacker") { }
292
294 {
295 npc_bushwhackerAI(Creature* creature) : ScriptedAI(creature)
296 {
297 }
298
300 {
301 if (me->isDead())
302 return;
303
304 if (TempSummon* summ = me->ToTempSummon())
305 if (Unit* summoner = summ->GetSummoner())
306 me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
307
308 Reset();
309 }
310
311 void UpdateAI(uint32 /*uiDiff*/) OVERRIDE
312 {
313 if (!UpdateVictim())
314 return;
315
317 }
318 };
319
321 {
322 return new npc_bushwhackerAI(creature);
323 }
324};
325
326/*######
327## npc_engineer_helice
328######*/
329
331{
332 // Spells
335
336 // Yells
344
345 // Quests
347};
348
350{
351public:
352 npc_engineer_helice() : CreatureScript("npc_engineer_helice") { }
353
355 {
356 npc_engineer_heliceAI(Creature* creature) : npc_escortAI(creature) { }
357
359
361 {
362 Player* player = GetPlayerForEscort();
363
364 switch (waypointId)
365 {
366 case 0:
367 Talk(SAY_WP_2);
368 break;
369 case 1:
370 Talk(SAY_WP_3);
371 me->CastSpell(5918.33f, 5372.91f, -98.770f, SPELL_EXPLODE_CRYSTAL, true);
372 me->SummonGameObject(184743, 5918.33f, 5372.91f, -98.770f, 0, 0, 0, 0, 0, 4000); //approx 3 to 4 seconds
373 me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
374 break;
375 case 2:
376 Talk(SAY_WP_4);
377 break;
378 case 7:
379 Talk(SAY_WP_5);
380 break;
381 case 8:
382 me->CastSpell(5887.37f, 5379.39f, -91.289f, SPELL_EXPLODE_CRYSTAL, true);
383 me->SummonGameObject(184743, 5887.37f, 5379.39f, -91.289f, 0, 0, 0, 0, 0, 4000); //approx 3 to 4 seconds
384 me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
385 break;
386 case 9:
387 Talk(SAY_WP_6);
388 break;
389 case 13:
390 if (player)
391 {
393 Talk(SAY_WP_7);
394 }
395 break;
396 }
397 }
398
400 {
401 m_uiChatTimer = 4000;
402 }
403
404 void JustDied(Unit* /*killer*/) OVERRIDE
405 {
407 {
408 if (Player* player = GetPlayerForEscort())
409 player->FailQuest(QUEST_DISASTER);
410 }
411 }
412
414 {
416
418 {
419 if (m_uiChatTimer <= uiDiff)
420 {
421 m_uiChatTimer = 12000;
422 }
423 else
424 m_uiChatTimer -= uiDiff;
425 }
426 }
427 };
428
430 {
431 return new npc_engineer_heliceAI(creature);
432 }
433
434 bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE
435 {
436 if (quest->GetQuestId() == QUEST_DISASTER)
437 {
439 {
440 creature->GetMotionMaster()->MoveJumpTo(0, 0.4f, 0.4f);
441 creature->setFaction(113);
442
443 pEscortAI->Start(false, false, player->GetGUID());
444 creature->AI()->Talk(SAY_WP_1);
445 }
446 }
447 return true;
448 }
449};
450
451/*#####
452## npc_jungle_punch_target
453#####*/
454
455#define SAY_OFFER "Care to try Grimbooze Thunderbrew's new jungle punch?"
456
469
485
487{
488public:
489 npc_jungle_punch_target() : CreatureScript("npc_jungle_punch_target") { }
490
492 {
494
496 {
497 sayTimer = 3500;
498 sayStep = 0;
499 timer = 0;
500 phase = 0;
501 playerGUID = 0;
502 orphanGUID = 0;
503 }
504
506 {
507 if (!phase && who && who->GetDistance2d(me) < 10.0f)
508 if (Player* player = who->ToPlayer())
509 if (player->GetQuestStatus(QUEST_THE_MIGHTY_HEMET_NESINGWARY) == QUEST_STATUS_INCOMPLETE)
510 {
511 playerGUID = player->GetGUID();
512 if (Aura* orphanOut = player->GetAura(SPELL_ORPHAN_OUT))
513 if (orphanOut->GetCaster() && orphanOut->GetCaster()->GetEntry() == ORPHAN_WOLVAR)
514 {
515 orphanGUID = orphanOut->GetCaster()->GetGUID();
516 phase = 1;
517 }
518 }
519 }
520
521 void proceedCwEvent(const uint32 diff)
522 {
523 if (timer <= diff)
524 {
527
528 if (!orphan || !player)
529 {
530 Reset();
531 return;
532 }
533
534 switch (phase)
535 {
536 case 1:
537 orphan->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(me->GetOrientation()) * 5, me->GetPositionY() + sin(me->GetOrientation()) * 5, me->GetPositionZ());
538 orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_6);
539 timer = 5000;
540 break;
541 case 2:
542 orphan->SetFacingToObject(me);
543 orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_7);
544 timer = 5000;
545 break;
546 case 3:
548 timer = 5000;
549 break;
550 case 4:
551 orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_8);
552 timer = 5000;
553 break;
554 case 5:
555 orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_9);
556 timer = 5000;
557 break;
558 case 6:
561 Reset();
562 return;
563 }
564 ++phase;
565 }
566 else
567 timer -= diff;
568 }
569
571 {
572 if (phase)
573 proceedCwEvent(diff);
574
575 if (!sayStep)
576 return;
577
578 if (sayTimer < diff)
579 {
581 sayTimer = 3000;
582 sayStep++;
583
584 if (sayStep > 3) // end
585 sayStep = 0;
586 }
587 else
588 sayTimer -= diff;
589 }
590
591 void SpellHit(Unit* caster, SpellInfo const* spellInfo) OVERRIDE
592 {
593 if (spellInfo->Id != SPELL_OFFER)
594 return;
595
596 Player* player = caster->ToPlayer();
597 if (!player)
598 return;
599
600 Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_TASTE_TEST);
601 if (!quest)
602 return;
603
604 QuestStatusMap::const_iterator itr = player->getQuestStatusMap().find(QUEST_TASTE_TEST);
605 if (itr->second.Status != QUEST_STATUS_INCOMPLETE)
606 return;
607
608 if (!quest->GetQuestObjectiveXObjectId(me->GetEntry()))
609 return;
610
611 player->KilledMonsterCredit(me->GetEntry(), 0);
613 sayStep = 1;
614 }
615
616 private:
623 };
624
626 {
627 return new npc_jungle_punch_targetAI(creature);
628 }
629};
630
631/*######
632## npc_adventurous_dwarf
633######*/
634
635#define GOSSIP_OPTION_ORANGE "Can you spare an orange?"
636#define GOSSIP_OPTION_BANANAS "Have a spare bunch of bananas?"
637#define GOSSIP_OPTION_PAPAYA "I could really use a papaya."
638
656
658{
659public:
660 npc_adventurous_dwarf() : CreatureScript("npc_adventurous_dwarf") { }
661
663 {
665 {
667 }
668 };
669
671 {
672 return new npc_adventurous_dwarfAI(creature);
673 }
674
675 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
676 {
677 if (player->GetQuestStatus(QUEST_12634) != QUEST_STATUS_INCOMPLETE)
678 return false;
679
680 if (player->GetItemCount(ITEM_ORANGE) < 1)
682
683 if (player->GetItemCount(ITEM_BANANAS) < 2)
685
686 if (player->GetItemCount(ITEM_PAPAYA) < 1)
688
689 player->PlayerTalkClass->SendGossipMenu(GOSSIP_MENU_DWARF, creature->GetGUID());
690 return true;
691 }
692
693 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
694 {
695 player->PlayerTalkClass->ClearMenus();
696 uint32 spellId = 0;
697
698 switch (action)
699 {
700 case GOSSIP_ACTION_INFO_DEF + 1:
701 spellId = SPELL_ADD_ORANGE;
702 break;
703 case GOSSIP_ACTION_INFO_DEF + 2:
704 spellId = SPELL_ADD_BANANAS;
705 break;
706 case GOSSIP_ACTION_INFO_DEF + 3:
707 spellId = SPELL_ADD_PAPAYA;
708 break;
709 }
710
711 if (spellId)
712 player->CastSpell(player, spellId, true);
713
714 creature->AI()->Talk(SAY_DWARF_HELP);
715 creature->DespawnOrUnsummon();
716 return true;
717 }
718};
719
720/*######
721## Quest The Lifewarden's Wrath
722######*/
723
725{
726 NPC_PRESENCE = 28563, // Freya's Presence
727 NPC_SABOTEUR = 28538, // Cultist Saboteur
728 NPC_SERVANT = 28320, // Servant of Freya
729
731
737};
738
740{
741public:
742 spell_q12620_the_lifewarden_wrath() : SpellScriptLoader("spell_q12620_the_lifewarden_wrath") { }
743
745 {
747
749 {
750 PreventHitDefaultEffect(effIndex);
751
752 if (Unit* caster = GetCaster())
753 {
754 if (Creature* presence = caster->FindNearestCreature(NPC_PRESENCE, 50.0f))
755 {
756 presence->AI()->Talk(WHISPER_ACTIVATE, caster);
757 presence->CastSpell(presence, SPELL_FREYA_DUMMY, true); // will target plants
758 // Freya Dummy could be scripted with the following code
759
760 // Revive plants
761 std::list<Creature*> servants;
763 for (std::list<Creature*>::iterator itr = servants.begin(); itr != servants.end(); ++itr)
764 {
765 // Couldn't find a spell that does this
766 if ((*itr)->isDead())
767 (*itr)->Respawn(true);
768
769 (*itr)->CastSpell(*itr, SPELL_FREYA_DUMMY_TRIGGER, true);
770 (*itr)->CastSpell(*itr, SPELL_LASHER_EMERGE, false);
771 (*itr)->CastSpell(*itr, SPELL_WILD_GROWTH, false);
772
773 if (Unit* target = (*itr)->SelectNearestTarget(150.0f))
774 (*itr)->AI()->AttackStart(target);
775 }
776
777 // Kill nearby enemies
778 std::list<Creature*> saboteurs;
779 caster->GetCreatureListWithEntryInGrid(saboteurs, NPC_SABOTEUR, 200.0f);
780 for (std::list<Creature*>::iterator itr = saboteurs.begin(); itr != saboteurs.end(); ++itr)
781 if ((*itr)->IsAlive())
782 // Lifeforce has a cast duration, it should be cast at all saboteurs one by one
783 presence->CastSpell((*itr), SPELL_LIFEFORCE, false);
784 }
785 }
786 }
787
792 };
793
798};
799
800/*######
801## Quest Kick, What Kick? (12589)
802######*/
803
826
828{
829public:
830 spell_q12589_shoot_rjr() : SpellScriptLoader("spell_q12589_shoot_rjr") { }
831
833 {
835
845
846 void HandleDummy(SpellEffIndex /*effIndex*/)
847 {
848 uint32 roll = std::rand() % 100 + 1;
849
850 uint8 ev;
851 if (roll <= 50)
852 ev = EVENT_MISS;
853 else if (roll <= 83)
854 ev = EVENT_HIT;
855 else
856 ev = EVENT_MISS_BIRD;
857
858 Unit* shooter = GetCaster();
859 Creature* wilhelm = GetHitUnit()->ToCreature();
860 Creature* apple = shooter->FindNearestCreature(NPC_APPLE, 30);
861 Creature* drostan = shooter->FindNearestCreature(NPC_DROSTAN, 30);
862
863 if (!wilhelm || !apple || !drostan)
864 return;
865
866 switch (ev)
867 {
868 case EVENT_MISS_BIRD:
869 {
870 Creature* crunchy = shooter->FindNearestCreature(NPC_CRUNCHY, 30);
871 Creature* bird = shooter->FindNearestCreature(NPC_THICKBIRD, 30);
872
873 if (!bird || !crunchy)
874 ; // fall to EVENT_MISS
875 else
876 {
877 shooter->CastSpell(bird, SPELL_MISS_BIRD_APPLE);
878 bird->CastSpell(bird, SPELL_BIRD_FALL);
879 wilhelm->AI()->Talk(SAY_WILHELM_MISS);
880 drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS);
881
882 bird->Kill(bird);
883 crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(),
884 bird->GetMap()->GetWaterOrGroundLevel(bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
886
887 break;
888 }
889 }
890 case EVENT_MISS:
891 {
892 shooter->CastSpell(wilhelm, SPELL_MISS_APPLE);
893 wilhelm->AI()->Talk(SAY_WILHELM_MISS);
894 drostan->AI()->Talk(SAY_DROSTAN_REPLY_MISS);
895 break;
896 }
897 case EVENT_HIT:
898 {
899 shooter->CastSpell(apple, SPELL_HIT_APPLE);
900 apple->CastSpell(apple, SPELL_APPLE_FALL);
901 wilhelm->AI()->Talk(SAY_WILHELM_HIT);
902 if (Player* player = shooter->ToPlayer())
903 player->KilledMonsterCredit(NPC_APPLE, 0);
904 apple->DespawnOrUnsummon();
905
906 break;
907 }
908 }
909 }
910
916 };
917
922};
923
924/*######
925## Quest: Song of Wind and Water ID: 12726
926######*/
927/*This quest precisly needs core script since battle vehicles are not well integrated with SAI,
928may be easily converted to SAI when they get.*/
930{
931 // Spells
934 // NPCs
937};
938
940{
941public:
942 npc_haiphoon() : CreatureScript("npc_haiphoon") { }
943
944 struct npc_haiphoonAI : public VehicleAI
945 {
946 npc_haiphoonAI(Creature* creature) : VehicleAI(creature) { }
947
948 void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE
949 {
950 if (target == me)
951 return;
952
953 if (spell->Id == SPELL_DEVOUR_WIND && me->GetCharmerOrOwnerPlayerOrPlayerItself())
954 {
955 me->UpdateEntry(NPC_HAIPHOON_AIR);
956 }
957 else if (spell->Id == SPELL_DEVOUR_WATER && me->GetCharmerOrOwnerPlayerOrPlayerItself())
958 {
959 me->UpdateEntry(NPC_HAIPHOON_WATER);
960 }
961 }
962 };
963
965 {
966 return new npc_haiphoonAI(creature);
967 }
968};
969
970/*######
971## Quest: Reconnaissance Flight (12671)
972######*/
974{
975 NPC_PLANE = 28710, // Vic's Flying Machine
976 NPC_PILOT = 28646,
977
986
987 AURA_ENGINE = 52255, // Engine on Fire
988
989 SPELL_LAND = 52226, // Land Flying Machine
990 SPELL_CREDIT = 53328 // Land Flying Machine Credit
991};
992
994{
995public:
996 npc_vics_flying_machine() : CreatureScript("npc_vics_flying_machine") { }
997
999 {
1001
1002 void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE
1003 {
1004 if (apply && passenger->GetTypeId() == TypeID::TYPEID_PLAYER)
1005 me->GetMotionMaster()->MovePath(NPC_PLANE, false);
1006 }
1007
1009 {
1010 if (type != WAYPOINT_MOTION_TYPE)
1011 return;
1012
1014 switch (id)
1015 {
1016 case 5:
1017 pilot->AI()->Talk(VIC_SAY_0);
1018 break;
1019 case 11:
1020 pilot->AI()->Talk(VIC_SAY_1);
1021 break;
1022 case 12:
1023 pilot->AI()->Talk(VIC_SAY_2);
1024 break;
1025 case 14:
1026 pilot->AI()->Talk(VIC_SAY_3);
1027 break;
1028 case 15:
1029 pilot->AI()->Talk(VIC_SAY_4);
1030 break;
1031 case 17:
1032 pilot->AI()->Talk(VIC_SAY_5);
1033 break;
1034 case 21:
1035 pilot->AI()->Talk(VIC_SAY_6);
1036 break;
1037 case 25:
1038 me->AI()->Talk(PLANE_EMOTE);
1039 me->AI()->DoCast(AURA_ENGINE);
1040 break;
1041 }
1042 }
1043
1044 void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
1045 {
1046 if (spell->Id == SPELL_LAND)
1047 {
1048 Unit* passenger = me->GetVehicleKit()->GetPassenger(1); // player should be on seat 1
1049 if (passenger && passenger->GetTypeId() == TypeID::TYPEID_PLAYER)
1050 {
1051 passenger->CastSpell(passenger, SPELL_CREDIT, true);
1052 passenger->ExitVehicle();
1053 }
1054 }
1055 }
1056
1057 void UpdateAI(uint32 /*diff*/) OVERRIDE { }
1058 };
1059
1061 {
1062 return new npc_vics_flying_machineAI(creature);
1063 }
1064};
1065
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::int8_t int8
Definition Define.h:75
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
std::uint16_t uint16
Definition Define.h:78
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ WAYPOINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition Object.h:55
uint32 GUID_LOPART(uint64 x)
#define sObjectMgr
Definition ObjectMgr.h:1617
#define PET_FOLLOW_ANGLE
Definition PetDefines.h:58
#define PET_FOLLOW_DIST
Definition PetDefines.h:57
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:89
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:87
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive)
#define CAST_AI(a, b)
@ STATE_ESCORT_ESCORTING
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
SpellEffIndex
@ EFFECT_0
@ EMOTE_ONESHOT_LAUGH
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SEND_EVENT
@ SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM
@ ALLIANCE
@ HORDE
SpellCastResult
#define SpellCheckCastFn(F)
#define SpellEffectFn(F, I, N)
@ UNIT_NPC_FLAG_GOSSIP
Definition Unit.h:687
@ UNIT_NPC_FLAG_QUESTGIVER
Definition Unit.h:688
@ MOVEMENTFLAG_FALLING
Definition Unit.h:734
@ MOVE_SWIM
Definition Unit.h:558
@ UNIT_FIELD_NPC_FLAGS
@ QUEST_THE_MIGHTY_HEMET_NESINGWARY
@ SPELL_ORPHAN_OUT
@ ORPHAN_WOLVAR
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:56
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
CreatureAI * AI() const
Definition Creature.h:483
CreatureScript(const char *name)
float GetWaterOrGroundLevel(float x, float y, float z, float *ground=NULL, bool swim=false) const
Definition Map.cpp:1941
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
static Creature * GetCreature(WorldObject const &u, uint64 guid)
static Player * GetPlayer(WorldObject const &, uint64 guid)
uint64 GetGUID() const
Definition Object.h:119
Player * ToPlayer()
Definition Object.h:204
TypeID GetTypeId() const
Definition Object.h:131
Creature * ToCreature()
Definition Object.h:207
QuestStatusMap & getQuestStatusMap()
Definition Player.h:1961
void KilledMonsterCredit(uint32 entry, uint64 guid=0)
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
void Say(std::string const &text, const Language language)
Handles said message in regular chat based on declared language and in config pre-defined Range.
Definition Player.cpp:15797
QuestObjective const * GetQuestObjectiveXObjectId(uint32 objectId) const
Definition QuestDef.cpp:311
Unit * GetExplTargetUnit()
HookList< CheckCastHandler > OnCheckCast
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
HookList< EffectHandler > OnEffectHitTarget
Unit * GetHitUnit()
void SetCustomCastResultMessage(SpellCustomErrors result)
Unit * GetCaster()
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
Definition Unit.h:1367
void Kill(Unit *victim, bool durabilityLoss=true)
Definition Unit.cpp:6342
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
MotionMaster * GetMotionMaster()
Definition Unit.h:2605
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:9124
void ExitVehicle(Position const *exitPosition=NULL)
Definition Unit.cpp:8306
Map * GetMap() const
Definition Object.h:740
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2841
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) 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 OnQuestAccept(Player *, Creature *creature, Quest const *) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipHello(Player *player, Creature *creature) 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
PrepareSpellScript(spell_q12589_shoot_rjr_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
SpellScript * GetSpellScript() const OVERRIDE
@ SAY_WP_3
@ SAY_WP_2
@ SAY_WP_4
@ SAY_WP_1
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
void Reset() OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
VehicleAI(Creature *c)
Definition CombatAI.cpp:262
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void WaypointReached(uint32 waypointId) OVERRIDE
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Player * GetPlayerForEscort()
void SetRun(bool on=true)
bool HasEscortState(uint32 escortState) const
npc_escortAI(Creature *creature)
void SpellHitTarget(Unit *target, SpellInfo const *spell) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *caster, SpellInfo const *spellInfo) OVERRIDE
void MovementInform(uint32 type, uint32 id) OVERRIDE
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *, SpellInfo const *spell) OVERRIDE
void PassengerBoarded(Unit *passenger, int8, bool apply) OVERRIDE
== Fields =======================================
@ FACTION_ESCORTEE_A
@ FACTION_ESCORTEE_H
@ SPELL_ADD_BANANAS
@ GOSSIP_MENU_DWARF
@ SPELL_ADD_ORANGE
@ SPELL_ADD_PAPAYA
#define GOSSIP_ITEM_AOF1
@ WHISPER_ACTIVATE
@ SPELL_LASHER_EMERGE
@ SPELL_WILD_GROWTH
@ SPELL_FREYA_DUMMY
@ SPELL_FREYA_DUMMY_TRIGGER
@ SPELL_LIFEFORCE
#define GOSSIP_VEKJIK_ITEM1
@ SPELL_EXPLODE_CRYSTAL
@ SAY_HEMET_HADRIUS_TAMARA_1
@ SAY_HEMET_HADRIUS_TAMARA_3
@ QUEST_TASTE_TEST
@ SAY_HEMET_HADRIUS_TAMARA_2
NesingwaryChildrensWeek
@ QUEST_THE_MIGHTY_HEMET_NESINGWARY
@ TEXT_WOLVAR_ORPHAN_6
@ TEXT_WOLVAR_ORPHAN_7
@ TEXT_NESINGWARY_1
@ TEXT_WOLVAR_ORPHAN_8
@ SPELL_ORPHAN_OUT
@ TEXT_WOLVAR_ORPHAN_9
void AddSC_sholazar_basin()
@ GOSSIP_TEXTID_AVATAR1
@ QUEST_FREYA_PACT
@ SPELL_FREYA_CONVERSATION
@ GOSSIP_TEXTID_AVATAR3
@ GOSSIP_TEXTID_AVATAR2
#define GOSSIP_ITEM_AOF2
@ SPELL_FREANZYHEARTS_FURY
@ SAY_TEXTID_VEKJIK1
@ GOSSIP_TEXTID_VEKJIK2
@ QUEST_MAKING_PEACE
@ GOSSIP_TEXTID_VEKJIK1
#define GOSSIP_ITEM1
@ SPELL_DEVOUR_WIND
@ NPC_HAIPHOON_AIR
@ NPC_HAIPHOON_WATER
@ SPELL_DEVOUR_WATER
@ FACTION_ESCORTEE_A
@ SAY_QUEST_ACCEPT_IRO
@ FACTION_ESCORTEE_H
@ SAY_START_IRO
@ QUEST_FORTUNATE_MISUNDERSTANDINGS
#define GOSSIP_OPTION_PAPAYA
@ SPELL_BIRD_FALL
@ SPELL_MISS_APPLE
@ SAY_DROSTAN_REPLY_MISS
@ SPELL_MISS_BIRD_APPLE
@ SAY_WILHELM_HIT
@ NPC_LUCKY_WILHELM
@ SPELL_APPLE_FALL
@ SAY_WILHELM_MISS
@ EVENT_MISS_BIRD
@ SPELL_HIT_APPLE
#define GOSSIP_OPTION_BANANAS
#define GOSSIP_VEKJIK_ITEM2
#define GOSSIP_OPTION_ORANGE
#define SAY_OFFER
#define GOSSIP_ITEM_AOF3