TrinityCore
go_scripts.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ContentData
19go_ethereum_prison
20go_ethereum_stasis
21go_southfury_moonstone
22go_resonite_cask
23go_tablet_of_the_seven
24go_tele_to_dalaran_crystal
25go_tele_to_violet_stand
26go_soulwell
27go_amberpine_outhouse
28go_veil_skith_cage
29go_bells
30EndContentData */
31
32#include "ScriptMgr.h"
33#include "DB2Structure.h"
34#include "GameEventMgr.h"
35#include "GameObject.h"
36#include "GameObjectAI.h"
37#include "GameTime.h"
38#include "Log.h"
39#include "MotionMaster.h"
40#include "Player.h"
41#include "ScriptedCreature.h"
42#include "ScriptedGossip.h"
43#include "TemporarySummon.h"
44#include "WorldSession.h"
45
46/*######
47## go_gilded_brazier (Paladin First Trail quest (9678))
48######*/
49
51{
54};
55
57{
58public:
59 go_gilded_brazier() : GameObjectScript("go_gilded_brazier") { }
60
62 {
64
65 bool OnGossipHello(Player* player) override
66 {
68 {
70 {
71 if (Creature* Stillblade = player->SummonCreature(NPC_STILLBLADE, 8106.11f, -7542.06f, 151.775f, 3.02598f, TEMPSUMMON_DEAD_DESPAWN, 1min))
72 Stillblade->AI()->AttackStart(player);
73 }
74 }
75 return true;
76 }
77 };
78
79 GameObjectAI* GetAI(GameObject* go) const override
80 {
81 return new go_gilded_brazierAI(go);
82 }
83};
84
85/*######
86## go_tablet_of_the_seven
87######*/
88
90{
91public:
92 go_tablet_of_the_seven() : GameObjectScript("go_tablet_of_the_seven") { }
93
95 {
97
99 bool OnGossipHello(Player* player) override
100 {
102 return true;
103
104 if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
105 player->CastSpell(player, 15065, false);
106
107 return true;
108 }
109 };
110
111 GameObjectAI* GetAI(GameObject* go) const override
112 {
113 return new go_tablet_of_the_sevenAI(go);
114 }
115};
116
117/*######
118## go_ethereum_prison
119######*/
120
122{
128 SPELL_REP_SPOR = 39476
130
132{
133 22810, 22811, 22812, 22813, 22814, 22815, //good guys
134 20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys
135};
136
138{
139public:
140 go_ethereum_prison() : GameObjectScript("go_ethereum_prison") { }
141
143 {
145
146 bool OnGossipHello(Player* player) override
147 {
149 int Random = rand32() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
150
153 {
154 if (!creature->IsHostileTo(player))
155 {
156 if (FactionTemplateEntry const* pFaction = creature->GetFactionTemplateEntry())
157 {
158 uint32 Spell = 0;
159
160 switch (pFaction->Faction)
161 {
162 case 1011: Spell = SPELL_REP_LC; break;
163 case 935: Spell = SPELL_REP_SHAT; break;
164 case 942: Spell = SPELL_REP_CE; break;
165 case 933: Spell = SPELL_REP_CON; break;
166 case 989: Spell = SPELL_REP_KT; break;
167 case 970: Spell = SPELL_REP_SPOR; break;
168 }
169
170 if (Spell)
171 creature->CastSpell(player, Spell, false);
172 else
173 TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry {}) but faction ({}) are not expected by script.", creature->GetEntry(), creature->GetFaction());
174 }
175 }
176 }
177
178 return false;
179 }
180 };
181
182 GameObjectAI* GetAI(GameObject* go) const override
183 {
184 return new go_ethereum_prisonAI(go);
185 }
186};
187
188/*######
189## go_ethereum_stasis
190######*/
191
193{
194 22825, 20888, 22827, 22826, 22828
195};
196
198{
199public:
200 go_ethereum_stasis() : GameObjectScript("go_ethereum_stasis") { }
201
203 {
205
206 bool OnGossipHello(Player* player) override
207 {
209 int Random = rand32() % (sizeof(NpcStasisEntry) / sizeof(uint32));
210
213
214 return false;
215 }
216 };
217
218 GameObjectAI* GetAI(GameObject* go) const override
219 {
220 return new go_ethereum_stasisAI(go);
221 }
222};
223
224/*######
225## go_resonite_cask
226######*/
227
229{
230 NPC_GOGGEROC = 11920
232
234{
235public:
236 go_resonite_cask() : GameObjectScript("go_resonite_cask") { }
237
239 {
241
242 bool OnGossipHello(Player* /*player*/) override
243 {
246
247 return false;
248 }
249 };
250
251 GameObjectAI* GetAI(GameObject* go) const override
252 {
253 return new go_resonite_caskAI(go);
254 }
255};
256
257/*######
258## go_southfury_moonstone
259######*/
260
262{
263 NPC_RIZZLE = 23002,
264 SPELL_BLACKJACK = 39865, //stuns player
265 SPELL_SUMMON_RIZZLE = 39866
267
269{
270public:
271 go_southfury_moonstone() : GameObjectScript("go_southfury_moonstone") { }
272
274 {
276
277 bool OnGossipHello(Player* player) override
278 {
279 //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
280 //player->CastSpell(player, SPELL_SUMMON_RIZZLE, false);
281
282 if (Creature* creature = player->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN))
283 creature->CastSpell(player, SPELL_BLACKJACK, false);
284
285 return false;
286 }
287 };
288
289 GameObjectAI* GetAI(GameObject* go) const override
290 {
291 return new go_southfury_moonstoneAI(go);
292 }
293};
294
295/*######
296## go_tele_to_dalaran_crystal
297######*/
298
300{
304
305#define GO_TELE_TO_DALARAN_CRYSTAL_FAILED "This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once."
306
308{
309public:
310 go_tele_to_dalaran_crystal() : GameObjectScript("go_tele_to_dalaran_crystal") { }
311
313 {
315
316 bool OnGossipHello(Player* player) override
317 {
319 return false;
320
322 return true;
323 }
324 };
325
326 GameObjectAI* GetAI(GameObject* go) const override
327 {
328 return new go_tele_to_dalaran_crystalAI(go);
329 }
330};
331
332/*######
333## go_tele_to_violet_stand
334######*/
335
337{
338public:
339 go_tele_to_violet_stand() : GameObjectScript("go_tele_to_violet_stand") { }
340
342 {
344
345 bool OnGossipHello(Player* player) override
346 {
348 return false;
349
350 return true;
351 }
352 };
353
354 GameObjectAI* GetAI(GameObject* go) const override
355 {
356 return new go_tele_to_violet_standAI(go);
357 }
358};
359
360/*######
361## go_blood_filled_orb
362######*/
363
365{
366 NPC_ZELEMAR = 17830
367
369
371{
372public:
373 go_blood_filled_orb() : GameObjectScript("go_blood_filled_orb") { }
374
376 {
378
379 bool OnGossipHello(Player* player) override
380 {
382 player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30s);
383
384 return true;
385 }
386 };
387
388 GameObjectAI* GetAI(GameObject* go) const override
389 {
390 return new go_blood_filled_orbAI(go);
391 }
392};
393
394/*######
395## go_soulwell
396######*/
397
399{
400 public:
401 go_soulwell() : GameObjectScript("go_soulwell") { }
402
404 {
406 {
407 }
408
409 bool OnGossipHello(Player* player) override
410 {
411 Unit* owner = me->GetOwner();
412 if (!owner || owner->GetTypeId() != TYPEID_PLAYER || !player->IsInSameRaidWith(owner->ToPlayer()))
413 return true;
414 return false;
415 }
416 };
417
418 GameObjectAI* GetAI(GameObject* go) const override
419 {
420 return new go_soulwellAI(go);
421 }
422};
423
424/*######
425## go_amberpine_outhouse
426######*/
427
428#define GOSSIP_USE_OUTHOUSE "Use the outhouse."
429#define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND "Quest item Anderhol's Slider Cider not found."
430
432{
442
444{
445public:
446 go_amberpine_outhouse() : GameObjectScript("go_amberpine_outhouse") { }
447
449 {
451
452 bool OnGossipHello(Player* player) override
453 {
455 if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED)
456 {
459 }
460 else
462
463 return true;
464 }
465
466 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
467 {
468 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
469 ClearGossipMenuFor(player);
470 if (action == GOSSIP_ACTION_INFO_DEF + 1)
471 {
472 CloseGossipMenuFor(player);
474 if (target)
475 {
476 target->AI()->SetData(1, player->GetNativeGender());
478 }
479 me->CastSpell(player, SPELL_INDISPOSED);
482 return true;
483 }
484 else
485 {
486 CloseGossipMenuFor(player);
488 return false;
489 }
490 }
491 };
492
493 GameObjectAI* GetAI(GameObject* go) const override
494 {
495 return new go_amberpine_outhouseAI(go);
496 }
497};
498
500{
501 public:
502 go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
503
505 {
507
508 bool OnGossipHello(Player* /*player*/) override
509 {
511 return true;
512 }
513 };
514
515 GameObjectAI* GetAI(GameObject* go) const override
516 {
517 return new go_massive_seaforium_chargeAI(go);
518 }
519};
520
521/*########
522#### go_veil_skith_cage
523#####*/
524
526{
530};
531
533{
534 public:
535 go_veil_skith_cage() : GameObjectScript("go_veil_skith_cage") { }
536
538 {
540
541 bool OnGossipHello(Player* player) override
542 {
545 {
546 std::vector<Creature*> childrenList;
548 for (Creature* creature : childrenList)
549 {
550 player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, creature->GetGUID());
551 creature->DespawnOrUnsummon(5s);
552 creature->GetMotionMaster()->MovePoint(1, me->GetPositionX() + 5, me->GetPositionY(), me->GetPositionZ());
553 creature->AI()->Talk(SAY_FREE_0);
554 creature->GetMotionMaster()->Clear();
555 }
556 }
557 return false;
558 }
559 };
560
561 GameObjectAI* GetAI(GameObject* go) const override
562 {
563 return new go_veil_skith_cageAI(go);
564 }
565};
566
567/*######
568## go_midsummer_bonfire
569######*/
570
572{
574};
575
577{
578public:
579 go_midsummer_bonfire() : GameObjectScript("go_midsummer_bonfire") { }
580
582 {
584
585 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
586 {
587 player->CastSpell(player, STAMP_OUT_BONFIRE_QUEST_COMPLETE, true);
588 CloseGossipMenuFor(player);
589 return false;
590 }
591 };
592
593 GameObjectAI* GetAI(GameObject* go) const override
594 {
595 return new go_midsummer_bonfireAI(go);
596 }
597};
598
600{
607
609{
613};
614
616{
617public:
618 go_midsummer_ribbon_pole() : GameObjectScript("go_midsummer_ribbon_pole") { }
619
621 {
623
624 bool OnGossipHello(Player* player) override
625 {
626 if (Creature* creature = me->FindNearestCreature(NPC_POLE_RIBBON_BUNNY, 10.0f))
627 {
628 creature->GetAI()->DoAction(ACTION_COSMETIC_FIRES);
629 player->CastSpell(player, RibbonPoleSpells[urand(0, 2)], true);
630 }
631 return true;
632 }
633 };
634
635 GameObjectAI* GetAI(GameObject* go) const override
636 {
637 return new go_midsummer_ribbon_poleAI(go);
638 }
639};
640
641/*####
642## go_brewfest_music
643####*/
644
646{
647 EVENT_BREWFESTDWARF01 = 11810, // 1.35 min
648 EVENT_BREWFESTDWARF02 = 11812, // 1.55 min
649 EVENT_BREWFESTDWARF03 = 11813, // 0.23 min
650 EVENT_BREWFESTGOBLIN01 = 11811, // 1.08 min
651 EVENT_BREWFESTGOBLIN02 = 11814, // 1.33 min
652 EVENT_BREWFESTGOBLIN03 = 11815 // 0.28 min
654
661
663{
664 SILVERMOON = 3430, // Horde
665 UNDERCITY = 1497,
669 IRONFORGE_1 = 809, // Alliance
672 EXODAR = 3557,
673 DARNASSUS = 1657,
674 SHATTRATH = 3703 // General
676
678{
682
684{
685public:
686 go_brewfest_music() : GameObjectScript("go_brewfest_music") { }
687
689 {
692
694 {
697 }
698
699 void UpdateAI(uint32 diff) override
700 {
701 _events.Update(diff);
702 while (uint32 eventId = _events.ExecuteEvent())
703 {
704 switch (eventId)
705 {
707 if (!IsHolidayActive(HOLIDAY_BREWFEST)) // Check if Brewfest is active
708 break;
709 rnd = urand(0, 2); // Select random music sample
710 _events.ScheduleEvent(EVENT_BM_SELECT_MUSIC, musicTime); // Select new song music after play time is over
711 break;
713 if (!IsHolidayActive(HOLIDAY_BREWFEST)) // Check if Brewfest is active
714 break;
715
716 switch (me->GetAreaId())
717 {
718 // Horde
719 case SILVERMOON:
720 case UNDERCITY:
721 case ORGRIMMAR_1:
722 case ORGRIMMAR_2:
723 case THUNDERBLUFF:
724 if (rnd == 0)
725 {
728 }
729 else if (rnd == 1)
730 {
733 }
734 else
735 {
738 }
739 break;
740 // Alliance
741 case IRONFORGE_1:
742 case IRONFORGE_2:
743 case STORMWIND:
744 case EXODAR:
745 case DARNASSUS:
746 if (rnd == 0)
747 {
750 }
751 else if (rnd == 1)
752 {
755 }
756 else
757 {
760 }
761 break;
762 // Neurtal
763 case SHATTRATH:
764 std::vector<Player*> playersNearby;
765 me->GetPlayerListInGrid(playersNearby, me->GetVisibilityRange());
766 for (Player* player : playersNearby)
767 {
768 if (player->GetTeamId() == TEAM_HORDE)
769 {
770 if (rnd == 0)
771 {
774 }
775 else if (rnd == 1)
776 {
779 }
780 else
781 {
784 }
785 }
786 else
787 {
788 if (rnd == 0)
789 {
792 }
793 else if (rnd == 1)
794 {
797 }
798 else
799 {
802 }
803 }
804 }
805 break;
806 }
807
808 _events.ScheduleEvent(EVENT_BM_START_MUSIC, 5s); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client
809 break;
810 default:
811 break;
812 }
813 }
814 }
815 private:
817 };
818
819 GameObjectAI* GetAI(GameObject* go) const override
820 {
821 return new go_brewfest_musicAI(go);
822 }
823};
824
825/*####
826## go_midsummer_music
827####*/
828
830{
831 EVENTMIDSUMMERFIREFESTIVAL_A = 12319, // 1.08 min
832 EVENTMIDSUMMERFIREFESTIVAL_H = 12325, // 1.12 min
833};
834
836{
839
841{
842public:
843 go_midsummer_music() : GameObjectScript("go_midsummer_music") { }
844
846 {
848 {
850 }
851
852 void UpdateAI(uint32 diff) override
853 {
854 _events.Update(diff);
855 while (uint32 eventId = _events.ExecuteEvent())
856 {
857 switch (eventId)
858 {
860 {
862 break;
863
864 std::vector<Player*> playersNearby;
865 me->GetPlayerListInGrid(playersNearby, me->GetVisibilityRange());
866 for (Player* player : playersNearby)
867 {
868 if (player->GetTeamId() == TEAM_HORDE)
870 else
872 }
873 _events.ScheduleEvent(EVENT_MM_START_MUSIC, 5s); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
874 break;
875 }
876 default:
877 break;
878 }
879 }
880 }
881 private:
883 };
884
885 GameObjectAI* GetAI(GameObject* go) const override
886 {
887 return new go_midsummer_musicAI(go);
888 }
889};
890
891/*####
892## go_darkmoon_faire_music
893####*/
894
896{
899
901{
904
906{
907public:
908 go_darkmoon_faire_music() : GameObjectScript("go_darkmoon_faire_music") { }
909
911 {
913 {
915 }
916
917 void UpdateAI(uint32 diff) override
918 {
919 _events.Update(diff);
920 while (uint32 eventId = _events.ExecuteEvent())
921 {
922 switch (eventId)
923 {
926 break;
928 _events.ScheduleEvent(EVENT_DFM_START_MUSIC, 5s); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
929 break;
930 default:
931 break;
932 }
933 }
934 }
935 private:
937 };
938
939 GameObjectAI* GetAI(GameObject* go) const override
940 {
941 return new go_darkmoon_faire_musicAI(go);
942 }
943};
944
945/*####
946## go_pirate_day_music
947####*/
948
950{
953
955{
958
960{
961public:
962 go_pirate_day_music() : GameObjectScript("go_pirate_day_music") { }
963
965 {
967 {
969 }
970
971 void UpdateAI(uint32 diff) override
972 {
973 _events.Update(diff);
974 while (uint32 eventId = _events.ExecuteEvent())
975 {
976 switch (eventId)
977 {
980 break;
982 _events.ScheduleEvent(EVENT_PDM_START_MUSIC, 5s); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
983 break;
984 default:
985 break;
986 }
987 }
988 }
989 private:
991 };
992
993 GameObjectAI* GetAI(GameObject* go) const override
994 {
995 return new go_pirate_day_musicAI(go);
996 }
997};
998
999/*####
1000## go_bells
1001####*/
1002
1004{
1005 BELLTOLLHORDE = 6595, // Undercity
1006 BELLTOLLTRIBAL = 6675, // Orgrimma/Thunderbluff
1007 BELLTOLLALLIANCE = 6594, // Stormwind
1008 BELLTOLLNIGHTELF = 6674, // Darnassus
1009 BELLTOLLDWARFGNOME = 7234, // Ironforge
1010 BELLTOLLKHARAZHAN = 9154 // Kharazhan
1012
1014{
1023 DUSKWOOD_ZONE = 10
1025
1027{
1030 GO_KHARAZHAN_BELL = 182064
1032
1034{
1036 EVENT_RING_BELL = 1
1038
1040{
1041public:
1042 go_bells() : GameObjectScript("go_bells") { }
1043
1044 struct go_bellsAI : public GameObjectAI
1045 {
1047
1048 void InitializeAI() override
1049 {
1050 uint32 zoneId = me->GetZoneId();
1051
1052 switch (me->GetEntry())
1053 {
1054 case GO_HORDE_BELL:
1055 {
1056 switch (zoneId)
1057 {
1058 case TIRISFAL_ZONE:
1059 case UNDERCITY_ZONE:
1061 case DUSKWOOD_ZONE:
1062 _soundId = BELLTOLLHORDE; // undead bell sound
1063 break;
1064 default:
1065 _soundId = BELLTOLLTRIBAL; // orc drum sound
1066 break;
1067 }
1068 break;
1069 }
1070 case GO_ALLIANCE_BELL:
1071 {
1072 switch (zoneId)
1073 {
1074 case IRONFORGE_ZONE:
1075 case DUN_MOROGH_ZONE:
1076 _soundId = BELLTOLLDWARFGNOME; // horn sound
1077 break;
1078 case DARNASSUS_ZONE:
1079 case TELDRASSIL_ZONE:
1080 case ASHENVALE_ZONE:
1081 _soundId = BELLTOLLNIGHTELF; // nightelf bell sound
1082 break;
1083 default:
1084 _soundId = BELLTOLLALLIANCE; // human bell sound
1085 }
1086 break;
1087 }
1088 case GO_KHARAZHAN_BELL:
1089 {
1091 break;
1092 }
1093 }
1094 }
1095
1096 void OnGameEvent(bool start, uint16 eventId) override
1097 {
1098 if (eventId == GAME_EVENT_HOURLY_BELLS && start)
1099 {
1100 time_t time = GameTime::GetGameTime();
1101 tm localTm;
1102 localtime_r(&time, &localTm);
1103 uint8 _rings = (localTm.tm_hour) % 12;
1104 if (_rings == 0) // 00:00 and 12:00
1105 {
1106 _rings = 12;
1107 }
1108
1109 // Dwarf hourly horn should only play a single time, each time the next hour begins.
1111 {
1112 _rings = 1;
1113 }
1114
1115 for (auto i = 0; i < _rings; ++i)
1117 }
1118 }
1119
1120 void UpdateAI(uint32 diff) override
1121 {
1122 _events.Update(diff);
1123
1124 while (uint32 eventId = _events.ExecuteEvent())
1125 {
1126 switch (eventId)
1127 {
1128 case EVENT_RING_BELL:
1130 break;
1131 default:
1132 break;
1133 }
1134 }
1135 }
1136 private:
1139 };
1140
1141 GameObjectAI* GetAI(GameObject* go) const override
1142 {
1143 return new go_bellsAI(go);
1144 }
1145};
1146
1148{
1149 new go_gilded_brazier();
1152 new go_ethereum_prison();
1153 new go_ethereum_stasis();
1154 new go_resonite_cask();
1157 new go_blood_filled_orb();
1158 new go_soulwell();
1161 new go_veil_skith_cage();
1164 new go_brewfest_music();
1165 new go_midsummer_music();
1167 new go_pirate_day_music();
1168 new go_bells();
1169}
uint8_t uint8
Definition: Define.h:144
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
bool IsHolidayActive(HolidayIds id)
@ GO_JUST_DEACTIVATED
Definition: GameObject.h:159
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
@ TEMPSUMMON_DEAD_DESPAWN
Definition: ObjectDefines.h:69
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: ObjectDefines.h:66
#define INTERACTION_DISTANCE
Definition: ObjectDefines.h:24
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
QuestStatus
Definition: QuestDef.h:141
@ QUEST_STATUS_REWARDED
Definition: QuestDef.h:148
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
@ QUEST_STATUS_COMPLETE
Definition: QuestDef.h:143
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
uint32 rand32()
Definition: Random.cpp:70
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
void AddGossipItemFor(Player *player, GossipOptionNpc optionNpc, std::string text, uint32 sender, uint32 action)
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
void ClearGossipMenuFor(Player *player)
void CloseGossipMenuFor(Player *player)
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
@ GAMEOBJECT_TYPE_QUESTGIVER
@ GAMEOBJECT_TYPE_GOOBER
@ TEAM_HORDE
@ HOLIDAY_DARKMOON_FAIRE
@ HOLIDAY_MIDSUMMER_FIRE_FESTIVAL
@ HOLIDAY_PIRATES_DAY
@ HOLIDAY_BREWFEST
CreatureAI * AI() const
Definition: Creature.h:214
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
GameObject *const me
Definition: GameObjectAI.h:50
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
void SetLootState(LootState s, Unit *unit=nullptr)
GameobjectTypes GetGoType() const
Definition: GameObject.h:279
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: Player.cpp:16680
bool IsInSameRaidWith(Player const *p) const
Definition: Player.cpp:2160
Gender GetNativeGender() const override
Definition: Player.h:1217
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: Player.cpp:16033
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: Player.cpp:9888
WorldSession * GetSession() const
Definition: Player.h:2101
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
std::unique_ptr< PlayerMenu > PlayerTalkClass
Definition: Player.h:2380
Definition: Spell.h:255
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:74
Definition: Unit.h:627
void GetPlayerListInGrid(Container &playerContainer, float maxSearchRange, bool alive=true) const
Definition: Object.cpp:3332
void PlayDirectSound(uint32 soundId, Player const *target=nullptr, uint32 broadcastTextId=0) const
Definition: Object.cpp:3592
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void PlayDirectMusic(uint32 musicId, Player const *target=nullptr) const
Definition: Object.cpp:3600
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
Unit * GetOwner() const
Definition: Object.cpp:2229
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
float GetVisibilityRange() const
Definition: Object.cpp:1447
uint32 GetAreaId() const
Definition: Object.h:546
uint32 GetZoneId() const
Definition: Object.h:545
void SendNotification(char const *format,...) ATTR_PRINTF(2
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:493
GameObjectAI * GetAI(GameObject *go) const override
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:388
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:819
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:939
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:182
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:218
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:79
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:515
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:593
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:885
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:635
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:993
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:251
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:418
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:289
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:111
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:326
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:354
GameObjectAI * GetAI(GameObject *go) const override
Definition: go_scripts.cpp:561
AmberpineOuthouse
Definition: go_scripts.cpp:432
@ NPC_OUTHOUSE_BUNNY
Definition: go_scripts.cpp:434
@ QUEST_DOING_YOUR_DUTY
Definition: go_scripts.cpp:435
@ SPELL_INDISPOSED_III
Definition: go_scripts.cpp:437
@ SPELL_INDISPOSED
Definition: go_scripts.cpp:436
@ ITEM_ANDERHOLS_SLIDER_CIDER
Definition: go_scripts.cpp:433
@ GOSSIP_OUTHOUSE_INUSE
Definition: go_scripts.cpp:439
@ GOSSIP_OUTHOUSE_VACANT
Definition: go_scripts.cpp:440
@ SPELL_CREATE_AMBERSEEDS
Definition: go_scripts.cpp:438
MidsummerPoleRibbon
Definition: go_scripts.cpp:600
@ ACTION_COSMETIC_FIRES
Definition: go_scripts.cpp:605
@ SPELL_TEST_RIBBON_POLE_2
Definition: go_scripts.cpp:602
@ SPELL_TEST_RIBBON_POLE_1
Definition: go_scripts.cpp:601
@ NPC_POLE_RIBBON_BUNNY
Definition: go_scripts.cpp:604
@ SPELL_TEST_RIBBON_POLE_3
Definition: go_scripts.cpp:603
#define GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND
Definition: go_scripts.cpp:429
BloodFilledOrb
Definition: go_scripts.cpp:365
@ NPC_ZELEMAR
Definition: go_scripts.cpp:366
#define GO_TELE_TO_DALARAN_CRYSTAL_FAILED
Definition: go_scripts.cpp:305
void AddSC_go_scripts()
BrewfestMusicEvents
Definition: go_scripts.cpp:678
@ EVENT_BM_SELECT_MUSIC
Definition: go_scripts.cpp:679
@ EVENT_BM_START_MUSIC
Definition: go_scripts.cpp:680
constexpr Seconds EVENT_BREWFESTDWARF02_TIME
Definition: go_scripts.cpp:656
BellHourlyMisc
@ GAME_EVENT_HOURLY_BELLS
@ EVENT_RING_BELL
constexpr Seconds EVENT_BREWFESTGOBLIN03_TIME
Definition: go_scripts.cpp:660
GildedBrazier
Definition: go_scripts.cpp:51
@ QUEST_THE_FIRST_TRIAL
Definition: go_scripts.cpp:53
@ NPC_STILLBLADE
Definition: go_scripts.cpp:52
BellHourlyObjects
@ GO_ALLIANCE_BELL
@ GO_KHARAZHAN_BELL
@ GO_HORDE_BELL
constexpr Seconds EVENT_BREWFESTGOBLIN01_TIME
Definition: go_scripts.cpp:658
PirateDayMusic
Definition: go_scripts.cpp:950
@ MUSIC_PIRATE_DAY_MUSIC
Definition: go_scripts.cpp:951
#define GOSSIP_USE_OUTHOUSE
Definition: go_scripts.cpp:428
constexpr Seconds EVENT_BREWFESTDWARF01_TIME
Definition: go_scripts.cpp:655
EthereumPrison
Definition: go_scripts.cpp:122
@ SPELL_REP_KT
Definition: go_scripts.cpp:127
@ SPELL_REP_CON
Definition: go_scripts.cpp:126
@ SPELL_REP_SPOR
Definition: go_scripts.cpp:128
@ SPELL_REP_LC
Definition: go_scripts.cpp:123
@ SPELL_REP_SHAT
Definition: go_scripts.cpp:124
@ SPELL_REP_CE
Definition: go_scripts.cpp:125
const uint32 NpcPrisonEntry[]
Definition: go_scripts.cpp:131
uint32 const RibbonPoleSpells[3]
Definition: go_scripts.cpp:608
BrewfestMusic
Definition: go_scripts.cpp:646
@ EVENT_BREWFESTGOBLIN03
Definition: go_scripts.cpp:652
@ EVENT_BREWFESTDWARF02
Definition: go_scripts.cpp:648
@ EVENT_BREWFESTDWARF01
Definition: go_scripts.cpp:647
@ EVENT_BREWFESTDWARF03
Definition: go_scripts.cpp:649
@ EVENT_BREWFESTGOBLIN02
Definition: go_scripts.cpp:651
@ EVENT_BREWFESTGOBLIN01
Definition: go_scripts.cpp:650
PirateDayMusicEvents
Definition: go_scripts.cpp:955
@ EVENT_PDM_START_MUSIC
Definition: go_scripts.cpp:956
BrewfestMusicAreas
Definition: go_scripts.cpp:663
@ UNDERCITY
Definition: go_scripts.cpp:665
@ IRONFORGE_1
Definition: go_scripts.cpp:669
@ ORGRIMMAR_2
Definition: go_scripts.cpp:667
@ SHATTRATH
Definition: go_scripts.cpp:674
@ IRONFORGE_2
Definition: go_scripts.cpp:670
@ THUNDERBLUFF
Definition: go_scripts.cpp:668
@ DARNASSUS
Definition: go_scripts.cpp:673
@ SILVERMOON
Definition: go_scripts.cpp:664
@ STORMWIND
Definition: go_scripts.cpp:671
@ EXODAR
Definition: go_scripts.cpp:672
@ ORGRIMMAR_1
Definition: go_scripts.cpp:666
constexpr Seconds EVENT_BREWFESTGOBLIN02_TIME
Definition: go_scripts.cpp:659
BellHourlySoundZones
@ HILLSBRAD_FOOTHILLS_ZONE
@ TIRISFAL_ZONE
@ ASHENVALE_ZONE
@ DUSKWOOD_ZONE
@ TELDRASSIL_ZONE
@ IRONFORGE_ZONE
@ DARNASSUS_ZONE
@ DUN_MOROGH_ZONE
@ UNDERCITY_ZONE
BellHourlySoundFX
@ BELLTOLLNIGHTELF
@ BELLTOLLALLIANCE
@ BELLTOLLKHARAZHAN
@ BELLTOLLHORDE
@ BELLTOLLTRIBAL
@ BELLTOLLDWARFGNOME
ResoniteCask
Definition: go_scripts.cpp:229
@ NPC_GOGGEROC
Definition: go_scripts.cpp:230
Southfury
Definition: go_scripts.cpp:262
@ SPELL_BLACKJACK
Definition: go_scripts.cpp:264
@ SPELL_SUMMON_RIZZLE
Definition: go_scripts.cpp:265
@ NPC_RIZZLE
Definition: go_scripts.cpp:263
MidsummerBonfire
Definition: go_scripts.cpp:572
@ STAMP_OUT_BONFIRE_QUEST_COMPLETE
Definition: go_scripts.cpp:573
const uint32 NpcStasisEntry[]
Definition: go_scripts.cpp:192
MidsummerMusicEvents
Definition: go_scripts.cpp:836
@ EVENT_MM_START_MUSIC
Definition: go_scripts.cpp:837
DalaranCrystal
Definition: go_scripts.cpp:300
@ QUEST_TELE_CRYSTAL_FLAG
Definition: go_scripts.cpp:302
@ QUEST_LEARN_LEAVE_RETURN
Definition: go_scripts.cpp:301
MissingFriends
Definition: go_scripts.cpp:526
@ NPC_CAPTIVE_CHILD
Definition: go_scripts.cpp:528
@ SAY_FREE_0
Definition: go_scripts.cpp:529
@ QUEST_MISSING_FRIENDS
Definition: go_scripts.cpp:527
DarkmoonFaireMusic
Definition: go_scripts.cpp:896
@ MUSIC_DARKMOON_FAIRE_MUSIC
Definition: go_scripts.cpp:897
constexpr Seconds EVENT_BREWFESTDWARF03_TIME
Definition: go_scripts.cpp:657
DarkmoonFaireMusicEvents
Definition: go_scripts.cpp:901
@ EVENT_DFM_START_MUSIC
Definition: go_scripts.cpp:902
MidsummerMusic
Definition: go_scripts.cpp:830
@ EVENTMIDSUMMERFIREFESTIVAL_A
Definition: go_scripts.cpp:831
@ EVENTMIDSUMMERFIREFESTIVAL_H
Definition: go_scripts.cpp:832
time_t GetGameTime()
Definition: GameTime.cpp:44
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
float GetAbsoluteAngle(float x, float y) const
Definition: Position.h:125
constexpr float GetPositionZ() const
Definition: Position.h:78
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:452
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
Definition: go_scripts.cpp:466
void OnGameEvent(bool start, uint16 eventId) override
void UpdateAI(uint32 diff) override
void InitializeAI() override
go_bellsAI(GameObject *go)
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:379
void UpdateAI(uint32 diff) override
Definition: go_scripts.cpp:699
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:146
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:206
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:65
bool OnGossipSelect(Player *player, uint32, uint32) override
Definition: go_scripts.cpp:585
void UpdateAI(uint32 diff) override
Definition: go_scripts.cpp:852
void UpdateAI(uint32 diff) override
Definition: go_scripts.cpp:971
bool OnGossipHello(Player *) override
Definition: go_scripts.cpp:242
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:409
go_soulwellAI(GameObject *go)
Definition: go_scripts.cpp:405
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:277
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:99
bool OnGossipHello(Player *player) override
Definition: go_scripts.cpp:541