2014-11-14 02:00:34 +01:00
|
|
|
/*
|
2020-01-02 06:44:10 +01:00
|
|
|
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
|
2014-11-14 02:00:34 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-11-30 15:37:11 +01:00
|
|
|
#include "MovementPackets.h"
|
2022-02-12 01:23:30 +01:00
|
|
|
#include "CharacterPackets.h"
|
2017-07-29 21:40:28 +02:00
|
|
|
#include "SpellPackets.h"
|
2014-11-14 02:00:34 +01:00
|
|
|
|
2015-01-26 12:59:18 +01:00
|
|
|
void WorldPackets::Spells::CancelAura::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> SpellID;
|
|
|
|
|
_worldPacket >> CasterGUID;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-02 01:38:29 +01:00
|
|
|
void WorldPackets::Spells::PetCancelAura::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> PetGUID;
|
|
|
|
|
_worldPacket >> SpellID;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-17 23:10:00 +01:00
|
|
|
void WorldPackets::Spells::CancelChannelling::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> ChannelSpell;
|
2018-10-04 18:50:21 +02:00
|
|
|
_worldPacket >> Reason;
|
2015-12-17 23:10:00 +01:00
|
|
|
}
|
|
|
|
|
|
2014-11-30 15:37:11 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::CategoryCooldown::Write()
|
2014-11-14 02:00:34 +01:00
|
|
|
{
|
|
|
|
|
_worldPacket.reserve(4 + 8 * CategoryCooldowns.size());
|
|
|
|
|
|
|
|
|
|
_worldPacket << uint32(CategoryCooldowns.size());
|
|
|
|
|
|
|
|
|
|
for (CategoryCooldownInfo const& cooldown : CategoryCooldowns)
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(cooldown.Category);
|
|
|
|
|
_worldPacket << int32(cooldown.ModCooldown);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-30 15:37:11 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::SendKnownSpells::Write()
|
2014-11-14 02:00:34 +01:00
|
|
|
{
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket.reserve(1 + 4 * KnownSpells.size() + 4 * FavoriteSpells.size());
|
2014-11-14 02:00:34 +01:00
|
|
|
|
|
|
|
|
_worldPacket.WriteBit(InitialLogin);
|
|
|
|
|
_worldPacket << uint32(KnownSpells.size());
|
2016-06-03 19:14:59 +02:00
|
|
|
_worldPacket << uint32(FavoriteSpells.size());
|
2014-11-14 02:00:34 +01:00
|
|
|
|
|
|
|
|
for (uint32 spellId : KnownSpells)
|
|
|
|
|
_worldPacket << uint32(spellId);
|
|
|
|
|
|
2016-06-03 19:14:59 +02:00
|
|
|
for (uint32 spellId : FavoriteSpells)
|
|
|
|
|
_worldPacket << uint32(spellId);
|
|
|
|
|
|
2014-11-14 02:00:34 +01:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2014-11-29 12:48:12 +01:00
|
|
|
|
2014-11-30 15:37:11 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::UpdateActionButtons::Write()
|
2014-11-16 02:09:27 +02:00
|
|
|
{
|
2017-05-21 23:18:43 +02:00
|
|
|
_worldPacket.append(ActionButtons.data(), ActionButtons.size());
|
2014-11-16 02:09:27 +02:00
|
|
|
_worldPacket << Reason;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-01 02:03:06 +02:00
|
|
|
void WorldPackets::Spells::SetActionButton::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> Action;
|
|
|
|
|
_worldPacket >> Index;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-30 15:37:11 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::SendUnlearnSpells::Write()
|
2014-11-16 02:09:27 +02:00
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(Spells.size());
|
2014-11-16 06:08:46 +01:00
|
|
|
for (uint32 spellId : Spells)
|
|
|
|
|
_worldPacket << uint32(spellId);
|
2014-11-16 02:09:27 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::AuraDataInfo const& auraData)
|
|
|
|
|
{
|
|
|
|
|
data << auraData.CastID;
|
|
|
|
|
data << int32(auraData.SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
data << auraData.Visual;
|
|
|
|
|
data << uint16(auraData.Flags);
|
2016-06-05 14:08:53 +02:00
|
|
|
data << uint32(auraData.ActiveFlags);
|
|
|
|
|
data << uint16(auraData.CastLevel);
|
|
|
|
|
data << uint8(auraData.Applications);
|
2018-10-04 18:50:21 +02:00
|
|
|
data << int32(auraData.ContentTuningID);
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(auraData.CastUnit.has_value());
|
|
|
|
|
data.WriteBit(auraData.Duration.has_value());
|
|
|
|
|
data.WriteBit(auraData.Remaining.has_value());
|
|
|
|
|
data.WriteBit(auraData.TimeMod.has_value());
|
2016-06-05 14:08:53 +02:00
|
|
|
data.WriteBits(auraData.Points.size(), 6);
|
|
|
|
|
data.WriteBits(auraData.EstimatedPoints.size(), 6);
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(auraData.ContentTuning.has_value());
|
2016-06-05 14:08:53 +02:00
|
|
|
|
2018-10-04 18:50:21 +02:00
|
|
|
if (auraData.ContentTuning)
|
|
|
|
|
data << *auraData.ContentTuning;
|
2017-04-15 12:32:36 +02:00
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
if (auraData.CastUnit)
|
|
|
|
|
data << *auraData.CastUnit;
|
|
|
|
|
|
|
|
|
|
if (auraData.Duration)
|
|
|
|
|
data << uint32(*auraData.Duration);
|
|
|
|
|
|
|
|
|
|
if (auraData.Remaining)
|
|
|
|
|
data << uint32(*auraData.Remaining);
|
|
|
|
|
|
|
|
|
|
if (auraData.TimeMod)
|
|
|
|
|
data << float(*auraData.TimeMod);
|
|
|
|
|
|
|
|
|
|
if (!auraData.Points.empty())
|
|
|
|
|
data.append(auraData.Points.data(), auraData.Points.size());
|
|
|
|
|
|
|
|
|
|
if (!auraData.EstimatedPoints.empty())
|
|
|
|
|
data.append(auraData.EstimatedPoints.data(), auraData.EstimatedPoints.size());
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::AuraInfo const& aura)
|
|
|
|
|
{
|
|
|
|
|
data << aura.Slot;
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(aura.AuraData.has_value());
|
2014-11-19 00:30:31 +02:00
|
|
|
data.FlushBits();
|
2014-11-19 21:09:30 +01:00
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
if (aura.AuraData)
|
|
|
|
|
data << *aura.AuraData;
|
|
|
|
|
|
2014-11-19 21:09:30 +01:00
|
|
|
return data;
|
2014-11-19 00:30:31 +02:00
|
|
|
}
|
|
|
|
|
|
2015-01-02 15:15:59 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::AuraUpdate::Write()
|
2014-11-29 12:48:12 +01:00
|
|
|
{
|
2015-01-02 15:15:59 +01:00
|
|
|
_worldPacket.WriteBit(UpdateAll);
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket.WriteBits(Auras.size(), 9);
|
|
|
|
|
for (AuraInfo const& aura : Auras)
|
|
|
|
|
_worldPacket << aura;
|
|
|
|
|
|
2015-01-02 15:15:59 +01:00
|
|
|
_worldPacket << UnitGUID;
|
2014-11-29 12:48:12 +01:00
|
|
|
|
2015-01-02 15:15:59 +01:00
|
|
|
return &_worldPacket;
|
2014-11-29 12:48:12 +01:00
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
ByteBuffer& operator>>(ByteBuffer& buffer, Optional<WorldPackets::Spells::TargetLocation>& location)
|
2014-11-30 15:37:11 +01:00
|
|
|
{
|
2022-01-23 20:31:52 +01:00
|
|
|
location.emplace();
|
2015-04-26 23:45:52 +02:00
|
|
|
buffer >> location->Transport;
|
|
|
|
|
buffer >> location->Location.m_positionX;
|
|
|
|
|
buffer >> location->Location.m_positionY;
|
|
|
|
|
buffer >> location->Location.m_positionZ;
|
2015-01-30 23:58:16 +01:00
|
|
|
return buffer;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
ByteBuffer& operator>>(ByteBuffer& buffer, WorldPackets::Spells::SpellTargetData& targetData)
|
|
|
|
|
{
|
|
|
|
|
buffer.ResetBitPos();
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2019-05-18 22:21:17 +02:00
|
|
|
targetData.Flags = buffer.ReadBits(26);
|
2016-06-05 14:08:53 +02:00
|
|
|
bool hasSrcLocation = buffer.ReadBit();
|
|
|
|
|
bool hasDstLocation = buffer.ReadBit();
|
|
|
|
|
bool hasOrientation = buffer.ReadBit();
|
|
|
|
|
bool hasMapID = buffer.ReadBit();
|
2015-01-30 23:58:16 +01:00
|
|
|
uint32 nameLength = buffer.ReadBits(7);
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
buffer >> targetData.Unit;
|
|
|
|
|
buffer >> targetData.Item;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (hasSrcLocation)
|
|
|
|
|
buffer >> targetData.SrcLocation;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (hasDstLocation)
|
|
|
|
|
buffer >> targetData.DstLocation;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (hasOrientation)
|
|
|
|
|
targetData.Orientation = buffer.read<float>();
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
if (hasMapID)
|
|
|
|
|
targetData.MapID = buffer.read<int32>();
|
|
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
targetData.Name = buffer.ReadString(nameLength);
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
return buffer;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
ByteBuffer& operator>>(ByteBuffer& buffer, WorldPackets::Spells::MissileTrajectoryRequest& trajectory)
|
|
|
|
|
{
|
|
|
|
|
buffer >> trajectory.Pitch;
|
|
|
|
|
buffer >> trajectory.Speed;
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2020-11-04 21:39:21 +01:00
|
|
|
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Spells::SpellOptionalReagent& optionalReagent)
|
|
|
|
|
{
|
|
|
|
|
data >> optionalReagent.ItemID;
|
|
|
|
|
data >> optionalReagent.Slot;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator>>(ByteBuffer& data, WorldPackets::Spells::SpellExtraCurrencyCost& extraCurrencyCost)
|
|
|
|
|
{
|
|
|
|
|
data >> extraCurrencyCost.CurrencyID;
|
|
|
|
|
data >> extraCurrencyCost.Count;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
ByteBuffer& operator>>(ByteBuffer& buffer, WorldPackets::Spells::SpellCastRequest& request)
|
|
|
|
|
{
|
|
|
|
|
buffer >> request.CastID;
|
2015-07-18 00:45:21 +02:00
|
|
|
buffer >> request.Misc[0];
|
|
|
|
|
buffer >> request.Misc[1];
|
2015-01-30 23:58:16 +01:00
|
|
|
buffer >> request.SpellID;
|
2020-11-04 21:39:21 +01:00
|
|
|
buffer >> request.Visual;
|
2015-01-30 23:58:16 +01:00
|
|
|
buffer >> request.MissileTrajectory;
|
2018-10-04 18:50:21 +02:00
|
|
|
buffer >> request.CraftingNPC;
|
2020-11-04 21:39:21 +01:00
|
|
|
request.OptionalReagents.resize(buffer.read<uint32>());
|
|
|
|
|
request.OptionalCurrencies.resize(buffer.read<uint32>());
|
|
|
|
|
|
|
|
|
|
for (WorldPackets::Spells::SpellOptionalReagent& optionalReagent : request.OptionalReagents)
|
|
|
|
|
buffer >> optionalReagent;
|
|
|
|
|
|
|
|
|
|
for (WorldPackets::Spells::SpellExtraCurrencyCost& optionalCurrency : request.OptionalCurrencies)
|
|
|
|
|
buffer >> optionalCurrency;
|
|
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
request.SendCastFlags = buffer.ReadBits(5);
|
2016-06-05 14:08:53 +02:00
|
|
|
bool hasMoveUpdate = buffer.ReadBit();
|
2015-01-30 23:58:16 +01:00
|
|
|
request.Weight.resize(buffer.ReadBits(2));
|
2016-06-05 14:08:53 +02:00
|
|
|
buffer >> request.Target;
|
2015-01-30 23:58:16 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (hasMoveUpdate)
|
|
|
|
|
{
|
2022-01-23 20:31:52 +01:00
|
|
|
request.MoveUpdate.emplace();
|
2016-06-05 14:08:53 +02:00
|
|
|
buffer >> *request.MoveUpdate;
|
2015-04-26 23:45:52 +02:00
|
|
|
}
|
2015-01-30 23:58:16 +01:00
|
|
|
|
|
|
|
|
for (WorldPackets::Spells::SpellWeight& weight : request.Weight)
|
2014-11-30 15:37:11 +01:00
|
|
|
{
|
2015-01-30 23:58:16 +01:00
|
|
|
buffer.ResetBitPos();
|
|
|
|
|
weight.Type = buffer.ReadBits(2);
|
|
|
|
|
buffer >> weight.ID;
|
|
|
|
|
buffer >> weight.Quantity;
|
2014-11-30 15:37:11 +01:00
|
|
|
}
|
|
|
|
|
|
2015-01-30 23:58:16 +01:00
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WorldPackets::Spells::CastSpell::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> Cast;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WorldPackets::Spells::PetCastSpell::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> PetGUID;
|
|
|
|
|
_worldPacket >> Cast;
|
2014-11-30 15:37:11 +01:00
|
|
|
}
|
|
|
|
|
|
2015-02-12 02:37:42 +00:00
|
|
|
void WorldPackets::Spells::UseItem::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> PackSlot;
|
|
|
|
|
_worldPacket >> Slot;
|
|
|
|
|
_worldPacket >> CastItem;
|
|
|
|
|
_worldPacket >> Cast;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::SpellPrepare::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << ClientCastID;
|
|
|
|
|
_worldPacket << ServerCastID;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::TargetLocation const& targetLocation)
|
2014-11-30 15:37:11 +01:00
|
|
|
{
|
2014-12-02 00:07:36 +02:00
|
|
|
data << targetLocation.Transport;
|
2015-02-12 19:56:39 +00:00
|
|
|
data << float(targetLocation.Location.m_positionX);
|
|
|
|
|
data << float(targetLocation.Location.m_positionY);
|
|
|
|
|
data << float(targetLocation.Location.m_positionZ);
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellTargetData const& spellTargetData)
|
|
|
|
|
{
|
2019-05-18 22:21:17 +02:00
|
|
|
data.WriteBits(spellTargetData.Flags, 26);
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(spellTargetData.SrcLocation.has_value());
|
|
|
|
|
data.WriteBit(spellTargetData.DstLocation.has_value());
|
|
|
|
|
data.WriteBit(spellTargetData.Orientation.has_value());
|
|
|
|
|
data.WriteBit(spellTargetData.MapID.has_value());
|
2014-12-02 00:07:36 +02:00
|
|
|
data.WriteBits(spellTargetData.Name.size(), 7);
|
|
|
|
|
data.FlushBits();
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
data << spellTargetData.Unit;
|
|
|
|
|
data << spellTargetData.Item;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (spellTargetData.SrcLocation)
|
|
|
|
|
data << *spellTargetData.SrcLocation;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (spellTargetData.DstLocation)
|
|
|
|
|
data << *spellTargetData.DstLocation;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (spellTargetData.Orientation)
|
|
|
|
|
data << *spellTargetData.Orientation;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
if (spellTargetData.MapID)
|
|
|
|
|
data << *spellTargetData.MapID;
|
|
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
data.WriteString(spellTargetData.Name);
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellMissStatus const& spellMissStatus)
|
|
|
|
|
{
|
|
|
|
|
data.WriteBits(spellMissStatus.Reason, 4);
|
2016-06-05 14:08:53 +02:00
|
|
|
if (spellMissStatus.Reason == SPELL_MISS_REFLECT)
|
|
|
|
|
data.WriteBits(spellMissStatus.ReflectStatus, 4);
|
|
|
|
|
|
|
|
|
|
data.FlushBits();
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2019-05-18 22:21:17 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellHitStatus const& spellHitStatus)
|
|
|
|
|
{
|
|
|
|
|
data << uint8(spellHitStatus.Reason);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellPowerData const& spellPowerData)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << int32(spellPowerData.Cost);
|
|
|
|
|
data << int8(spellPowerData.Type);
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::RuneData const& runeData)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint8(runeData.Start);
|
|
|
|
|
data << uint8(runeData.Count);
|
2016-06-05 14:08:53 +02:00
|
|
|
data << uint32(runeData.Cooldowns.size());
|
|
|
|
|
if (!runeData.Cooldowns.empty())
|
|
|
|
|
data.append(runeData.Cooldowns.data(), runeData.Cooldowns.size());
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::MissileTrajectoryResult const& missileTrajectory)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint32(missileTrajectory.TravelTime);
|
|
|
|
|
data << float(missileTrajectory.Pitch);
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellAmmo const& spellAmmo)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << int32(spellAmmo.DisplayID);
|
|
|
|
|
data << int8(spellAmmo.InventoryType);
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::CreatureImmunities const& immunities)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << int32(immunities.School);
|
|
|
|
|
data << int32(immunities.Value);
|
2014-12-02 00:07:36 +02:00
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellHealPrediction const& spellPred)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << int32(spellPred.Points);
|
|
|
|
|
data << uint8(spellPred.Type);
|
2014-12-02 00:07:36 +02:00
|
|
|
data << spellPred.BeaconGUID;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellCastData const& spellCastData)
|
|
|
|
|
{
|
|
|
|
|
data << spellCastData.CasterGUID;
|
|
|
|
|
data << spellCastData.CasterUnit;
|
2016-06-03 09:27:27 +02:00
|
|
|
data << spellCastData.CastID;
|
2016-06-05 14:08:53 +02:00
|
|
|
data << spellCastData.OriginalCastID;
|
2015-02-12 19:56:39 +00:00
|
|
|
data << int32(spellCastData.SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
data << spellCastData.Visual;
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint32(spellCastData.CastFlags);
|
2018-10-04 18:50:21 +02:00
|
|
|
data << uint32(spellCastData.CastFlagsEx);
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint32(spellCastData.CastTime);
|
2014-12-02 00:07:36 +02:00
|
|
|
data << spellCastData.MissileTrajectory;
|
2016-06-05 14:08:53 +02:00
|
|
|
data << int32(spellCastData.Ammo.DisplayID);
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint8(spellCastData.DestLocSpellCastIndex);
|
2014-12-02 00:07:36 +02:00
|
|
|
data << spellCastData.Immunities;
|
|
|
|
|
data << spellCastData.Predict;
|
2016-06-05 14:08:53 +02:00
|
|
|
data.WriteBits(spellCastData.HitTargets.size(), 16);
|
|
|
|
|
data.WriteBits(spellCastData.MissTargets.size(), 16);
|
2019-05-18 22:21:17 +02:00
|
|
|
data.WriteBits(spellCastData.HitStatus.size(), 16);
|
2016-06-05 14:08:53 +02:00
|
|
|
data.WriteBits(spellCastData.MissStatus.size(), 16);
|
|
|
|
|
data.WriteBits(spellCastData.RemainingPower.size(), 9);
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(spellCastData.RemainingRunes.has_value());
|
2016-06-05 14:08:53 +02:00
|
|
|
data.WriteBits(spellCastData.TargetPoints.size(), 16);
|
|
|
|
|
data.FlushBits();
|
|
|
|
|
|
2019-05-18 22:21:17 +02:00
|
|
|
for (WorldPackets::Spells::SpellMissStatus const& missStatus : spellCastData.MissStatus)
|
|
|
|
|
data << missStatus;
|
2016-06-05 14:08:53 +02:00
|
|
|
|
|
|
|
|
data << spellCastData.Target;
|
2014-12-02 00:07:36 +02:00
|
|
|
|
2019-05-18 22:21:17 +02:00
|
|
|
for (ObjectGuid const& hitTarget : spellCastData.HitTargets)
|
|
|
|
|
data << hitTarget;
|
|
|
|
|
|
|
|
|
|
for (ObjectGuid const& missTarget : spellCastData.MissTargets)
|
|
|
|
|
data << missTarget;
|
2014-12-02 00:07:36 +02:00
|
|
|
|
2019-05-18 22:21:17 +02:00
|
|
|
for (WorldPackets::Spells::SpellHitStatus const& hitStatus : spellCastData.HitStatus)
|
|
|
|
|
data << hitStatus;
|
2014-12-02 00:07:36 +02:00
|
|
|
|
|
|
|
|
for (WorldPackets::Spells::SpellPowerData const& power : spellCastData.RemainingPower)
|
|
|
|
|
data << power;
|
|
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (spellCastData.RemainingRunes)
|
|
|
|
|
data << *spellCastData.RemainingRunes;
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
for (WorldPackets::Spells::TargetLocation const& targetLoc : spellCastData.TargetPoints)
|
|
|
|
|
data << targetLoc;
|
|
|
|
|
|
2014-12-02 00:55:29 +02:00
|
|
|
return data;
|
2014-12-02 00:07:36 +02:00
|
|
|
}
|
2014-11-30 15:37:11 +01:00
|
|
|
|
2014-12-02 00:07:36 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::SpellStart::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Cast;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellGo::Write()
|
|
|
|
|
{
|
2016-07-07 22:56:07 +02:00
|
|
|
*this << Cast;
|
2014-12-02 00:07:36 +02:00
|
|
|
|
2016-07-07 22:56:07 +02:00
|
|
|
WriteLogDataBit();
|
|
|
|
|
FlushBits();
|
2014-12-02 00:07:36 +02:00
|
|
|
|
2016-07-07 22:56:07 +02:00
|
|
|
WriteLogData();
|
2014-11-30 15:37:11 +01:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
2014-11-30 18:49:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::LearnedSpells::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(SpellID.size());
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << uint32(FavoriteSpellID.size());
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << uint32(SpecializationID);
|
2014-11-30 18:49:52 +02:00
|
|
|
for (int32 spell : SpellID)
|
|
|
|
|
_worldPacket << spell;
|
|
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
for (int32 spell : FavoriteSpellID)
|
|
|
|
|
_worldPacket << spell;
|
|
|
|
|
|
2014-11-30 18:49:52 +02:00
|
|
|
_worldPacket.WriteBit(SuppressMessaging);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2014-11-30 20:13:23 +02:00
|
|
|
|
2016-06-20 17:04:12 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::SupercededSpells::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(SpellID.size());
|
|
|
|
|
_worldPacket << uint32(Superceded.size());
|
2016-07-06 00:05:13 +02:00
|
|
|
_worldPacket << uint32(FavoriteSpellID.size());
|
2016-06-20 17:04:12 +02:00
|
|
|
|
|
|
|
|
if (!SpellID.empty())
|
|
|
|
|
_worldPacket.append(SpellID.data(), SpellID.size());
|
|
|
|
|
|
|
|
|
|
if (!Superceded.empty())
|
|
|
|
|
_worldPacket.append(Superceded.data(), Superceded.size());
|
|
|
|
|
|
2016-07-06 00:05:13 +02:00
|
|
|
if (!FavoriteSpellID.empty())
|
|
|
|
|
_worldPacket.append(FavoriteSpellID.data(), FavoriteSpellID.size());
|
|
|
|
|
|
2016-06-20 17:04:12 +02:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-30 20:13:23 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::SpellFailure::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CasterUnit;
|
2016-06-03 09:27:27 +02:00
|
|
|
_worldPacket << CastID;
|
2015-02-12 19:56:39 +00:00
|
|
|
_worldPacket << int32(SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << Visual;
|
2015-03-14 14:33:30 +01:00
|
|
|
_worldPacket << uint16(Reason);
|
2014-11-30 20:13:23 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellFailedOther::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CasterUnit;
|
2016-06-03 09:27:27 +02:00
|
|
|
_worldPacket << CastID;
|
2015-02-12 19:56:39 +00:00
|
|
|
_worldPacket << uint32(SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << Visual;
|
2015-02-12 19:56:39 +00:00
|
|
|
_worldPacket << uint8(Reason);
|
2014-11-30 20:13:23 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-05 00:33:21 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::CastFailed::Write()
|
|
|
|
|
{
|
2016-06-03 09:27:27 +02:00
|
|
|
_worldPacket << CastID;
|
2015-02-12 19:56:39 +00:00
|
|
|
_worldPacket << int32(SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << Visual;
|
2015-02-12 19:56:39 +00:00
|
|
|
_worldPacket << int32(Reason);
|
|
|
|
|
_worldPacket << int32(FailedArg1);
|
|
|
|
|
_worldPacket << int32(FailedArg2);
|
2014-12-05 00:33:21 +02:00
|
|
|
|
2014-11-30 20:13:23 +02:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::PetCastFailed::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CastID;
|
|
|
|
|
_worldPacket << int32(SpellID);
|
|
|
|
|
_worldPacket << int32(Reason);
|
|
|
|
|
_worldPacket << int32(FailedArg1);
|
|
|
|
|
_worldPacket << int32(FailedArg2);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-30 20:13:23 +02:00
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellModifierData const& spellModifierData)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << float(spellModifierData.ModifierValue);
|
|
|
|
|
data << uint8(spellModifierData.ClassIndex);
|
2014-11-30 20:13:23 +02:00
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellModifier const& spellModifier)
|
|
|
|
|
{
|
2015-02-12 19:56:39 +00:00
|
|
|
data << uint8(spellModifier.ModIndex);
|
2014-11-30 20:13:23 +02:00
|
|
|
data << uint32(spellModifier.ModifierData.size());
|
|
|
|
|
for (WorldPackets::Spells::SpellModifierData const& modData : spellModifier.ModifierData)
|
|
|
|
|
data << modData;
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SetSpellModifier::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(Modifiers.size());
|
|
|
|
|
for (WorldPackets::Spells::SpellModifier const& spellMod : Modifiers)
|
|
|
|
|
_worldPacket << spellMod;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2014-12-04 19:23:35 +01:00
|
|
|
|
2015-02-01 20:52:05 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::UnlearnedSpells::Write()
|
2014-12-04 19:23:35 +01:00
|
|
|
{
|
2015-02-01 20:52:05 +01:00
|
|
|
_worldPacket << uint32(SpellID.size());
|
|
|
|
|
for (uint32 spellId : SpellID)
|
2014-12-04 19:23:35 +01:00
|
|
|
_worldPacket << uint32(spellId);
|
|
|
|
|
|
2015-07-19 00:31:11 +02:00
|
|
|
_worldPacket.WriteBit(SuppressMessaging);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
2014-12-04 19:23:35 +01:00
|
|
|
return &_worldPacket;
|
2014-12-04 19:24:09 +01:00
|
|
|
}
|
2015-02-11 23:09:56 +00:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::CooldownEvent::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(SpellID);
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
|
|
|
|
_worldPacket.FlushBits();
|
2015-02-11 23:09:56 +00:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-02-17 01:01:44 +01:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ClearCooldowns::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(SpellID.size());
|
|
|
|
|
if (!SpellID.empty())
|
|
|
|
|
_worldPacket.append(SpellID.data(), SpellID.size());
|
|
|
|
|
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
2015-02-17 01:01:44 +01:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ClearCooldown::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(SpellID);
|
|
|
|
|
_worldPacket.WriteBit(ClearOnHold);
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
2015-02-17 01:01:44 +01:00
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ModifyCooldown::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(SpellID);
|
|
|
|
|
_worldPacket << int32(DeltaTime);
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
2021-11-20 00:28:48 +01:00
|
|
|
_worldPacket.WriteBit(WithoutCategoryCooldown);
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.FlushBits();
|
2015-02-17 01:01:44 +01:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellCooldownStruct const& cooldown)
|
|
|
|
|
{
|
|
|
|
|
data << uint32(cooldown.SrecID);
|
|
|
|
|
data << uint32(cooldown.ForcedCooldown);
|
2016-10-25 19:13:32 +02:00
|
|
|
data << float(cooldown.ModRate);
|
2015-02-17 01:01:44 +01:00
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellCooldown::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Caster;
|
|
|
|
|
_worldPacket << uint8(Flags);
|
|
|
|
|
_worldPacket << uint32(SpellCooldowns.size());
|
|
|
|
|
for (SpellCooldownStruct const& cooldown : SpellCooldowns)
|
|
|
|
|
_worldPacket << cooldown;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellHistoryEntry const& historyEntry)
|
|
|
|
|
{
|
|
|
|
|
data << uint32(historyEntry.SpellID);
|
|
|
|
|
data << uint32(historyEntry.ItemID);
|
|
|
|
|
data << uint32(historyEntry.Category);
|
|
|
|
|
data << int32(historyEntry.RecoveryTime);
|
|
|
|
|
data << int32(historyEntry.CategoryRecoveryTime);
|
2016-10-25 19:13:32 +02:00
|
|
|
data << float(historyEntry.ModRate);
|
2022-01-23 20:31:52 +01:00
|
|
|
data.WriteBit(historyEntry.unused622_1.has_value());
|
|
|
|
|
data.WriteBit(historyEntry.unused622_2.has_value());
|
2015-02-17 01:01:44 +01:00
|
|
|
data.WriteBit(historyEntry.OnHold);
|
2015-09-05 00:09:38 +02:00
|
|
|
if (historyEntry.unused622_1)
|
|
|
|
|
data << uint32(*historyEntry.unused622_1);
|
|
|
|
|
if (historyEntry.unused622_2)
|
|
|
|
|
data << uint32(*historyEntry.unused622_2);
|
2015-02-17 01:01:44 +01:00
|
|
|
data.FlushBits();
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SendSpellHistory::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(Entries.size());
|
|
|
|
|
for (SpellHistoryEntry const& historyEntry : Entries)
|
|
|
|
|
_worldPacket << historyEntry;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ClearAllSpellCharges::Write()
|
|
|
|
|
{
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
|
|
|
|
_worldPacket.FlushBits();
|
2015-02-17 01:01:44 +01:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ClearSpellCharges::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(Category);
|
2015-04-04 20:24:31 +02:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
|
|
|
|
_worldPacket.FlushBits();
|
2015-02-17 01:01:44 +01:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SetSpellCharges::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(Category);
|
2015-07-19 00:31:11 +02:00
|
|
|
_worldPacket << uint32(NextRecoveryTime);
|
|
|
|
|
_worldPacket << uint8(ConsumedCharges);
|
2016-10-25 19:13:32 +02:00
|
|
|
_worldPacket << float(ChargeModRate);
|
2015-02-17 01:01:44 +01:00
|
|
|
_worldPacket.WriteBit(IsPet);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellChargeEntry const& chargeEntry)
|
|
|
|
|
{
|
|
|
|
|
data << uint32(chargeEntry.Category);
|
|
|
|
|
data << uint32(chargeEntry.NextRecoveryTime);
|
2016-10-25 19:13:32 +02:00
|
|
|
data << float(chargeEntry.ChargeModRate);
|
2015-02-17 01:01:44 +01:00
|
|
|
data << uint8(chargeEntry.ConsumedCharges);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SendSpellCharges::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(Entries.size());
|
|
|
|
|
for (SpellChargeEntry const& chargeEntry : Entries)
|
|
|
|
|
_worldPacket << chargeEntry;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-03-10 16:29:52 +01:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ClearTarget::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Guid;
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-03-11 22:34:15 +01:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::CancelOrphanSpellVisual::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(SpellVisualID);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::CancelSpellVisual::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Source;
|
|
|
|
|
_worldPacket << int32(SpellVisualID);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-03-13 17:19:33 +01:00
|
|
|
|
2017-05-04 18:08:02 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::CancelSpellVisualKit::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Source;
|
|
|
|
|
_worldPacket << int32(SpellVisualKitID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket.WriteBit(MountedVisual);
|
|
|
|
|
_worldPacket.FlushBits();
|
2017-05-04 18:08:02 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::PlayOrphanSpellVisual::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << SourceLocation;
|
2017-05-16 22:44:31 +02:00
|
|
|
_worldPacket << SourceRotation;
|
2017-05-04 18:08:02 +02:00
|
|
|
_worldPacket << TargetLocation;
|
|
|
|
|
_worldPacket << Target;
|
|
|
|
|
_worldPacket << int32(SpellVisualID);
|
|
|
|
|
_worldPacket << float(TravelSpeed);
|
2019-05-18 22:21:17 +02:00
|
|
|
_worldPacket << float(LaunchDelay);
|
|
|
|
|
_worldPacket << float(MinDuration);
|
2017-05-04 18:08:02 +02:00
|
|
|
_worldPacket.WriteBit(SpeedAsTime);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-03 16:28:17 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::PlaySpellVisual::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Source;
|
|
|
|
|
_worldPacket << Target;
|
2019-05-18 22:21:17 +02:00
|
|
|
_worldPacket << Transport;
|
2017-05-04 18:08:02 +02:00
|
|
|
_worldPacket << TargetPosition;
|
2018-10-04 18:50:21 +02:00
|
|
|
_worldPacket << uint32(SpellVisualID);
|
|
|
|
|
_worldPacket << float(TravelSpeed);
|
2019-05-18 22:21:17 +02:00
|
|
|
_worldPacket << uint16(HitReason);
|
2018-10-04 18:50:21 +02:00
|
|
|
_worldPacket << uint16(MissReason);
|
|
|
|
|
_worldPacket << uint16(ReflectStatus);
|
2019-05-18 22:21:17 +02:00
|
|
|
_worldPacket << float(LaunchDelay);
|
|
|
|
|
_worldPacket << float(MinDuration);
|
2016-12-03 16:28:17 +01:00
|
|
|
_worldPacket.WriteBit(SpeedAsTime);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-26 17:06:30 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::PlaySpellVisualKit::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Unit;
|
|
|
|
|
_worldPacket << int32(KitRecID);
|
|
|
|
|
_worldPacket << int32(KitType);
|
|
|
|
|
_worldPacket << uint32(Duration);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket.WriteBit(MountedVisual);
|
|
|
|
|
_worldPacket.FlushBits();
|
2015-10-26 17:06:30 +01:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-13 11:49:30 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::SpellVisualLoadScreen::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(SpellVisualKitID);
|
|
|
|
|
_worldPacket << int32(Delay);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-13 17:19:33 +01:00
|
|
|
void WorldPackets::Spells::CancelCast::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> CastID;
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket >> SpellID;
|
2015-03-13 17:19:33 +01:00
|
|
|
}
|
2015-03-19 21:56:03 +01:00
|
|
|
|
|
|
|
|
void WorldPackets::Spells::OpenItem::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> Slot
|
|
|
|
|
>> PackSlot;
|
|
|
|
|
}
|
2015-04-04 16:04:40 +02:00
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellChannelStartInterruptImmunities const& interruptImmunities)
|
|
|
|
|
{
|
|
|
|
|
data << int32(interruptImmunities.SchoolImmunities);
|
|
|
|
|
data << int32(interruptImmunities.Immunities);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellTargetedHealPrediction const& targetedHealPrediction)
|
|
|
|
|
{
|
|
|
|
|
data << targetedHealPrediction.TargetGUID;
|
|
|
|
|
data << targetedHealPrediction.Predict;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellChannelStart::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CasterGUID;
|
|
|
|
|
_worldPacket << int32(SpellID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << Visual;
|
2015-04-04 16:04:40 +02:00
|
|
|
_worldPacket << uint32(ChannelDuration);
|
2022-01-23 20:31:52 +01:00
|
|
|
_worldPacket.WriteBit(InterruptImmunities.has_value());
|
|
|
|
|
_worldPacket.WriteBit(HealPrediction.has_value());
|
2015-04-04 16:04:40 +02:00
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (InterruptImmunities)
|
|
|
|
|
_worldPacket << *InterruptImmunities;
|
2015-04-04 16:04:40 +02:00
|
|
|
|
2015-04-26 23:45:52 +02:00
|
|
|
if (HealPrediction)
|
|
|
|
|
_worldPacket << *HealPrediction;
|
2015-04-04 16:04:40 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellChannelUpdate::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CasterGUID;
|
|
|
|
|
_worldPacket << int32(TimeRemaining);
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-04-19 13:45:43 +02:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ResurrectRequest::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << ResurrectOffererGUID;
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << uint32(ResurrectOffererVirtualRealmAddress);
|
|
|
|
|
_worldPacket << uint32(PetNumber);
|
|
|
|
|
_worldPacket << int32(SpellID);
|
2016-10-25 19:13:32 +02:00
|
|
|
_worldPacket.WriteBits(Name.length(), 11);
|
2015-04-19 13:45:43 +02:00
|
|
|
_worldPacket.WriteBit(UseTimer);
|
|
|
|
|
_worldPacket.WriteBit(Sickness);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
_worldPacket.WriteString(Name);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-04-23 20:18:48 +02:00
|
|
|
|
|
|
|
|
void WorldPackets::Spells::UnlearnSkill::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> SkillLine;
|
|
|
|
|
}
|
2015-06-15 02:03:00 +03:00
|
|
|
|
2018-02-04 00:11:10 +01:00
|
|
|
void WorldPackets::Spells::SelfRes::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> SpellID;
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-15 02:03:00 +03:00
|
|
|
void WorldPackets::Spells::GetMirrorImageData::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> UnitGUID;
|
|
|
|
|
_worldPacket >> DisplayID;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-12 01:23:30 +01:00
|
|
|
WorldPackets::Spells::MirrorImageComponentedData::MirrorImageComponentedData()
|
|
|
|
|
: ServerPacket(SMSG_MIRROR_IMAGE_COMPONENTED_DATA, 8 + 4 + 8 * 1 + 8 + 11 * 4)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPackets::Spells::MirrorImageComponentedData::~MirrorImageComponentedData() = default;
|
|
|
|
|
|
2015-06-15 02:03:00 +03:00
|
|
|
WorldPacket const* WorldPackets::Spells::MirrorImageComponentedData::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << UnitGUID;
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << int32(DisplayID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << int32(SpellVisualKitID);
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << uint8(RaceID);
|
|
|
|
|
_worldPacket << uint8(Gender);
|
|
|
|
|
_worldPacket << uint8(ClassID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << uint32(Customizations.size());
|
2015-06-15 02:03:00 +03:00
|
|
|
_worldPacket << GuildGUID;
|
|
|
|
|
_worldPacket << uint32(ItemDisplayID.size());
|
|
|
|
|
|
2020-11-04 21:39:21 +01:00
|
|
|
for (Character::ChrCustomizationChoice const& customization : Customizations)
|
|
|
|
|
_worldPacket << customization;
|
|
|
|
|
|
2016-06-05 14:08:53 +02:00
|
|
|
for (int32 itemDisplayId : ItemDisplayID)
|
|
|
|
|
_worldPacket << int32(itemDisplayId);
|
2015-06-15 02:03:00 +03:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::MirrorImageCreatureData::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << UnitGUID;
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << int32(DisplayID);
|
2020-11-04 21:39:21 +01:00
|
|
|
_worldPacket << int32(SpellVisualKitID);
|
2015-06-15 02:03:00 +03:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2015-07-19 09:20:58 +02:00
|
|
|
|
|
|
|
|
void WorldPackets::Spells::SpellClick::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> SpellClickUnitGuid;
|
|
|
|
|
TryAutoDismount = _worldPacket.ReadBit();
|
|
|
|
|
}
|
2015-07-23 22:00:40 +02:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::ResyncRunes::Write()
|
|
|
|
|
{
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket << Runes;
|
2015-07-23 22:00:40 +02:00
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2016-02-03 01:25:01 +01:00
|
|
|
|
2018-08-25 20:00:14 +02:00
|
|
|
WorldPacket const* WorldPackets::Spells::AddRunePower::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(AddedRunesMask);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-03 01:25:01 +01:00
|
|
|
void WorldPackets::Spells::MissileTrajectoryCollision::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> Target;
|
|
|
|
|
_worldPacket >> SpellID;
|
|
|
|
|
_worldPacket >> CastID;
|
2016-02-03 17:14:15 +01:00
|
|
|
_worldPacket >> CollisionPos;
|
2016-02-03 01:25:01 +01:00
|
|
|
}
|
2016-02-03 15:10:58 +01:00
|
|
|
|
2016-02-09 23:58:22 +01:00
|
|
|
WorldPacket const* WorldPackets::Spells::NotifyMissileTrajectoryCollision::Write()
|
2016-02-06 23:05:55 +01:00
|
|
|
{
|
|
|
|
|
_worldPacket << Caster;
|
2016-06-03 09:27:27 +02:00
|
|
|
_worldPacket << CastID;
|
2016-02-06 23:05:55 +01:00
|
|
|
_worldPacket << CollisionPos;
|
2016-03-18 23:53:29 +01:00
|
|
|
|
2016-02-06 23:05:55 +01:00
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-03 15:10:58 +01:00
|
|
|
void WorldPackets::Spells::UpdateMissileTrajectory::Read()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket >> Guid;
|
2021-11-02 22:53:56 +01:00
|
|
|
_worldPacket >> CastID;
|
2016-02-03 15:10:58 +01:00
|
|
|
_worldPacket >> MoveMsgID;
|
|
|
|
|
_worldPacket >> SpellID;
|
|
|
|
|
_worldPacket >> Pitch;
|
|
|
|
|
_worldPacket >> Speed;
|
2016-02-03 17:14:15 +01:00
|
|
|
_worldPacket >> FirePos;
|
|
|
|
|
_worldPacket >> ImpactPos;
|
2016-02-03 15:10:58 +01:00
|
|
|
bool hasStatus = _worldPacket.ReadBit();
|
|
|
|
|
|
|
|
|
|
_worldPacket.ResetBitPos();
|
|
|
|
|
if (hasStatus)
|
|
|
|
|
{
|
2022-01-23 20:31:52 +01:00
|
|
|
Status.emplace();
|
2016-06-05 14:08:53 +02:00
|
|
|
_worldPacket >> *Status;
|
2016-02-03 15:10:58 +01:00
|
|
|
}
|
|
|
|
|
}
|
2016-02-29 00:23:23 +00:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::SpellDelayed::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << Caster;
|
|
|
|
|
_worldPacket << uint32(ActualDelay);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2016-03-18 23:53:29 +01:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::DispelFailed::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << CasterGUID;
|
|
|
|
|
_worldPacket << VictimGUID;
|
|
|
|
|
_worldPacket << uint32(SpellID);
|
|
|
|
|
_worldPacket << uint32(FailedSpells.size());
|
|
|
|
|
if (!FailedSpells.empty())
|
|
|
|
|
_worldPacket.append(FailedSpells.data(), FailedSpells.size());
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2017-03-17 18:50:11 +01:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::CustomLoadScreen::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << uint32(TeleportSpellID);
|
|
|
|
|
_worldPacket << uint32(LoadingScreenID);
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2020-04-24 19:00:19 +02:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::MountResult::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << int32(Result);
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|
2020-08-16 12:07:51 +02:00
|
|
|
|
|
|
|
|
WorldPacket const* WorldPackets::Spells::MissileCancel::Write()
|
|
|
|
|
{
|
|
|
|
|
_worldPacket << OwnerGUID;
|
|
|
|
|
_worldPacket << int32(SpellID);
|
|
|
|
|
_worldPacket.WriteBit(Reverse);
|
|
|
|
|
_worldPacket.FlushBits();
|
|
|
|
|
|
|
|
|
|
return &_worldPacket;
|
|
|
|
|
}
|