void WorldSession::HandleBlackMarketHelloOpcode(WorldPacket& recvData) { ObjectGuid NpcGUID; uint8 bitOrder[8] = { 4, 5, 2, 7, 0, 1, 3, 6 }; recvData.ReadBitInOrder(NpcGUID, bitOrder); recvData.ReadGuidBytes(NpcGUID, 4, 3, 0, 6, 2, 7, 5, 1); if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBlackMarketHello(NpcGUID, sBlackMarketMgr->isBlackMarketOpen()); }
void WorldSession::HandleBlackMarketHelloOpcode(WorldPacket& recvData) { ObjectGuid guid; guid[4] = recvData.ReadBit(); guid[5] = recvData.ReadBit(); guid[2] = recvData.ReadBit(); guid[7] = recvData.ReadBit(); guid[0] = recvData.ReadBit(); guid[1] = recvData.ReadBit(); guid[3] = recvData.ReadBit(); guid[6] = recvData.ReadBit(); recvData.ReadByteSeq(guid[3]); recvData.ReadByteSeq(guid[5]); recvData.ReadByteSeq(guid[0]); recvData.ReadByteSeq(guid[6]); recvData.ReadByteSeq(guid[4]); recvData.ReadByteSeq(guid[1]); recvData.ReadByteSeq(guid[7]); recvData.ReadByteSeq(guid[2]); uint64 npcGuid = uint64(guid); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_BLACKMARKET); if (!unit) { TC_LOG_DEBUG("network", "WORLD: Received CMSG_BLACKMARKET_HELLO - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(npcGuid))); return; } if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBlackMarketHello(npcGuid); }
//void called when player click on black market npc void WorldSession::HandleBlackMarketHello(WorldPacket& recvData) { ObjectGuid guid; guid[4] = recvData.ReadBit(); guid[1] = recvData.ReadBit(); guid[5] = recvData.ReadBit(); guid[3] = recvData.ReadBit(); guid[0] = recvData.ReadBit(); guid[7] = recvData.ReadBit(); guid[2] = recvData.ReadBit(); guid[6] = recvData.ReadBit(); recvData.ReadByteSeq(guid[2]); recvData.ReadByteSeq(guid[6]); recvData.ReadByteSeq(guid[7]); recvData.ReadByteSeq(guid[0]); recvData.ReadByteSeq(guid[4]); recvData.ReadByteSeq(guid[5]); recvData.ReadByteSeq(guid[3]); recvData.ReadByteSeq(guid[1]); uint64 npcGuid = uint64(guid); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_BLACK_MARKET); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBlackMarketHello - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(npcGuid))); return; } // remove fake death if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBlackMarketHello(npcGuid); }