Correctly apply damage adjustments to periodic damage ticks

This commit is contained in:
郑佩茹
2023-09-03 10:21:41 -06:00
parent 91696a5c1b
commit 2dd4ee1162

View File

@@ -640,7 +640,32 @@ public:
damage *= 1.0f - gearAdjustment;
}
}
};
void ModifyPeriodicDamageAurasTick(Unit* /*target*/, Unit* attacker, uint32& damage, SpellInfo const* /*spellInfo*/) override
{
if (!sIndividualProgression->enabled || !attacker)
return;
bool isPet = attacker->GetOwner() && attacker->GetOwner()->GetTypeId() == TYPEID_PLAYER;
if (!isPet && attacker->GetTypeId() != TYPEID_PLAYER)
{
return;
}
Player* player = isPet ? attacker->GetOwner()->ToPlayer() : attacker->ToPlayer();
float gearAdjustment = computeTotalGearTuning(player);
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40))
{
damage *= (sIndividualProgression->ComputeVanillaAdjustment(player->getLevel(), sIndividualProgression->vanillaPowerAdjustment) - gearAdjustment);
}
else if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5))
{
damage *= (sIndividualProgression->tbcPowerAdjustment - gearAdjustment);
}
else
{
damage *= 1.0f - gearAdjustment;
}
}};
void AddSC_mod_individual_progression_player()
{