diff options
| author | Jeremy <Golrag@users.noreply.github.com> | 2025-10-31 09:37:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-31 09:37:57 +0100 |
| commit | 29254bc9bb6268ebe83818bc6ce352588ed84edd (patch) | |
| tree | f5f31290ed48735bfd969022df83f091d3220c62 /src | |
| parent | dda7d3ead9e033563ec58ef86877bbed24eddab3 (diff) | |
Scripts/Arenas: Implement Nagrand Arena (Legion) (#31406)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Battlegrounds/NagrandArena/arena_nagrand_arena_legion.cpp | 74 | ||||
| -rw-r--r-- | src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp | 2 |
2 files changed, 76 insertions, 0 deletions
diff --git a/src/server/scripts/Battlegrounds/NagrandArena/arena_nagrand_arena_legion.cpp b/src/server/scripts/Battlegrounds/NagrandArena/arena_nagrand_arena_legion.cpp new file mode 100644 index 00000000000..c089455af93 --- /dev/null +++ b/src/server/scripts/Battlegrounds/NagrandArena/arena_nagrand_arena_legion.cpp @@ -0,0 +1,74 @@ +/* + * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Battleground.h" +#include "BattlegroundScript.h" +#include "GameObject.h" +#include "Map.h" +#include "ScriptMgr.h" + +namespace NagrandArenaLegion +{ + namespace MapIds + { + static constexpr uint32 NagrandArena = 1505; + } + + namespace GameObjects + { + static constexpr uint32 Gate1 = 260527; + static constexpr uint32 Gate2 = 260528; + } +} + +struct arena_nagrand_arena_legion : ArenaScript +{ + explicit arena_nagrand_arena_legion(BattlegroundMap* map) : ArenaScript(map) { } + + void OnStart() override + { + for (ObjectGuid const& guid : _doorGUIDs) + { + if (GameObject* door = battlegroundMap->GetGameObject(guid)) + { + door->UseDoorOrButton(); + door->DespawnOrUnsummon(5s); + } + } + } + + void OnGameObjectCreate(GameObject* gameobject) override + { + switch (gameobject->GetEntry()) + { + case NagrandArenaLegion::GameObjects::Gate1: + case NagrandArenaLegion::GameObjects::Gate2: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; +}; + +void AddSC_arena_nagrand_arena_legion() +{ + RegisterBattlegroundMapScript(arena_nagrand_arena_legion, NagrandArenaLegion::MapIds::NagrandArena); +} diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp index 56a61a43c71..a0442285800 100644 --- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp +++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp @@ -64,6 +64,7 @@ void AddSC_battleground_temple_of_kotmogu(); void AddSC_battleground_deephaul_ravine(); void AddSC_arena_blades_edge_legion(); +void AddSC_arena_nagrand_arena_legion(); void AddSC_arena_mugambala(); void AddSC_arena_hook_point(); @@ -125,6 +126,7 @@ void AddBattlegroundsScripts() AddSC_battleground_deephaul_ravine(); AddSC_arena_blades_edge_legion(); + AddSC_arena_nagrand_arena_legion(); AddSC_arena_mugambala(); AddSC_arena_hook_point(); |
