diff --git a/conf/individualProgression.conf.dist b/conf/individualProgression.conf.dist index 6b462e7..30d3c22 100644 --- a/conf/individualProgression.conf.dist +++ b/conf/individualProgression.conf.dist @@ -268,3 +268,27 @@ IndividualProgression.DeathKnightUnlockProgression = 11 # IndividualProgression.DeathKnightStartingProgression = 11 +# +# IndividualProgression.DisableDefaultProgression +# Description: Disable the regular progression flow, so progression must be advanced through custom creature progression entries +# +# Default: 0 - Disabled +# 1 - Enabled +# +# + +IndividualProgression.DisableDefaultProgression = 0 +# +# IndividualProgression.CustomProgression +# Description: A list of creature IDs paired to progression states. When a creature on the list is defeated by a player, +# the player will be set to that progression state. Used for custom, non-standard progression. +# Not needed for regular, Blizz-like progress through expansions, which works by default. +# Example: IndividualProgression.CustomProgression="448 6, 639 11" +# This example would allow players access to TBC content for defeating Hogger (entry 448), and Northrend content for defeating VanCleef (entry 639) +# Leave empty to disable (default.) +# +# Default: "" - Disabled (default) +# +# + +IndividualProgression.CustomProgression = "" diff --git a/src/IndividualProgression.cpp b/src/IndividualProgression.cpp index 9b6374f..5e47651 100644 --- a/src/IndividualProgression.cpp +++ b/src/IndividualProgression.cpp @@ -208,12 +208,39 @@ uint8 IndividualProgression::GetAccountProgression(uint32 accountId) return progressionLevel; } +void IndividualProgression::LoadCustomProgressionEntries(std::string const& customProgressionString) +{ + std::string delimitedValue; + std::stringstream customProgressionStream; + + customProgressionStream.str(customProgressionString); + while (std::getline(customProgressionStream, delimitedValue, ',')) + { + std::string pairOne, pairTwo; + std::stringstream progressionPairStream(delimitedValue); + progressionPairStream>>pairOne>>pairTwo; + uint32 creatureEntryId = atoi(pairOne.c_str()); + uint8 progressionValue = atoi(pairTwo.c_str()); + sIndividualProgression->customProgressionMap[creatureEntryId] = progressionValue; + } +} + +bool IndividualProgression::hasCustomProgressionValue(uint32 creatureEntry) +{ + if (customProgressionMap.empty()) + { + return false; + } + return (customProgressionMap.find(creatureEntry) != customProgressionMap.end()); +} + class IndividualPlayerProgression_WorldScript : public WorldScript { private: static void LoadConfig() { + sIndividualProgression->customProgressionMap.clear(); sIndividualProgression->enabled = sConfigMgr->GetOption("IndividualProgression.Enable", true); sIndividualProgression->vanillaPowerAdjustment = sConfigMgr->GetOption("IndividualProgression.VanillaPowerAdjustment", 1); sIndividualProgression->vanillaHealingAdjustment = sConfigMgr->GetOption("IndividualProgression.VanillaHealingAdjustment", 1); @@ -232,9 +259,11 @@ private: sIndividualProgression->startingProgression = sConfigMgr->GetOption("IndividualProgression.StartingProgression", 0); sIndividualProgression->questMoneyAtLevelCap = sConfigMgr->GetOption("IndividualProgression.QuestMoneyAtLevelCap", true); sIndividualProgression->repeatableVanillaQuestsXp = sConfigMgr->GetOption("IndividualProgression.RepeatableVanillaQuestsXP", true); + sIndividualProgression->disableDefaultProgression = sConfigMgr->GetOption("IndividualProgression.DisableDefaultProgression", false); sIndividualProgression->tbcRacesProgressionLevel = sConfigMgr->GetOption("IndividualProgression.TbcRacesUnlockProgression", 0); sIndividualProgression->deathKnightProgressionLevel = sConfigMgr->GetOption("IndividualProgression.DeathKnightUnlockProgression", 11); sIndividualProgression->deathKnightStartingProgression = sConfigMgr->GetOption("IndividualProgression.DeathKnightStartingProgression", 11); + sIndividualProgression->LoadCustomProgressionEntries(sConfigMgr->GetOption("IndividualProgression.CustomProgression", "")); } static void LoadXpValues() diff --git a/src/IndividualProgression.h b/src/IndividualProgression.h index 360051a..c5d31a2 100644 --- a/src/IndividualProgression.h +++ b/src/IndividualProgression.h @@ -117,21 +117,24 @@ class IndividualProgression public: static IndividualProgression* instance(); + std::map customProgressionMap; questXpMapType questXpMap; float vanillaPowerAdjustment, vanillaHealthAdjustment, tbcPowerAdjustment, tbcHealthAdjustment, vanillaHealingAdjustment, tbcHealingAdjustment, previousGearTuning; - bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp; + bool enabled, questXpFix, hunterPetLevelFix, requirePreAQQuests, enforceGroupRules, fishingFix, simpleConfigOverride, questMoneyAtLevelCap, repeatableVanillaQuestsXp, disableDefaultProgression; int progressionLimit, startingProgression, tbcRacesProgressionLevel, deathKnightProgressionLevel, deathKnightStartingProgression; bool hasPassedProgression(Player* player, ProgressionState state) const; static bool isBeforeProgression(Player* player, ProgressionState state) ; void UpdateProgressionState(Player* player, ProgressionState newState) const; - static void ForceUpdateProgressionState(Player* player, ProgressionState newState) ; + static void ForceUpdateProgressionState(Player* player, ProgressionState newState); void CheckAdjustments(Player* player) const; void ApplyGearStatsTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const; void ApplyGearHealthTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const; void AdjustVanillaStats(Player* player) const; void AdjustTBCStats(Player* player) const; void AdjustWotLKStats(Player* player) const; + bool hasCustomProgressionValue(uint32 creatureEntry); + static void LoadCustomProgressionEntries(const std::string& customProgressionString); static void AdjustStats(Player* player, float computedAdjustment, float computedHealingAdjustment); static uint8 GetAccountProgression(uint32 accountId); }; diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index a5666fe..fa193e6 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -209,7 +209,10 @@ public: switch (quest->GetQuestId()) { case MIGHT_OF_KALIMDOR: - sIndividualProgression->UpdateProgressionState(player, PROGRESSION_PRE_AQ); + if (!sIndividualProgression->disableDefaultProgression) + { + sIndividualProgression->UpdateProgressionState(player, PROGRESSION_PRE_AQ); + } break; case QUEST_MORROWGRAIN: case QUEST_TROLL_NECKLACE: @@ -257,6 +260,15 @@ public: return; } + if (sIndividualProgression->hasCustomProgressionValue(killed->GetEntry())) + { + sIndividualProgression->UpdateProgressionState(killer, static_cast(sIndividualProgression->customProgressionMap[killed->GetEntry()])); + } + + if (sIndividualProgression->disableDefaultProgression) + { + return; + } switch (killed->GetEntry()) { case RAGNAROS: