Hp adjustments on player login (#588)

This commit is contained in:
Grimfeather
2025-07-30 00:39:32 +02:00
committed by GitHub
parent ad2e8e4536
commit a4be26f81e
3 changed files with 25 additions and 2 deletions

View File

@@ -66,6 +66,25 @@ void IndividualProgression::CheckAdjustments(Player* player) const
}
}
void IndividualProgression::CheckHPAdjustments(Player* player) const
{
if (!enabled)
{
return;
}
// Player is still in Vanilla content - give Vanilla health adjustment
if (!hasPassedProgression(player, PROGRESSION_PRE_TBC) || (!hasPassedProgression(player, PROGRESSION_PRE_TBC) && (player->GetLevel() <= IP_LEVEL_VANILLA)))
{
player->SetMaxHealth(player->GetMaxHealth() * vanillaHealthAdjustment);
}
// Player is in TBC content - give TBC health adjustment
else if (!hasPassedProgression(player, PROGRESSION_TBC_TIER_5) || (!hasPassedProgression(player, PROGRESSION_TBC_TIER_5) && (player->GetLevel() <= IP_LEVEL_TBC)))
{
player->SetMaxHealth(player->GetMaxHealth() * tbcHealthAdjustment);
}
}
void IndividualProgression::ApplyGearStatsTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const
{
if (item->Quality != ITEM_QUALITY_EPIC) // Non-endgame gear is okay

View File

@@ -253,6 +253,7 @@ public:
void UpdateProgressionState(Player* player, ProgressionState newState) const;
static void ForceUpdateProgressionState(Player* player, ProgressionState newState);
void CheckAdjustments(Player* player) const;
void CheckHPAdjustments(Player* player) const;
void ApplyGearStatsTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
void ComputeGearTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
void AdjustVanillaStats(Player* player) const;

View File

@@ -34,6 +34,7 @@ public:
}
sIndividualProgression->CheckAdjustments(player);
sIndividualProgression->CheckHPAdjustments(player);
sIndividualProgression->checkIPProgression(player);
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_MOLTEN_CORE)) && (player->GetQuestStatus(PROGRESSION_FLAG_MC) != QUEST_STATUS_REWARDED))
@@ -262,12 +263,14 @@ public:
{
return;
}
float gearAdjustment = 0.0;
for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
{
if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
sIndividualProgression->ComputeGearTuning(player, gearAdjustment, item->GetTemplate());
}
// Player is still in Vanilla content - give Vanilla health adjustment
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_TBC) || (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_TBC) && (player->GetLevel() <= IP_LEVEL_VANILLA)))
{