diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Battlegrounds/TolViron/arena_tol_viron_arena.cpp | 74 | ||||
| -rw-r--r-- | src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp | 4 |
2 files changed, 78 insertions, 0 deletions
diff --git a/src/server/scripts/Battlegrounds/TolViron/arena_tol_viron_arena.cpp b/src/server/scripts/Battlegrounds/TolViron/arena_tol_viron_arena.cpp new file mode 100644 index 00000000000..e98e12dd9d1 --- /dev/null +++ b/src/server/scripts/Battlegrounds/TolViron/arena_tol_viron_arena.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 TolVironArena +{ + namespace MapIds + { + static constexpr uint32 TolVironArena = 980; + } + + namespace GameObjects + { + static constexpr uint32 Door01 = 213196; + static constexpr uint32 Door02 = 213197; + } +} + +struct arena_tol_viron_arena : ArenaScript +{ + explicit arena_tol_viron_arena(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 TolVironArena::GameObjects::Door01: + case TolVironArena::GameObjects::Door02: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; +}; + +void AddSC_arena_tol_viron_arena() +{ + RegisterBattlegroundMapScript(arena_tol_viron_arena, TolVironArena::MapIds::TolVironArena); +} diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp index abc27d22331..64bb72bbf61 100644 --- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp +++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp @@ -63,6 +63,8 @@ void AddSC_battleground_temple_of_kotmogu(); void AddSC_battleground_deephaul_ravine(); +void AddSC_arena_tol_viron_arena(); + void AddSC_arena_blades_edge_legion(); void AddSC_arena_nagrand_arena_legion(); void AddSC_arena_ashamanes_fall(); @@ -126,6 +128,8 @@ void AddBattlegroundsScripts() AddSC_battleground_temple_of_kotmogu(); AddSC_battleground_deephaul_ravine(); + AddSC_arena_tol_viron_arena(); + AddSC_arena_blades_edge_legion(); AddSC_arena_nagrand_arena_legion(); AddSC_arena_ashamanes_fall(); |
