diff options
| author | Jeremy <Golrag@users.noreply.github.com> | 2025-11-02 11:17:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-02 11:17:07 +0100 |
| commit | 76b5bac5eb5b09c94450e316bfabc7b0adc30161 (patch) | |
| tree | 9e8f4bcb3140fce3d981cccf53d6186dcbb7c0c9 | |
| parent | 1998b124016307f67ab6d998fbc552e1fe20db48 (diff) | |
Scripts/Arenas: Implement Tiger's Peak (#31436)
3 files changed, 115 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_11_02_01_world.sql b/sql/updates/world/master/2025_11_02_01_world.sql new file mode 100644 index 00000000000..dfd6dba1c08 --- /dev/null +++ b/sql/updates/world/master/2025_11_02_01_world.sql @@ -0,0 +1,37 @@ +SET @OGUID := 4000246; +SET @SPAWN_GROUP := 1281; + +DELETE FROM `battleground_scripts` WHERE `MapId` = 1134 AND `BattlemasterListId` = 0; +INSERT INTO `battleground_scripts` (`MapId`, `BattlemasterListId`, `ScriptName`) VALUES +(1134, 0, 'arena_tigers_peak'); + +DELETE FROM `battleground_template` WHERE `ID` = 757; +INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `Comment`) VALUES +(757, 4535, 4534, 0, 1, 'The Tigers Peak'); + +DELETE FROM `spawn_group_template` WHERE `groupId` BETWEEN @SPAWN_GROUP+0 AND @SPAWN_GROUP+0; +INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES +(@SPAWN_GROUP+0, 'Tigers Peak - Shadow sight', 0x20); + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+3; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 219395, 1134, 6732, 6732, '0', '0', 0, 502.437042236328125, 633.0946044921875, 380.65478515625, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Door (Area: The Tiger's Peak - Difficulty: 0) CreateObject1 +(@OGUID+1, 219396, 1134, 6732, 6732, '0', '0', 0, 632.4952392578125, 633.09466552734375, 380.65478515625, 0, 0, 0, 0, 1, 7200, 255, 1, 63305), -- Door (Area: The Tiger's Peak - Difficulty: 0) CreateObject1 +(@OGUID+2, 184663, 1134, 6732, 6732, '0', '0', 0, 566.65625, 664.56597900390625, 383.680908203125, 2.460912704467773437, 0, 0, 0.942641258239746093, 0.333807557821273803, 360, 255, 1, 63305), -- Shadow Sight (Area: The Tiger's Peak - Difficulty: 0) CreateObject2 +(@OGUID+3, 184664, 1134, 6732, 6732, '0', '0', 0, 566.6805419921875, 602.2274169921875, 383.6812744140625, 3.316144466400146484, 0, 0, -0.99619388580322265, 0.087165042757987976, 360, 255, 1, 63305); -- Shadow Sight (Area: The Tiger's Peak - Difficulty: 0) CreateObject2 + +DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+3; +INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES +(@OGUID+0, 0, 0, 1, -0.00000004371138828, 0, 0), -- Door +(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0); -- Door + +UPDATE `gameobject_template_addon` SET `faction`=114, `flags`=0x20 WHERE `entry` IN (219396, 219395); -- Door + +DELETE FROM `spawn_group` WHERE `groupId` BETWEEN @SPAWN_GROUP+0 AND @SPAWN_GROUP+0; +INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES +(@SPAWN_GROUP, 1, @OGUID+2), +(@SPAWN_GROUP, 1, @OGUID+3); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 33 AND `SourceEntry` BETWEEN @SPAWN_GROUP+0 AND @SPAWN_GROUP+0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `SourceGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ScriptName`) VALUES +(33, @SPAWN_GROUP, 0, 0, 0, 'condition_is_shadow_sight_enabled'); diff --git a/src/server/scripts/Battlegrounds/TigersPeak/arena_the_tigers_peak.cpp b/src/server/scripts/Battlegrounds/TigersPeak/arena_the_tigers_peak.cpp new file mode 100644 index 00000000000..6406c4bc252 --- /dev/null +++ b/src/server/scripts/Battlegrounds/TigersPeak/arena_the_tigers_peak.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 TigersPeak +{ + namespace MapIds + { + static constexpr uint32 TigersPeak = 1134; + } + + namespace GameObjects + { + static constexpr uint32 Door01 = 219395; + static constexpr uint32 Door02 = 219396; + } +} + +struct arena_tigers_peak : ArenaScript +{ + explicit arena_tigers_peak(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 TigersPeak::GameObjects::Door01: + case TigersPeak::GameObjects::Door02: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; +}; + +void AddSC_arena_the_tigers_peak() +{ + RegisterBattlegroundMapScript(arena_tigers_peak, TigersPeak::MapIds::TigersPeak); +} diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp index 64bb72bbf61..33b5ae0b874 100644 --- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp +++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp @@ -65,6 +65,8 @@ void AddSC_battleground_deephaul_ravine(); void AddSC_arena_tol_viron_arena(); +void AddSC_arena_the_tigers_peak(); + void AddSC_arena_blades_edge_legion(); void AddSC_arena_nagrand_arena_legion(); void AddSC_arena_ashamanes_fall(); @@ -130,6 +132,8 @@ void AddBattlegroundsScripts() AddSC_arena_tol_viron_arena(); + AddSC_arena_the_tigers_peak(); + AddSC_arena_blades_edge_legion(); AddSC_arena_nagrand_arena_legion(); AddSC_arena_ashamanes_fall(); |
