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:
Kelsi 2026-03-11 03:29:37 -07:00
parent d2ae4d8215
commit dfc78572f5

View file

@ -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;