Update Progression Quests (#763)

hidden progression quests are now removed when a player goes down in progression levels
This commit is contained in:
Grimfeather
2025-09-24 12:43:47 +02:00
committed by GitHub
parent 6d5ca4c55b
commit 3af27e4a20
4 changed files with 33 additions and 163 deletions

View File

@@ -369,6 +369,35 @@ void IndividualProgression::checkKillProgression(Player* killer, Creature* kille
} }
} }
void IndividualProgression::UpdateProgressionQuests(Player* player)
{
// remove all hidden progression quests
for (uint8 i = PROGRESSION_MOLTEN_CORE; i <= PROGRESSION_WOTLK_TIER_5; ++i)
{
uint32 PROGRESSION_QUEST = 66000;
PROGRESSION_QUEST = PROGRESSION_QUEST + i;
if (player->GetQuestStatus(PROGRESSION_QUEST) == QUEST_STATUS_REWARDED)
player->RemoveRewardedQuest(PROGRESSION_QUEST);
}
// add hidden progression quests
for (uint8 i = PROGRESSION_MOLTEN_CORE; i <= PROGRESSION_WOTLK_TIER_5; ++i)
{
ProgressionState PROGRESSION_STATE = static_cast<ProgressionState>(i);
uint32 PROGRESSION_QUEST = 66000;
PROGRESSION_QUEST = PROGRESSION_QUEST + i;
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_STATE)) && (player->GetQuestStatus(PROGRESSION_QUEST) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_QUEST);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_QUEST);
player->RewardQuest(quest, 0, player, false, false);
}
}
}
class IndividualPlayerProgression_WorldScript : public WorldScript class IndividualPlayerProgression_WorldScript : public WorldScript
{ {

View File

@@ -268,6 +268,7 @@ public:
void AdjustWotLKStats(Player* player) const; void AdjustWotLKStats(Player* player) const;
bool hasCustomProgressionValue(uint32 creatureEntry); bool hasCustomProgressionValue(uint32 creatureEntry);
void checkIPProgression(Player* player); void checkIPProgression(Player* player);
void UpdateProgressionQuests(Player* player);
void checkKillProgression(Player* player, Creature* killed); void checkKillProgression(Player* player, Creature* killed);
static void LoadCustomProgressionEntries(const std::string& customProgressionString); static void LoadCustomProgressionEntries(const std::string& customProgressionString);
static void AdjustStats(Player* player, float computedAdjustment, float computedHealingAdjustment); static void AdjustStats(Player* player, float computedAdjustment, float computedHealingAdjustment);

View File

@@ -36,168 +36,7 @@ public:
sIndividualProgression->CheckAdjustments(player); sIndividualProgression->CheckAdjustments(player);
sIndividualProgression->CheckHPAdjustments(player); sIndividualProgression->CheckHPAdjustments(player);
sIndividualProgression->checkIPProgression(player); sIndividualProgression->checkIPProgression(player);
sIndividualProgression->UpdateProgressionQuests(player);
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_MOLTEN_CORE)) && (player->GetQuestStatus(PROGRESSION_FLAG_MC) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_MC);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_MC);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_ONYXIA)) && (player->GetQuestStatus(PROGRESSION_FLAG_ONYXIA) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_ONYXIA);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_ONYXIA);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_BLACKWING_LAIR)) && (player->GetQuestStatus(PROGRESSION_FLAG_BWL) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_BWL);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_BWL);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_AQ)) && (player->GetQuestStatus(PROGRESSION_FLAG_PRE_AQ) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_PRE_AQ);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_PRE_AQ);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_AQ_WAR)) && (player->GetQuestStatus(PROGRESSION_FLAG_AQ_WAR) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_AQ_WAR);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_AQ_WAR);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_AQ)) && (player->GetQuestStatus(PROGRESSION_FLAG_AQ) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_AQ);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_AQ);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40)) && (player->GetQuestStatus(PROGRESSION_FLAG_NAXX40) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_NAXX40);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_NAXX40);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_TBC)) && (player->GetQuestStatus(PROGRESSION_FLAG_PRE_TBC) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_PRE_TBC);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_PRE_TBC);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_1)) && (player->GetQuestStatus(PROGRESSION_FLAG_TBC_T1) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_TBC_T1);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_TBC_T1);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_2)) && (player->GetQuestStatus(PROGRESSION_FLAG_TBC_T2) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_TBC_T2);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_TBC_T2);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_3)) && (player->GetQuestStatus(PROGRESSION_FLAG_TBC_T3) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_TBC_T3);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_TBC_T3);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_4)) && (player->GetQuestStatus(PROGRESSION_FLAG_TBC_T4) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_TBC_T4);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_TBC_T4);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5)) && (player->GetQuestStatus(PROGRESSION_FLAG_TBC_T5) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_TBC_T5);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_TBC_T5);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_WOTLK_TIER_1)) && (player->GetQuestStatus(PROGRESSION_FLAG_WOTLK_T1) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_WOTLK_T1);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_WOTLK_T1);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_WOTLK_TIER_2)) && (player->GetQuestStatus(PROGRESSION_FLAG_WOTLK_T2) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_WOTLK_T2);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_WOTLK_T2);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_WOTLK_TIER_3)) && (player->GetQuestStatus(PROGRESSION_FLAG_WOTLK_T3) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_WOTLK_T3);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_WOTLK_T3);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_WOTLK_TIER_4)) && (player->GetQuestStatus(PROGRESSION_FLAG_WOTLK_T4) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_WOTLK_T4);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_WOTLK_T4);
player->RewardQuest(quest, 0, player, false, false);
}
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_WOTLK_TIER_5)) && (player->GetQuestStatus(PROGRESSION_FLAG_WOTLK_T5) != QUEST_STATUS_REWARDED))
{
Quest const* quest = sObjectMgr->GetQuestTemplate(PROGRESSION_FLAG_WOTLK_T5);
player->AddQuest(quest, nullptr);
player->CompleteQuest(PROGRESSION_FLAG_WOTLK_T5);
player->RewardQuest(quest, 0, player, false, false);
}
} }
void OnPlayerSetMaxLevel(Player* player, uint32& maxPlayerLevel) override void OnPlayerSetMaxLevel(Player* player, uint32& maxPlayerLevel) override

View File

@@ -43,7 +43,8 @@ public:
Player* target = player->GetConnectedPlayer(); Player* target = player->GetConnectedPlayer();
std::string playername = target->GetName(); std::string playername = target->GetName();
sIndividualProgression->ForceUpdateProgressionState(player->GetConnectedPlayer(), static_cast<ProgressionState>(progressionLevel)); sIndividualProgression->ForceUpdateProgressionState(target, static_cast<ProgressionState>(progressionLevel));
sIndividualProgression->UpdateProgressionQuests(target);
handler->PSendSysMessage("Updated Progression Level for |cff00ffff{}|r = |cff00ffff{}|r", playername, progressionLevel); handler->PSendSysMessage("Updated Progression Level for |cff00ffff{}|r = |cff00ffff{}|r", playername, progressionLevel);
return true; return true;