aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2025-11-02 11:11:51 +0100
committerGitHub <noreply@github.com>2025-11-02 11:11:51 +0100
commit1998b124016307f67ab6d998fbc552e1fe20db48 (patch)
treeaed330fbd95301ccbecb222559792765bd36d658
parentb3fb5d6f509c4ed2509e1ae6f98459554b660d3c (diff)
Scripts/Arenas: Implement Tol'Viron Arena (#31437)
-rw-r--r--sql/updates/world/master/2025_11_02_00_world.sql49
-rw-r--r--src/server/scripts/Battlegrounds/TolViron/arena_tol_viron_arena.cpp74
-rw-r--r--src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp4
3 files changed, 127 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_11_02_00_world.sql b/sql/updates/world/master/2025_11_02_00_world.sql
new file mode 100644
index 00000000000..785cb9e9200
--- /dev/null
+++ b/sql/updates/world/master/2025_11_02_00_world.sql
@@ -0,0 +1,49 @@
+SET @OGUID := 3000045;
+SET @SPAWN_GROUP := 1280;
+
+DELETE FROM `battleground_scripts` WHERE `MapId` = 980 AND `BattlemasterListId` = 0;
+INSERT INTO `battleground_scripts` (`MapId`, `BattlemasterListId`, `ScriptName`) VALUES
+(980, 0, 'arena_tol_viron_arena');
+
+DELETE FROM `battleground_template` WHERE `ID` = 719;
+INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `Comment`) VALUES
+(719, 4137, 4136, 0, 1, 'Tol''Viron Arena');
+
+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, 'Tol''Viron Arena - Shadow sight', 0x20);
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+9;
+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, 174863, 980, 6296, 6296, '0', '0', 0, -10702.828125, 915.14263916015625, 26.43194770812988281, 0.802850961685180664, 0, 0, 0.390730857849121093, 0.920504987239837646, 7200, 255, 1, 63305), -- Stove (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+1, 213197, 980, 6296, 6296, '0', '0', 0, -10774.611328125, 431.23828125, 23.54276275634765625, 0, 0, 0, 0, 1, 7200, 255, 1, 63305), -- Arena Door (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+2, 213196, 980, 6296, 6296, '0', '0', 0, -10654.30078125, 428.3046875, 23.54276275634765625, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Arena Door (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+3, 174863, 980, 6296, 6296, '0', '0', 0, -10698.638671875, 1078.226806640625, 25.42545700073242187, 0.584681987762451171, -0.00155210494995117, 0.000661849975585937, 0.288195610046386718, 0.957570075988769531, 7200, 255, 1, 63305), -- Stove (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+4, 160409, 980, 6296, 6296, '0', '0', 0, -10703.166015625, 917.15948486328125, 26.689788818359375, 4.860742568969726562, 0, 0, -0.65275955200195312, 0.757565200328826904, 7200, 255, 1, 63305), -- Chair (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+5, 160410, 980, 6296, 6296, '0', '0', 0, -10701.15625, 916.4442138671875, 26.689788818359375, 3.848456144332885742, 0, 0, -0.93819046020507812, 0.346119433641433715, 7200, 255, 1, 63305), -- Chair (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+6, 160409, 980, 6296, 6296, '0', '0', 0, -10698.5322265625, 1080.269775390625, 25.67640495300292968, 4.642578601837158203, -0.00128030776977539, -0.0010986328125, -0.73135185241699218, 0.681998252868652343, 7200, 255, 1, 63305), -- Chair (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+7, 160410, 980, 6296, 6296, '0', '0', 0, -10696.724609375, 1079.136474609375, 25.67953109741210937, 3.630285263061523437, -0.00058650970458984, -0.00158119201660156, -0.97029399871826171, 0.241922914981842041, 7200, 255, 1, 63305), -- Chair (Area: Tol'viron Arena - Difficulty: 0) CreateObject1
+(@OGUID+8, 184663, 980, 6296, 6296, '0', '0', 0, -10715.2392578125, 484.53472900390625, 24.69634437561035156, 2.460912704467773437, 0, 0, 0.942641258239746093, 0.333807557821273803, 360, 255, 1, 63305), -- Shadow Sight (Area: Tol'viron Arena - Difficulty: 0) CreateObject2
+(@OGUID+9, 184664, 980, 6296, 6296, '0', '0', 0, -10715.873046875, 375.99652099609375, 24.44685173034667968, 3.316144466400146484, 0, 0, -0.99619388580322265, 0.087165042757987976, 360, 255, 1, 63305); -- Shadow Sight (Area: Tol'viron Arena - Difficulty: 0) CreateObject2
+
+DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+9;
+INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES
+(@OGUID+0, 0, 0, 0.995804905891418457, -0.0915016159415245, 0, 0), -- Stove
+(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0), -- Arena Door
+(@OGUID+2, 0, 0, 1, -0.00000004371138828, 0, 0), -- Arena Door
+(@OGUID+3, 0.000157425383804365, 0.001680092304013669, 0.999846339225769042, 0.01745205745100975, 0, 0), -- Stove
+(@OGUID+4, 0, 0, 0.995804905891418457, -0.0915016159415245, 0, 0), -- Chair
+(@OGUID+5, 0, 0, 0.995804905891418457, -0.0915016159415245, 0, 0), -- Chair
+(@OGUID+6, 0.000157425383804365, 0.001680092304013669, 0.999846339225769042, 0.01745205745100975, 0, 0), -- Chair
+(@OGUID+7, 0.000157425383804365, 0.001680092304013669, 0.999846339225769042, 0.01745205745100975, 0, 0); -- Chair
+
+UPDATE `gameobject_template_addon` SET `faction`=114, `flags`=0x20 WHERE `entry` IN (213196, 213197); -- Arena 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+8),
+(@SPAWN_GROUP, 1, @OGUID+9);
+
+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/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();