Add /inspect command to view player equipment

- Add CMSG_INSPECT (0x114) and SMSG_INSPECT_RESULTS (0x115) opcodes
- Implement InspectPacket builder for sending inspect requests
- Add inspectTarget() method to GameHandler with validation
- Add /inspect slash command in chat system
- Validate target is a player before sending inspect request
- Show helpful error messages for invalid inspect attempts
- Display confirmation message when inspect request is sent
This commit is contained in:
kelsi davis 2026-02-07 12:37:13 -08:00
parent 4da8c75af4
commit 8b8e32e716
6 changed files with 51 additions and 0 deletions

View file

@ -1504,6 +1504,32 @@ std::shared_ptr<Entity> GameHandler::getTarget() const {
return entityManager.getEntity(targetGuid);
}
void GameHandler::inspectTarget() {
if (state != WorldState::IN_WORLD || !socket) {
LOG_WARNING("Cannot inspect: not in world or not connected");
return;
}
if (targetGuid == 0) {
addSystemChatMessage("You must target a player to inspect.");
return;
}
auto target = getTarget();
if (!target || target->getType() != ObjectType::PLAYER) {
addSystemChatMessage("You can only inspect players.");
return;
}
auto packet = InspectPacket::build(targetGuid);
socket->send(packet);
auto player = std::static_pointer_cast<Player>(target);
std::string name = player->getName().empty() ? "Target" : player->getName();
addSystemChatMessage("Inspecting " + name + "...");
LOG_INFO("Sent inspect request for player: ", name, " (GUID: 0x", std::hex, targetGuid, std::dec, ")");
}
void GameHandler::releaseSpirit() {
if (!playerDead_) return;
if (socket && state == WorldState::IN_WORLD) {