From 951f908697fabcb8ac4f84deecd294af75a3f400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Wed, 5 Apr 2023 11:42:47 -0600 Subject: [PATCH] Require Sceptre of Celebras for Maraudon Shortcut --- sql/world/base/dungeon_attunements.sql | 3 ++ src/IndividualProgression_loader.cpp | 2 ++ src/vanillaScripts/misc_scripts.cpp | 39 ++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/vanillaScripts/misc_scripts.cpp diff --git a/sql/world/base/dungeon_attunements.sql b/sql/world/base/dungeon_attunements.sql index 11d47d2..dc7a76c 100644 --- a/sql/world/base/dungeon_attunements.sql +++ b/sql/world/base/dungeon_attunements.sql @@ -8,6 +8,9 @@ REPLACE INTO `dungeon_access_requirements` (`dungeon_access_id`, `requirement_ty REPLACE INTO `dungeon_access_requirements` (`dungeon_access_id`, `requirement_type`, `requirement_id`, `requirement_note`, `faction`, `priority`, `leader_only`, `comment`) VALUES (63, 1, 10277, 'You must complete the quest "The Caverns of Time" to enter Old Hillsbrad.', 2, NULL, 0, NULL); REPLACE INTO `dungeon_access_requirements` (`dungeon_access_id`, `requirement_type`, `requirement_id`, `requirement_note`, `faction`, `priority`, `leader_only`, `comment`) VALUES (64, 2, 32649, 'You must possess the Medallion of Karabor to enter the Black Temple.', 2, NULL, 0, NULL); +/* Maraudon Portal Requirement Script */ +UPDATE `gameobject_template` SET `ScriptName` = 'go_mara_portal' WHERE `entry` = 178404; + /* TBC Attunement Quests - Restore pre-3.0 version */ DELETE FROM `creature_questender` WHERE `id`=22421 AND `quest`=13431; DELETE FROM `creature_questender` WHERE `id`=22421 AND `quest`=10901; diff --git a/src/IndividualProgression_loader.cpp b/src/IndividualProgression_loader.cpp index 6cbd112..b92d96e 100644 --- a/src/IndividualProgression_loader.cpp +++ b/src/IndividualProgression_loader.cpp @@ -33,6 +33,7 @@ void AddSC_npc_omarion(); void AddSC_Ipp_Wotlk_Modded_Scripts(); void AddSC_aq_scripts(); void AddSC_cot_scripts(); +void AddSC_misc_scripts(); void AddSC_ipp_spell_scripts(); void AddSC_individualProgression_commandscript(); void AddSC_mod_individual_progression_awareness(); @@ -72,6 +73,7 @@ void Addmod_individual_progressionScripts() AddSC_Ipp_Wotlk_Modded_Scripts(); AddSC_aq_scripts(); AddSC_cot_scripts(); + AddSC_misc_scripts(); AddSC_ipp_spell_scripts(); AddSC_individualProgression_commandscript(); AddSC_mod_individual_progression_awareness(); diff --git a/src/vanillaScripts/misc_scripts.cpp b/src/vanillaScripts/misc_scripts.cpp new file mode 100644 index 0000000..b64e623 --- /dev/null +++ b/src/vanillaScripts/misc_scripts.cpp @@ -0,0 +1,39 @@ +#include "IndividualProgression.h" +#include "ScriptMgr.h" +#include "Player.h" +#include "GameObjectAI.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" + +class go_mara_portal : public GameObjectScript +{ +public: + go_mara_portal() : GameObjectScript("go_mara_portal") { } + + struct go_mara_portalAI : GameObjectAI + { + + explicit go_mara_portalAI(GameObject *object) : GameObjectAI(object) { }; + + bool CanBeSeen(Player const* player) override + { + if (player->IsGameMaster()) + { + return true; + } + return player->HasItemCount(17191, 1, false); // Require Sceptre of Celebras + } + + }; + + GameObjectAI *GetAI(GameObject *object) const override + { + return new go_mara_portalAI(object); + } +}; + +void AddSC_misc_scripts() +{ + new go_mara_portal(); +} +