aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorJason Dove <1695733+jasongdove@users.noreply.github.com>2025-07-08 22:26:37 +0000
committerGitHub <noreply@github.com>2025-07-09 00:26:37 +0200
commitc7f5696479bb85c8fc7ee0d9fdaeb92e2b32213f (patch)
tree5eb2e7ad82f88dd089a58aad31f54c996d9edba3 /src/server/scripts/EasternKingdoms
parent04d44bd3a081fdf1b13ff20cd97a399f0fdfc477 (diff)
Core/Scenarios: Allow scripts to set instance scenario by id (#31104)
* add example at Stratholme service entrance
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
index 0d092af1082..920d2f1d0b2 100644
--- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
+++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp
@@ -33,7 +33,9 @@ EndContentData */
#include "GameObject.h"
#include "GameObjectAI.h"
#include "Group.h"
+#include "ScenarioMgr.h"
#include "InstanceScript.h"
+#include "Map.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
@@ -388,6 +390,25 @@ class spell_stratholme_haunting_phantoms : public AuraScript
}
};
+static constexpr uint32 StratholmeLfgDungeonServiceEntrance = 274;
+static constexpr uint32 StratholmeScenarioServiceEntrance = 637;
+
+// 10107 - Areatrigger
+class at_stratholme_service_entrance : public OnlyOnceAreaTriggerScript
+{
+public:
+ at_stratholme_service_entrance() : OnlyOnceAreaTriggerScript("at_stratholme_service_entrance") { }
+
+ bool TryHandleOnce(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
+ {
+ if (InstanceMap* map = player->GetMap()->ToInstanceMap())
+ if (map->GetLfgDungeonsId() == StratholmeLfgDungeonServiceEntrance)
+ map->SetInstanceScenario(sScenarioMgr->CreateInstanceScenario(map, StratholmeScenarioServiceEntrance));
+
+ return true;
+ }
+};
+
void AddSC_stratholme()
{
new go_gauntlet_gate();
@@ -395,4 +416,5 @@ void AddSC_stratholme()
new npc_spectral_ghostly_citizen();
RegisterSpellScript(spell_ysida_saved_credit);
RegisterSpellScript(spell_stratholme_haunting_phantoms);
+ new at_stratholme_service_entrance();
}