mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
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:
parent
4da8c75af4
commit
8b8e32e716
6 changed files with 51 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue