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 "G3DPosition.hpp"
26#include "GameObject.h"
27#include "GameObjectAI.h"
28#include "Map.h"
29#include "MotionMaster.h"
30#include "ObjectMgr.h"
31#include "Player.h"
32#include "ScriptedCreature.h"
33#include "ScriptMgr.h"
34#include "Spell.h"
35#include "SpellAuras.h"
36#include "SpellScript.h"
37#include "SpellHistory.h"
38#include "TaskScheduler.h"
39#include "TemporarySummon.h"
40#include "WaypointDefines.h"
41
42#include <unordered_map>
43
45{
46 namespace Actions
47 {
48 static constexpr uint32 CaptureAzeriteNode = 1;
49 static constexpr uint32 ConsumeBuff = 2;
50 static constexpr uint32 SpawnBuff = 3;
51 static constexpr uint32 CommanderText1 = 4;
52 }
53
54 namespace Areas
55 {
56 static constexpr uint32 Shipwreck = 9511;
57 static constexpr uint32 Waterfall = 9512;
58 static constexpr uint32 CrashSite = 9513;
59 static constexpr uint32 Overlook = 9514;
60 static constexpr uint32 TarPits = 9515;
61 static constexpr uint32 Ruins = 9516;
62 static constexpr uint32 Tower = 9517;
63 static constexpr uint32 Plunge = 9518;
64 static constexpr uint32 TidePools = 9519;
65 static constexpr uint32 Bonfire = 9520;
66 static constexpr uint32 Ridge = 9521;
67 static constexpr uint32 Temple = 9522;
68
69 static constexpr std::array<uint32, 12> AzeriteNodes =
70 {
72 };
73 }
74
75 namespace Creatures
76 {
77 static constexpr uint32 Controller = 125269;
78 static constexpr uint32 AirSupplies = 133532;
79 static constexpr uint32 AirSupplyGroundDummy = 133542;
80
81 static constexpr uint32 NathanosBlightCaller = 131773;
82 static constexpr uint32 MathiasShaw = 130532;
83 static constexpr uint32 AzeriteFissure = 125253;
84 }
85
86 namespace CommanderTexts
87 {
88 static constexpr uint8 Intro1 = 0;
89 static constexpr uint8 Intro2 = 1;
90 static constexpr uint8 Intro3 = 2;
91 static constexpr uint8 Intro4 = 3;
92
93 static constexpr uint8 SuppliesSpawned = 4;
94 static constexpr uint8 CapturedAzerite = 5;
95 }
96
97 namespace GameObjects
98 {
99 static constexpr uint32 AllianceAirshipPrepCollision = 281224;
100 static constexpr uint32 HordeAirshipPrepCollision = 281226;
101
102 static constexpr uint32 BerserkBuff = 206564;
103 static constexpr uint32 FoodBuff = 206565;
104 static constexpr uint32 SpeedBuff = 206566;
105
106 static constexpr std::array<uint32, 3> Buffs = { BerserkBuff, FoodBuff, SpeedBuff };
107 }
108
109 namespace PvpStats
110 {
111 static constexpr uint32 CapturedAzerite = 744;
112 }
113
114 namespace Sounds
115 {
116 static constexpr uint32 PvpFlagCapturedAlliance = 8173;
117 static constexpr uint32 PvpFlagCapturedHorde = 8213;
118 }
119
120 namespace Spells
121 {
122 static constexpr uint32 ActivateAzerite = 248688;
123 static constexpr uint32 AzeriteGeyser = 248668;
124 static constexpr uint32 SummonAzeriteCaptureNode1 = 262749;
125 static constexpr uint32 SummonAzeriteCaptureNode2 = 248674;
126 static constexpr uint32 SummonAzeriteCaptureNode3 = 262748;
127 static constexpr uint32 AzeriteKnockBack = 262385;
128 static constexpr uint32 EarthQuakeCameraShake = 248719;
129 static constexpr uint32 CapturedAllianceCosmeticFx = 262508;
130 static constexpr uint32 CapturedHordeCosmeticFx = 262512;
131
132 static constexpr uint32 AchievementCredit = 261968; // on capture azerite node
133 static constexpr uint32 AchievementTrackerDeathFromAbove = 261954; // Death from Above achievement
134 static constexpr uint32 AchievementCreditClaimJumper = 261953; // to cast when capturing an azerite node when less than 30s on ground
136
137 static constexpr uint32 RocketParachute = 250917;
138 static constexpr uint32 RocketParachute2 = 250921;
139
140 static constexpr uint32 NoFallingDamage = 262359;
141 static constexpr uint32 Parachute = 269779;
142
144
145 static constexpr uint32 RopeBeam = 115048;
146 static constexpr uint32 PingVehicle = 115050;
147
148 static constexpr uint32 CreateHasteRuneBuffAreaTrigger = 295663;
149
150 static constexpr uint32 DustCloudImpactBigger = 54740;
151 static constexpr uint32 SpeedUp = 294701;
152 }
153
154 namespace SpellVisuals
155 {
156 static constexpr uint32 HasteRuneBuff = 85696;
157 static constexpr uint32 AzeriteBirth = 74145;
158 }
159
160 namespace StringIds
161 {
162 static constexpr std::string_view AirSupplyGroundDummy1 = "air_supply_ground_dummy_1";
163 static constexpr std::string_view AirSupplyGroundDummy2 = "air_supply_ground_dummy_2";
164 static constexpr std::string_view AirSupplyGroundDummy3 = "air_supply_ground_dummy_3";
165 static constexpr std::string_view AirSupplyGroundDummy4 = "air_supply_ground_dummy_4";
166 static constexpr std::string_view AirSupplyGroundDummy5 = "air_supply_ground_dummy_5";
167 static constexpr std::string_view AirSupplyGroundDummy6 = "air_supply_ground_dummy_6";
168
170 }
171
172 namespace WorldStates
173 {
174 static constexpr uint32 AllianceScore = 13845;
175 static constexpr uint32 HordeScore = 13844;
176 static constexpr uint32 MaxScore = 13846;
177 }
178
179 namespace Texts
180 {
181 static constexpr uint32 AzeriteSpawning = 134097;
182 static constexpr uint32 AllianceNearVictory = 10598;
183 static constexpr uint32 HordeNearVictory = 10599;
184 }
185}
186
188{
189 static constexpr uint32 WARNING_NEAR_VICTORY_SCORE = 1200;
190 static constexpr uint8 MAX_AZERITE_SPAWNS = 3;
191 static constexpr uint8 MAX_BUFF_SPAWNS = 3;
192
194 {
195 _isInformedNearVictory = { false, false };
196 _commanderGUIDs = { };
197 }
198
199 void OnUpdate(uint32 diff) override
200 {
201 _scheduler.Update(diff);
202 }
203
204 void OnPrepareStage2() override
205 {
206 for (ObjectGuid const& guid : _commanderGUIDs)
207 if (Creature const* creature = battlegroundMap->GetCreature(guid))
208 creature->AI()->DoAction(SeethingShore::Actions::CommanderText1);
209 }
210
211 void OnPrepareStage3() override
212 {
213 _scheduler.Schedule(2s, [this](TaskContext& context)
214 {
216 {
217 SpawnAzeriteNodes();
218 context.Repeat(100ms);
219 }
220 else
221 context.Repeat(2s);
222 });
223 }
224
225 void OnStart() override
226 {
227 for (ObjectGuid const& guid : _doors)
228 {
229 if (GameObject* gameObject = battlegroundMap->GetGameObject(guid))
230 {
231 gameObject->UseDoorOrButton();
232 gameObject->DespawnOrUnsummon(3s);
233 }
234 }
235
236 _scheduler.Schedule(30s, 2min, [this](TaskContext& context)
237 {
238 SpawnBuffs();
239 context.Repeat();
240 });
241 }
242
243 void HandleAssaultPoint(GameObject* capturePoint, Player* player)
244 {
245 if (!player)
246 return;
247
248 capturePoint->SendCustomAnim(1);
249 Team const team = battleground->GetPlayerTeam(player->GetGUID());
250 TeamId const teamId = GetTeamIdForTeam(team);
251
252 if (team == ALLIANCE)
253 {
256 }
257 else if (team == HORDE)
258 {
261 }
262
263 battleground->AddPoint(team, 100);
267
268 // the achievement criteria doesn't have a aura condition so we do it manually here
271
273 {
274 _isInformedNearVictory[teamId] = true;
275 if (teamId == TEAM_ALLIANCE)
277 else
279 }
280
282 capturePoint->SetAnimKitId(2560, false);
283 capturePoint->DespawnOrUnsummon(2s);
284
285 _activeAzeriteNodes.erase(capturePoint->GetAreaId());
286
287 if (Creature const* commander = battlegroundMap->GetCreature(_commanderGUIDs[teamId]))
288 commander->AI()->DoAction(SeethingShore::Actions::CaptureAzeriteNode);
289
294 }
295
296 void OnCreatureCreate(Creature* creature) override
297 {
298 switch (creature->GetEntry())
299 {
301 _controllerGUID = creature->GetGUID();
302 break;
304 _airSupplyGroundDummyGUIDs.emplace_back(creature->GetGUID());
305 break;
307 _commanderGUIDs[TEAM_HORDE] = creature->GetGUID();
308 break;
311 break;
312 default:
313 break;
314 }
315 }
316
317 void OnGameObjectCreate(GameObject* gameobject) override
318 {
319 switch (gameobject->GetEntry())
320 {
323 _doors.emplace_back(gameobject->GetGUID());
324 break;
325 default:
326 break;
327 }
328 }
329
330 void OnGameObjectRemove(GameObject* gameobject) override
331 {
332 switch (gameobject->GetEntry())
333 {
337 DoAction(SeethingShore::Actions::ConsumeBuff, gameobject, nullptr);
338 break;
339 default:
340 break;
341 }
342 }
343
344 void DoAction(uint32 actionId, WorldObject* source, WorldObject* target) override
345 {
346 switch (actionId)
347 {
350 break;
352 if (source)
353 if (Creature const* groundDummy = source->FindNearestCreature(SeethingShore::Creatures::AirSupplyGroundDummy, 20.0f))
354 _activeBuffs.erase(groundDummy->GetStringId(StringIdType::Spawn));
355 break;
356 default:
357 break;
358 }
359 }
360
362 {
364 {
365 std::vector<uint32> targets = SelectAzeriteNodesToSpawn();
366
367 CastSpellExtraArgs const args = CastSpellExtraArgs(true)
368 .SetCustomArg(targets);
369 controller->CastSpell(nullptr, SeethingShore::Spells::ActivateAzerite, args);
370 _firstSetDone = true;
371
372 for (uint32 const node : targets)
373 _activeAzeriteNodes.insert(node);
374 }
375
378 {
380 });
381 }
382
383 std::vector<uint32> SelectAzeriteNodesToSpawn() const
384 {
385 if (!_firstSetDone)
386 {
387 return {
391 };
392 }
393
394 std::vector<uint32> selected;
395 std::ranges::copy_if(SeethingShore::Areas::AzeriteNodes.begin(), SeethingShore::Areas::AzeriteNodes.end(), std::back_inserter(selected), [this](uint32 node)
396 {
397 return !_activeAzeriteNodes.contains(node);
398 });
399
400 uint32 const maxSpawns = MAX_AZERITE_SPAWNS - _activeAzeriteNodes.size();
401 Trinity::Containers::RandomResize(selected, std::max<uint32>(maxSpawns, 0));
402 return selected;
403 }
404
406 {
407 std::vector<std::string_view> toSpawn = SelectBuffsToSpawn();
408 if (toSpawn.empty())
409 return;
410
411 for (ObjectGuid const& guid : _commanderGUIDs)
412 if (Creature const* creature = battlegroundMap->GetCreature(guid))
413 creature->AI()->DoAction(SeethingShore::Actions::SpawnBuff);
414
415 for (ObjectGuid const& guid : _airSupplyGroundDummyGUIDs)
416 {
417 if (Creature* creature = battlegroundMap->GetCreature(guid))
418 {
419 bool const isValid = std::ranges::any_of(toSpawn.begin(), toSpawn.end(), [&](std::string_view stringId)
420 {
421 return creature->HasStringId(stringId);
422 });
423
424 if (!isValid)
425 continue;
426
427 _activeBuffs.insert(creature->GetStringId(StringIdType::Spawn));
428 creature->AI()->DoAction(SeethingShore::Actions::SpawnBuff);
429 }
430 }
431 }
432
433 std::vector<std::string_view> SelectBuffsToSpawn() const
434 {
435 std::vector<std::string_view> selected;
436 std::ranges::copy_if(SeethingShore::StringIds::AirSupplyGroundDummies.begin(), SeethingShore::StringIds::AirSupplyGroundDummies.end(), std::back_inserter(selected), [this](std::string_view buff)
437 {
438 return !_activeBuffs.contains(buff);
439 });
440
441 uint32 const maxSpawns = MAX_BUFF_SPAWNS - _activeBuffs.size();
442 Trinity::Containers::RandomResize(selected, std::max<uint32>(maxSpawns, 0));
443 return selected;
444 }
445
446private:
449
452 std::array<bool, PVP_TEAMS_COUNT> _isInformedNearVictory;
453
454 std::set<uint32> _activeAzeriteNodes;
455 std::set<std::string_view> _activeBuffs;
457 std::array<ObjectGuid, PVP_TEAMS_COUNT> _commanderGUIDs;
458};
459
460// 248688 - Activate Azerite
462{
463 bool Validate(SpellInfo const* /*spellInfo*/) override
464 {
465 return ValidateSpellInfo(
466 {
469 });
470 }
471
472 void FilterTargets(std::list<WorldObject*>& targets) const
473 {
474 std::vector<uint32> const* nodesToActivate = std::any_cast<std::vector<uint32>>(&GetSpell()->m_customArg);
475 if (!nodesToActivate)
476 {
477 targets.clear();
478 return;
479 }
480
481 auto itr = targets.begin();
482 while (itr != targets.end())
483 {
484 Creature const* creature = (*itr)->ToCreature();
485 if (!creature)
486 {
487 targets.erase(itr++);
488 continue;
489 }
490
491 bool const shouldActivate = std::ranges::any_of(*nodesToActivate, [&creature](uint32 areaId)
492 {
493 return creature->GetAreaId() == areaId;
494 });
495
496 if (!shouldActivate)
497 targets.erase(itr++);
498 else
499 ++itr;
500 }
501 }
502
507
513};
514
515// 248668 - Azerite Geyser
517{
518 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
519 {
520 if (Unit* unitOwner = GetUnitOwner())
521 {
523 unitOwner->CastSpell(unitOwner, SeethingShore::Spells::AzeriteKnockBack, true);
524 unitOwner->GetMotionMaster()->MoveTargetedHome();
525 }
526 }
527
532};
533
534// 250917 - Rocket Parachute
558
559// 250921 - Rocket Parachute
561{
562public:
564
565 bool Validate(SpellInfo const* /*spellInfo*/) override
566 {
567 return ValidateSpellInfo(
568 {
570 });
571 }
572
573 void HandlePeriodicTrigger(AuraEffect const* /*auraEffect*/)
574 {
576 return;
577
578 Unit* target = GetTarget();
579 float const delta = target->GetPositionZ() - target->GetFloorZ();
580 if (delta <= 30.0f)
581 {
582 SpellCastResult const castResult = target->CastSpell(target, SeethingShore::Spells::Parachute, true);
583 _parachuteDeployed = castResult == SPELL_CAST_OK;
584 }
585 }
586
587 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
588 {
589 // this should prevent next tick from re-applying this aura
590 if (Unit* unitOwner = GetUnitOwner())
591 unitOwner->RemoveAurasDueToSpell(SeethingShore::Spells::RocketParachute);
592 }
593
599
600private:
602};
603
604// 269779 - Parachute
606{
607 bool Validate(SpellInfo const* spellInfo) override
608 {
609 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } })
611 {
612 static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()),
615 });
616 }
617
618 void ApplyParachuteAura(SpellEffIndex /*effIndex*/) const
619 {
620 if (Player* player = GetHitPlayer())
621 {
625
626 player->CastSpell(player, static_cast<uint32>(GetEffectInfo().CalcValueAsInt(player)), args);
627 player->CastSpell(player, SeethingShore::Spells::AchievementTrackerCreditClaimJumper, true);
628 player->CastSpell(player, SeethingShore::Spells::AchievementTrackerDeathFromAbove, true);
629 }
630 }
631
632 void ResetFallDamage(SpellEffIndex /*effIndex*/) const
633 {
634 if (Player* player = GetHitPlayer())
635 player->SetFallInformation(0, player->GetPositionZ());
636 }
637
643};
644
645// 294701 - Speed Up
647{
648 void ResetCooldowns(SpellEffIndex /*effIndex*/) const
649 {
650 // Unsure about which spells should reset and which not
651 // It's not the same list as the ones that reset on encounter reset
652 if (Player* player = GetCaster()->ToPlayer())
653 player->GetSpellHistory()->ResetAllCooldowns();
654 }
655
660};
661
662// 272471 - Azerite
663// 281306 - Azerite
664// 281307 - Azerite
666{
668
669 bool OnCapturePointAssaulted(Player* player) override
670 {
672 return true;
673
674 if (ZoneScript* zoneScript = me->GetZoneScript())
675 {
676 zoneScript->DoAction(SeethingShore::Actions::CaptureAzeriteNode, player, me);
677 return false;
678 }
679
680 return true;
681 }
682};
683
684// 278407 - Sword of Dawn
685// 279254 - The Warbringer
687{
688 explicit transport_seething_shore() : TransportScript("transport_seething_shore") { }
689
690 void OnRemovePassenger(Transport* /*transport*/, Player* player) override
691 {
692 if (!player->IsInWorld())
693 return;
694
695 if (Battleground const* bg = player->GetBattleground())
696 {
697 if (bg->GetStatus() != STATUS_IN_PROGRESS)
698 {
699 WorldSafeLocsEntry const* pos = bg->GetTeamStartPosition(Battleground::GetTeamIndexByTeamId(player->GetBGTeam()));
700 player->TeleportTo({ .Location = pos->Loc, .TransportGuid = pos->TransportSpawnId ? ObjectGuid::Create<HighGuid::Transport>(*pos->TransportSpawnId) : ObjectGuid::Empty });
701 return;
702 }
703
706 }
707 }
708};
709
710// 133533 - Air Supplies
721
727
728// 133542 - Air Supply Ground Dummy
730{
732
733 static constexpr uint32 PATH_ID_GROUND = 1;
734
735 static WaypointPath ConvertPosToPath(Position const& position)
736 {
737 return {
739 {
740 { 0, position.GetPositionX(), position.GetPositionY(), position.GetPositionZ() }
741 },
744 };
745 }
746
747 static inline const std::unordered_map<std::string_view, AirSupplyData> AIR_SUPPLY_DATA =
748 {
749 { SeethingShore::StringIds::AirSupplyGroundDummy1, { { 1398.8298f, 2727.5322f, 121.74067f, 1.789716362953186035f }, { 1398.7153f, 2728.0469f, 28.024399f } } },
750 { SeethingShore::StringIds::AirSupplyGroundDummy2, { { 1226.2812f, 2934.0356f, 152.03821f, 2.737864494323730468f }, { 1224.4445f, 2934.8203f, 72.7618f } } },
751 { SeethingShore::StringIds::AirSupplyGroundDummy3, { { 1226.276f, 2826.9246f, 145.53375f,5.083248138427734375f }, { 1226.9896f, 2825.0894f, 39.256886f } } },
752 { SeethingShore::StringIds::AirSupplyGroundDummy4, { { 1384.7483f, 2847.356f, 113.422775f, 2.29029250144958496f }, { 1384.2257f, 2847.9524f, 38.665867f } } },
753 { SeethingShore::StringIds::AirSupplyGroundDummy5, { { 1323.1545f, 2627.9531f, 99.90129f, 3.868808984756469726f }, { 1322.7587f, 2627.6008f, 0.9027778f } } },
754 { SeethingShore::StringIds::AirSupplyGroundDummy6, { { 1423.8021f, 2870.2188f, 115.70237f, 1.629547119140625f }, { 1423.7188f, 2871.6362f, 36.968292f } } }
755 };
756
757 void UpdateAI(uint32 diff) override
758 {
759 _scheduler.Update(diff);
760 }
761
763 {
764 std::string_view const stringId = me->GetStringId(StringIdType::Spawn);
765 if (!AIR_SUPPLY_DATA.contains(stringId))
766 return;
767
768 auto const& [spawn, destination] = AIR_SUPPLY_DATA.at(stringId);
770 supplies->GetMotionMaster()->MovePath(ConvertPosToPath(destination), false);
771 }
772
773 void DoAction(int32 actionId) override
774 {
775 if (actionId == SeethingShore::Actions::SpawnBuff)
776 {
777 _scheduler.Schedule(5s, [&](TaskContext const&)
778 {
780 });
781 }
782 }
783
784private:
786};
787
788// 133532 - Air Supplies
790{
792
793 void WaypointPathEnded(uint32 /*pointId*/, uint32 pathId) override
794 {
796 return;
797
799 if (!groundDummy)
800 return;
801
802 QuaternionData const rot = QuaternionData::fromEulerAnglesZYX(groundDummy->GetOrientation(), 0.f, 0.f);
803 uint8 const action = urand(0, 3);
804 switch (action)
805 {
806 case 0:
807 case 1:
808 case 2:
809 // pretty sure some serverside spell is used, and we could drop this whole switch
810 if (GameObject* buff = GameObject::CreateGameObject(SeethingShore::GameObjects::Buffs[action], groundDummy->GetMap(), groundDummy->GetPosition(), rot, 255, GO_STATE_READY))
811 {
812 buff->SetSpawnedByDefault(false);
813 buff->SetRespawnTime(300); // this is equal to the haste rune buff area trigger
814 groundDummy->GetMap()->AddToMap(buff);
815 }
816 break;
817 case 3:
819 break;
820 default:
821 break;
822 }
823
824 groundDummy->CastSpell(nullptr, SeethingShore::Spells::DustCloudImpactBigger, true);
826 }
827};
828
830{
831 explicit at_bg_seething_shore_haste_rune_buff(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
832
833 void OnCreate(Spell const* /*creatingSpell*/) override
834 {
836 }
837
838 void OnUnitEnter(Unit* unit) override
839 {
840 if (Player* player = unit->ToPlayer())
841 {
842 if (ZoneScript* zonescript = at->GetZoneScript())
843 {
844 player->CastSpell(player, SeethingShore::Spells::SpeedUp, true);
845 zonescript->DoAction(SeethingShore::Actions::ConsumeBuff, at);
846 at->Remove();
847 }
848 }
849 }
850};
851
852// 131773 - Nathanos Blightcaller
853// 130532 - Master Mathias Shaw
855{
856 explicit npc_bg_seething_shore_commander(Creature* creature) : ScriptedAI(creature) { }
857
858 void UpdateAI(uint32 diff) override
859 {
860 _scheduler.Update(diff);
861 }
862
863 void DoAction(int32 actionId) override
864 {
865 switch (actionId)
866 {
869 _scheduler.Schedule(30s, [this](TaskContext& context)
870 {
872 context.Schedule(15s, [this](TaskContext& context2)
873 {
875 context2.Schedule(12s, [this](TaskContext const&)
876 {
878 });
879 });
880 });
881 break;
883 if (urand(0, 1))
885 break;
888 break;
889 default:
890 break;
891 }
892 }
893
894private:
896};
897
898// 129344 - Vignette Dummy
900{
901 explicit npc_bg_seething_shore_vignette_dummy(Creature* creature) : ScriptedAI(creature) { }
902
903 void JustAppeared() override
904 {
905 _scheduler.Schedule(38s, [this](TaskContext const&)
906 {
909 });
910 }
911
912 void UpdateAI(uint32 diff) override
913 {
914 _scheduler.Update(diff);
915 }
916
917private:
919};
920
@ 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:42
#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
constexpr TeamId GetTeamIdForTeam(Team team)
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TEAM_ALLIANCE
@ TEAM_HORDE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_KNOCK_BACK
@ SPELL_EFFECT_APPLY_AURA
@ 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:277
GameObject *const me
GOState GetGoState() const
Definition GameObject.h:284
bool HasFlag(GameObjectFlags flags) const
Definition GameObject.h:276
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:517
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:1186
void DoOnPlayers(T &&fn)
Definition Map.h:406
int32 GetWorldStateValue(int32 worldStateId) const
Definition Map.cpp:427
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:3552
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:3542
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:1226
Battleground * GetBattleground() const
Definition Player.cpp:25719
Team GetBGTeam() const
Definition Player.cpp:24358
uint32 const Id
Definition SpellInfo.h:328
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:588
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:635
void SendPlaySpellVisual(Unit *target, uint32 spellVisualId, uint8 missReason, uint8 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
Definition Unit.cpp:12305
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
Map * GetMap() const
Definition Object.h:411
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
ZoneScript * GetZoneScript() const
Definition Object.h:417
float GetFloorZ() const
Definition Object.cpp:3106
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1517
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 fromEulerAnglesZYX(float Z, float Y, float X)
Optional< ObjectGuid::LowType > TransportSpawnId
Definition ObjectMgr.h:837
WorldLocation Loc
Definition ObjectMgr.h:836
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