From 17e820ab2e5d552bb440bf08e3072f65554fd63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Wed, 9 Nov 2022 09:48:23 -0700 Subject: [PATCH] Allow Dungeon Set 2 before AQ progression phase --- conf/individualProgression.conf.dist | 12 +++++++ sql/world/base/ipp_aware_npcs.sql | 4 ++- src/IndividualProgression.cpp | 1 + src/IndividualProgression.h | 2 +- src/IndividualProgressionAwarenessScripts.cpp | 31 +++++++++++++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/conf/individualProgression.conf.dist b/conf/individualProgression.conf.dist index 30d3c22..b58f1ac 100644 --- a/conf/individualProgression.conf.dist +++ b/conf/individualProgression.conf.dist @@ -292,3 +292,15 @@ IndividualProgression.DisableDefaultProgression = 0 # IndividualProgression.CustomProgression = "" +# +# IndividualProgression.AllowEarlyDungeonSet2 +# Description: Dungeon Set 2 was introduced in patch 1.10 and requires completing some AQ content that is normally not available until a later phase +# When enabled, this allows the relevant content to be accessed early so that Dungeon Set 2 can be acquired before it is made obsolete +# by raid gear. +# +# Default: 0 - Disabled +# 1 - Enabled +# +# + +IndividualProgression.AllowEarlyDungeonSet2 = 1 \ No newline at end of file diff --git a/sql/world/base/ipp_aware_npcs.sql b/sql/world/base/ipp_aware_npcs.sql index 62a2958..571ff46 100644 --- a/sql/world/base/ipp_aware_npcs.sql +++ b/sql/world/base/ipp_aware_npcs.sql @@ -4,7 +4,9 @@ UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_tbc' WHERE `entry` IN (16 20026, 20027, 20053, 20054, 20069, 18542, 20080, 20081, 20082, 21643, 20130, 19934, 19936, 19950, 19951, 19959, 22889, 22902, 22835, 22837); -UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_aq' WHERE `entry` IN (15293,15270,15306,15191,15181,15182,15306,15599,15282,15183,15194,15176,15270,16091,15701,15612,15613,15540,15704,15693,15431,15903,15180, 15499); +UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_ds2' WHERE `entry` IN (15282, 15270); + +UPDATE `creature_template` SET `ScriptName` = 'npc_ipp_aq' WHERE `entry` IN (15293,15306,15191,15181,15182,15306,15599,15183,15194,15176,15270,16091,15701,15612,15613,15540,15704,15693,15431,15903,15180, 15499, 15500, 15498); # Two Cenarion Scouts - 15609 and 15610 - should be in this progression but they have some quest AI that we don't want to override, so leave them for now # Light's Hope Chapel diff --git a/src/IndividualProgression.cpp b/src/IndividualProgression.cpp index 5e47651..2214de7 100644 --- a/src/IndividualProgression.cpp +++ b/src/IndividualProgression.cpp @@ -264,6 +264,7 @@ private: sIndividualProgression->deathKnightProgressionLevel = sConfigMgr->GetOption("IndividualProgression.DeathKnightUnlockProgression", 11); sIndividualProgression->deathKnightStartingProgression = sConfigMgr->GetOption("IndividualProgression.DeathKnightStartingProgression", 11); sIndividualProgression->LoadCustomProgressionEntries(sConfigMgr->GetOption("IndividualProgression.CustomProgression", "")); + sIndividualProgression->earlyDungeonSet2 = sConfigMgr->GetOption("IndividualProgression.AllowEarlyDungeonSet2", true); } static void LoadXpValues() diff --git a/src/IndividualProgression.h b/src/IndividualProgression.h index 87cc2f6..421cdca 100644 --- a/src/IndividualProgression.h +++ b/src/IndividualProgression.h @@ -135,7 +135,7 @@ public: std::map customProgressionMap; questXpMapType questXpMap; float vanillaPowerAdjustment, vanillaHealthAdjustment, tbcPowerAdjustment, tbcHealthAdjustment, vanillaHealingAdjustment, tbcHealingAdjustment, previousGearTuning; - bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp, disableDefaultProgression; + bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp, disableDefaultProgression, earlyDungeonSet2; int progressionLimit, startingProgression, tbcRacesProgressionLevel, deathKnightProgressionLevel, deathKnightStartingProgression; bool hasPassedProgression(Player* player, ProgressionState state) const; diff --git a/src/IndividualProgressionAwarenessScripts.cpp b/src/IndividualProgressionAwarenessScripts.cpp index 8cccb06..caac810 100644 --- a/src/IndividualProgressionAwarenessScripts.cpp +++ b/src/IndividualProgressionAwarenessScripts.cpp @@ -260,6 +260,36 @@ public: } }; +class npc_ipp_ds2 : public CreatureScript +{ +public: + npc_ipp_ds2() : CreatureScript("npc_ipp_ds2") { } + + struct npc_ipp_ds2AI: ScriptedAI + { + explicit npc_ipp_ds2AI(Creature* creature) : ScriptedAI(creature) { }; + + bool CanBeSeen(Player const* player) override + { + if (player->IsGameMaster() || !sIndividualProgression->enabled) + { + return true; + } + if (sIndividualProgression->earlyDungeonSet2) + { + return true; + } + Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); + return sIndividualProgression->hasPassedProgression(target, PROGRESSION_BLACKWING_LAIR); + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_ipp_ds2AI(creature); + } +}; + class npc_ipp_naxx40 : public CreatureScript { public: @@ -290,6 +320,7 @@ void AddSC_mod_individual_progression_awareness() { new npc_ipp_aq(); // new npc_ipp_naxx40(); // Not used yet + new npc_ipp_ds2(); new npc_ipp_tbc(); new npc_ipp_tbc_t4(); new npc_ipp_tbc_pre_t4();