feat: add PROC_TRIGGER floating combat text for spell procs

Handles SMSG_SPELL_CHANCE_PROC_LOG (previously silently ignored) to
display gold "PROC!" floating text when the player triggers a spell
proc. Reads caster/target packed GUIDs and spell ID from the packet
header; skips variable-length effect payload.

Adds CombatTextEntry::PROC_TRIGGER type with gold color rendering,
visible alongside existing damage/heal/energize floating numbers.
This commit is contained in:
Kelsi 2026-03-12 06:06:41 -07:00
parent 10ad246e29
commit 3e8f03c7b7
3 changed files with 25 additions and 2 deletions

View file

@ -5578,9 +5578,28 @@ void GameHandler::handlePacket(network::Packet& packet) {
packet.setReadPos(packet.getSize());
break;
}
case Opcode::SMSG_SPELL_CHANCE_PROC_LOG: {
// Format (all expansions): PackedGuid target + PackedGuid caster + uint32 spellId + ...
if (packet.getSize() - packet.getReadPos() < 3) {
packet.setReadPos(packet.getSize()); break;
}
/*uint64_t targetGuid =*/ UpdateObjectParser::readPackedGuid(packet);
if (packet.getSize() - packet.getReadPos() < 2) {
packet.setReadPos(packet.getSize()); break;
}
uint64_t procCasterGuid = UpdateObjectParser::readPackedGuid(packet);
if (packet.getSize() - packet.getReadPos() < 4) {
packet.setReadPos(packet.getSize()); break;
}
uint32_t procSpellId = packet.readUInt32();
// Show a "PROC!" floating text when the player triggers the proc
if (procCasterGuid == playerGuid && procSpellId > 0)
addCombatText(CombatTextEntry::PROC_TRIGGER, 0, procSpellId, true);
packet.setReadPos(packet.getSize());
break;
}
case Opcode::SMSG_SPELLINSTAKILLLOG:
case Opcode::SMSG_SPELLLOGEXECUTE:
case Opcode::SMSG_SPELL_CHANCE_PROC_LOG:
case Opcode::SMSG_SPELL_CHANCE_RESIST_PUSHBACK:
case Opcode::SMSG_SPELL_UPDATE_CHAIN_TARGETS:
packet.setReadPos(packet.getSize());