diff --git a/src/IndividualProgression.cpp b/src/IndividualProgression.cpp index f22f458..7a0915c 100644 --- a/src/IndividualProgression.cpp +++ b/src/IndividualProgression.cpp @@ -208,71 +208,146 @@ bool IndividualProgression::hasCustomProgressionValue(uint32 creatureEntry) } +void IndividualProgression::checkIPProgression(Player* killer) +{ + if (!enabled || disableDefaultProgression) + { + return; + } + + if (killer->HasAchieved(HALION_KILL)) // 4815 + { + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_5); + return; + } + else if (killer->HasAchieved(LICH_KING_KILL)) // 4597 + { + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_4); + return; + } + else if (killer->HasAchieved(ANUB_ARAK_KILL)) // 3916 + { + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_3); + return; + } + else if (killer->HasAchieved(KEL_THUZAD_KILL)) // 575 + { + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_1); + return; + } + else if (killer->HasAchieved(KIL_JAEDEN_KILL)) // 698 + { + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_5); + return; + } + else if (killer->HasAchieved(ZUL_JIN_KILL)) // 691 + { + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_4); + return; + } + else if (killer->HasAchieved(ILLIDAN_KILL)) // 697 + { + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_3); + return; + } + else if (killer->HasAchieved(KAEL_THAS_KILL)) // 696 + { + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_2); + return; + } + else if (killer->HasAchieved(MALCHEZAAR_KILL)) // 690 + { + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_1); + return; + } + else if (killer->HasAchieved(C_THUN_KILL)) // 687 + { + UpdateProgressionState(killer, PROGRESSION_AQ); + return; + } + else if (killer->HasAchieved(NEFARIAN_KILL)) // 685 + { + UpdateProgressionState(killer, PROGRESSION_BLACKWING_LAIR); + return; + } + else if (killer->HasAchieved(ONYXIAS_KILL)) // 684 + { + UpdateProgressionState(killer, PROGRESSION_ONYXIA); + return; + } + else if (killer->HasAchieved(RAGNAROS_KILL)) // 686 + { + UpdateProgressionState(killer, PROGRESSION_MOLTEN_CORE); + return; + } +} + void IndividualProgression::checkKillProgression(Player* killer, Creature* killed) { - if (!enabled) - { - return; - } + if (!enabled) + { + return; + } - if (hasCustomProgressionValue(killed->GetEntry())) - { - UpdateProgressionState(killer, static_cast(customProgressionMap[killed->GetEntry()])); - return; - } + if (hasCustomProgressionValue(killed->GetEntry())) + { + UpdateProgressionState(killer, static_cast(customProgressionMap[killed->GetEntry()])); + return; + } - if (disableDefaultProgression) - { - return; - } - switch (killed->GetEntry()) - { - case RAGNAROS: - UpdateProgressionState(killer, PROGRESSION_MOLTEN_CORE); - break; - case ONYXIA: - UpdateProgressionState(killer, PROGRESSION_ONYXIA); - break; - case NEFARIAN: - UpdateProgressionState(killer, PROGRESSION_BLACKWING_LAIR); - break; - case CTHUN: - UpdateProgressionState(killer, PROGRESSION_AQ); - break; - case KELTHUZAD_40: - UpdateProgressionState(killer, PROGRESSION_NAXX40); - break; - case MALCHEZAAR: - UpdateProgressionState(killer, PROGRESSION_TBC_TIER_1); - break; - case KAELTHAS: - UpdateProgressionState(killer, PROGRESSION_TBC_TIER_2); - break; - case ILLIDAN: - UpdateProgressionState(killer, PROGRESSION_TBC_TIER_3); - break; - case ZULJIN: - UpdateProgressionState(killer, PROGRESSION_TBC_TIER_4); - break; - case KILJAEDEN: - UpdateProgressionState(killer, PROGRESSION_TBC_TIER_5); - break; - case KELTHUZAD: - UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_1); - break; - case YOGGSARON: - UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_2); - break; - case ANUBARAK: - UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_3); - break; - case LICH_KING: - UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_4); - break; - case HALION: - UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_5); - break; - } + if (disableDefaultProgression) + { + return; + } + + switch (killed->GetEntry()) + { + case RAGNAROS: + UpdateProgressionState(killer, PROGRESSION_MOLTEN_CORE); + break; + case ONYXIA: + UpdateProgressionState(killer, PROGRESSION_ONYXIA); + break; + case NEFARIAN: + UpdateProgressionState(killer, PROGRESSION_BLACKWING_LAIR); + break; + case CTHUN: + UpdateProgressionState(killer, PROGRESSION_AQ); + break; + case KELTHUZAD_40: + UpdateProgressionState(killer, PROGRESSION_NAXX40); + break; + case MALCHEZAAR: + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_1); + break; + case KAELTHAS: + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_2); + break; + case ILLIDAN: + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_3); + break; + case ZULJIN: + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_4); + break; + case KILJAEDEN: + UpdateProgressionState(killer, PROGRESSION_TBC_TIER_5); + break; + case KELTHUZAD: + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_1); + break; + case YOGGSARON: + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_2); + break; + case ANUBARAK: + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_3); + break; + case LICH_KING: + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_4); + break; + case HALION: + UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_5); + break; + } } diff --git a/src/IndividualProgression.h b/src/IndividualProgression.h index 2c4e48d..73aab7a 100644 --- a/src/IndividualProgression.h +++ b/src/IndividualProgression.h @@ -92,6 +92,23 @@ enum ProgressionQuests PROGRESSION_FLAG_WOTLK_T5 = 66018 }; +enum ProgressionAchievements +{ + KEL_THUZAD_KILL = 575, // WotLK, naxx40 does not have an achievement + ONYXIAS_KILL = 684, + NEFARIAN_KILL = 685, + RAGNAROS_KILL = 686, + C_THUN_KILL = 687, + MALCHEZAAR_KILL = 690, + ZUL_JIN_KILL = 691, + KAEL_THAS_KILL = 696, + ILLIDAN_KILL = 697, + KIL_JAEDEN_KILL = 698, + ANUB_ARAK_KILL = 3916, + LICH_KING_KILL = 4597, + HALION_KILL = 4815 +}; + enum ProgressionZones { ZONE_AZUREMYST = 3524, @@ -242,6 +259,7 @@ public: void AdjustTBCStats(Player* player) const; void AdjustWotLKStats(Player* player) const; bool hasCustomProgressionValue(uint32 creatureEntry); + void checkIPProgression(Player* player); void checkKillProgression(Player* player, Creature* killed); static void LoadCustomProgressionEntries(const std::string& customProgressionString); static void AdjustStats(Player* player, float computedAdjustment, float computedHealingAdjustment); diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index d0994b1..8ac827b 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -32,7 +32,9 @@ public: { sIndividualProgression->UpdateProgressionState(player, static_cast(sIndividualProgression->startingProgression)); } + sIndividualProgression->CheckAdjustments(player); + sIndividualProgression->checkIPProgression(player); if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_MOLTEN_CORE)) && (player->GetQuestStatus(PROGRESSION_FLAG_MC) != QUEST_STATUS_REWARDED)) { @@ -504,22 +506,26 @@ public: + void OnPlayerCreatureKill(Player* killer, Creature* killed) override { - sIndividualProgression->checkKillProgression(killer, killed); - Group* group = killer->GetGroup(); - if (!group) + if (killed->GetCreatureTemplate()->rank > CREATURE_ELITE_NORMAL) { - return; - } - for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) - { - Player* member = itr->GetSource(); - if (!member) - continue; + sIndividualProgression->checkKillProgression(killer, killed); + Group* group = killer->GetGroup(); + if (!group) + { + return; + } + for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) + { + Player* member = itr->GetSource(); + if (!member) + continue; - if (killer->IsAtLootRewardDistance(member)) - sIndividualProgression->checkKillProgression(member, killed); + if (killer->IsAtLootRewardDistance(member)) + sIndividualProgression->checkKillProgression(member, killed); + } } }