Implemented Phase Definitions, Terrainswap and multiphasing

* fixes cataclysm aura effect SPELL_AURA_PHASE without phasemasks defined in miscValueA

NOTE:
 - Need some more test and feedback!

Thanks to:
 - Naios: Main Author
 - Cyberbrest: For the hard research work about multiphasing.
 - Venugh: He helped me with a lot of strange compile Errors.
 - Shauren: For the 4.3.4 phaseshift packet.
 - Booksize: He showed me how terrainswap works
 - Zakamurite: For Backporting some to MaNGOS
 - All other Author
This commit is contained in:
Salja 2013-12-16 14:09:19 +02:00 committed by Antz
parent 7c485a9ccc
commit ab2c78ba59
29 changed files with 418 additions and 210 deletions

View file

@ -575,45 +575,38 @@ void WorldSession::SendNotification(int32 string_id, ...)
}
}
void WorldSession::SendSetPhaseShift(uint32 phaseMask, uint16 mapId)
void WorldSession::SendSetPhaseShift(std::set<uint32> const& phaseIds, std::set<uint32> const& terrainswaps)
{
if (PlayerLoading())
return;
ObjectGuid guid = _player->GetObjectGuid();
uint32 phaseFlags = 0;
for (uint32 i = 0; i < sPhaseStore.GetNumRows(); i++)
{
if (PhaseEntry const* phase = sPhaseStore.LookupEntry(i))
{
if (phase->PhaseShift == phaseMask)
{
phaseFlags = phase->Flags;
break;
}
}
}
WorldPacket data(SMSG_SET_PHASE_SHIFT, 30);
WorldPacket data(SMSG_SET_PHASE_SHIFT, 1 + 8 + 4 + 4 + 4 + 4 + 2 * phaseIds.size() + 4 + terrainswaps.size() * 2);
data.WriteGuidMask<2, 3, 1, 6, 4, 5, 0, 7>(guid);
data.WriteGuidBytes<7, 4>(guid);
data << uint32(0); // number of WorldMapArea.dbc entries to control world map shift * 2
data << uint32(0);
//for (uint8 i = 0; i < worldMapAreaCount; ++i)
// data << uint16(0); // WorldMapArea.dbc id (controls map display)
data.WriteGuidBytes<1>(guid);
data << uint32(phaseMask ? phaseFlags : 8);
data << uint32(phaseIds.size() ? 0 : 8); // flags (not phasemask)
data.WriteGuidBytes<2, 6>(guid);
data << uint32(0); // number of inactive terrain swaps * 2
data << uint32(0); // Inactive terrain swaps
//for (uint8 i = 0; i < inactiveSwapsCount; ++i)
// data << uint16(0);
data << uint32(phaseMask ? 2 : 0); // WRONG: number of Phase.dbc ids * 2
if (phaseMask)
data << uint16(phaseMask);
data << uint32(phaseIds.size() * 2); // Phase.dbc ids
for (std::set<uint32>::const_iterator itr = phaseIds.begin(); itr != phaseIds.end(); ++itr)
data << uint16(*itr);
data.WriteGuidBytes<3, 0>(guid);
data << uint32(mapId ? 2 : 0); // number of terrains swaps * 2
if (mapId)
data << uint16(mapId);
data << uint32(terrainswaps.size() * 2); // Active terrain swaps
for (std::set<uint32>::const_iterator itr = terrainswaps.begin(); itr != terrainswaps.end(); ++itr)
data << uint16(*itr);
data.WriteGuidBytes<5>(guid);
SendPacket(&data);