fix(Core/Unit): Threat from energize effects should be proportional t… (#17352)

fix(Core/Unit): Threat from energize effects should be proportional to the amount of power gained
This commit is contained in:
Skjalf
2023-09-26 17:30:35 -03:00
committed by GitHub
parent a7969472b4
commit a8e514ea39

View File

@@ -11255,12 +11255,12 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow
void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType)
{
victim->ModifyPower(powerType, damage, false);
int32 gainedPower = victim->ModifyPower(powerType, damage, false);
if (powerType != POWER_HAPPINESS)
if (powerType != POWER_HAPPINESS && gainedPower)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
victim->getHostileRefMgr().threatAssist(this, float(gainedPower) * 0.5f, spellInfo);
}
SendEnergizeSpellLog(victim, spellID, damage, powerType);