mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Update Progression Quests (#763)
hidden progression quests are now removed when a player goes down in progression levels
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user