From d4887311e39527e036419ebd966f399fdbdae67a Mon Sep 17 00:00:00 2001 From: Traesh Date: Sun, 25 Sep 2016 16:13:12 +0200 Subject: Core/Scenes: Implemented scene system Closes #17858 Closes #17976 --- src/server/scripts/World/scene_scripts.cpp | 42 ++++++++++++++++++++++++ src/server/scripts/World/world_script_loader.cpp | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 src/server/scripts/World/scene_scripts.cpp (limited to 'src/server/scripts/World') diff --git a/src/server/scripts/World/scene_scripts.cpp b/src/server/scripts/World/scene_scripts.cpp new file mode 100644 index 00000000000..860c97e60ea --- /dev/null +++ b/src/server/scripts/World/scene_scripts.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008-2016 TrinityCore + * + * 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 . + */ + +#include "ScriptMgr.h" +#include "Player.h" + +enum SceneSpells +{ + SPELL_DEATHWING_SIMULATOR = 201184 +}; + +class scene_deathwing_simulator : public SceneScript +{ + public: + scene_deathwing_simulator() : SceneScript("scene_deathwing_simulator") { } + + // Called when a player receive trigger from scene + void OnSceneTriggerEvent(Player* player, uint32 /*sceneInstanceID*/, SceneTemplate const* /*sceneTemplate*/, std::string const& triggerName) override + { + if (triggerName == "BURN PLAYER") + player->CastSpell(player, SPELL_DEATHWING_SIMULATOR, true); // Deathwing Simulator Burn player + } +}; + +void AddSC_scene_scripts() +{ + new scene_deathwing_simulator(); +} diff --git a/src/server/scripts/World/world_script_loader.cpp b/src/server/scripts/World/world_script_loader.cpp index bc007ab8100..2d5b5efebf2 100644 --- a/src/server/scripts/World/world_script_loader.cpp +++ b/src/server/scripts/World/world_script_loader.cpp @@ -30,6 +30,7 @@ void AddSC_npc_innkeeper(); void AddSC_npcs_special(); void AddSC_achievement_scripts(); void AddSC_action_ip_logger(); +void AddSC_scene_scripts(); // player void AddSC_chat_log(); void AddSC_duel_reset(); @@ -49,6 +50,7 @@ void AddWorldScripts() AddSC_npcs_special(); AddSC_achievement_scripts(); AddSC_chat_log(); // location: scripts\World\chat_log.cpp + AddSC_scene_scripts(); // FIXME: This should be moved in a script validation hook. // To avoid duplicate code, we check once /*ONLY*/ if logging is permitted or not. -- cgit v1.2.3