mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
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:
@@ -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)
|
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);
|
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);
|
SendEnergizeSpellLog(victim, spellID, damage, powerType);
|
||||||
|
|||||||
Reference in New Issue
Block a user