TrinityCore
Loading...
Searching...
No Matches
battleground_seething_shore.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#include "AreaTrigger.h"
19#include "AreaTriggerAI.h"
20#include "Battleground.h"
21#include "BattlegroundPackets.h"
22#include "BattlegroundScript.h"
23#include "Containers.h"
24#include "CreatureAI.h"
25#include "GameObject.h"
26#include "GameObjectAI.h"
27#include "Map.h"
28#include "MotionMaster.h"
29#include "ObjectMgr.h"
30#include "Player.h"
31#include "ScriptedCreature.h"
32#include "ScriptMgr.h"
33#include "Spell.h"
34#include "SpellAuras.h"
35#include "SpellScript.h"
36#include "TaskScheduler.h"
37#include "TemporarySummon.h"
38#include "WaypointDefines.h"
39
40#include <unordered_map>
41
43{
44 namespace Actions
45 {
46 static constexpr uint32 CaptureAzeriteNode = 1;
47 static constexpr uint32 ConsumeBuff = 2;
48 static constexpr uint32 SpawnBuff = 3;
49 static constexpr uint32 CommanderText1 = 4;
50 }
51
52 namespace Areas
53 {
54 static constexpr uint32 Shipwreck = 9511;
55 static constexpr uint32 Waterfall = 9512;
56 static constexpr uint32 CrashSite = 9513;
57 static constexpr uint32 Overlook = 9514;
58 static constexpr uint32 TarPits = 9515;
59 static constexpr uint32 Ruins = 9516;
60 static constexpr uint32 Tower = 9517;
61 static constexpr uint32 Plunge = 9518;
62 static constexpr uint32 TidePools = 9519;
63 static constexpr uint32 Bonfire = 9520;
64 static constexpr uint32 Ridge = 9521;
65 static constexpr uint32 Temple = 9522;
66
67 static constexpr std::array<uint32, 12> AzeriteNodes =
68 {
70 };
71 }
72
73 namespace Creatures
74 {
75 static constexpr uint32 Controller = 125269;
76 static constexpr uint32 AirSupplies = 133532;
77 static constexpr uint32 AirSupplyGroundDummy = 133542;
78
79 static constexpr uint32 NathanosBlightCaller = 131773;
80 static constexpr uint32 MathiasShaw = 130532;
81 static constexpr uint32 AzeriteFissure = 125253;
82 }
83
84 namespace CommanderTexts
85 {
86 static constexpr uint8 Intro1 = 0;
87 static constexpr uint8 Intro2 = 1;
88 static constexpr uint8 Intro3 = 2;
89 static constexpr uint8 Intro4 = 3;
90
91 static constexpr uint8 SuppliesSpawned = 4;
92 static constexpr uint8 CapturedAzerite = 5;
93 }
94
95 namespace GameObjects
96 {
97 static constexpr uint32 AllianceAirshipPrepCollision = 281224;
98 static constexpr uint32 HordeAirshipPrepCollision = 281226;
99
100 static constexpr uint32 BerserkBuff = 206564;
101 static constexpr uint32 FoodBuff = 206565;
102 static constexpr uint32 SpeedBuff = 206566;
103
104 static constexpr std::array<uint32, 3> Buffs = { BerserkBuff, FoodBuff, SpeedBuff };
105 }
106
107 namespace PvpStats
108 {
109 static constexpr uint32 CapturedAzerite = 744;
110 }
111
112 namespace Sounds
113 {
114 static constexpr uint32 PvpFlagCapturedAlliance = 8173;
115 static constexpr uint32 PvpFlagCapturedHorde = 8213;
116 }
117
118 namespace Spells
119 {
120 static constexpr uint32 ActivateAzerite = 248688;
121 static constexpr uint32 AzeriteGeyser = 248668;
122 static constexpr uint32 SummonAzeriteCaptureNode1 = 262749;
123 static constexpr uint32 SummonAzeriteCaptureNode2 = 248674;
124 static constexpr uint32 SummonAzeriteCaptureNode3 = 262748;
125 static constexpr uint32 AzeriteKnockBack = 262385;
126 static constexpr uint32 EarthQuakeCameraShake = 248719;
127 static constexpr uint32 CapturedAllianceCosmeticFx = 262508;
128 static constexpr uint32 CapturedHordeCosmeticFx = 262512;
129
130 static constexpr uint32 AchievementCredit = 261968; // on capture azerite node
131 static constexpr uint32 AchievementTrackerDeathFromAbove = 261954; // Death from Above achievement
132 static constexpr uint32 AchievementCreditClaimJumper = 261953; // to cast when capturing an azerite node when less than 30s on ground
134
135 static constexpr uint32 RocketParachute = 250917;
136 static constexpr uint32 RocketParachute2 = 250921;
137
138 static constexpr uint32 NoFallingDamage = 262359;
139 static constexpr uint32 Parachute = 269779;
140
142
143 static constexpr uint32 RopeBeam = 115048;
144 static constexpr uint32 PingVehicle = 115050;
145
146 static constexpr uint32 CreateHasteRuneBuffAreaTrigger = 295663;
147
148 static constexpr uint32 DustCloudImpactBigger = 54740;
149 static constexpr uint32 SpeedUp = 294701;
150 }
151
152 namespace SpellVisuals
153 {
154 static constexpr uint32 HasteRuneBuff = 85696;
155 static constexpr uint32 AzeriteBirth = 74145;
156 }
157
158 namespace StringIds
159 {
160 static constexpr std::string_view AirSupplyGroundDummy1 = "air_supply_ground_dummy_1";
161 static constexpr std::string_view AirSupplyGroundDummy2 = "air_supply_ground_dummy_2";
162 static constexpr std::string_view AirSupplyGroundDummy3 = "air_supply_ground_dummy_3";
163 static constexpr std::string_view AirSupplyGroundDummy4 = "air_supply_ground_dummy_4";
164 static constexpr std::string_view AirSupplyGroundDummy5 = "air_supply_ground_dummy_5";
165 static constexpr std::string_view AirSupplyGroundDummy6 = "air_supply_ground_dummy_6";
166
168 }
169
170 namespace WorldStates
171 {
172 static constexpr uint32 AllianceScore = 13845;
173 static constexpr uint32 HordeScore = 13844;
174 static constexpr uint32 MaxScore = 13846;
175 }
176
177 namespace Texts
178 {
179 static constexpr uint32 AzeriteSpawning = 134097;
180 static constexpr uint32 AllianceNearVictory = 10598;
181 static constexpr uint32 HordeNearVictory = 10599;
182 }
183}
184
186{
187 static constexpr uint32 WARNING_NEAR_VICTORY_SCORE = 1200;
188 static constexpr uint8 MAX_AZERITE_SPAWNS = 3;
189 static constexpr uint8 MAX_BUFF_SPAWNS = 3;
190
192 {
193 _isInformedNearVictory = { false, false };
194 _commanderGUIDs = { };
195 }
196
197 void OnUpdate(uint32 diff) override
198 {
199 _scheduler.Update(diff);
200 }
201
202 void OnPrepareStage2() override
203 {
204 for (ObjectGuid const& guid : _commanderGUIDs)
205 if (Creature const* creature = battlegroundMap->GetCreature(guid))
206 creature->AI()->DoAction(SeethingShore::Actions::CommanderText1);
207 }
208
209 void OnPrepareStage3() override
210 {
211 _scheduler.Schedule(2s, [this](TaskContext& context)
212 {
214 {
215 SpawnAzeriteNodes();
216 context.Repeat(100ms);
217 }
218 else
219 context.Repeat(2s);
220 });
221 }
222
223 void OnStart() override
224 {
225 for (ObjectGuid const& guid : _doors)
226 {
227 if (GameObject* gameObject = battlegroundMap->GetGameObject(guid))
228 {
229 gameObject->UseDoorOrButton();
230 gameObject->DespawnOrUnsummon(3s);
231 }
232 }
233
234 _scheduler.Schedule(30s, 2min, [this](TaskContext& context)
235 {
236 SpawnBuffs();
237 context.Repeat();
238 });
239 }
240
241 void HandleAssaultPoint(GameObject* capturePoint, Player* player)
242 {
243 if (!player)
244 return;
245
246 capturePoint->SendCustomAnim(1);
247 Team const team = battleground->GetPlayerTeam(player->GetGUID());
248 TeamId const teamId = GetTeamIdForTeam(team);
249
250 if (team == ALLIANCE)
251 {
254 }
255 else if (team == HORDE)
256 {
259 }
260
261 battleground->AddPoint(team, 100);
265
266 // the achievement criteria doesn't have a aura condition so we do it manually here
269
271 {
272 _isInformedNearVictory[teamId] = true;
273 if (teamId == TEAM_ALLIANCE)
275 else
277 }
278
280 capturePoint->SetAnimKitId(2560, false);
281 capturePoint->DespawnOrUnsummon(2s);
282
283 _activeAzeriteNodes.erase(capturePoint->GetAreaId());
284
285 if (Creature const* commander = battlegroundMap->GetCreature(_commanderGUIDs[teamId]))
286 commander->AI()->DoAction(SeethingShore::Actions::CaptureAzeriteNode);
287
292 }
293
294 void OnCreatureCreate(Creature* creature) override
295 {
296 switch (creature->GetEntry())
297 {
299 _controllerGUID = creature->GetGUID();
300 break;
302 _airSupplyGroundDummyGUIDs.emplace_back(creature->GetGUID());
303 break;
305 _commanderGUIDs[TEAM_HORDE] = creature->GetGUID();
306 break;
309 break;
310 default:
311 break;
312 }
313 }
314
315 void OnGameObjectCreate(GameObject* gameobject) override
316 {
317 switch (gameobject->GetEntry())
318 {
321 _doors.emplace_back(gameobject->GetGUID());
322 break;
323 default:
324 break;
325 }
326 }
327
328 void OnGameObjectRemove(GameObject* gameobject) override
329 {
330 switch (gameobject->GetEntry())
331 {
335 DoAction(SeethingShore::Actions::ConsumeBuff, gameobject, nullptr);
336 break;
337 default:
338 break;
339 }
340 }
341
342 void DoAction(uint32 actionId, WorldObject* source, WorldObject* target) override
343 {
344 switch (actionId)
345 {
348 break;
350 if (source)
351 if (Creature const* groundDummy = source->FindNearestCreature(SeethingShore::Creatures::AirSupplyGroundDummy, 20.0f))
352 _activeBuffs.erase(groundDummy->GetStringId(StringIdType::Spawn));
353 break;
354 default:
355 break;
356 }
357 }
358
360 {
362 {
363 std::vector<uint32> targets = SelectAzeriteNodesToSpawn();
364
365 CastSpellExtraArgs const args = CastSpellExtraArgs(true)
366 .SetCustomArg(targets);
367 controller->CastSpell(nullptr, SeethingShore::Spells::ActivateAzerite, args);
368 _firstSetDone = true;
369
370 for (uint32 const node : targets)
371 _activeAzeriteNodes.insert(node);
372 }
373
376 {
378 });
379 }
380
381 std::vector<uint32> SelectAzeriteNodesToSpawn() const
382 {
383 if (!_firstSetDone)
384 {
385 return {
389 };
390 }
391
392 std::vector<uint32> selected;
393 std::ranges::copy_if(SeethingShore::Areas::AzeriteNodes.begin(), SeethingShore::Areas::AzeriteNodes.end(), std::back_inserter(selected), [this](uint32 node)
394 {
395 return !_activeAzeriteNodes.contains(node);
396 });
397
398 uint32 const maxSpawns = MAX_AZERITE_SPAWNS - _activeAzeriteNodes.size();
399 Trinity::Containers::RandomResize(selected, std::max<uint32>(maxSpawns, 0));
400 return selected;
401 }
402
404 {
405 std::vector<std::string_view> toSpawn = SelectBuffsToSpawn();
406 if (toSpawn.empty())
407 return;
408
409 for (ObjectGuid const& guid : _commanderGUIDs)
410 if (Creature const* creature = battlegroundMap->GetCreature(guid))
411 creature->AI()->DoAction(SeethingShore::Actions::SpawnBuff);
412
413 for (ObjectGuid const& guid : _airSupplyGroundDummyGUIDs)
414 {
415 if (Creature* creature = battlegroundMap->GetCreature(guid))
416 {
417 bool const isValid = std::ranges::any_of(toSpawn.begin(), toSpawn.end(), [&](std::string_view stringId)
418 {
419 return creature->HasStringId(stringId);
420 });
421
422 if (!isValid)
423 continue;
424
425 _activeBuffs.insert(creature->GetStringId(StringIdType::Spawn));
426 creature->AI()->DoAction(SeethingShore::Actions::SpawnBuff);
427 }
428 }
429 }
430
431 std::vector<std::string_view> SelectBuffsToSpawn() const
432 {
433 std::vector<std::string_view> selected;
434 std::ranges::copy_if(SeethingShore::StringIds::AirSupplyGroundDummies.begin(), SeethingShore::StringIds::AirSupplyGroundDummies.end(), std::back_inserter(selected), [this](std::string_view buff)
435 {
436 return !_activeBuffs.contains(buff);
437 });
438
439 uint32 const maxSpawns = MAX_BUFF_SPAWNS - _activeBuffs.size();
440 Trinity::Containers::RandomResize(selected, std::max<uint32>(maxSpawns, 0));
441 return selected;
442 }
443
444private:
447
450 std::array<bool, PVP_TEAMS_COUNT> _isInformedNearVictory;
451
452 std::set<uint32> _activeAzeriteNodes;
453 std::set<std::string_view> _activeBuffs;
455 std::array<ObjectGuid, PVP_TEAMS_COUNT> _commanderGUIDs;
456};
457
458// 248688 - Activate Azerite
460{
461 bool Validate(SpellInfo const* /*spellInfo*/) override
462 {
463 return ValidateSpellInfo(
464 {
467 });
468 }
469
470 void FilterTargets(std::list<WorldObject*>& targets) const
471 {
472 std::vector<uint32> const* nodesToActivate = std::any_cast<std::vector<uint32>>(&GetSpell()->m_customArg);
473 if (!nodesToActivate)
474 {
475 targets.clear();
476 return;
477 }
478
479 auto itr = targets.begin();
480 while (itr != targets.end())
481 {
482 Creature const* creature = (*itr)->ToCreature();
483 if (!creature)
484 {
485 targets.erase(itr++);
486 continue;
487 }
488
489 bool const shouldActivate = std::ranges::any_of(*nodesToActivate, [&creature](uint32 areaId)
490 {
491 return creature->GetAreaId() == areaId;
492 });
493
494 if (!shouldActivate)
495 targets.erase(itr++);
496 else
497 ++itr;
498 }
499 }
500
505
511};
512
513// 248668 - Azerite Geyser
515{
516 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
517 {
518 if (Unit* unitOwner = GetUnitOwner())
519 {
521 unitOwner->CastSpell(unitOwner, SeethingShore::Spells::AzeriteKnockBack, true);
522 unitOwner->GetMotionMaster()->MoveTargetedHome();
523 }
524 }
525
530};
531
532// 250917 - Rocket Parachute
556
557// 250921 - Rocket Parachute
559{
560public:
562
563 bool Validate(SpellInfo const* /*spellInfo*/) override
564 {
565 return ValidateSpellInfo(
566 {
568 });
569 }
570
571 void HandlePeriodicTrigger(AuraEffect const* /*auraEffect*/)
572 {
574 return;
575
576 Unit* target = GetTarget();
577 float const delta = target->GetPositionZ() - target->GetFloorZ();
578 if (delta <= 30.0f)
579 {
580 SpellCastResult const castResult = target->CastSpell(target, SeethingShore::Spells::Parachute, true);
581 _parachuteDeployed = castResult == SPELL_CAST_OK;
582 }
583 }
584
585 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
586 {
587 // this should prevent next tick from re-applying this aura
588 if (Unit* unitOwner = GetUnitOwner())
589 unitOwner->RemoveAurasDueToSpell(SeethingShore::Spells::RocketParachute);
590 }
591
597
598private:
600};
601
602// 269779 - Parachute
604{
605 bool Validate(SpellInfo const* spellInfo) override
606 {
607 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } })
609 {
610 static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()),
613 });
614 }
615
616 void ApplyParachuteAura(SpellEffIndex /*effIndex*/) const
617 {
618 if (Player* player = GetHitPlayer())
619 {
623
624 player->CastSpell(player, static_cast<uint32>(GetEffectInfo().CalcValueAsInt(player)), args);
625 player->CastSpell(player, SeethingShore::Spells::AchievementTrackerCreditClaimJumper, true);
626 player->CastSpell(player, SeethingShore::Spells::AchievementTrackerDeathFromAbove, true);
627 }
628 }
629
630 void ResetFallDamage(SpellEffIndex /*effIndex*/) const
631 {
632 if (Player* player = GetHitPlayer())
633 player->SetFallInformation(0, player->GetPositionZ());
634 }
635
641};
642
643// 294701 - Speed Up
645{
646 void ResetCooldowns(SpellEffIndex /*effIndex*/) const
647 {
648 // Unsure about which spells should reset and which not
649 // It's not the same list as the ones that reset on encounter reset
650 if (Player* player = GetCaster()->ToPlayer())
651 player->RemoveArenaSpellCooldowns();
652 }
653
658};
659
660// 272471 - Azerite
661// 281306 - Azerite
662// 281307 - Azerite
664{
666
667 bool OnCapturePointAssaulted(Player* player) override
668 {
670 return true;
671
672 if (ZoneScript* zoneScript = me->GetZoneScript())
673 {
674 zoneScript->DoAction(SeethingShore::Actions::CaptureAzeriteNode, player, me);
675 return false;
676 }
677
678 return true;
679 }
680};
681
682// 278407 - Sword of Dawn
683// 279254 - The Warbringer
685{
686 explicit transport_seething_shore() : TransportScript("transport_seething_shore") { }
687
688 void OnRemovePassenger(Transport* /*transport*/, Player* player) override
689 {
690 if (!player->IsInWorld())
691 return;
692
693 if (Battleground const* bg = player->GetBattleground())
694 {
695 if (bg->GetStatus() != STATUS_IN_PROGRESS)
696 {
697 WorldSafeLocsEntry const* pos = bg->GetTeamStartPosition(Battleground::GetTeamIndexByTeamId(player->GetBGTeam()));
698 player->TeleportTo({ .Location = pos->Loc, .TransportGuid = pos->TransportSpawnId ? ObjectGuid::Create<HighGuid::Transport>(*pos->TransportSpawnId) : ObjectGuid::Empty });
699 return;
700 }
701
704 }
705 }
706};
707
708// 133533 - Air Supplies
719
725
726// 133542 - Air Supply Ground Dummy
728{
730
731 static constexpr uint32 PATH_ID_GROUND = 1;
732
733 static WaypointPath ConvertPosToPath(Position const& position)
734 {
735 return {
737 {
738 { 0, position.GetPositionX(), position.GetPositionY(), position.GetPositionZ() }
739 },
742 };
743 }
744
745 static inline const std::unordered_map<std::string_view, AirSupplyData> AIR_SUPPLY_DATA =
746 {
747 { SeethingShore::StringIds::AirSupplyGroundDummy1, { { 1398.8298f, 2727.5322f, 121.74067f, 1.789716362953186035f }, { 1398.7153f, 2728.0469f, 28.024399f } } },
748 { SeethingShore::StringIds::AirSupplyGroundDummy2, { { 1226.2812f, 2934.0356f, 152.03821f, 2.737864494323730468f }, { 1224.4445f, 2934.8203f, 72.7618f } } },
749 { SeethingShore::StringIds::AirSupplyGroundDummy3, { { 1226.276f, 2826.9246f, 145.53375f,5.083248138427734375f }, { 1226.9896f, 2825.0894f, 39.256886f } } },
750 { SeethingShore::StringIds::AirSupplyGroundDummy4, { { 1384.7483f, 2847.356f, 113.422775f, 2.29029250144958496f }, { 1384.2257f, 2847.9524f, 38.665867f } } },
751 { SeethingShore::StringIds::AirSupplyGroundDummy5, { { 1323.1545f, 2627.9531f, 99.90129f, 3.868808984756469726f }, { 1322.7587f, 2627.6008f, 0.9027778f } } },
752 { SeethingShore::StringIds::AirSupplyGroundDummy6, { { 1423.8021f, 2870.2188f, 115.70237f, 1.629547119140625f }, { 1423.7188f, 2871.6362f, 36.968292f } } }
753 };
754
755 void UpdateAI(uint32 diff) override
756 {
757 _scheduler.Update(diff);
758 }
759
761 {
762 std::string_view const stringId = me->GetStringId(StringIdType::Spawn);
763 if (!AIR_SUPPLY_DATA.contains(stringId))
764 return;
765
766 auto const& [spawn, destination] = AIR_SUPPLY_DATA.at(stringId);
768 supplies->GetMotionMaster()->MovePath(ConvertPosToPath(destination), false);
769 }
770
771 void DoAction(int32 actionId) override
772 {
773 if (actionId == SeethingShore::Actions::SpawnBuff)
774 {
775 _scheduler.Schedule(5s, [&](TaskContext const&)
776 {
778 });
779 }
780 }
781
782private:
784};
785
786// 133532 - Air Supplies
788{
790
791 void WaypointPathEnded(uint32 /*pointId*/, uint32 pathId) override
792 {
794 return;
795
797 if (!groundDummy)
798 return;
799
801 uint8 const action = urand(0, 3);
802 switch (action)
803 {
804 case 0:
805 case 1:
806 case 2:
807 // pretty sure some serverside spell is used, and we could drop this whole switch
808 if (GameObject* buff = GameObject::CreateGameObject(SeethingShore::GameObjects::Buffs[action], groundDummy->GetMap(), groundDummy->GetPosition(), rot, 255, GO_STATE_READY))
809 {
810 buff->SetSpawnedByDefault(false);
811 buff->SetRespawnTime(300); // this is equal to the haste rune buff area trigger
812 groundDummy->GetMap()->AddToMap(buff);
813 }
814 break;
815 case 3:
817 break;
818 default:
819 break;
820 }
821
822 groundDummy->CastSpell(nullptr, SeethingShore::Spells::DustCloudImpactBigger, true);
824 }
825};
826
828{
829 explicit at_bg_seething_shore_haste_rune_buff(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
830
831 void OnCreate(Spell const* /*creatingSpell*/) override
832 {
834 }
835
836 void OnUnitEnter(Unit* unit) override
837 {
838 if (Player* player = unit->ToPlayer())
839 {
840 if (ZoneScript* zonescript = at->GetZoneScript())
841 {
842 player->CastSpell(player, SeethingShore::Spells::SpeedUp, true);
843 zonescript->DoAction(SeethingShore::Actions::ConsumeBuff, at);
844 at->Remove();
845 }
846 }
847 }
848};
849
850// 131773 - Nathanos Blightcaller
851// 130532 - Master Mathias Shaw
853{
854 explicit npc_bg_seething_shore_commander(Creature* creature) : ScriptedAI(creature) { }
855
856 void UpdateAI(uint32 diff) override
857 {
858 _scheduler.Update(diff);
859 }
860
861 void DoAction(int32 actionId) override
862 {
863 switch (actionId)
864 {
867 _scheduler.Schedule(30s, [this](TaskContext& context)
868 {
870 context.Schedule(15s, [this](TaskContext& context2)
871 {
873 context2.Schedule(12s, [this](TaskContext const&)
874 {
876 });
877 });
878 });
879 break;
881 if (urand(0, 1))
883 break;
886 break;
887 default:
888 break;
889 }
890 }
891
892private:
894};
895
896// 129344 - Vignette Dummy
898{
899 explicit npc_bg_seething_shore_vignette_dummy(Creature* creature) : ScriptedAI(creature) { }
900
901 void JustAppeared() override
902 {
903 _scheduler.Schedule(38s, [this](TaskContext const&)
904 {
907 });
908 }
909
910 void UpdateAI(uint32 diff) override
911 {
912 _scheduler.Update(diff);
913 }
914
915private:
917};
918
@ STATUS_IN_PROGRESS
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:434
Spells
Definition PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:43
#define RegisterBattlegroundMapScript(script_name, mapId)
Definition ScriptMgr.h:1447
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1392
#define RegisterGameObjectAI(ai_name)
Definition ScriptMgr.h:1410
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_KNOCK_BACK
@ SPELL_EFFECT_APPLY_AURA
constexpr TeamId GetTeamIdForTeam(Team team)
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ ALLIANCE
@ HORDE
SpellCastResult
@ SPELL_CAST_OK
@ GO_FLAG_NOT_SELECTABLE
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
@ GO_STATE_READY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_CAN_TURN_WHILE_FALLING
@ SPELL_AURA_DUMMY
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectRemoveFn(F, I, N, M)
Creatures
void AddSC_battleground_seething_shore()
Sounds
AreaTrigger *const at
void PlaySpellVisual(uint32 spellVisualId) const
HookList< EffectPeriodicHandler > OnEffectPeriodic
Aura * GetAura() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
Unit * GetUnitOwner() const
ObjectGuid GetCastId() const
Definition SpellAuras.h:186
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
bool IsInWorld() const
Definition BaseEntity.h:158
Battleground * battleground
BattlegroundMap * battlegroundMap
void UpdateWorldState(int32 worldStateId, int32 value, bool hidden=false) const
void PlaySoundToAll(uint32 SoundID)
uint32 GetTeamScore(TeamId teamId) const
static TeamId GetTeamIndexByTeamId(Team team)
virtual void EndBattleground(Team winner)
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
void AddPoint(Team team, uint32 points=1)
Team GetPlayerTeam(ObjectGuid guid) const
void UpdatePvpStat(Player *player, uint32 pvpStatId, uint32 value)
Creature *const me
Definition CreatureAI.h:63
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
std::string_view GetStringId(StringIdType type) const
Definition Creature.h:285
GameObject *const me
GOState GetGoState() const
Definition GameObject.h:290
bool HasFlag(GameObjectFlags flags) const
Definition GameObject.h:282
static GameObject * CreateGameObject(uint32 entry, Map *map, Position const &pos, QuaternionData const &rotation, uint32 animProgress, GOState goState, uint32 artKit=0)
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forceRespawnTime=0s)
void SendCustomAnim(uint32 anim)
void SetAnimKitId(uint16 animKitId, bool oneshot)
bool AddToMap(T *)
Definition Map.cpp:527
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition Object.cpp:1191
void DoOnPlayers(T &&fn)
Definition Map.h:411
int32 GetWorldStateValue(int32 worldStateId) const
Definition Map.cpp:437
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:3588
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:3578
static ObjectGuid const Empty
Definition ObjectGuid.h:314
Player * ToPlayer()
Definition Object.h:126
GameObject * ToGameObject()
Definition Object.h:131
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
Definition Player.cpp:1181
Battleground * GetBattleground() const
Definition Player.cpp:25650
Team GetBGTeam() const
Definition Player.cpp:24277
uint32 const Id
Definition SpellInfo.h:328
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:590
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Spell * GetSpell() const
HookList< EffectHandler > OnEffectLaunchTarget
HookList< EffectHandler > OnEffectLaunch
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Spell.h:277
std::any m_customArg
Definition Spell.h:649
ObjectGuid m_castId
Definition Spell.h:604
TaskContext & Schedule(TaskScheduler::duration_t time, TaskScheduler::task_handler_t task)
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
Definition Unit.h:647
void SendPlaySpellVisual(Unit *target, uint32 spellVisualId, uint8 missReason, uint8 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
Definition Unit.cpp:12400
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
Map * GetMap() const
Definition Object.h:411
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
ZoneScript * GetZoneScript() const
Definition Object.h:417
float GetFloorZ() const
Definition Object.cpp:3109
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1522
uint32 GetAreaId() const
Definition Object.h:333
void FilterTargets(std::list< WorldObject * > &targets) const
void HandleRemove(AuraEffect const *, AuraEffectHandleModes) const
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes) const
static constexpr uint32 ConsumeBuff
static constexpr uint32 CommanderText1
static constexpr uint32 CaptureAzeriteNode
static constexpr uint32 TarPits
static constexpr uint32 TidePools
static constexpr uint32 Overlook
static constexpr uint32 Shipwreck
static constexpr std::array< uint32, 12 > AzeriteNodes
static constexpr uint32 CrashSite
static constexpr uint32 Waterfall
static constexpr uint32 Bonfire
static constexpr uint32 NathanosBlightCaller
static constexpr uint32 AirSupplyGroundDummy
static constexpr std::array< uint32, 3 > Buffs
static constexpr uint32 HordeAirshipPrepCollision
static constexpr uint32 AllianceAirshipPrepCollision
static constexpr uint32 CapturedAzerite
static constexpr uint32 PvpFlagCapturedAlliance
static constexpr uint32 PvpFlagCapturedHorde
static constexpr uint32 AchievementTrackerDeathFromAbove
static constexpr uint32 AchievementCreditClaimJumper
static constexpr uint32 PingVehicle
static constexpr uint32 AzeriteGeyser
static constexpr uint32 EarthQuakeCameraShake
static constexpr uint32 RocketParachute
static constexpr uint32 DustCloudImpactBigger
static constexpr uint32 SummonAzeriteCaptureNode2
static constexpr uint32 AzeriteKnockBack
static constexpr uint32 CapturedHordeCosmeticFx
static constexpr std::array< uint32, 3 > SummonAzeriteCaptureNodeSpells
static constexpr uint32 AchievementCredit
static constexpr uint32 SummonAzeriteCaptureNode1
static constexpr uint32 RocketParachute2
static constexpr uint32 CreateHasteRuneBuffAreaTrigger
static constexpr uint32 AchievementTrackerCreditClaimJumper
static constexpr uint32 ActivateAzerite
static constexpr uint32 CapturedAllianceCosmeticFx
static constexpr uint32 SummonAzeriteCaptureNode3
static constexpr uint32 NoFallingDamage
static constexpr std::string_view AirSupplyGroundDummy2
static constexpr std::string_view AirSupplyGroundDummy1
static constexpr std::string_view AirSupplyGroundDummy3
static constexpr std::string_view AirSupplyGroundDummy6
static constexpr std::array< std::string_view, 6 > AirSupplyGroundDummies
static constexpr std::string_view AirSupplyGroundDummy4
static constexpr std::string_view AirSupplyGroundDummy5
static constexpr uint32 AzeriteSpawning
static constexpr uint32 AllianceNearVictory
static constexpr uint32 HordeNearVictory
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
TriggerCastFlags TriggerFlags
CastSpellExtraArgs & SetCustomArg(std::any customArg)
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
constexpr float GetOrientation() const
Definition Position.h:90
constexpr float GetPositionZ() const
Definition Position.h:89
static QuaternionData fromOrientation(float orientation)
Optional< ObjectGuid::LowType > TransportSpawnId
Definition ObjectMgr.h:836
WorldLocation Loc
Definition ObjectMgr.h:835
at_bg_seething_shore_haste_rune_buff(AreaTrigger *areatrigger)
void OnGameObjectCreate(GameObject *gameobject) override
static constexpr uint32 WARNING_NEAR_VICTORY_SCORE
std::array< bool, PVP_TEAMS_COUNT > _isInformedNearVictory
std::array< ObjectGuid, PVP_TEAMS_COUNT > _commanderGUIDs
void OnGameObjectRemove(GameObject *gameobject) override
void HandleAssaultPoint(GameObject *capturePoint, Player *player)
std::vector< uint32 > SelectAzeriteNodesToSpawn() const
void OnCreatureCreate(Creature *creature) override
void DoAction(uint32 actionId, WorldObject *source, WorldObject *target) override
std::set< std::string_view > _activeBuffs
std::vector< std::string_view > SelectBuffsToSpawn() const
bool OnCapturePointAssaulted(Player *player) override
void WaypointPathEnded(uint32, uint32 pathId) override
static const std::unordered_map< std::string_view, AirSupplyData > AIR_SUPPLY_DATA
static WaypointPath ConvertPosToPath(Position const &position)
void OnRemovePassenger(Transport *, Player *player) override