aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2025-10-02 21:35:19 +0200
committerGitHub <noreply@github.com>2025-10-02 21:35:19 +0200
commit3fb6401b043788d1182c93b48d00d365ba05ab4c (patch)
tree2b497a1a1efcc5d7f6f4f29e5df17109cc9c6c08 /src
parent830fc29500b4dfe46e490e3c49fe0df13bb87df3 (diff)
Scripts/Arenas: Implement Maldraxxus Coliseum (#31315)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp125
-rw-r--r--src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp8
2 files changed, 131 insertions, 2 deletions
diff --git a/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp b/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp
new file mode 100644
index 00000000000..643f582e3fa
--- /dev/null
+++ b/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp
@@ -0,0 +1,125 @@
+/*
+ * 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 "Creature.h"
+#include "GameObject.h"
+#include "Map.h"
+#include "MotionMaster.h"
+#include "ScriptMgr.h"
+
+namespace MaldraxxusColiseum
+{
+ namespace MapIds
+ {
+ static constexpr uint32 MaldraxxusColiseum = 2509;
+ }
+
+ namespace Creatures
+ {
+ static constexpr uint32 MaldraxxianGladiator = 185764;
+ }
+
+ namespace GameObjects
+ {
+ static constexpr uint32 Door = 375890;
+ }
+
+ namespace Destinations
+ {
+ static constexpr Position Guard1 = { 2875.89f, 2285.57f, 3260.1755f };
+ static constexpr Position Guard2 = { 2816.69f, 2300.51f, 3260.1885f };
+ static constexpr Position Guard3 = { 2873.62f, 2219.39f, 3260.7085f };
+ static constexpr Position Guard4 = { 2823.31f, 2204.30f, 3260.0960f };
+ }
+
+ namespace StringIds
+ {
+ static constexpr std::string_view Guard1 = "arena_maldraxxus_coliseum_1";
+ static constexpr std::string_view Guard2 = "arena_maldraxxus_coliseum_2";
+ static constexpr std::string_view Guard3 = "arena_maldraxxus_coliseum_3";
+ static constexpr std::string_view Guard4 = "arena_maldraxxus_coliseum_4";
+ }
+}
+
+struct arena_maldraxxus_coliseum : ArenaScript
+{
+ explicit arena_maldraxxus_coliseum(BattlegroundMap* map) : ArenaScript(map) { }
+
+ void OnStart() override
+ {
+ for (ObjectGuid const& guid : _doorGUIDs)
+ {
+ if (GameObject* door = battlegroundMap->GetGameObject(guid))
+ {
+ door->UseDoorOrButton();
+ door->DespawnOrUnsummon(5s);
+ }
+ }
+
+ for (ObjectGuid const& guid : _gladiatorGUIDs)
+ {
+ if (Creature* creature = battlegroundMap->GetCreature(guid))
+ {
+ if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard1))
+ creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard1);
+ else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard2))
+ creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard2);
+ else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard3))
+ creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard3);
+ else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard4))
+ creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard4);
+
+ creature->DespawnOrUnsummon(2s);
+ }
+ }
+ }
+
+ void OnCreatureCreate(Creature* creature) override
+ {
+ switch (creature->GetEntry())
+ {
+ case MaldraxxusColiseum::Creatures::MaldraxxianGladiator:
+ _gladiatorGUIDs.emplace_back(creature->GetGUID());
+ break;
+ default:
+ break;
+ }
+ }
+
+ void OnGameObjectCreate(GameObject* gameobject) override
+ {
+ switch (gameobject->GetEntry())
+ {
+ case MaldraxxusColiseum::GameObjects::Door:
+ _doorGUIDs.emplace_back(gameobject->GetGUID());
+ break;
+ default:
+ break;
+ }
+ }
+
+private:
+ GuidVector _doorGUIDs;
+ GuidVector _gladiatorGUIDs;
+};
+
+void AddSC_arena_maldraxxus_coliseum()
+{
+ RegisterBattlegroundMapScript(arena_maldraxxus_coliseum, MaldraxxusColiseum::MapIds::MaldraxxusColiseum);
+}
diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp
index a0612f2016d..5bf00c0a80a 100644
--- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp
+++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp
@@ -64,9 +64,11 @@ void AddSC_battleground_temple_of_kotmogu();
void AddSC_battleground_deephaul_ravine();
void AddSC_arena_blades_edge_legion();
-void AddSC_arena_the_robodrome();
void AddSC_arena_mugambala();
+void AddSC_arena_the_robodrome();
+
+void AddSC_arena_maldraxxus_coliseum();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
@@ -117,7 +119,9 @@ void AddBattlegroundsScripts()
AddSC_battleground_deephaul_ravine();
AddSC_arena_blades_edge_legion();
- AddSC_arena_the_robodrome();
AddSC_arena_mugambala();
+ AddSC_arena_the_robodrome();
+
+ AddSC_arena_maldraxxus_coliseum();
}