aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Draenor/draenor_script_loader.cpp2
-rw-r--r--src/server/scripts/Draenor/zone_assault_on_the_dark_portal.cpp68
2 files changed, 70 insertions, 0 deletions
diff --git a/src/server/scripts/Draenor/draenor_script_loader.cpp b/src/server/scripts/Draenor/draenor_script_loader.cpp
index f5f4f416a2b..2d8e1f17915 100644
--- a/src/server/scripts/Draenor/draenor_script_loader.cpp
+++ b/src/server/scripts/Draenor/draenor_script_loader.cpp
@@ -16,11 +16,13 @@
*/
// This is where scripts' loading functions should be declared:
+void AddSC_assault_on_the_dark_portal();
void AddSC_draenor_shadowmoon_valley();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddDraenorScripts()
{
+ AddSC_assault_on_the_dark_portal();
AddSC_draenor_shadowmoon_valley();
}
diff --git a/src/server/scripts/Draenor/zone_assault_on_the_dark_portal.cpp b/src/server/scripts/Draenor/zone_assault_on_the_dark_portal.cpp
new file mode 100644
index 00000000000..fdbb9628d51
--- /dev/null
+++ b/src/server/scripts/Draenor/zone_assault_on_the_dark_portal.cpp
@@ -0,0 +1,68 @@
+/*
+ * 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 "PhasingHandler.h"
+#include "Player.h"
+#include "QuestDef.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+
+enum AssaultOnTheDarkPortalSpells
+{
+ SPELL_DARK_PORTAL_RUN_AWAY = 158985
+};
+
+// 621 - Dark Portal: Run away
+class scene_dark_portal_run_away : public SceneScript
+{
+public:
+ scene_dark_portal_run_away() : SceneScript("scene_dark_portal_run_away") { }
+
+ void OnSceneComplete(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/) override
+ {
+ player->RemoveAurasDueToSpell(SPELL_DARK_PORTAL_RUN_AWAY);
+ PhasingHandler::OnConditionChange(player);
+ }
+};
+
+// 34420 - The Cost of War
+class quest_the_cost_of_war : public QuestScript
+{
+public:
+ quest_the_cost_of_war() : QuestScript("quest_the_cost_of_war") { }
+
+ void OnQuestStatusChange(Player* player, Quest const* /*quest*/, QuestStatus /*oldStatus*/, QuestStatus newStatus) override
+ {
+ if (newStatus == QUEST_STATUS_NONE)
+ {
+ player->RemoveAurasDueToSpell(SPELL_DARK_PORTAL_RUN_AWAY);
+ PhasingHandler::OnConditionChange(player);
+ }
+ else if (newStatus == QUEST_STATUS_INCOMPLETE)
+ {
+ player->CastSpell(player, SPELL_DARK_PORTAL_RUN_AWAY, TRIGGERED_FULL_MASK);
+ PhasingHandler::OnConditionChange(player);
+ }
+ }
+};
+
+void AddSC_assault_on_the_dark_portal()
+{
+ new scene_dark_portal_run_away();
+ new quest_the_cost_of_war();
+};