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

@@ -63,6 +63,25 @@ void IndividualProgression::CheckAdjustments(Player* player) const
// This lets us add haste spells back to quivers
player->RemoveAura(RANGED_HASTE_SPELL);
player->CastSpell(player, RANGED_HASTE_SPELL, false);
}
}
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);
}
}

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))
@@ -225,7 +226,7 @@ public:
void OnPlayerMapChanged(Player* player) override
{
sIndividualProgression->CheckAdjustments(player);
sIndividualProgression->checkIPProgression(player);
sIndividualProgression->checkIPProgression(player);
}
void OnPlayerLevelChanged(Player* player, uint8 /*oldLevel*/) override
@@ -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)))
{
@@ -537,7 +540,7 @@ public:
}
void OnPlayerUpdateArea(Player* player, uint32 /*oldArea*/, uint32 newArea) override
{
{
switch (newArea) {
case AREA_DARKSHORE:
if ((sIndividualProgression->hasPassedProgression(player, PROGRESSION_PRE_AQ)) && (sIndividualProgression->isBeforeProgression(player, PROGRESSION_AQ_WAR)))