diff options
Diffstat (limited to 'src/game/SpellHandler.cpp')
-rw-r--r-- | src/game/SpellHandler.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 74313eaa38b..dd88ef8e50a 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -537,3 +537,79 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data ) if(unit->isVehicle()) _player->EnterVehicle((Vehicle*)unit); } + +void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data ) +{ + sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA"); + CHECK_PACKET_SIZE(recv_data, 8); + uint64 guid; + recv_data >> guid; + + // Get unit for which data is needed by client + Unit *unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL); + if(!unit) + return; + // Get creator of the unit + Unit *creator = ObjectAccessor::GetObjectInWorld(unit->GetCreatorGUID(),(Unit*)NULL); + if (!creator) + return; + WorldPacket data(SMSG_MIRRORIMAGE_DATA, 68); + data << (uint64)guid; + data << (uint32)creator->GetDisplayId(); + if (creator->GetTypeId()==TYPEID_PLAYER) + { + Player * pCreator = (Player *)creator; + data << (uint8)pCreator->getRace(); + data << (uint8)pCreator->getGender(); + data << (uint8)pCreator->getClass(); + data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 0); // skin + + data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 1); // face + data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 2); // hair + data << (uint8)pCreator->GetByteValue(PLAYER_BYTES, 3); // haircolor + data << (uint8)pCreator->GetByteValue(PLAYER_BYTES_2, 0); // facialhair + + data << (uint32)0; // unk + static const EquipmentSlots ItemSlots[] = + { + EQUIPMENT_SLOT_HEAD, + EQUIPMENT_SLOT_SHOULDERS, + EQUIPMENT_SLOT_BODY, + EQUIPMENT_SLOT_CHEST, + EQUIPMENT_SLOT_WAIST, + EQUIPMENT_SLOT_LEGS, + EQUIPMENT_SLOT_FEET, + EQUIPMENT_SLOT_WRISTS, + EQUIPMENT_SLOT_HANDS, + EQUIPMENT_SLOT_BACK, + EQUIPMENT_SLOT_TABARD, + EQUIPMENT_SLOT_END + }; + // Display items in visible slots + for (EquipmentSlots const* itr = &ItemSlots[0];*itr!=EQUIPMENT_SLOT_END;++itr) + if (Item const *item = pCreator->GetItemByPos(INVENTORY_SLOT_BAG_0, *itr)) + data << (uint32)item->GetProto()->DisplayInfoID; + else + data << (uint32)0; + } + else + { + // Skip player data for creatures + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + data << (uint32)0; + } + SendPacket( &data ); +} + |