From f3c8d23aaa0c9c5fa4f6ed894c6e50b074d891c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Tue, 8 Aug 2023 09:40:49 -0600 Subject: [PATCH] Karazhan progression fixes --- sql/world/base/dungeon_karazhan.sql | 8 +++++ src/IndividualProgression_loader.cpp | 2 ++ src/tbcScripts/instance_karazhan.cpp | 52 ++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 src/tbcScripts/instance_karazhan.cpp diff --git a/sql/world/base/dungeon_karazhan.sql b/sql/world/base/dungeon_karazhan.sql index 6f7e3b4..02d8f02 100644 --- a/sql/world/base/dungeon_karazhan.sql +++ b/sql/world/base/dungeon_karazhan.sql @@ -1,2 +1,10 @@ # Restore Enchanting formula drops to their pre-3.1 rates UPDATE `creature_loot_template` SET `Chance` = 5 WHERE `Item` IN (22559, 22561, 22545, 22560); + +# make blackened urn unsellable and give as reward +UPDATE `item_template` SET `Quality` = 1, `SellPrice` = 0, `description` = 'Used to summon Nightbane in Karazhan' WHERE (`entry` = 24140); +UPDATE `quest_template` SET `StartItem` = 24140 WHERE `ID` = 9644; +UPDATE `quest_template_addon` SET `ProvidedItemCount` = 1 WHERE (`ID` = 9644); + +# Philanthropist should drop gold +UPDATE `creature_template` SET `mingold` = 110000, `maxgold` = 130000 WHERE (`entry` = 16470); diff --git a/src/IndividualProgression_loader.cpp b/src/IndividualProgression_loader.cpp index b92d96e..ea9e85c 100644 --- a/src/IndividualProgression_loader.cpp +++ b/src/IndividualProgression_loader.cpp @@ -39,6 +39,7 @@ void AddSC_individualProgression_commandscript(); void AddSC_mod_individual_progression_awareness(); void AddSC_mod_individual_progression_player(); void AddSC_npc_archmage_timear(); +void AddSC_karazhan_70(); void Addmod_individual_progressionScripts() @@ -79,4 +80,5 @@ void Addmod_individual_progressionScripts() AddSC_mod_individual_progression_awareness(); AddSC_mod_individual_progression_player(); AddSC_npc_archmage_timear(); + AddSC_karazhan_70(); } diff --git a/src/tbcScripts/instance_karazhan.cpp b/src/tbcScripts/instance_karazhan.cpp new file mode 100644 index 0000000..c59bfcc --- /dev/null +++ b/src/tbcScripts/instance_karazhan.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 + */ + +#include "Player.h" +#include "ScriptMgr.h" + +enum BlackUrn +{ + DATA_NIGHTBANE = 11, + NPC_NIGHTBANE = 17225, + ITEM_BLACKENED_URN = 24140 +}; + +class go_blackened_urn_70 : public GameObjectScript +{ +public: + go_blackened_urn_70() : GameObjectScript("go_blackened_urn") { } + + //if we summon an entity instead of using a sort of invisible entity, we could unsummon boss on reset + //right now that doesn't work because of how the urn works + bool OnGossipHello(Player* player, GameObject* go) override + { + float IntroWay[8][3] = + { + {-11053.37f, -1794.48f, 149.00f}, + {-11141.07f, -1841.40f, 125.00f}, + {-11187.28f, -1890.23f, 125.00f}, + {-11189.20f, -1931.25f, 125.00f}, + {-11153.76f, -1948.93f, 125.00f}, + {-11128.73f, -1929.75f, 125.00f}, + {-11140.00f, -1915.00f, 122.00f}, + {-11163.00f, -1903.00f, 91.473f} + }; //TODO: move to table + + if (player->HasItemCount(ITEM_BLACKENED_URN, 1)) + { + if (InstanceScript* pInstance = go->GetInstanceScript()) + { + if (pInstance->GetData(DATA_NIGHTBANE) != DONE && !go->FindNearestCreature(NPC_NIGHTBANE, 40.0f)) + if (Creature* cr = ObjectAccessor::GetCreature(*player, pInstance->GetGuidData(DATA_NIGHTBANE))) + cr->GetMotionMaster()->MovePoint(0, IntroWay[0][0], IntroWay[0][1], IntroWay[0][2]); + } + } + return false; + } +}; + +void AddSC_karazhan_70() +{ + new go_blackened_urn_70(); +} \ No newline at end of file