diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Battlegrounds/BlackRookHold/arena_black_rook_hold_arena.cpp | 77 | ||||
| -rw-r--r-- | src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp | 4 |
2 files changed, 81 insertions, 0 deletions
diff --git a/src/server/scripts/Battlegrounds/BlackRookHold/arena_black_rook_hold_arena.cpp b/src/server/scripts/Battlegrounds/BlackRookHold/arena_black_rook_hold_arena.cpp new file mode 100644 index 00000000000..9686efc214c --- /dev/null +++ b/src/server/scripts/Battlegrounds/BlackRookHold/arena_black_rook_hold_arena.cpp @@ -0,0 +1,77 @@ +/* + * 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 BlackRookHoldArena +{ + namespace MapIds + { + static constexpr uint32 BlackRookHoldArena = 1504; + } + + namespace GameObjects + { + static constexpr uint32 BlackRookDoor02 = 245763; + static constexpr uint32 BlackRookDoor05 = 245766; + static constexpr uint32 BlackRookDoor06 = 245767; + static constexpr uint32 BlackRookDoor09 = 245770; + static constexpr uint32 BlackRookDoor07 = 245768; + static constexpr uint32 BlackRookDoor10 = 245781; + } +} + +struct arena_black_rook_hold_arena : ArenaScript +{ + explicit arena_black_rook_hold_arena(BattlegroundMap* map) : ArenaScript(map) { } + + void OnStart() override + { + for (ObjectGuid const& guid : _doorGUIDs) + if (GameObject* door = battlegroundMap->GetGameObject(guid)) + door->UseDoorOrButton(); + } + + void OnGameObjectCreate(GameObject* gameobject) override + { + switch (gameobject->GetEntry()) + { + case BlackRookHoldArena::GameObjects::BlackRookDoor02: + case BlackRookHoldArena::GameObjects::BlackRookDoor05: + case BlackRookHoldArena::GameObjects::BlackRookDoor06: + case BlackRookHoldArena::GameObjects::BlackRookDoor09: + case BlackRookHoldArena::GameObjects::BlackRookDoor07: + case BlackRookHoldArena::GameObjects::BlackRookDoor10: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; +}; + +void AddSC_arena_black_rook_hold_arena() +{ + RegisterBattlegroundMapScript(arena_black_rook_hold_arena, BlackRookHoldArena::MapIds::BlackRookHoldArena); +} diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp index 33b5ae0b874..48634e27a77 100644 --- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp +++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp @@ -82,6 +82,8 @@ void AddSC_arena_nokhudon_proving_grounds(); void AddSC_arena_cage_of_carnage(); +void AddSC_arena_black_rook_hold_arena(); + // The name of this function should match: // void Add${NameOfDirectory}Scripts() void AddBattlegroundsScripts() @@ -148,4 +150,6 @@ void AddBattlegroundsScripts() AddSC_arena_nokhudon_proving_grounds(); AddSC_arena_cage_of_carnage(); + + AddSC_arena_black_rook_hold_arena(); } |
