mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Now also checking achievements for progression kills (#587)
- now checking achievements as well for progression updates - no longer checking progression after every creature kill. now only after boss kills.
This commit is contained in:
@@ -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)
|
void IndividualProgression::checkKillProgression(Player* killer, Creature* killed)
|
||||||
{
|
{
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasCustomProgressionValue(killed->GetEntry()))
|
if (hasCustomProgressionValue(killed->GetEntry()))
|
||||||
{
|
{
|
||||||
UpdateProgressionState(killer, static_cast<ProgressionState>(customProgressionMap[killed->GetEntry()]));
|
UpdateProgressionState(killer, static_cast<ProgressionState>(customProgressionMap[killed->GetEntry()]));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disableDefaultProgression)
|
if (disableDefaultProgression)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (killed->GetEntry())
|
|
||||||
{
|
switch (killed->GetEntry())
|
||||||
case RAGNAROS:
|
{
|
||||||
UpdateProgressionState(killer, PROGRESSION_MOLTEN_CORE);
|
case RAGNAROS:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_MOLTEN_CORE);
|
||||||
case ONYXIA:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_ONYXIA);
|
case ONYXIA:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_ONYXIA);
|
||||||
case NEFARIAN:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_BLACKWING_LAIR);
|
case NEFARIAN:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_BLACKWING_LAIR);
|
||||||
case CTHUN:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_AQ);
|
case CTHUN:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_AQ);
|
||||||
case KELTHUZAD_40:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_NAXX40);
|
case KELTHUZAD_40:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_NAXX40);
|
||||||
case MALCHEZAAR:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_1);
|
case MALCHEZAAR:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_1);
|
||||||
case KAELTHAS:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_2);
|
case KAELTHAS:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_2);
|
||||||
case ILLIDAN:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_3);
|
case ILLIDAN:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_3);
|
||||||
case ZULJIN:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_4);
|
case ZULJIN:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_4);
|
||||||
case KILJAEDEN:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_5);
|
case KILJAEDEN:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_TBC_TIER_5);
|
||||||
case KELTHUZAD:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_1);
|
case KELTHUZAD:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_1);
|
||||||
case YOGGSARON:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_2);
|
case YOGGSARON:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_2);
|
||||||
case ANUBARAK:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_3);
|
case ANUBARAK:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_3);
|
||||||
case LICH_KING:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_4);
|
case LICH_KING:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_4);
|
||||||
case HALION:
|
break;
|
||||||
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_5);
|
case HALION:
|
||||||
break;
|
UpdateProgressionState(killer, PROGRESSION_WOTLK_TIER_5);
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,23 @@ enum ProgressionQuests
|
|||||||
PROGRESSION_FLAG_WOTLK_T5 = 66018
|
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
|
enum ProgressionZones
|
||||||
{
|
{
|
||||||
ZONE_AZUREMYST = 3524,
|
ZONE_AZUREMYST = 3524,
|
||||||
@@ -242,6 +259,7 @@ public:
|
|||||||
void AdjustTBCStats(Player* player) const;
|
void AdjustTBCStats(Player* player) const;
|
||||||
void AdjustWotLKStats(Player* player) const;
|
void AdjustWotLKStats(Player* player) const;
|
||||||
bool hasCustomProgressionValue(uint32 creatureEntry);
|
bool hasCustomProgressionValue(uint32 creatureEntry);
|
||||||
|
void checkIPProgression(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);
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ public:
|
|||||||
{
|
{
|
||||||
sIndividualProgression->UpdateProgressionState(player, static_cast<ProgressionState>(sIndividualProgression->startingProgression));
|
sIndividualProgression->UpdateProgressionState(player, static_cast<ProgressionState>(sIndividualProgression->startingProgression));
|
||||||
}
|
}
|
||||||
|
|
||||||
sIndividualProgression->CheckAdjustments(player);
|
sIndividualProgression->CheckAdjustments(player);
|
||||||
|
sIndividualProgression->checkIPProgression(player);
|
||||||
|
|
||||||
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_MOLTEN_CORE)) && (player->GetQuestStatus(PROGRESSION_FLAG_MC) != QUEST_STATUS_REWARDED))
|
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
|
void OnPlayerCreatureKill(Player* killer, Creature* killed) override
|
||||||
{
|
{
|
||||||
sIndividualProgression->checkKillProgression(killer, killed);
|
if (killed->GetCreatureTemplate()->rank > CREATURE_ELITE_NORMAL)
|
||||||
Group* group = killer->GetGroup();
|
|
||||||
if (!group)
|
|
||||||
{
|
{
|
||||||
return;
|
sIndividualProgression->checkKillProgression(killer, killed);
|
||||||
}
|
Group* group = killer->GetGroup();
|
||||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
if (!group)
|
||||||
{
|
{
|
||||||
Player* member = itr->GetSource();
|
return;
|
||||||
if (!member)
|
}
|
||||||
continue;
|
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||||
|
{
|
||||||
|
Player* member = itr->GetSource();
|
||||||
|
if (!member)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (killer->IsAtLootRewardDistance(member))
|
if (killer->IsAtLootRewardDistance(member))
|
||||||
sIndividualProgression->checkKillProgression(member, killed);
|
sIndividualProgression->checkKillProgression(member, killed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user