jordan83221

MiscHandler.cpp

Nov 7th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.09 KB | None | 0 0
  1. ///< @todo refactor me with new data stillnot done 22/02/16
  2. void WorldSession::SendSetPhaseShift(const std::set<uint32> & p_PhaseIds, const std::set<uint32> & p_TerrainSwaps, const std::set<uint32> & p_InactiveTerrainSwap)
  3. {
  4.     uint32 unkValue = 0;
  5.  
  6.     WorldPacket l_ShiftPacket(SMSG_SET_PHASE_SHIFT, 500);
  7.     l_ShiftPacket.appendPackGUID(m_Player->GetGUID());      ///< CLientGUID
  8.     // 0x8 or 0x10 is related to areatrigger, if we send flags 0x00 areatrigger doesn't work in some case
  9.     l_ShiftPacket << uint32(0x18);                          ///< PhaseShiftFlags
  10.     l_ShiftPacket << uint32(p_PhaseIds.size());             ///< PhaseShiftCount
  11.     l_ShiftPacket.appendPackGUID(0);                        ///< PersonalGUID
  12.     // Active terrain swaps, may switch with inactive terrain
  13.  
  14.     for (std::set<uint32>::const_iterator l_It = p_PhaseIds.begin(); l_It != p_PhaseIds.end(); ++l_It)
  15.     {
  16.         l_ShiftPacket << uint16(1);                         ///< PhaseFlags
  17.         l_ShiftPacket << uint16(*l_It);                     ///< PhaseID
  18.     }
  19.  
  20.     /// Inactive terrain swaps, may switch with active terrain
  21.     l_ShiftPacket << uint32(p_InactiveTerrainSwap.size() * 2);  ///< Active terrain swaps size
  22.     for (std::set<uint32>::const_iterator l_It = p_InactiveTerrainSwap.begin(); l_It != p_InactiveTerrainSwap.end(); ++l_It)
  23.         l_ShiftPacket << uint16(*l_It);                         ///< Active terrain swap map id
  24.  
  25.     // WorldMapAreaId ?
  26.     l_ShiftPacket << unkValue;                                  ///< Inactive terrain swaps size used for PreloadMapIDs
  27.     //for (uint32 i = 0; i < unkValue; i++)
  28.         //data << uint16(0);                                    ///< Inactive terrain swap map id
  29.  
  30.     /// Active terrain swaps
  31.     l_ShiftPacket << uint32(p_TerrainSwaps.size() * 2);         ///< UI map swaps size
  32.     for (std::set<uint32>::const_iterator l_It = p_TerrainSwaps.begin(); l_It != p_TerrainSwaps.end(); ++l_It)
  33.         l_ShiftPacket << uint16(*l_It);                         ///< UI map id, WorldMapArea.dbc, controls map display
  34.  
  35.     SendPacket(&l_ShiftPacket);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment