mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
feat: show melee absorb/resist in combat text from SMSG_ATTACKERSTATEUPDATE
Sub-damage entries carry absorbed/resisted per school. Accumulate these and emit ABSORB/RESIST combat text alongside the hit damage when nonzero, matching the behavior just added for SMSG_SPELLNONMELEEDAMAGELOG.
This commit is contained in:
parent
d2ae4d8215
commit
dfc78572f5
1 changed files with 10 additions and 0 deletions
|
|
@ -13529,6 +13529,16 @@ void GameHandler::handleAttackerStateUpdate(network::Packet& packet) {
|
|||
} else {
|
||||
auto type = data.isCrit() ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::MELEE_DAMAGE;
|
||||
addCombatText(type, data.totalDamage, 0, isPlayerAttacker);
|
||||
// Show partial absorb/resist from sub-damage entries
|
||||
uint32_t totalAbsorbed = 0, totalResisted = 0;
|
||||
for (const auto& sub : data.subDamages) {
|
||||
totalAbsorbed += sub.absorbed;
|
||||
totalResisted += sub.resisted;
|
||||
}
|
||||
if (totalAbsorbed > 0)
|
||||
addCombatText(CombatTextEntry::ABSORB, static_cast<int32_t>(totalAbsorbed), 0, isPlayerAttacker);
|
||||
if (totalResisted > 0)
|
||||
addCombatText(CombatTextEntry::RESIST, static_cast<int32_t>(totalResisted), 0, isPlayerAttacker);
|
||||
}
|
||||
|
||||
(void)isPlayerTarget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue