Core/Spells: Implement spell queue

As of patch 4.1 spell casts can now be queued up 400ms before a ongoing cast finishes or the global cooldown expires to deliver a smooth transitions between casts though emulators do not really benefit from it.

closes #224
This commit is contained in:
Ovahlord committed 2021-05-24 17:14:55 +02:00
1 parent ed8cc640f0
commit 4430863a1e
13 files changed
+513 -260

No files matched your search

@@ -788,3 +788,36 @@ void WorldPackets::Spells::CastSpell::Read()
{
_worldPacket >> Cast;
}
void WorldPackets::Spells::UseItem::Read()
{
_worldPacket >> PackSlot;
_worldPacket >> Slot;
_worldPacket >> Cast.CastID;
_worldPacket >> Cast.SpellID;
_worldPacket >> CastItem;
_worldPacket >> Cast.Misc;
_worldPacket >> Cast.SendCastFlags;
_worldPacket >> Cast.Target;
if (Cast.SendCastFlags & CAST_FLAG_HAS_TRAJECTORY)
{
_worldPacket >> Cast.MissileTrajectory;
bool hasMovementData = _worldPacket.read<bool>();
if (hasMovementData)
_worldPacket >> Cast.MoveUpdate;
}
if (Cast.SendCastFlags & CAST_FLAG_HAS_WEIGHT)
{
uint32 weightCount = _worldPacket.read<uint32>();
Cast.Weight.resize(weightCount);
for (WorldPackets::Spells::SpellWeight& weight : Cast.Weight)
{
_worldPacket >> weight.Type;
_worldPacket >> weight.ID;
_worldPacket >> weight.Quantity;
}
}
}