Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Core/Units: generating rage from damage taken will now use the full u…
Browse files Browse the repository at this point in the history
…nmitigated damage amount instead of the final instead
  • Loading branch information
Ovahlord committed Dec 10, 2023
1 parent df646fb commit 8c3d501
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,15 +828,6 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
}
}

if (!damage)
{
// Rage from absorbed damage
if (cleanDamage && cleanDamage->absorbed_damage && victim->GetPowerType() == POWER_RAGE)
victim->RewardRage(cleanDamage->absorbed_damage, false);

return 0;
}

uint32 health = victim->GetHealth();

// duel ends when player has 1 or less hp
Expand Down Expand Up @@ -939,8 +930,8 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
// Rage from damage received
if (attacker != victim && victim->GetPowerType() == POWER_RAGE)
{
uint32 rage_damage = damage + (cleanDamage ? cleanDamage->absorbed_damage : 0);
victim->RewardRage(rage_damage, false);
uint32 rageBaseReward = damage + (cleanDamage ? cleanDamage->absorbed_damage + cleanDamage->mitigated_damage : 0);
victim->RewardRage(rageBaseReward, false);
}

if (attacker && attacker->GetTypeId() == TYPEID_PLAYER)
Expand Down Expand Up @@ -13459,7 +13450,7 @@ void Unit::RewardRage(uint32 baseRage, bool attacker)
else
{
// Calculate rage from health and damage taken (formular taken from SimulationCraft)
addRage = std::floor(0.5f + (baseRage * 18.92f / GetMaxHealth()));
addRage = baseRage * 18.92f / GetMaxHealth();

// Berserker Rage
if (HasAura(18499))
Expand Down

0 comments on commit 8c3d501

Please sign in to comment.